1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[888],{4487:function(e,t,n){"use strict";n.d(t,{$e:function(){return a},Tb:function(){return i},e:function(){return s}});var r=n(5659);function i(e,t){return(0,r.Gd)().captureException(e,{captureContext:t})}function s(e){(0,r.Gd)().configureScope(e)}function a(e){(0,r.Gd)().withScope(e)}},5659:function(e,t,n){"use strict";n.d(t,{Gd:function(){return f},cu:function(){return d}});var r=n(2844),i=n(1170),s=n(2343),a=n(1235),o=n(2448),l=n(350),u=n(9015);class c{__init(){this._stack=[{}]}constructor(e,t=new l.s,n=4){this._version=n,c.prototype.__init.call(this),this.getStackTop().scope=t,e&&this.bindClient(e)}isOlderThan(e){return this._version<e}bindClient(e){let t=this.getStackTop();t.client=e,e&&e.setupIntegrations&&e.setupIntegrations()}pushScope(){let e=l.s.clone(this.getScope());return this.getStack().push({client:this.getClient(),scope:e}),e}popScope(){return!(this.getStack().length<=1)&&!!this.getStack().pop()}withScope(e){let t=this.pushScope();try{e(t)}finally{this.popScope()}}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getStack(){return this._stack}getStackTop(){return this._stack[this._stack.length-1]}captureException(e,t){let n=this._lastEventId=t&&t.event_id?t.event_id:(0,r.DM)(),i=Error("Sentry syntheticException");return this._withClient((r,s)=>{r.captureException(e,{originalException:e,syntheticException:i,...t,event_id:n},s)}),n}captureMessage(e,t,n){let i=this._lastEventId=n&&n.event_id?n.event_id:(0,r.DM)(),s=Error(e);return this._withClient((r,a)=>{r.captureMessage(e,t,{originalException:e,syntheticException:s,...n,event_id:i},a)}),i}captureEvent(e,t){let n=t&&t.event_id?t.event_id:(0,r.DM)();return"transaction"!==e.type&&(this._lastEventId=n),this._withClient((r,i)=>{r.captureEvent(e,{...t,event_id:n},i)}),n}lastEventId(){return this._lastEventId}addBreadcrumb(e,t){let{scope:n,client:r}=this.getStackTop();if(!n||!r)return;let{beforeBreadcrumb:a=null,maxBreadcrumbs:o=100}=r.getOptions&&r.getOptions()||{};if(o<=0)return;let l=(0,i.yW)(),u={timestamp:l,...e},c=a?(0,s.Cf)(()=>a(u,t)):u;null!==c&&n.addBreadcrumb(c,o)}setUser(e){let t=this.getScope();t&&t.setUser(e)}setTags(e){let t=this.getScope();t&&t.setTags(e)}setExtras(e){let t=this.getScope();t&&t.setExtras(e)}setTag(e,t){let n=this.getScope();n&&n.setTag(e,t)}setExtra(e,t){let n=this.getScope();n&&n.setExtra(e,t)}setContext(e,t){let n=this.getScope();n&&n.setContext(e,t)}configureScope(e){let{scope:t,client:n}=this.getStackTop();t&&n&&e(t)}run(e){let t=h(this);try{e(this)}finally{h(t)}}getIntegration(e){let t=this.getClient();if(!t)return null;try{return t.getIntegration(e)}catch(n){return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&s.kg.warn(`Cannot retrieve integration ${e.id} from the current Hub`),null}}startTransaction(e,t){return this._callExtensionMethod("startTransaction",e,t)}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(e=!1){if(e)return this.endSession();this._sendSessionUpdate()}endSession(){let e=this.getStackTop(),t=e&&e.scope,n=t&&t.getSession();n&&(0,u.RJ)(n),this._sendSessionUpdate(),t&&t.setSession()}startSession(e){let{scope:t,client:n}=this.getStackTop(),{release:r,environment:i}=n&&n.getOptions()||{},{userAgent:s}=a.n2.navigator||{},o=(0,u.Hv)({release:r,environment:i,...t&&{user:t.getUser()},...s&&{userAgent:s},...e});if(t){let l=t.getSession&&t.getSession();l&&"ok"===l.status&&(0,u.CT)(l,{status:"exited"}),this.endSession(),t.setSession(o)}return o}shouldSendDefaultPii(){let e=this.getClient(),t=e&&e.getOptions();return Boolean(t&&t.sendDefaultPii)}_sendSessionUpdate(){let{scope:e,client:t}=this.getStackTop();if(!e)return;let n=e.getSession();n&&t&&t.captureSession&&t.captureSession(n)}_withClient(e){let{scope:t,client:n}=this.getStackTop();n&&e(n,t)}_callExtensionMethod(e,...t){let n=d(),r=n.__SENTRY__;if(r&&r.extensions&&"function"==typeof r.extensions[e])return r.extensions[e].apply(this,t);("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&s.kg.warn(`Extension method ${e} couldn't be found, doing nothing.`)}}function d(){return a.n2.__SENTRY__=a.n2.__SENTRY__||{extensions:{},hub:void 0},a.n2}function h(e){let t=d(),n=_(t);return m(t,e),n}function f(){let e=d();return((!p(e)||_(e).isOlderThan(4))&&m(e,new c),(0,o.KV)())?function(e){try{let t=d().__SENTRY__,n=t&&t.extensions&&t.extensions.domain&&t.extensions.domain.active;if(!n)return _(e);
1if(!p(n)||_(n).isOlderThan(4)){let r=_(e).getStackTop();m(n,new c(r.client,l.s.clone(r.scope)))}return _(n)}catch(i){return _(e)}}(e):_(e)}function p(e){return!!(e&&e.__SENTRY__&&e.__SENTRY__.hub)}function _(e){return(0,a.YO)("hub",()=>new c,e)}function m(e,t){if(!e)return!1;let n=e.__SENTRY__=e.__SENTRY__||{};return n.hub=t,!0}},350:function(e,t,n){"use strict";n.d(t,{c:function(){return h},s:function(){return c}});var r=n(7597),i=n(1170),s=n(6893),a=n(2343),o=n(2844),l=n(1235),u=n(9015);class c{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={}}static clone(e){let t=new c;return e&&(t._breadcrumbs=[...e._breadcrumbs],t._tags={...e._tags},t._extra={...e._extra},t._contexts={...e._contexts},t._user=e._user,t._level=e._level,t._span=e._span,t._session=e._session,t._transactionName=e._transactionName,t._fingerprint=e._fingerprint,t._eventProcessors=[...e._eventProcessors],t._requestSession=e._requestSession,t._attachments=[...e._attachments],t._sdkProcessingMetadata={...e._sdkProcessingMetadata}),t}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{},this._session&&(0,u.CT)(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(e){return this._requestSession=e,this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this._tags={...this._tags,[e]:t},this._notifyScopeListeners(),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return null===t?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSpan(e){return this._span=e,this._notifyScopeListeners(),this}getSpan(){return this._span}getTransaction(){let e=this.getSpan();return e&&e.transaction}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;if("function"==typeof e){let t=e(this);return t instanceof c?t:this}return e instanceof c?(this._tags={...this._tags,...e._tags},this._extra={...this._extra,...e._extra},this._contexts={...this._contexts,...e._contexts},e._user&&Object.keys(e._user).length&&(this._user=e._user),e._level&&(this._level=e._level),e._fingerprint&&(this._fingerprint=e._fingerprint),e._requestSession&&(this._requestSession=e._requestSession)):(0,r.PO)(e)&&(this._tags={...this._tags,...e.tags},this._extra={...this._extra,...e.extra},this._contexts={...this._contexts,...e.contexts},e.user&&(this._user=e.user),e.level&&(this._level=e.level),e.fingerprint&&(this._fingerprint=e.fingerprint),e.requestSession&&(this._requestSession=e.requestSession)),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this._attachments=[],this}addBreadcrumb(e,t){let n="number"==typeof t?t:100;if(n<=0)return this;let r={timestamp:(0,i.yW)(),...e};return this._breadcrumbs=[...this._breadcrumbs,r].slice(-n),this._notifyScopeListeners(),this}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}getAttachments(){return this._attachments}clearAttachments(){return this._attachments=[],this}applyToEvent(e,t={}){if(this._extra&&Object.keys(this._extra).length&&(e.extra={...this._extra,...e.extra}),this._tags&&Object.keys(this._tags).length&&(e.tags={...this._tags,...e.tags}),this._user&&Object.keys(this._user).length&&(e.user={...this._user,...e.user}),this._contexts&&Object.keys(this._contexts).length&&(e.contexts={...this._contexts,...e.contexts}),this._level&&(e.level=this._level),this._transactionName&&(e.transaction=this._transactionName),this._span){e.contexts={trace:this._span.getTraceContext(),...e.contexts};let n=this._span.transaction&&this._span.transaction.name;n&&(e.tags={transaction:n,...e.tags})}return this._applyFingerprint(e),e.breadcrumbs=[...e.breadcrumbs||[],...this._breadcrumbs],e.breadcrumbs=e.breadcrumbs.length>0?e.breadcrumbs:void 0,e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...this._sdkProcessingMetadata},this._notifyEventProcessors([...d(),...this._eventProcessors],e,t)}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...e},this}_notifyEventProcessors(e,t,n,i=0){return new s.cW((s,o)=>{let l=e[i];if(null===t||"function"!=typeof l)s(t);else{let u=l({...t},n);("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&l.id&&null===u&&a.kg.log(`Event processor "${l.id}" dropped event`),(0,r.J8)(u)?u.then(t=>this._notifyEventProcessors(e,t,n,i+1).then(s)).then(null,o):this._notifyEventProcessors(e,u,n,i+1).then(s).then(null,o)}})}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEac
1h(e=>{e(this)}),this._notifyingListeners=!1)}_applyFingerprint(e){e.fingerprint=e.fingerprint?(0,o.lE)(e.fingerprint):[],this._fingerprint&&(e.fingerprint=e.fingerprint.concat(this._fingerprint)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint}}function d(){return(0,l.YO)("globalEventProcessors",()=>[])}function h(e){d().push(e)}},9015:function(e,t,n){"use strict";n.d(t,{CT:function(){return o},Hv:function(){return a},RJ:function(){return l}});var r=n(1170),i=n(2844),s=n(535);function a(e){let t=(0,r.ph)(),n={sid:(0,i.DM)(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>(0,s.Jr)({sid:`${n.sid}`,init:n.init,started:new Date(1e3*n.started).toISOString(),timestamp:new Date(1e3*n.timestamp).toISOString(),status:n.status,errors:n.errors,did:"number"==typeof n.did||"string"==typeof n.did?`${n.did}`:void 0,duration:n.duration,attrs:{release:n.release,environment:n.environment,ip_address:n.ipAddress,user_agent:n.userAgent}})};return e&&o(n,e),n}function o(e,t={}){if(!t.user||(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),e.did||t.did||(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||(0,r.ph)(),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=32===t.sid.length?t.sid:(0,i.DM)()),void 0!==t.init&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),"number"==typeof t.started&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if("number"==typeof t.duration)e.duration=t.duration;else{let n=e.timestamp-e.started;e.duration=n>=0?n:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),"number"==typeof t.errors&&(e.errors=t.errors),t.status&&(e.status=t.status)}function l(e,t){let n={};t?n={status:t}:"ok"===e.status&&(n={status:"exited"}),o(e,n)}},2758:function(e,t,n){"use strict";n.d(t,{ro:function(){return m},lb:function(){return _}});var r=n(5659),i=n(2343),s=n(7597),a=n(2448),o=n(9732),l=n(3233);function u(){let e=(0,l.x1)();if(e){let t="internal_error";("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&i.kg.log(`[Tracing] Transaction: ${t} -> Global error occured`),e.setStatus(t)}}var c=n(6458),d=n(3391);function h(){let e=this.getScope();if(e){let t=e.getSpan();if(t)return{"sentry-trace":t.toTraceparent()}}return{}}function f(e,t,n){var r;let a;return(0,l.zu)(t)?void 0!==e.sampled?(e.setMetadata({sampleRate:Number(e.sampled)}),e):("function"==typeof t.tracesSampler?(a=t.tracesSampler(n),e.setMetadata({sampleRate:Number(a)})):void 0!==n.parentSampled?a=n.parentSampled:(a=t.tracesSampleRate,e.setMetadata({sampleRate:Number(a)})),r=a,(0,s.i2)(r)||!("number"==typeof r||"boolean"==typeof r)?(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&i.kg.warn(`[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(r)} of type ${JSON.stringify(typeof r)}.`),1):(r<0||r>1)&&(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&i.kg.warn(`[Tracing] Given sample rate is invalid. Sample rate must be between 0 and 1. Got ${r}.`),1))?(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&i.kg.warn("[Tracing] Discarding transaction because of invalid sample rate."),e.sampled=!1,e):a?(e.sampled=Math.random()<a,e.sampled)?(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&i.kg.log(`[Tracing] starting ${e.op} transaction - ${e.name}`),e):(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&i.kg.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(a)})`),e):(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&i.kg.log(`[Tracing] Discarding transaction because ${"function"==typeof t.tracesSampler?"tracesSampler returned 0 or false":"a negative sampling decision was inherited or tracesSampleRate is set to 0"}`),e.sampled=!1,e):(e.sampled=!1,e)}function p(e,t){let n=this.getClient(),r=n&&n.getOptions()||{},s=r.instrumenter||"sentry",a=e.instrumenter||"sentry";s!==a&&(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&i.kg.error(`A transaction was started with instrumenter=\`${a}\`, but the SDK is configured with the \`${s}\` instrumenter. 2The transaction will not be sampled. Please use the ${s} instrumentation to start transactions.`),e.sampled=!1);let o=new d.Y(e,this);return(o=f(o,r,{parentSampled:e.parentSampled,transactionContext:e,...t})).sampled&&o.initSpanRecorder(r._experiments&&r._experiments.maxSpans),o}function _(e,t,n,r,i,s,a){let o=e.getClient(),l=o&&o.getOptions()||{},u=new c.io(t,e,n,r,a,i);return(u=f(u,l,{parentSampled:t.parentSampled,transactionContext:t,...s})).sampled&&u.initSpanRecorder(l._experiments&&l._experiments.maxSpans),u}function m(){!function(){let e=(0,r.cu)();e.__SENTRY__&&(e.__SENTRY__.extensions=e.__SENTRY__.extensions||{},e.__SENTRY__.extensions.startTransaction||(e.__SENTRY__.extensions.startTransaction=p),e.__SENTRY__.extensions.traceHeaders||(e.__SENTRY__.extensions.traceHeaders=h))}(),(0,a.KV)()&&function(){let t=(0,r.cu)();if(!t.__SENTRY__)return;let n={mongodb(){let t=(0,a.l$)(e,"./integrations/node/mongo");return new t.Mongo},mongoose(){let t=(0,a.l$)(e,"./integrations/node/mongo");return new t.Mongo({mongoose:!0})},mysql(){let t=(0,a.l$)(e,"./integrations/node/mysql");return new t.Mysql},pg(){let t=(0,a.l$)(e,"./integrations/node/postgres");return new t.Postgres}},i=Object.keys(n).filter(e=>!!(0,a.$y)(e)).map(e=>{try{return n[e]()}catch(t){return}}).filter(e=>e);i.length>0&&(t.__SENTRY__.integrations=[...t.__SENTRY__.integrations||[],...i])}(),(0,o.o)("error",u),(0,o.o)("unhandledrejection",u)}e=n.hmd(e)},6458:function(e,t,n){"use strict";n.d(t,{hd:function(){return u},io:function(){return d},mg:function(){return l},nT:function(){return o}});var r=n(1170),i=n(2343),s=n(5334),a=n(3391);let o=1e3,l=3e4,u=5e3;class c extends s.gB{constructor(e,t,n,r){super(r),this._pushActivity=e,this._popActivity=t,this.transactionSpanId=n}add(e){e.spanId!==this.transactionSpanId&&(e.finish=t=>{e.endTimestamp="number"==typeof t?t:(0,r._I)(),this._popActivity(e.spanId)},void 0===e.endTimestamp&&this._pushActivity(e.spanId)),super.add(e)}}class d extends a.Y{__init(){this.activities={}}__init2(){this._heartbeatCounter=0}__init3(){this._finished=!1}__init4(){this._beforeFinishCallbacks=[]}constructor(e,t,n=o,r=l,s=u,a=!1){super(e,t),this._idleHub=t,this._idleTimeout=n,this._finalTimeout=r,this._heartbeatInterval=s,this._onScope=a,d.prototype.__init.call(this),d.prototype.__init2.call(this),d.prototype.__init3.call(this),d.prototype.__init4.call(this),a&&(h(t),("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&i.kg.log(`Setting idle transaction on scope. Span ID: ${this.spanId}`),t.configureScope(e=>e.setSpan(this))),this._startIdleTimeout(),setTimeout(()=>{this._finished||(this.setStatus("deadline_exceeded"),this.finish())},this._finalTimeout)}finish(e=(0,r._I)()){if(this._finished=!0,this.activities={},this.spanRecorder){for(let t of(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&i.kg.log("[Tracing] finishing IdleTransaction",new Date(1e3*e).toISOString(),this.op),this._beforeFinishCallbacks))t(this,e);this.spanRecorder.spans=this.spanRecorder.spans.filter(t=>{if(t.spanId===this.spanId)return!0;!t.endTimestamp&&(t.endTimestamp=e,t.setStatus("cancelled"),("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&i.kg.log("[Tracing] cancelling span since transaction ended early",JSON.stringify(t,void 0,2)));let n=t.startTimestamp<e;return!n&&("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&i.kg.log("[Tracing] discarding Span since it happened after Transaction was finished",JSON.stringify(t,void 0,2)),n}),("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&i.kg.log("[Tracing] flushing IdleTransaction")}else("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&i.kg.log("[Tracing] No active IdleTransaction");return this._onScope&&h(this._idleHub),super.finish(e)}registerBeforeFinishCallback(e){this._beforeFinishCallbacks.push(e)}initSpanRecorder(e){if(!this.spanRecorder){let t=e=>{this._finished||this._pushActivity(e)},n=e=>{this._finished||this._popActivity(e)};this.spanRecorder=new c(t,n,this.spanId,e),("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&i.kg.log("Starting heartbeat"),this._pingHeartbeat()}this.spanRecorder.add(this)}_cancelIdleTimeout(){this._idleTimeoutID&&(clearTimeout(this._idleTimeoutID),this._idleTimeoutID=void 0)}_startIdleTimeout(e){this._cancelIdleTimeout(),this._idleTimeoutID=setTimeout(()=>{this._finished||0!==Object.keys(this.activities).length||this.finish(e)},this._idleTimeout)}
2_pushActivity(e){this._cancelIdleTimeout(),("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&i.kg.log(`[Tracing] pushActivity: ${e}`),this.activities[e]=!0,("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&i.kg.log("[Tracing] new activities count",Object.keys(this.activities).length)}_popActivity(e){if(this.activities[e]&&(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&i.kg.log(`[Tracing] popActivity ${e}`),delete this.activities[e],("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&i.kg.log("[Tracing] new activities count",Object.keys(this.activities).length)),0===Object.keys(this.activities).length){let t=(0,r._I)()+this._idleTimeout/1e3;this._startIdleTimeout(t)}}_beat(){if(this._finished)return;let e=Object.keys(this.activities).join("");e===this._prevHeartbeatString?this._heartbeatCounter++:this._heartbeatCounter=1,this._prevHeartbeatString=e,this._heartbeatCounter>=3?(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&i.kg.log("[Tracing] Transaction finished because of no change for 3 heart beats"),this.setStatus("deadline_exceeded"),this.finish()):this._pingHeartbeat()}_pingHeartbeat(){("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&i.kg.log(`pinging Heartbeat -> current counter: ${this._heartbeatCounter}`),setTimeout(()=>{this._beat()},this._heartbeatInterval)}}function h(e){let t=e.getScope();if(t){let n=t.getTransaction();n&&t.setSpan(void 0)}}},5334:function(e,t,n){"use strict";n.d(t,{Dr:function(){return u},gB:function(){return l}});var r=n(5375),i=n(2844),s=n(1170),a=n(2343),o=n(535);class l{__init(){this.spans=[]}constructor(e=1e3){l.prototype.__init.call(this),this._maxlen=e}add(e){this.spans.length>this._maxlen?e.spanRecorder=void 0:this.spans.push(e)}}class u{__init2(){this.traceId=(0,i.DM)()}__init3(){this.spanId=(0,i.DM)().substring(16)}__init4(){this.startTimestamp=(0,s._I)()}__init5(){this.tags={}}__init6(){this.data={}}__init7(){this.instrumenter="sentry"}constructor(e){if(u.prototype.__init2.call(this),u.prototype.__init3.call(this),u.prototype.__init4.call(this),u.prototype.__init5.call(this),u.prototype.__init6.call(this),u.prototype.__init7.call(this),!e)return this;e.traceId&&(this.traceId=e.traceId),e.spanId&&(this.spanId=e.spanId),e.parentSpanId&&(this.parentSpanId=e.parentSpanId),"sampled"in e&&(this.sampled=e.sampled),e.op&&(this.op=e.op),e.description&&(this.description=e.description),e.data&&(this.data=e.data),e.tags&&(this.tags=e.tags),e.status&&(this.status=e.status),e.startTimestamp&&(this.startTimestamp=e.startTimestamp),e.endTimestamp&&(this.endTimestamp=e.endTimestamp),e.instrumenter&&(this.instrumenter=e.instrumenter)}startChild(e){let t=new u({...e,parentSpanId:this.spanId,sampled:this.sampled,traceId:this.traceId});if(t.spanRecorder=this.spanRecorder,t.spanRecorder&&t.spanRecorder.add(t),t.transaction=this.transaction,("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&t.transaction){let n=e&&e.op||"< unknown op >",r=t.transaction.name||"< unknown name >",i=t.transaction.spanId,s=`[Tracing] Starting '${n}' span on transaction '${r}' (${i}).`;t.transaction.metadata.spanMetadata[t.spanId]={logMessage:s},a.kg.log(s)}return t}setTag(e,t){return this.tags={...this.tags,[e]:t},this}setData(e,t){return this.data={...this.data,[e]:t},this}setStatus(e){return this.status=e,this}setHttpStatus(e){this.setTag("http.status_code",String(e));let t=function(e){if(e<400&&e>=100)return"ok";if(e>=400&&e<500)switch(e){case 401:return"unauthenticated";case 403:return"permission_denied";case 404:return"not_found";case 409:return"already_exists";case 413:return"failed_precondition";case 429:return"resource_exhausted";default:return"invalid_argument"}if(e>=500&&e<600)switch(e){case 501:return"unimplemented";case 503:return"unavailable";case 504:return"deadline_exceeded";default:return"internal_error"}return"unknown_error"}(e);return"unknown_error"!==t&&this.setStatus(t),this}isSuccess(){return"ok"===this.status}finish(e){if(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&this.transaction&&this.transaction.spanId!==this.spanId){let{logMessage:t}=this.transaction.metadata.spanMetadata[this.spanId];t&&a.kg.log(t.replace("Starting","Finishing"))}this.endTimestamp="number"==typeof e?e:(0,s._I)()}toTraceparent(){let e="";return void 0!==this.sampled&&(e=this.sampled?"-1":"-0"),`${this.traceId}-${this.spanId}${e}`}toContext(){return(0,o.Jr)({data:this.data,description:this.description,endTimestamp:this.endTimestamp,op:this.op,parentSpanId:this.parentSpanId,sampled:this.sampled,spanId:this.spanId,startTimestamp:this.startTimestamp,status:this.status,tags:this.tags,traceId:this.traceId})}updateWithContext(e){return this.data=(0,r.h)(e.data,()=>({})),this.description=e.description,this.endTimestamp=e.endTimestamp,this.op=e.op,this.parentSpanId=e.parentSpanId,this.sampled=e.sampled,this.spanId=(0,r.h)(e.spanId,()=>this.spanId),this.startTimestamp=(0,r.h)(e.startTimestamp,()=>this.startTimestamp),this.status=e.status,this.tags=(0,r.h)(e.tags,()=>({})),this.traceId=(0,r.h)(e.traceId,()=>this.traceId),this}getTraceContext(){return(0,o.Jr)({data:Object.keys(this.data).length>0?this.data:void 0,description:this.description,op:this.op,parent_span_id:this.parentSpanId,span_id:this.spanId,status:this.status,tags:Object.keys(this.tags).length>0?this.tags:void 0,trace_id:this.traceId})}toJSON(){return(0,o.Jr)({data:Object.keys(this.data).length>0?this.data:void 0,description:this.description,op:this.op,parent_span_id:this.parentSpanId,span_id:this.spanId,start_timestamp:this.startTimestamp,status:this.status,tags:Object.keys(this.tags).length>0?this.tags:void 0,timestamp:this.endTimestamp,trace_id:this.traceId})}}},3391:function(e,t,n){"use strict";n.d(t,{Y:function(){return u}});var r=n(5375),i=n(5659),s=n(1170),a=n(2343),o=n(535),l=n(5334);class u extends l.Dr{__init(){this._measurements={}}__init2(){this._contexts={}}__init3(){this._frozenDynamicSamplingContext=void 0}constructor(e,t){super(e),u.prototype.__init.call(this),u.prototype.__init2.call(this),u.prototype.__init3.call(this),this._hub=t||(0,i.Gd)(),this._name=e.name||"",this.metadata={source:"custom",...e.metadata,spanMetadata:{},changes:[],propagations:0},this._trimEnd=e.trimEnd,this.transaction=this;let n=this.metadata.dynamicSamplingContext;n&&(this._frozenDynamicSamplingContext={...n})}get name(){return this._name}set name(e){this.setName(e)}setName(e,t="custom"){(e!==this.name||t!==this.metadata.source)&&this.metadata.changes.push({source:this.metadata.source,timestamp:(0,s.ph)(),propagations:this.metadata.propagations}),this._name=e,this.metadata.source=t}initSpanRecorder(e=1e3){this.spanRecorder||(this.spanRecorder=new l.gB(e)),this.spanRecorder.add(this)}setContext(e,t){null===t?delete this._contexts[e]:this._contexts[e]=t}setMeasurement(e,t,n=""){this._measurements[e]={value:t,unit:n}}setMetadata(e){this.metadata={...this.metadata,...e}}finish(e){if(void 0!==this.endTimestamp)return;if(this.name||(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&a.kg.warn("Transaction has no name, falling back to `<unlabeled transaction>
2`."),this.name="<unlabeled transaction>"),super.finish(e),!0!==this.sampled){("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&a.kg.log("[Tracing] Discarding transaction because its trace was not chosen to be sampled.");let t=this._hub.getClient();t&&t.recordDroppedEvent("sample_rate","transaction");return}let n=this.spanRecorder?this.spanRecorder.spans.filter(e=>e!==this&&e.endTimestamp):[];this._trimEnd&&n.length>0&&(this.endTimestamp=n.reduce((e,t)=>e.endTimestamp&&t.endTimestamp?e.endTimestamp>t.endTimestamp?e:t:e).endTimestamp);let r=this.metadata,i={contexts:{...this._contexts,trace:this.getTraceContext()},spans:n,start_timestamp:this.startTimestamp,tags:this.tags,timestamp:this.endTimestamp,transaction:this.name,type:"transaction",sdkProcessingMetadata:{...r,dynamicSamplingContext:this.getDynamicSamplingContext()},...r.source&&{transaction_info:{source:r.source,changes:r.changes,propagations:r.propagations}}},s=Object.keys(this._measurements).length>0;return s&&(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&a.kg.log("[Measurements] Adding measurements to transaction",JSON.stringify(this._measurements,void 0,2)),i.measurements=this._measurements),("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&a.kg.log(`[Tracing] Finishing ${this.op} transaction: ${this.name}.`),this._hub.captureEvent(i)}toContext(){let e=super.toContext();return(0,o.Jr)({...e,name:this.name,trimEnd:this._trimEnd})}updateWithContext(e){return super.updateWithContext(e),this.name=(0,r.h)(e.name,()=>""),this._trimEnd=e.trimEnd,this}getDynamicSamplingContext(){if(this._frozenDynamicSamplingContext)return this._frozenDynamicSamplingContext;let e=this._hub||(0,i.Gd)(),t=e&&e.getClient();if(!t)return{};let{environment:n,release:r}=t.getOptions()||{},{publicKey:s}=t.getDsn()||{},a=this.metadata.sampleRate,l=void 0!==a?a.toString():void 0,u=e.getScope(),{segment:c}=u&&u.getUser()||{},d=this.metadata.source,h=d&&"url"!==d?this.name:void 0,f=(0,o.Jr)({environment:n,release:r,transaction:h,user_segment:c,public_key:s,trace_id:this.traceId,sample_rate:l});return f}}},3233:function(e,t,n){"use strict";n.d(t,{XL:function(){return a},x1:function(){return s},zu:function(){return i}});var r=n(5659);function i(e){let t=(0,r.Gd)().getClient(),n=e||t&&t.getOptions();return!!n&&("tracesSampleRate"in n||"tracesSampler"in n)}function s(e){let t=e||(0,r.Gd)(),n=t.getScope();return n&&n.getTransaction()}function a(e){return e/1e3}},8464:function(e,t,n){"use strict";n.d(t,{Rt:function(){return a},l4:function(){return o},qT:function(){return l}});var r=n(7597),i=n(1235);let s=(0,i.Rf)();function a(e,t={}){try{let n,i=e,s=[],a=0,o=0,l=Array.isArray(t)?t:t.keyAttrs,u=!Array.isArray(t)&&t.maxStringLength||80;for(;i&&a++<5&&(n=function(e,t){let n,i,s,a,o;let l=[];if(!e||!e.tagName)return"";l.push(e.tagName.toLowerCase());let u=t&&t.length?t.filter(t=>e.getAttribute(t)).map(t=>[t,e.getAttribute(t)]):null;if(u&&u.length)u.forEach(e=>{l.push(`[${e[0]}="${e[1]}"]`)});else if(e.id&&l.push(`#${e.id}`),(n=e.className)&&(0,r.HD)(n))for(o=0,i=n.split(/\s+/);o<i.length;o++)l.push(`.${i[o]}`);let c=["type","name","title","alt"];for(o=0;o<c.length;o++)s=c[o],(a=e.getAttribute(s))&&l.push(`[${s}="${a}"]`);return l.join("")}(i,l),"html"!==n&&(!(a>1)||!(o+3*s.length+n.length>=u)));)s.push(n),o+=n.length,i=i.parentNode;return s.reverse().join(" > ")}catch(c){return"<unknown>"}}function o(){try{return s.document.location.href}catch(e){return""}}function l(e){return s.document&&s.document.querySelector?s.document.querySelector(e):null}},5375:function(e,t,n){"use strict";function r(e,t){return null!=e?e:t()}n.d(t,{h:function(){return r}})},9732:function(e,t,n){"use strict";let r,i,s;n.d(t,{o:function(){return _}});var a=n(7597),o=n(2343),l=n(535),u=n(360),c=n(8823),d=n(1235);let h=(0,d.Rf)(),f={},p={};function _(e,t){f[e]=f[e]||[],f[e].push(t),function(e){if(!p[e])switch(p[e]=!0,e){case"console":"console"in h&&o.RU.forEach(function(e){e in h.console&&(0,l.hl)(h.console,e,function(t){return function(...n){m("console",{args:n,level:e}),t&&t.apply(h.console,n)}})});break;case"dom":(function(){if(!("document"in h))return;let e=m.bind(null,"dom"),t=g(e,!0);h.document.addEventListener("click",t,!1),h.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(t=>{let n=h[t]&&h[t].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&((0,l.hl)(n,"addEventListener",function(t){return function(n,r,i){if("click"===n||"keypress"==n)try{let s=this,a=s.__sentry_instrumentation_handlers__=s.__sentry_instrumentation_handlers__||{},o=a[n]=a[n]||{refCount:0};if(!o.handler){let l=g(e);o.handler=l,t.call(this,n,l,i)}o.refCount++}catch(u){}return t.call(this,n,r,i)}}),(0,l.hl)(n,"removeEventListener",function(e){return function(t,n,r){if("click"===t||"keypress"==t)try{let i=this.__sentry_instrumentation_handlers__||{},s=i[t];
2s&&(s.refCount--,s.refCount<=0&&(e.call(this,t,s.handler,r),s.handler=void 0,delete i[t]),0===Object.keys(i).length&&delete this.__sentry_instrumentation_handlers__)}catch(a){}return e.call(this,t,n,r)}}))})})();break;case"xhr":(function(){if(!("XMLHttpRequest"in h))return;let e=XMLHttpRequest.prototype;(0,l.hl)(e,"open",function(e){return function(...t){let n=this,r=t[1],i=n.__sentry_xhr__={method:(0,a.HD)(t[0])?t[0].toUpperCase():t[0],url:t[1]};(0,a.HD)(r)&&"POST"===i.method&&r.match(/sentry_key/)&&(n.__sentry_own_request__=!0);let s=function(){if(4===n.readyState){try{i.status_code=n.status}catch(e){}m("xhr",{args:t,endTimestamp:Date.now(),startTimestamp:Date.now(),xhr:n})}};return"onreadystatechange"in n&&"function"==typeof n.onreadystatechange?(0,l.hl)(n,"onreadystatechange",function(e){return function(...t){return s(),e.apply(n,t)}}):n.addEventListener("readystatechange",s),e.apply(n,t)}}),(0,l.hl)(e,"send",function(e){return function(...t){return this.__sentry_xhr__&&void 0!==t[0]&&(this.__sentry_xhr__.body=t[0]),m("xhr",{args:t,startTimestamp:Date.now(),xhr:this}),e.apply(this,t)}})})();break;case"fetch":(0,c.t$)()&&(0,l.hl)(h,"fetch",function(e){return function(...t){let n={args:t,fetchData:{method:function(e=[]){return"Request"in h&&(0,a.V9)(e[0],Request)&&e[0].method?String(e[0].method).toUpperCase():e[1]&&e[1].method?String(e[1].method).toUpperCase():"GET"}(t),url:function(e=[]){return"string"==typeof e[0]?e[0]:"Request"in h&&(0,a.V9)(e[0],Request)?e[0].url:String(e[0])}(t)},startTimestamp:Date.now()};return m("fetch",{...n}),e.apply(h,t).then(e=>(m("fetch",{...n,endTimestamp:Date.now(),response:e}),e),e=>{throw m("fetch",{...n,endTimestamp:Date.now(),error:e}),e})}});break;case"history":(function(){if(!(0,c.Bf)())return;let e=h.onpopstate;function t(e){return function(...t){let n=t.length>2?t[2]:void 0;if(n){let i=r,s=String(n);r=s,m("history",{from:i,to:s})}return e.apply(this,t)}}h.onpopstate=function(...t){let n=h.location.href,i=r;if(r=n,m("history",{from:i,to:n}),e)try{return e.apply(this,t)}catch(s){}},(0,l.hl)(h.history,"pushState",t),(0,l.hl)(h.history,"replaceState",t)})();break;case"error":y=h.onerror,h.onerror=function(e,t,n,r,i){return m("error",{column:r,error:i,line:n,msg:e,url:t}),!!y&&y.apply(this,arguments)};break;case"unhandledrejection":v=h.onunhandledrejection,h.onunhandledrejection=function(e){return m("unhandledrejection",e),!v||v.apply(this,arguments)};break;default:("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&o.kg.warn("unknown instrumentation type:",e);return}}(e)}function m(e,t){if(e&&f[e])for(let n of f[e]||[])try{n(t)}catch(r){("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&o.kg.error(`Error while triggering instrumentation handler. 3Type: ${e} 4Name: ${(0,u.$P)(n)} 5Error:`,r)}}function g(e,t=!1){return n=>{if(!n||s===n||function(e){if("keypress"!==e.type)return!1;try{let t=e.target;if(!t||!t.tagName)return!0;if("INPUT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable)return!1}catch(n){}return!0}(n))return;let r="keypress"===n.type?"input":n.type;void 0===i?(e({event:n,name:r,global:t}),s=n):function(e,t){if(!e||e.type!==t.type)return!0;try{if(e.target!==t.target)return!0}catch(n){}return!1}(s,n)&&(e({event:n,name:r,global:t}),s=n),clearTimeout(i),i=h.setTimeout(()=>{i=void 0},1e3)}}let y=null,v=null},7597:function(e,t,n){"use strict";n.d(t,{Cy:function(){return m},HD:function(){return u},J8:function(){return _},Kj:function(){return p},PO:function(){return d},TX:function(){return o},V9:function(){return y},VW:function(){return a},VZ:function(){return i},cO:function(){return h},fm:function(){return l},i2:function(){return g},kK:function(){return f},pt:function(){return c}});let r=Object.prototype.toString;function i(e){switch(r.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return y(e,Error)}}function s(e,t){return r.call(e)===`[object ${t}]`}function a(e){return s(e,"ErrorEvent")}function o(e){return s(e,"DOMError")}function l(e){return s(e,"DOMException")}function u(e){return s(e,"String")}function c(e){return null===e||"object"!=typeof e&&"function"!=typeof e}function d(e){return s(e,"Object")}function h(e){return"undefined"!=typeof Event&&y(e,Event)}function f(e){return"undefined"!=typeof Element&&y(e,Element)}function p(e){return s(e,"RegExp")}function _(e){return Boolean(e&&e.then&&"function"==typeof e.then)}
5function m(e){return d(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function g(e){return"number"==typeof e&&e!=e}function y(e,t){try{return e instanceof t}catch(n){return!1}}},2343:function(e,t,n){"use strict";let r;n.d(t,{Cf:function(){return a},RU:function(){return s},kg:function(){return r}});var i=n(1235);let s=["debug","info","warn","error","log","assert","trace"];function a(e){if(!("console"in i.n2))return e();let t=i.n2.console,n={};s.forEach(e=>{let r=t[e]&&t[e].__sentry_original__;e in t&&r&&(n[e]=t[e],t[e]=r)});try{return e()}finally{Object.keys(n).forEach(e=>{t[e]=n[e]})}}function o(){let e=!1,t={enable(){e=!0},disable(){e=!1}};return"undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__?s.forEach(n=>{t[n]=(...t)=>{e&&a(()=>{i.n2.console[n](`Sentry Logger [${n}]:`,...t)})}}):s.forEach(e=>{t[e]=()=>void 0}),t}r="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__?(0,i.YO)("logger",o):o()},2844:function(e,t,n){"use strict";n.d(t,{DM:function(){return s},Db:function(){return l},EG:function(){return u},YO:function(){return c},jH:function(){return o},lE:function(){return d}});var r=n(535),i=n(1235);function s(){let e=i.n2,t=e.crypto||e.msCrypto;if(t&&t.randomUUID)return t.randomUUID().replace(/-/g,"");let n=t&&t.getRandomValues?()=>t.getRandomValues(new Uint8Array(1))[0]:()=>16*Math.random();return"10000000100040008000100000000000".replace(/[018]/g,e=>(e^(15&n())>>e/4).toString(16))}function a(e){return e.exception&&e.exception.values?e.exception.values[0]:void 0}function o(e){let{message:t,event_id:n}=e;if(t)return t;let r=a(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function l(e,t,n){let r=e.exception=e.exception||{},i=r.values=r.values||[],s=i[0]=i[0]||{};s.value||(s.value=t||""),s.type||(s.type=n||"Error")}function u(e,t){let n=a(e);if(!n)return;let r=n.mechanism;if(n.mechanism={type:"generic",handled:!0,...r,...t},t&&"data"in t){let i={...r&&r.data,...t.data};n.mechanism.data=i}}function c(e){if(e&&e.__sentry_captured__)return!0;try{(0,r.xp)(e,"__sentry_captured__",!0)}catch(t){}return!1}function d(e){return Array.isArray(e)?e:[e]}},2448:function(e,t,n){"use strict";n.d(t,{l$:function(){return s},KV:function(){return i},$y:function(){return a}}),e=n.hmd(e);var r=n(3454);function i(){return!("undefined"!=typeof __SENTRY_BROWSER_BUNDLE__&&__SENTRY_BROWSER_BUNDLE__)&&"[object process]"===Object.prototype.toString.call(void 0!==r?r:0)}function s(e,t){return e.require(t)}function a(t){let n;try{n=s(e,t)}catch(r){}try{let{cwd:i}=s(e,"process");n=s(e,`${i()}/node_modules/${t}`)}catch(a){}return n}},535:function(e,t,n){"use strict";n.d(t,{$Q:function(){return l},HK:function(){return u},Jr:function(){return _},Sh:function(){return d},_j:function(){return c},hl:function(){return a},xp:function(){return o},zf:function(){return p}});var r=n(8464),i=n(7597),s=n(7321);function a(e,t,n){if(!(t in e))return;let r=e[t],i=n(r);if("function"==typeof i)try{l(i,r)}catch(s){}e[t]=i}function o(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}function l(e,t){let n=t.prototype||{};e.prototype=t.prototype=n,o(e,"__sentry_original__",t)}function u(e){return e.__sentry_original__}function c(e){return Object.keys(e).map(t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`).join("&")}function d(e){if((0,i.VZ)(e))return{message:e.message,name:e.name,stack:e.stack,...f(e)};if(!(0,i.cO)(e))return e;{let t={type:e.type,target:h(e.target),currentTarget:h(e.currentTarget),...f(e)};return"undefined"!=typeof CustomEvent&&(0,i.V9)(e,CustomEvent)&&(t.detail=e.detail),t}}function h(e){try{return(0,i.kK)(e)?(0,r.Rt)(e):Object.prototype.toString.call(e)}catch(t){return"<unknown>"}}function f(e){if("object"!=typeof e||null===e)return{};{let t={};for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}}function p(e,t=40){let n=Object.keys(d(e));if(n.sort(),!n.length)return"[object has no keys]";if(n[0].length>=t)return(0,s.$G)(n[0],t);for(let r=n.length;r>0;r--){let i=n.slice(0,r).join(", ");if(!(i.length>t)){if(r===n.length)return i;return(0,s.$G)(i,t)}}return""}function _(e){let t=new Map;return function e(t,n){if((0,i.PO)(t)){let r=n.get(t);if(void 0!==r)return r;let s={};for(let a of(n.set(t,s),Object.keys(t)))void 0!==t[a]&&(s[a]=e(t[a],n));return s}if(Array.isArray(t)){let o=n.get(t);if(void 0!==o)return o;let l=[];return n.set(t,l),t.forEach(t=>{l.push(e(t,n))}),l}return t}(e,t)}},360:function(e,t,n){"use strict";function r(...e){let t=e.sort((e,t)=>
5e[0]-t[0]).map(e=>e[1]);return(e,n=0)=>{let r=[];for(let i of e.split("\n").slice(n)){let s=i.replace(/\(error: (.*)\)/,"$1");for(let a of t){let o=a(s);if(o){r.push(o);break}}}return function(e){if(!e.length)return[];let t=e,n=t[0].function||"",r=t[t.length-1].function||"";return(-1!==n.indexOf("captureMessage")||-1!==n.indexOf("captureException"))&&(t=t.slice(1)),-1!==r.indexOf("sentryWrapped")&&(t=t.slice(0,-1)),t.slice(0,50).map(e=>({...e,filename:e.filename||t[0].filename,function:e.function||"?"})).reverse()}(r)}}function i(e){return Array.isArray(e)?r(...e):e}n.d(t,{$P:function(){return a},Sq:function(){return i},pE:function(){return r}});let s="<anonymous>";function a(e){try{if(!e||"function"!=typeof e)return s;return e.name||s}catch(t){return s}}},7321:function(e,t,n){"use strict";n.d(t,{$G:function(){return i},U0:function(){return a},nK:function(){return s}});var r=n(7597);function i(e,t=0){return"string"!=typeof e||0===t?e:e.length<=t?e:`${e.substr(0,t)}...`}function s(e,t){if(!Array.isArray(e))return"";let n=[];for(let r=0;r<e.length;r++){let i=e[r];try{n.push(String(i))}catch(s){n.push("[value cannot be serialized]")}}return n.join(t)}function a(e,t=[],n=!1){return t.some(t=>(function(e,t,n=!1){return!!(0,r.HD)(e)&&((0,r.Kj)(t)?t.test(e):!!(0,r.HD)(t)&&(n?e===t:e.includes(t)))})(e,t,n))}},8823:function(e,t,n){"use strict";n.d(t,{Ak:function(){return a},Bf:function(){return u},Du:function(){return o},t$:function(){return l}});var r=n(2343),i=n(1235);let s=(0,i.Rf)();function a(){if(!("fetch"in s))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch(e){return!1}}function o(e){return e&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function l(){if(!a())return!1;if(o(s.fetch))return!0;let e=!1,t=s.document;if(t&&"function"==typeof t.createElement)try{let n=t.createElement("iframe");
5n.hidden=!0,t.head.appendChild(n),n.contentWindow&&n.contentWindow.fetch&&(e=o(n.contentWindow.fetch)),t.head.removeChild(n)}catch(i){("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&r.kg.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",i)}return e}function u(){let e=s.chrome,t=e&&e.app&&e.app.runtime,n="history"in s&&!!s.history.pushState&&!!s.history.replaceState;return!t&&n}},6893:function(e,t,n){"use strict";n.d(t,{$2:function(){return o},WD:function(){return a},cW:function(){return l}});var r,i,s=n(7597);function a(e){return new l(t=>{t(e)})}function o(e){return new l((t,n)=>{n(e)})}(r=i||(i={}))[r.PENDING=0]="PENDING",r[r.RESOLVED=1]="RESOLVED",r[r.REJECTED=2]="REJECTED";class l{__init(){this._state=i.PENDING}__init2(){this._handlers=[]}constructor(e){l.prototype.__init.call(this),l.prototype.__init2.call(this),l.prototype.__init3.call(this),l.prototype.__init4.call(this),l.prototype.__init5.call(this),l.prototype.__init6.call(this);try{e(this._resolve,this._reject)}catch(t){this._reject(t)}}then(e,t){return new l((n,r)=>{this._handlers.push([!1,t=>{if(e)try{n(e(t))}catch(i){r(i)}else n(t)},e=>{if(t)try{n(t(e))}catch(i){r(i)}else r(e)}]),this._executeHandlers()})}catch(e){return this.then(e=>e,e)}finally(e){return new l((t,n)=>{let r,i;return this.then(t=>{i=!1,r=t,e&&e()},t=>{i=!0,r=t,e&&e()}).then(()=>{if(i){n(r);return}t(r)})})}__init3(){this._resolve=e=>{this._setResult(i.RESOLVED,e)}}__init4(){this._reject=e=>{this._setResult(i.REJECTED,e)}}__init5(){this._setResult=(e,t)=>{if(this._state===i.PENDING){if((0,s.J8)(t)){t.then(this._resolve,this._reject);return}this._state=e,this._value=t,this._executeHandlers()}}}__init6(){this._executeHandlers=()=>{if(this._state===i.PENDING)return;let e=this._handlers.slice();this._handlers=[],e.forEach(e=>{e[0]||(this._state===i.RESOLVED&&e[1](this._value),this._state===i.REJECTED&&e[2](this._value),e[0]=!0)})}}}},1170:function(e,t,n){"use strict";n.d(t,{Z1:function(){return h},_I:function(){return d},ph:function(){return c},yW:function(){return u}});var r=n(2448),i=n(1235);e=n.hmd(e);let s=(0,i.Rf)(),a={nowSeconds:()=>Date.now()/1e3},o=(0,r.KV)()?function(){try{let t=(0,r.l$)(e,"perf_hooks");return t.performance}catch(n){return}}():function(){let{performance:e}=s;if(!e||!e.now)return;let t=Date.now()-e.now();return{now:()=>e.now(),timeOrigin:t}}(),l=void 0===o?a:{nowSeconds:()=>(o.timeOrigin+o.now())/1e3},u=a.nowSeconds.bind(a),c=l.nowSeconds.bind(l),d=c,h=(()=>{let{performance:e}=s;if(!e||!e.now)return;let t=e.now(),n=Date.now(),r=e.timeOrigin?Math.abs(e.timeOrigin+t-n):36e5,i=e.timing&&e.timing.navigationStart,a="number"==typeof i?Math.abs(i+t-n):36e5;return r<36e5||a<36e5?r<=a?e.timeOrigin:i:n})()},1235:function(e,t,n){"use strict";function r(e){return e&&e.Math==Math?e:void 0}n.d(t,{Rf:function(){return s},YO:function(){return a},n2:function(){return i}});let i="object"==typeof globalThis&&r(globalThis)||"object"==typeof window&&r(window)||"object"==typeof self&&r(self)||"object"==typeof n.g&&r(n.g)||function(){return this}()||{};function s(){return i}function a(e,t,n){let r=n||i,s=r.__SENTRY__=r.__SENTRY__||{},a=s[e]||(s[e]=t());return a}},4098:function(e,t){var n,r="undefined"!=typeof self?self:this,i=function(){function e(){this.fetch=!1,this.DOMException=r.DOMException}return e.prototype=r,new e}();n=i,function(e){var t={searchParams:"URLSearchParams"in n,iterable:"Symbol"in n&&"iterator"in Symbol,blob:"FileReader"in n&&"Blob"in n&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in n,arrayBuffer:"ArrayBuffer"in n};if(t.arrayBuffer)var r=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],i=ArrayBuffer.isView||function(e){return e&&r.indexOf(Object.prototype.toString.call(e))>-1};function s(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw TypeError("Invalid character in header field name");return e.toLowerCase()}function a(e){return"string"!=typeof e&&(e=String(e)),e}function o(e){var n={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return t.iterable&&(n[Symbol.iterator]=function(){return n}),n}function l(e){this.map={},e instanceof l?e.forEach(function(e,t){this.append(t,e)},this):Array.isArray(e)?e.forEach(function(e){this.append(e[0],e[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function u(e){if(e.bodyUsed)return Promise.reject(TypeError("Already read"));e.bodyUsed=!0}function c(e){return new Promise(function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}})}function d(e){var t=new FileReader,n=c(t);return t.readAsArrayBuffer(e),n}function h(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function f(){return this.bodyUsed=!1,this._initBody=function(e){if(this._bodyInit=e,e){if("string"==typeof e)this._bodyText=e;else if(t.blob&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e;else if(t.formData&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(t.searchParams&&URLSearchParams.prototype.isPrototypeOf(e))this._bodyText=e.toString();else{var n;t.arrayBuffer&&t.blob&&(n=e)&&DataView.prototype.isPrototypeOf(n)?(this._bodyArrayBuffer=h(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):t.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||i(e))?this._bodyArrayBuffer=h(e):this._bodyText=e=Object.prototype.toString.call(e)}}else this._bodyText="";!this.headers.get("content-type")&&("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):t.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},t.blob&&(this.blob=function(){var e=u(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(!this._bodyFormData)return Promise.resolve(new Blob([this._bodyText]));throw Error("could not read FormData body as blob")},this.arrayBuffer=function(){return this._bodyArrayBuffer?u(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(d)}),this.text=function(){var e,t,n,r=u(this);if(r)return r;if(this._bodyBlob)return e=this._bodyBlob,n=c(t=new FileReader),t.readAsText(e),n;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}(this._bodyArrayBuffer));if(!this._bodyFormData)return Promise.resolve(this._bodyText);throw Error("could not read FormData body as text")},t.formData&&(this.formData=function(){return this.text().then(m)}),this.json=function(){return this.text().then(JSON.parse)},this}l.prototype.append=function(e,t){e=s(e),t=a(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},l.prototype.delete=function(e){delete this.map[s(e)]},l.prototype.get=function(e){return e=s(e),this.has(e)?this.map[e]:null},l.prototype.has=function(e){return this.map.hasOwnProperty(s(e))},l.prototype.set=function(e,t){this.map[s(e)]=a(t)},l.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},l.prototype.keys=function(){var e=[];return this.forEach(function(t,n){e.push(n)}),o(e)},l.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),o(e)},l.prototype.entries=function(){var e=[];return this.forEach(function(t,n){e.push([n,t])}),o(e)},t.iterable&&(l.prototype[Symbol.iterator]=l.prototype.entries);
5var p=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function _(e,t){var n,r,i=(t=t||{}).body;if(e instanceof _){if(e.bodyUsed)throw TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new l(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,i||null==e._bodyInit||(i=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",(t.headers||!this.headers)&&(this.headers=new l(t.headers)),this.method=(r=(n=t.method||this.method||"GET").toUpperCase(),p.indexOf(r)>-1?r:n),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function m(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(i))}}),t}function g(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new l(t.headers),this.url=t.url||"",this._initBody(e)}_.prototype.clone=function(){return new _(this,{body:this._bodyInit})},f.call(_.prototype),f.call(g.prototype),g.prototype.clone=function(){return new g(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new l(this.headers),url:this.url})},g.error=function(){var e=new g(null,{status:0,statusText:""});return e.type="error",e};var y=[301,302,303,307,308];g.redirect=function(e,t){if(-1===y.indexOf(t))throw RangeError("Invalid status code");return new g(null,{status:t,headers:{location:e}})},e.DOMException=n.DOMException;try{new e.DOMException}catch(v){e.DOMException=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function b(n,r){return new Promise(function(i,s){var a=new _(n,r);if(a.signal&&a.signal.aborted)return s(new e.DOMException("Aborted","AbortError"));var o=new XMLHttpRequest;function u(){o.abort()}o.onload=function(){var e,t,n={status:o.status,statusText:o.statusText,headers:(e=o.getAllResponseHeaders()||"",t=new l,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach(function(e){var n=e.split(":"),r=n.shift().trim();if(r){var i=n.join(":").trim();t.append(r,i)}}),t)};n.url="responseURL"in o?o.responseURL:n.headers.get("X-Request-URL");var r="response"in o?o.response:o.responseText;i(new g(r,n))},o.onerror=function(){s(TypeError("Network request failed"))},o.ontimeout=function(){s(TypeError("Network request failed"))},o.onabort=function(){s(new e.DOMException("Aborted","AbortError"))},o.open(a.method,a.url,!0),"include"===a.credentials?o.withCredentials=!0:"omit"===a.credentials&&(o.withCredentials=!1),"responseType"in o&&t.blob&&(o.responseType="blob"),a.headers.forEach(function(e,t){o.setRequestHeader(t,e)}),a.signal&&(a.signal.addEventListener("abort",u),o.onreadystatechange=function(){4===o.readyState&&a.signal.removeEventListener("abort",u)}),o.send(void 0===a._bodyInit?null:a._bodyInit)})}b.polyfill=!0,n.fetch||(n.fetch=b,n.Headers=l,n.Request=_,n.Response=g),e.Headers=l,e.Request=_,e.Response=g,e.fetch=b,Object.defineProperty(e,"__esModule",{value:!0})}({}),i.fetch.ponyfill=!0,delete i.fetch.polyfill,(t=i.fetch).default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t},284:function(e){var t=function(){if("object"==typeof self&&self)return self;if("object"==typeof window&&window)return window;throw Error("Unable to resolve global `this`")};e.exports=function(){if(this)return this;if("object"==typeof globalThis&&globalThis)return globalThis;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch(e){return t()}try{if(!__global__)return t();return __global__}finally{delete Object.prototype.__global__}}()},3454:function(e,t,n){"use strict";var r,i;e.exports=(null==(r=n.g.process)?void 0:r.env)&&"object"==typeof(null==(i=n.g.process)?void 0:i.env)?n.g.process:n(7663)},6840:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/_app",function(){return n(733)}])},3517:function(e,t,n){"use strict";let r,i,s,a,o,l;var u=n(1235);function c(e){let t;let n=e[0],r=1;for(;r<e.length;){let i=e[r],s=e[r+1];if(r+=2,("optionalAccess"===i||"optionalCall"===i)&&null==n)return;"access"===i||"optionalAccess"===i?(t=n,n=s(n)):("call"===i||"optionalCall"===i)&&(n=s((...e)=>n.call(t,...e)),t=void 0)}return n}let d=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^/]+?|)(\.[^./]*|))(?:[/]*)$/;function h(...e){let t="",n=!1;for(let r=e.length-1;r>=-1&&!n;r--){let i=r>=0?e[r]:"/";i&&(t=`${i}/${t}`,n="/"===i.charAt(0))}return t=(function(e,t){let n=0;for(let r=e.length-1;r>=0;r--){let i=e[r];"."===i?e.splice(r,1):".."===i?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e})(t.split("/").filter(e=>!!e),!n).join("/"),(n?"/":"")+t||"."}function f(e){let t=0;for(;t<e.length&&""===e[t];t++);let n=e.length-1;for(;n>=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}class p{static __initStatic(){this.id="RewriteFrames"}__init(){this.name=p.id}__init2(){this._prefix="app:///"}constructor(e={}){p.prototype.__init.call(this),p.prototype.__init2.call(this),p.prototype.__init3.call(this),e.root&&(this._root=e.root),e.prefix&&(this._prefix=e.prefix),e.iteratee&&(this._iteratee=e.iteratee)}setupOnce(e,t){e(e=>{let n=t().getIntegration(p);return n?n.process(e):e})}process(e){let t=e;return e.exception&&Array.isArray(e.exception.values)&&(t=this._processExceptionsEvent(t)),t}__init3(){this._iteratee=e=>{if(!e.filename)return e;let t=/^[A-Z]:\\/.test(e.filename),n=/^\//.test(e.filename);if(t||n){var r;let i;let s=t?e.filename.replace(/^[A-Z]:/,"").replace(/\\/g,"/"):e.filename,a=this._root?function(e,t){e=h(e).substr(1),t=h(t).substr(1);let n=f(e.split("/")),r=f(t.split("/")),i=Math.min(n.length,r.length),s=i;for(let a=0;a<i;a++)if(n[a]!==r[a]){s=a;break}let o=[];for(let l=s;l<n.length;l++)o.push("..");return(o=o.concat(r.slice(s))).join("/")}(this._root,s):(i=function(e){let t=d.exec(e);return t?t.slice(1):[]}(s)[2],r&&i.substr(-1*r.length)===r&&(i=i.substr(0,i.length-r.length)),i);e.filename=`${this._prefix}${a}`}return e}}_processExceptionsEvent(e){try{return{...e,exception:{...e.exception,values:e.exception.values.map(e=>({...e,...e.stacktrace&&{stacktrace:this._processStacktrace(e.stacktrace)}}))}}}catch(t){return e}}_processStacktrace(e){return{...e,frames:e&&e.frames&&e.frames.map(e=>this._iteratee(e))}}}p.__initStatic();let _="7.24.2";var m=n(2343),g=n(2844),y=n(7321);let v=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/];class b{static __initStatic(){this.id="InboundFilters"}__init(){this.name=b.id}constructor(e={}){this._options=e,b.prototype.__init.call(this)}setupOnce(e,t){let n=e=>{let n=t();if(n){let r=n.getIntegration(b);if(r){var i;let s=n.getClient(),a=s?s.getOptions():{},o=function(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...v],ignoreInternal:void 0===e.ignoreInternal||e.ignoreInternal}}(r._options,a);return(o.ignoreInternal&&function(e){try{return"SentryError"===e.exception.values[0].type}catch(t){}return!1}(e)?(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&m.kg.warn(`Event dropped due to being internal Sentry Error. 6Event: ${(0,g.jH)(e)}`),0):(i=o.ignoreErrors)&&i.length&&(function(e){if(e.message)return[e.message];if(e.exception)try{let{type:t="",value:n=""}=e.exception.values&&e.exception.values[0]||{};return[`${n}`,`${t}: ${n}`]}catch(r){("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&m.kg.error(`Cannot extract message for event ${(0,g.jH)(e)}`)}return[]})(e).some(e=>(0,y.U0)(e,i))?(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&m.kg.warn(`Event dropped due to being matched by \`ignoreErrors\` option. 7Event: ${(0,g.jH)(e)}`),0):!function(e,t){if(!t||!t.length)return!1;let n=E(e);return!!n&&(0,y.U0)(n,t)}(e,o.denyUrls)?function(e,t){if(!t||!t.length)return!0;let n=E(e);return!n||(0,y.U0)(n,t)}(e,o.allowUrls)||(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&m.kg.warn(`Event dropped due to not being matched by \`allowUrls\` option. 8Event: ${(0,g.jH)(e)}. 9Url: ${E(e)}`),0):(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&m.kg.warn(`Event dropped due to being matched by \`denyUrls\` option. 10Event: ${(0,g.jH)(e)}. 11Url: ${E(e)}`),0))?e:null}}return e};n.id=this.name,e(n)}}function E(e){try{let t;try{t=e.exception.values[0].stacktrace.frames}catch(n){}return t?function(e=[]){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n&&"<anonymous>"!==n.filename&&"[native code]"!==n.filename)return n.filename||null}return null}(t):null}catch(r){return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&m.kg.error(`Cannot extract url for event ${(0,g.jH)(e)}`),null}}b.__initStatic();var w=n(535);class S{constructor(){S.prototype.__init.call(this)}static __initStatic(){this.id="FunctionToString"}__init(){this.name=S.id}setupOnce(){r=Function.prototype.toString,Function.prototype.toString=function(...e){let t=(0,w.HK)(this)||this;return r.apply(t,e)}}}S.__initStatic();var x=n(5659),T=n(350);let k=[];var R=n(360),O=n(8823),j=n(9732);
11class N extends Error{constructor(e,t="warn"){super(e),this.message=e,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=t}}let D=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function C(e,t=!1){let{host:n,path:r,pass:i,port:s,projectId:a,protocol:o,publicKey:l}=e;return`${o}://${l}${t&&i?`:${i}`:""}@${n}${s?`:${s}`:""}/${r?`${r}/`:r}${a}`}function P(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}var A=n(7597),I=n(6893);function $(e,t=Infinity,r=Infinity){try{return function e(t,r,i=Infinity,s=Infinity,a=function(){let e="function"==typeof WeakSet,t=e?new WeakSet:[];return[function(n){if(e)return!!t.has(n)||(t.add(n),!1);for(let r=0;r<t.length;r++){let i=t[r];if(i===n)return!0}return t.push(n),!1},function(n){if(e)t.delete(n);else for(let r=0;r<t.length;r++)if(t[r]===n){t.splice(r,1);break}}]}()){let[o,l]=a;if(null===r||["number","boolean","string"].includes(typeof r)&&!(0,A.i2)(r))return r;let u=function(e,t){try{if("domain"===e&&t&&"object"==typeof t&&t._events)return"[Domain]";if("domainEmitter"===e)return"[DomainEmitter]";if(void 0!==n.g&&t===n.g)return"[Global]";if("undefined"!=typeof window&&t===window)return"[Window]";if("undefined"!=typeof document&&t===document)return"[Document]";if((0,A.Cy)(t))return"[SyntheticEvent]";if("number"==typeof t&&t!=t)return"[NaN]";if(void 0===t)return"[undefined]";if("function"==typeof t)return`[Function: ${(0,R.$P)(t)}]`;if("symbol"==typeof t)return`[${String(t)}]`;if("bigint"==typeof t)return`[BigInt: ${String(t)}]`;return`[object ${Object.getPrototypeOf(t).constructor.name}]`}catch(r){return`**non-serializable** (${r})`}}(t,r);if(!u.startsWith("[object "))return u;if(r.__sentry_skip_normalization__)return r;if(0===i)return u.replace("object ","");if(o(r))return"[Circular ~]";if(r&&"function"==typeof r.toJSON)try{let c=r.toJSON();return e("",c,i-1,s,a)}catch(d){}let h=Array.isArray(r)?[]:{},f=0,p=(0,w.Sh)(r);for(let _ in p){if(!Object.prototype.hasOwnProperty.call(p,_))continue;if(f>=s){h[_]="[MaxProperties ~]";break}let m=p[_];h[_]=e(_,m,i-1,s,a),f++}return l(r),h}("",e,t,r)}catch(i){return{ERROR:`**non-serializable** (${i})`}}}function U(e,t=[]){return[e,t]}function B(e,t){let n=e[1];n.forEach(e=>{let n=e[0].type;t(e,n)})}function L(e,t){let n=t||new TextEncoder;return n.encode(e)}function G(e,t){let[n,r]=e,i=JSON.stringify(n);function s(e){"string"==typeof i?i="string"==typeof e?i+e:[L(i,t),e]:i.push("string"==typeof e?L(e,t):e)}for(let a of r){let[o,l]=a;if(s(` 12${JSON.stringify(o)} 13`),"string"==typeof l||l instanceof Uint8Array)s(l);else{let u;try{u=JSON.stringify(l)}catch(c){u=JSON.stringify($(l))}s(u)}}return"string"==typeof i?i:function(e){let t=e.reduce((e,t)=>e+t.length,0),n=new Uint8Array(t),r=0;for(let i of e)n.set(i,r),r+=i.length;return n}(i)}let z={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default"};var M=n(1170);function Y(e,t={}){let n="string"==typeof t?t:t.tunnel,r="string"!=typeof t&&t._metadata?t._metadata.sdk:void 0;return n||`${function(e){let t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}(e)}${e.projectId}/envelope/?${(0,w._j)({sentry_key:e.publicKey,sentry_version:"7",...r&&{sentry_client:`${r.name}/${r.version}`}})}`}function Z(e){if(!e||!e.sdk)return;let{name:t,version:n}=e.sdk;return{name:t,version:n}}var F=n(9015);let H="Not capturing exception because it's already been captured.";class q{__init(){this._integrations={}}__init2(){this._integrationsInitialized=!1}__init3(){this._numProcessing=0}__init4(){this._outcomes={}}constructor(e){if(q.prototype.__init.call(this),q.prototype.__init2.call(this),q.prototype.__init3.call(this),q.prototype.__init4.call(this),this._options=e,e.dsn){this._dsn=function(e){let t="string"==typeof e?function(e){let t=D.exec(e);if(!t)throw new N(`Invalid Sentry Dsn: ${e}`);let[n,r,i="",s,a="",o]=t.slice(1),l="",u=o,c=u.split("/");if(c.length>1&&(l=c.slice(0,-1).join("/"),u=c.pop()),u){let d=u.match(/^\d+/);
13d&&(u=d[0])}return P({host:s,pass:i,path:l,projectId:u,port:a,protocol:n,publicKey:r})}(e):P(e);return!function(e){if(!("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__))return;let{port:t,projectId:n,protocol:r}=e;if(["protocol","publicKey","host","projectId"].forEach(t=>{if(!e[t])throw new N(`Invalid Sentry Dsn: ${t} missing`)}),!n.match(/^\d+$/))throw new N(`Invalid Sentry Dsn: Invalid projectId ${n}`);if(!("http"===r||"https"===r))throw new N(`Invalid Sentry Dsn: Invalid protocol ${r}`);if(t&&isNaN(parseInt(t,10)))throw new N(`Invalid Sentry Dsn: Invalid port ${t}`)}(t),t}(e.dsn);let t=Y(this._dsn,e);this._transport=e.transport({recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:t})}else("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&m.kg.warn("No DSN provided, client will not do anything.")}captureException(e,t,n){if((0,g.YO)(e)){("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&m.kg.log(H);return}let r=t&&t.event_id;return this._process(this.eventFromException(e,t).then(e=>this._captureEvent(e,t,n)).then(e=>{r=e})),r}captureMessage(e,t,n,r){let i=n&&n.event_id,s=(0,A.pt)(e)?this.eventFromMessage(String(e),t,n):this.eventFromException(e,n);return this._process(s.then(e=>this._captureEvent(e,n,r)).then(e=>{i=e})),i}captureEvent(e,t,n){if(t&&t.originalException&&(0,g.YO)(t.originalException)){("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&m.kg.log(H);return}let r=t&&t.event_id;return this._process(this._captureEvent(e,t,n).then(e=>{r=e})),r}captureSession(e){if(!this._isEnabled()){("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&m.kg.warn("SDK not enabled, will not capture session.");return}"string"!=typeof e.release?("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&m.kg.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),(0,F.CT)(e,{init:!1}))}getDsn(){return this._dsn}getOptions(){return this._options}getTransport(){return this._transport}flush(e){let t=this._transport;
13return t?this._isClientDoneProcessing(e).then(n=>t.flush(e).then(e=>n&&e)):(0,I.WD)(!0)}close(e){return this.flush(e).then(e=>(this.getOptions().enabled=!1,e))}setupIntegrations(){this._isEnabled()&&!this._integrationsInitialized&&(this._integrations=function(e){let t={};return e.forEach(e=>{t[e.name]=e,-1===k.indexOf(e.name)&&(e.setupOnce(T.c,x.Gd),k.push(e.name),("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&m.kg.log(`Integration installed: ${e.name}`))}),t}(this._options.integrations),this._integrationsInitialized=!0)}getIntegrationById(e){return this._integrations[e]}getIntegration(e){try{return this._integrations[e.id]||null}catch(t){return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&m.kg.warn(`Cannot retrieve integration ${e.id} from the current Client`),null}}sendEvent(e,t={}){if(this._dsn){let n=function(e,t,n,r){var i,s;let a=Z(n),o=e.type||"event";i=e,(s=n&&n.sdk)&&(i.sdk=i.sdk||{},i.sdk.name=i.sdk.name||s.name,i.sdk.version=i.sdk.version||s.version,i.sdk.integrations=[...i.sdk.integrations||[],...s.integrations||[]],i.sdk.packages=[...i.sdk.packages||[],...s.packages||[]]);let l=function(e,t,n,r){let i=e.sdkProcessingMetadata&&e.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:e.event_id,sent_at:new Date().toISOString(),...t&&{sdk:t},...!!n&&{dsn:C(r)},..."transaction"===e.type&&i&&{trace:(0,w.Jr)({...i})}}}(e,a,r,t);delete e.sdkProcessingMetadata;let u=[{type:o},e];return U(l,[u])}(e,this._dsn,this._options._metadata,this._options.tunnel);for(let r of t.attachments||[])n=function(e,t){let[n,r]=e;return[n,[...r,t]]}(n,function(e,t){let n="string"==typeof e.data?L(e.data,t):e.data;return[(0,w.Jr)({type:"attachment",length:n.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType}),n]}(r,this._options.transportOptions&&this._options.transportOptions.textEncoder));this._sendEnvelope(n)}}sendSession(e){if(this._dsn){let t=function(e,t,n,r){let i=Z(n),s={sent_at:new Date().toISOString(),...i&&{sdk:i},...!!r&&{dsn:C(t)}};return U(s,["aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e]])}(e,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(t)}}recordDroppedEvent(e,t,n){if(this._options.sendClientReports){let r=`${e}:${t}`;("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&m.kg.log(`Adding outcome: "${r}"`),this._outcomes[r]=this._outcomes[r]+1||1}}_updateSessionFromEvent(e,t){let n=!1,r=!1,i=t.exception&&t.exception.values;if(i)for(let s of(r=!0,i)){let a=s.mechanism;if(a&&!1===a.handled){n=!0;break}}let o="ok"===e.status,l=o&&0===e.errors||o&&n;l&&((0,F.CT)(e,{...n&&{status:"crashed"},errors:e.errors||Number(r||n)}),this.captureSession(e))}_isClientDoneProcessing(e){return new I.cW(t=>{let n=0,r=setInterval(()=>{0==this._numProcessing?(clearInterval(r),t(!0)):(n+=1,e&&n>=e&&(clearInterval(r),t(!1)))},1)})}_isEnabled(){return!1!==this.getOptions().enabled&&void 0!==this._dsn}_prepareEvent(e,t,n){let{normalizeDepth:r=3,normalizeMaxBreadth:i=1e3}=this.getOptions(),s={...e,event_id:e.event_id||t.event_id||(0,g.DM)(),timestamp:e.timestamp||(0,M.yW)()};this._applyClientOptions(s),this._applyIntegrationsMetadata(s);let a=n;t.captureContext&&(a=T.s.clone(a).update(t.captureContext));let o=(0,I.WD)(s);if(a&&a.getAttachments){let l=[...t.attachments||[],...a.getAttachments()];l.length&&(t.attachments=l),o=a.applyToEvent(s,t)}return o.then(e=>"number"==typeof r&&r>0?this._normalizeEvent(e,r,i):e)}_normalizeEvent(e,t,n){if(!e)return null;let r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(e=>({...e,...e.data&&{data:$(e.data,t,n)}}))},...e.user&&{user:$(e.user,t,n)},...e.contexts&&{contexts:$(e.contexts,t,n)},...e.extra&&{extra:$(e.extra,t,n)}};return e.contexts&&e.contexts.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=$(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(e=>(e.data&&(e.data=$(e.data,t,n)),e))),r}_applyClientOptions(e){let t=this.getOptions(),{environment:n,release:r,dist:i,maxValueLength:s=250}=t;"environment"in e||(e.environment="environment"in t?n:"production"),void 0===e.release&&void 0!==r&&(e.release=r),void 0===e.dist&&void 0!==i&&(e.dist=i),e.message&&(e.message=(0,y.$G)(e.message,s));let a=e.exception&&e.exception.values&&e.exception.values[0];
13a&&a.value&&(a.value=(0,y.$G)(a.value,s));let o=e.request;o&&o.url&&(o.url=(0,y.$G)(o.url,s))}_applyIntegrationsMetadata(e){let t=Object.keys(this._integrations);t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}_captureEvent(e,t={},n){return this._processEvent(e,t,n).then(e=>e.event_id,e=>{("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&("log"===e.logLevel?m.kg.log(e.message):m.kg.warn(e))})}_processEvent(e,t,n){let r=this.getOptions(),{sampleRate:i}=r;if(!this._isEnabled())return(0,I.$2)(new N("SDK not enabled, will not capture event.","log"));let s="transaction"===e.type,a=s?"beforeSendTransaction":"beforeSend",o=r[a];return!s&&"number"==typeof i&&Math.random()>i?(this.recordDroppedEvent("sample_rate","error",e),(0,I.$2)(new N(`Discarding event because it's not included in the random sample (sampling rate = ${i})`,"log"))):this._prepareEvent(e,t,n).then(n=>{if(null===n)throw this.recordDroppedEvent("event_processor",e.type||"error",e),new N("An event processor returned `null`, will not send event.","log");let r=t.data&&!0===t.data.__sentry__;if(r||!o)return n;let i=o(n,t);return function(e,t){let n=`\`${t}\` must return \`null\` or a valid event.`;if((0,A.J8)(e))return e.then(e=>{if(!(0,A.PO)(e)&&null!==e)throw new N(n);return e},e=>{throw new N(`\`${t}\` rejected with ${e}`)});if(!(0,A.PO)(e)&&null!==e)throw new N(n);return e}(i,a)}).then(r=>{if(null===r)throw this.recordDroppedEvent("before_send",e.type||"error",e),new N(`\`${a}\` returned \`null\`, will not send event.`,"log");let i=n&&n.getSession();!s&&i&&this._updateSessionFromEvent(i,r);let o=r.transaction_info;if(s&&o&&r.transaction!==e.transaction){let l="custom";r.transaction_info={...o,source:l,changes:[...o.changes,{source:l,timestamp:r.timestamp,propagations:o.propagations}]}}return this.sendEvent(r,t),r}).then(null,e=>{if(e instanceof N)throw e;throw this.captureException(e,{data:{__sentry__:!0},originalException:e}),new N(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event. 14Reason: ${e}`)})}_process(e){this._numProcessing++,e.then(e=>(this._numProcessing--,e),e=>(this._numProcessing--,e))}_sendEnvelope(e){this._transport&&this._dsn?this._transport.send(e).then(null,e=>{("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&m.kg.error("Error while sending event:",e)}):("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&m.kg.error("Transport disabled")}_clearOutcomes(){let e=this._outcomes;return this._outcomes={},Object.keys(e).map(t=>{let[n,r]=t.split(":");return{reason:n,category:r,quantity:e[t]}})}}function V(e,t){let n=W(e,t),r={type:t&&t.name,value:function(e){let t=e&&e.message;return t?t.error&&"string"==typeof t.error.message?t.error.message:t:"No error message"}(t)};return n.length&&(r.stacktrace={frames:n}),void 0===r.type&&""===r.value&&(r.value="Unrecoverable error caught"),r}function J(e,t){return{exception:{values:[V(e,t)]}}}function W(e,t){let n=t.stacktrace||t.stack||"",r=function(e){if(e){if("number"==typeof e.framesToPop)return e.framesToPop;if(K.test(e.message))return 1}return 0}(t);try{return e(n,r)}catch(i){}return[]}let K=/Minified React error #\d+;/i;function X(e,t,n,r,i){let s;if((0,A.VW)(t)&&t.error)return J(e,t.error);if((0,A.TX)(t)||(0,A.fm)(t)){if("stack"in t)s=J(e,t);else{let a=t.name||((0,A.TX)(t)?"DOMError":"DOMException"),o=t.message?`${a}: ${t.message}`:a;s=Q(e,o,n,r),(0,g.Db)(s,o)}return"code"in t&&(s.tags={...s.tags,"DOMException.code":`${t.code}`}),s}return(0,A.VZ)(t)?J(e,t):(0,A.PO)(t)||(0,A.cO)(t)?(s=function(e,t,n,r){let i=(0,x.Gd)(),s=i.getClient(),a=s&&s.getOptions().normalizeDepth,o={exception:{values:[{type:(0,A.cO)(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:`Non-Error ${r?"promise rejection":"exception"} captured with keys: ${(0,w.zf)(t)}`}]},extra:{__serialized__:function e(t,n=3,r=102400){let i=$(t,n);return~-encodeURI(JSON.stringify(i)).split(/%..|./).length>r?e(t,n-1,r):i}(t,a)}};if(n){let l=W(e,n);l.length&&(o.exception.values[0].stacktrace={frames:l})}return o}(e,t,n,i),(0,g.EG)(s,{synthetic:!0}),s):(s=Q(e,t,n,r),(0,g.Db)(s,`${t}`,void 0),(0,g.EG)(s,{synthetic:!0}),s)}function Q(e,t,n,r){let i={message:t};if(r&&n){let s=W(e,n);s.length&&(i.exception={values:[{value:t,stacktrace:{frames:s}}]})}return i}var ee=n(4487);let et=u.n2,en=0;function er(e,t={}
14,n){if("function"!=typeof e)return e;try{let r=e.__sentry_wrapped__;if(r)return r;if((0,w.HK)(e))return e}catch(i){return e}let s=function(){let r=Array.prototype.slice.call(arguments);try{n&&"function"==typeof n&&n.apply(this,arguments);let i=r.map(e=>er(e,t));return e.apply(this,i)}catch(s){throw en++,setTimeout(()=>{en--}),(0,ee.$e)(e=>{e.addEventProcessor(e=>(t.mechanism&&((0,g.Db)(e,void 0,void 0),(0,g.EG)(e,t.mechanism)),e.extra={...e.extra,arguments:r},e)),(0,ee.Tb)(s)}),s}};try{for(let a in e)Object.prototype.hasOwnProperty.call(e,a)&&(s[a]=e[a])}catch(o){}(0,w.$Q)(s,e),(0,w.xp)(e,"__sentry_wrapped__",s);try{let l=Object.getOwnPropertyDescriptor(s,"name");l.configurable&&Object.defineProperty(s,"name",{get:()=>e.name})}catch(u){}return s}var ei=n(8464);let es=["fatal","error","warning","log","info","debug"];function ea(e){if(!e)return{};let t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};let n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],relative:t[5]+n+r}}let eo="Breadcrumbs";class el{static __initStatic(){this.id=eo}__init(){this.name=el.id}constructor(e){el.prototype.__init.call(this),this.options={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e}}setupOnce(){var e;this.options.console&&(0,j.o)("console",eu),this.options.dom&&(0,j.o)("dom",(e=this.options.dom,function(t){let n;let r="object"==typeof e?e.serializeAttribute:void 0,i="object"==typeof e&&"number"==typeof e.maxStringLength?e.maxStringLength:void 0;i&&i>1024&&(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&m.kg.warn(`\`dom.maxStringLength\` cannot exceed 1024, but a value of ${i} was configured. Sentry will use 1024 instead.`),i=1024),"string"==typeof r&&(r=[r]);try{n=t.event.target?(0,ei.Rt)(t.event.target,{keyAttrs:r,maxStringLength:i}):(0,ei.Rt)(t.event,{keyAttrs:r,maxStringLength:i})}catch(s){n="<unknown>"}0!==n.length&&(0,x.Gd)().addBreadcrumb({category:`ui.${t.name}`,message:n},{event:t.event,name:t.name,global:t.global})})),this.options.xhr&&(0,j.o)("xhr",ec),this.options.fetch&&(0,j.o)("fetch",ed),this.options.history&&(0,j.o)("history",eh)}addSentryBreadcrumb(e){this.options.sentry&&(0,x.Gd)().addBreadcrumb({category:`sentry.${"transaction"===e.type?"transaction":"event"}`,event_id:e.event_id,level:e.level,message:(0,g.jH)(e)},{event:e})}}function eu(e){var t;for(let n=0;n<e.args.length;n++)if("ref=Ref<"===e.args[n]){e.args[n+1]="viewRef";break}let r={category:"console",data:{arguments:e.args,logger:"console"},level:"warn"===(t=e.level)?"warning":es.includes(t)?t:"log",message:(0,y.nK)(e.args," ")};if("assert"===e.level){if(!1!==e.args[0])return;r.message=`Assertion failed: ${(0,y.nK)(e.args.slice(1)," ")||"console.assert"}`,r.data.arguments=e.args.slice(1)}(0,x.Gd)().addBreadcrumb(r,{input:e.args,level:e.level})}function ec(e){if(e.endTimestamp){if(e.xhr.__sentry_own_request__)return;let{method:t,url:n,status_code:r,body:i}=e.xhr.__sentry_xhr__||{};(0,x.Gd)().addBreadcrumb({category:"xhr",data:{method:t,url:n,status_code:r},type:"http"},{xhr:e.xhr,input:i});return}}function ed(e){!e.endTimestamp||e.fetchData.url.match(/sentry_key/)&&"POST"===e.fetchData.method||(e.error?(0,x.Gd)().addBreadcrumb({category:"fetch",data:e.fetchData,level:"error",type:"http"},{data:e.error,input:e.args}):(0,x.Gd)().addBreadcrumb({category:"fetch",data:{...e.fetchData,status_code:e.response.status},type:"http"},{input:e.args,response:e.response}))}function eh(e){let t=e.from,n=e.to,r=ea(et.location.href),i=ea(t),s=ea(n);i.path||(i=r),r.protocol===s.protocol&&r.host===s.host&&(n=s.relative),r.protocol===i.protocol&&r.host===i.host&&(t=i.relative),(0,x.Gd)().addBreadcrumb({category:"navigation",data:{from:t,to:n}})}el.__initStatic();class ef extends q{constructor(e){e._metadata=e._metadata||{},e._metadata.sdk=e._metadata.sdk||{name:"sentry.javascript.browser",packages:[{name:"npm:@sentry/browser",version:_}],version:_},super(e),e.sendClientReports&&et.document&&et.document.addEventListener("visibilitychange",()=>{"hidden"===et.document.visibilityState&&this._flushOutcomes()})}eventFromException(e,t){return function(e,t,n,r){let i=n&&n.syntheticException||void 0,s=X(e,t,i,r);return(0,g.EG)(s),s.level="error",n&&n.event_id&&(s.event_id=n.event_id),(0,I.WD)(s)}(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t="info",n){return function(e,t,n="info",r,i){let s=r&&r.syntheticException||void 0,a=Q(e,t,s,i);return a.level=n,r&&r.event_id&&(a.event_id=r.event_id),(0,I.WD)(a)}(this._options.stackParser,e,t,n,this._options.attachStacktrace)}sendEvent(e,t){let n=this.getIntegrationById(eo);c([n,"optionalAccess",e=>e.addSentryBreadcrumb,"optionalCall",t=>t(e)]),super.sendEvent(e,t)}_prepareEvent(e,t,n){return e.platform=e.platform||"javascript",super._prepareEvent(e,t,n)}_flushOutcomes(){let e=this._clearOutcomes();if(0===e.length){("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&m.kg.log("No outcomes to send");return}if(!this._dsn){("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&m.kg.log("No dsn provided, will not send outcomes");return}("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&m.kg.log("Sending outcomes:",e);let t=Y(this._dsn,this._options),n=function(e,t,n){let r=[{type:"client_report"},{timestamp:(0,M.yW)(),discarded_events:e}];return U(t?{dsn:t}:{},[r])}(e,this._options.tunnel&&C(this._dsn));try{let r="[object Navigator]"===Object.prototype.toString.call(et&&et.navigator),i=r&&"function"==typeof et.navigator.sendBeacon;
14if(i&&!this._options.transportOptions){let s=et.navigator.sendBeacon.bind(et.navigator);s(t,G(n))}else this._sendEnvelope(n)}catch(a){("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&m.kg.error(a)}}}function ep(e,t,n,r){let i={filename:e,function:t,in_app:!0};return void 0!==n&&(i.lineno=n),void 0!==r&&(i.colno=r),i}let e_=/^\s*at (?:(.*\).*?|.*?) ?\((?:address at )?)?((?:file|https?|blob|chrome-extension|address|native|eval|webpack|<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,em=/\((\S*)(?::(\d+))(?::(\d+))\)/,eg=e=>{let t=e_.exec(e);if(t){let n=t[2]&&0===t[2].indexOf("eval");if(n){let r=em.exec(t[2]);r&&(t[2]=r[1],t[3]=r[2],t[4]=r[3])}let[i,s]=ex(t[1]||"?",t[2]);return ep(s,i,t[3]?+t[3]:void 0,t[4]?+t[4]:void 0)}},ey=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension|safari-extension|safari-web-extension|capacitor)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,ev=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,eb=e=>{let t=ey.exec(e);if(t){let n=t[3]&&t[3].indexOf(" > eval")>-1;if(n){let r=ev.exec(t[3]);r&&(t[1]=t[1]||"eval",t[3]=r[1],t[4]=r[2],t[5]="")}let i=t[3],s=t[1]||"?";return[s,i]=ex(s,i),ep(i,s,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},eE=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,ew=e=>{let t=eE.exec(e);return t?ep(t[2],t[1]||"?",+t[3],t[4]?+t[4]:void 0):void 0},eS=(0,R.pE)(...[[30,eg],[50,eb],[40,ew]]),ex=(e,t)=>{let n=-1!==e.indexOf("safari-extension"),r=-1!==e.indexOf("safari-web-extension");return n||r?[-1!==e.indexOf("@")?e.split("@")[0]:"?",n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},eT=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"];class ek{static __initStatic(){this.id="TryCatch"}__init(){this.name=ek.id}constructor(e){ek.prototype.__init.call(this),this._options={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...e}}setupOnce(){this._options.setTimeout&&(0,w.hl)(et,"setTimeout",eR),this._options.setInterval&&(0,w.hl)(et,"setInterval",eR),this._options.requestAnimationFrame&&(0,w.hl)(et,"requestAnimationFrame",eO),this._options.XMLHttpRequest&&"XMLHttpRequest"in et&&(0,w.hl)(XMLHttpRequest.prototype,"send",ej);let e=this._options.eventTarget;if(e){let t=Array.isArray(e)?e:eT;t.forEach(eN)}}}function eR(e){return function(...t){let n=t[0];return t[0]=er(n,{mechanism:{data:{function:(0,R.$P)(e)},handled:!0,type:"instrument"}}),e.apply(this,t)}}function eO(e){return function(t){return e.apply(this,[er(t,{mechanism:{data:{function:"requestAnimationFrame",handler:(0,R.$P)(e)},handled:!0,type:"instrument"}})])}}function ej(e){return function(...t){let n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(e=>{e in n&&"function"==typeof n[e]&&(0,w.hl)(n,e,function(t){let n={mechanism:{data:{function:e,handler:(0,R.$P)(t)},handled:!0,type:"instrument"}},r=(0,w.HK)(t);return r&&(n.mechanism.data.handler=(0,R.$P)(r)),er(t,n)})}),e.apply(this,t)}}function eN(e){let t=et[e]&&et[e].prototype;t&&t.hasOwnProperty&&t.hasOwnProperty("addEventListener")&&((0,w.hl)(t,"addEventListener",function(t){return function(n,r,i){try{"function"==typeof r.handleEvent&&(r.handleEvent=er(r.handleEvent,{mechanism:{data:{function:"handleEvent",handler:(0,R.$P)(r),target:e},handled:!0,type:"instrument"}}))}catch(s){}return t.apply(this,[n,er(r,{mechanism:{data:{function:"addEventListener",handler:(0,R.$P)(r),target:e},handled:!0,type:"instrument"}}),i])}}),(0,w.hl)(t,"removeEventListener",function(e){return function(t,n,r){try{let i=n&&n.__sentry_wrapped__;i&&e.call(this,t,i,r)}catch(s){}return e.call(this,t,n,r)}}))}ek.__initStatic();class eD{static __initStatic(){this.id="GlobalHandlers"}__init(){this.name=eD.id}__init2(){this._installFunc={onerror:eC,onunhandledrejection:eP}}constructor(e){eD.prototype.__init.call(this),eD.prototype.__init2.call(this),this._options={onerror:!0,onunhandledrejection:!0,...e}}setupOnce(){Error.stackTraceLimit=50;let e=this._options;for(let t in e){var n;let r=this._installFunc[t];r&&e[t]&&(n=t,("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&m.kg.log(`Global Handler attached: ${n}`),r(),this._installFunc[t]=void 0)}}}function eC(){(0,j.o)("error",e=>{let[t,n,r]=e$();if(!t.getIntegration(eD))return;let{msg:i,url:s,line:a,column:o,error:l}=e;if(en>0||l&&l.__sentry_own_request__)return;let u=void 0===l&&(0,A.HD)(i)?function(e,t,n,r){let i=(0,A.VW)(e)?e.message:e,s="Error",a=i.match(/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i);a&&(s=a[1],i=a[2]);let o={exception:{values:[{type:s,value:i}]}};return eA(o,t,n,r)}(i,s,a,o):eA(X(n,l||i,void 0,r,!1),s,a,o);u.level="error",eI(t,l,u,"onerror")})}function eP(){(0,j.o)("unhandledrejection",e=>{let[t,n,r]=e$();if(!t.getIntegration(eD))return;let i=e;try{"reason"in e?i=e.reason:"detail"in e&&"reason"in e.detail&&(i=e.detail.reason)}catch(s){}if(en>0||i&&i.__sentry_own_request__)return!0;let a=(0,A.pt)(i)?{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(i)}`}]}}:X(n,i,void 0,r,!0);a.level="error",eI(t,i,a,"onunhandledrejection")})}function eA(e,t,n,r){let i=e.exception=e.exception||{},s=i.values=i.values||[],a=s[0]=s[0]||{},o=a.stacktrace=a.stacktrace||{},l=o.frames=o.frames||[],u=isNaN(parseInt(r,10))?void 0:r,c=isNaN(parseInt(n,10))?void 0:n,d=(0,A.HD)(t)&&t.length>0?t:(0,ei.l4)();return 0===l.length&&l.push({colno:u,filename:d,function:"?",in_app:!0,lineno:c}),e}function eI(e,t,n,r){(0,g.EG)(n,{handled:!1,type:r}),e.captureEvent(n,{originalException:t})}function e$(){let e=(0,x.Gd)(),t=e.getClient(),n=t&&t.getOptions()||{stackParser:()=>[],attachStacktrace:!1};return[e,n.stackParser,n.attachStacktrace]}eD.__initStatic();class eU{static __initStatic(){this.id="LinkedErrors"}__init(){this.name=eU.id}constructor(e={}){eU.prototype.__init.call(this),this._key=e.key||"cause",this._limit=e.limit||5}setupOnce(){let e=(0,x.Gd)().getClient();e&&(0,T.c)((t,n)=>{let r=(0,x.Gd)().getIntegration(eU);return r?function(e,t,n,r,i){if(!r.exception||!r.exception.values||!i||!(0,A.V9)(i.originalException,Error))return r;let s=function e(t,n,r,i,s=[]){if(!(0,A.V9)(r[i],Error)||s.length+1>=n)return s;let a=V(t,r[i]);return e(t,n,r[i],i,[a,...s])}(e,n,i.originalException,t);return r.exception.values=[...s,...r.exception.values],r}(e.getOptions().stackParser,r._key,r._limit,t,n):t})}}eU.__initStatic();class eB{constructor(){eB.prototype.__init.call(this)}static __initStatic(){this.id="Dedupe"}__init(){this.name=eB.id}setupOnce(e,t){let n=e=>{let n=t().getIntegration(eB);if(n){try{var r;if((r=n._previousEvent)&&(function(e,t){let n=e.message,r=t.message;return!!((n||r)&&(!n||r)&&(n||!r)&&n===r&&eG(e,t)&&eL(e,t))}(e,r)||function(e,t){let n=ez(t),r=ez(e);return!!(n&&r&&n.type===r.type&&n.value===r.value&&eG(e,t)&&eL(e,t))}(e,r)))return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&m.kg.warn("Event dropped due to being a duplicate of previously captured event."),null}catch(i){}return n._previousEvent=e}return e};n.id=this.name,e(n)}}function eL(e,t){let n=eM(e),r=eM(t);if(!n&&!r)return!0;
14if(n&&!r||!n&&r||r.length!==n.length)return!1;for(let i=0;i<r.length;i++){let s=r[i],a=n[i];if(s.filename!==a.filename||s.lineno!==a.lineno||s.colno!==a.colno||s.function!==a.function)return!1}return!0}function eG(e,t){let n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;try{return!(n.join("")!==r.join(""))}catch(i){return!1}}function ez(e){return e.exception&&e.exception.values&&e.exception.values[0]}function eM(e){let t=e.exception;if(t)try{return t.values[0].stacktrace.frames}catch(n){}}eB.__initStatic();class eY{constructor(){eY.prototype.__init.call(this)}static __initStatic(){this.id="HttpContext"}__init(){this.name=eY.id}setupOnce(){(0,T.c)(e=>{if((0,x.Gd)().getIntegration(eY)){if(!et.navigator&&!et.location&&!et.document)return e;let t=e.request&&e.request.url||et.location&&et.location.href,{referrer:n}=et.document||{},{userAgent:r}=et.navigator||{},i={...e.request&&e.request.headers,...n&&{Referer:n},...r&&{"User-Agent":r}},s={...t&&{url:t},headers:i};return{...e,request:s}}return e})}}function eZ(e,t,n=function(e){let t=[];function n(e){return t.splice(t.indexOf(e),1)[0]}return{$:t,add:function(r){if(!(void 0===e||t.length<e))return(0,I.$2)(new N("Not adding Promise because buffer limit was reached."));let i=r();return -1===t.indexOf(i)&&t.push(i),i.then(()=>n(i)).then(null,()=>n(i).then(null,()=>{})),i},drain:function(e){return new I.cW((n,r)=>{let i=t.length;if(!i)return n(!0);let s=setTimeout(()=>{e&&e>0&&n(!1)},e);t.forEach(e=>{(0,I.WD)(e).then(()=>{--i||(clearTimeout(s),n(!0))},r)})})}}}(e.bufferSize||30)){let r={},i=e=>n.drain(e);return{send:function(i){let s=[];if(B(i,(t,n)=>{let i=z[n];if(function(e,t,n=Date.now()){return(e[t]||e.all||0)>n}(r,i)){let a=eF(t,n);e.recordDroppedEvent("ratelimit_backoff",i,a)}else s.push(t)}),0===s.length)return(0,I.WD)();let a=U(i[0],s),o=t=>{B(a,(n,r)=>{let i=eF(n,r);e.recordDroppedEvent(t,z[r],i)})},l=()=>t({body:G(a,e.textEncoder)}).then(e=>{void 0!==e.statusCode&&(e.statusCode<200||e.statusCode>=300)&&("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&m.kg.warn(`Sentry responded with status code ${e.statusCode} to sent event.`),r=function(e,{statusCode:t,headers:n},r=Date.now()){let i={...e},s=n&&n["x-sentry-rate-limits"],a=n&&n["retry-after"];if(s)for(let o of s.trim().split(",")){let[l,u]=o.split(":",2),c=parseInt(l,10),d=(isNaN(c)?60:c)*1e3;if(u)for(let h of u.split(";"))i[h]=r+d;else i.all=r+d}else a?i.all=r+function(e,t=Date.now()){let n=parseInt(`${e}`,10);if(!isNaN(n))return 1e3*n;let r=Date.parse(`${e}`);return isNaN(r)?6e4:r-t}(a,r):429===t&&(i.all=r+6e4);return i}(r,e)},e=>{("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&m.kg.error("Failed while sending event:",e),o("network_error")});return n.add(l).then(e=>e,e=>{if(e instanceof N)return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&m.kg.error("Skipped sending event because buffer is full."),o("queue_overflow"),(0,I.WD)();throw e})},flush:i}}function eF(e,t){if("event"===t||"transaction"===t)return Array.isArray(e)?e[1]:void 0}function eH(e,t=function(){if(a)return a;if((0,O.Du)(et.fetch))return a=et.fetch.bind(et);let e=et.document,t=et.fetch;if(e&&"function"==typeof e.createElement)try{let n=e.createElement("iframe");n.hidden=!0,e.head.appendChild(n);let r=n.contentWindow;r&&r.fetch&&(t=r.fetch),e.head.removeChild(n)}catch(i){("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&m.kg.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",i)}return a=t.bind(et)}()){return eZ(e,function(n){let r={body:n.body,method:"POST",referrerPolicy:"origin",headers:e.headers,keepalive:n.body.length<=65536,...e.fetchOptions};try{return t(e.url,r).then(e=>({statusCode:e.status,headers:{"x-sentry-rate-limits":e.headers.get("X-Sentry-Rate-Limits"),"retry-after":e.headers.get("Retry-After")}}))}catch(i){return a=void 0,(0,I.$2)(i)}})}function eq(e){return eZ(e,function(t){return new I.cW((n,r)=>{let i=new XMLHttpRequest;for(let s in i.onerror=r,i.onreadystatechange=()=>{4===i.readyState&&n({statusCode:i.status,headers:{"x-sentry-rate-limits":i.getResponseHeader("X-Sentry-Rate-Limits"),"retry-after":i.getResponseHeader("Retry-After")}})},i.open("POST",e.url),e.headers)Object.prototype.hasOwnProperty.call(e.headers,s)&&i.setRequestHeader(s,e.headers[s]);i.send(t.body)})})}eY.__initStatic();let eV=[new b,new S,new ek,new el,new eD,new eU,new eB,new eY];function eJ(e){e.startSession({ignoreDuration:!0}),e.captureSession()}var eW=n(2758),eK=n(3233);let eX=RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function eQ(e){let t;let n=e.match(eX);if(e&&n)return"1"===n[3]?t=!0:"0"===n[3]&&(t=!1),{traceId:n[1],parentSampled:t,parentSpanId:n[2]}}let e0="baggage",e1="sentry-",e2=/^sentry-/;function e3(e){if(!(0,A.HD)(e)&&!Array.isArray(e))return;let t={};if(Array.isArray(e))t=e.reduce((e,t)=>
14{let n=e5(t);return{...e,...n}},{});else{if(!e)return;t=e5(e)}let n=Object.entries(t).reduce((e,[t,n])=>{if(t.match(e2)){let r=t.slice(e1.length);e[r]=n}return e},{});return Object.keys(n).length>0?n:void 0}function e4(e){let t=Object.entries(e).reduce((e,[t,n])=>(n&&(e[`${e1}${t}`]=n),e),{});return function(e){if(0!==Object.keys(e).length)return Object.entries(e).reduce((e,[t,n],r)=>{let i=`${encodeURIComponent(t)}=${encodeURIComponent(n)}`,s=0===r?i:`${e},${i}`;return s.length>8192?(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&m.kg.warn(`Not adding key: ${t} with val: ${n} to baggage header due to exceeding baggage size limits.`),e):s},"")}(t)}function e5(e){return e.split(",").map(e=>e.split("=").map(e=>decodeURIComponent(e.trim()))).reduce((e,[t,n])=>(e[t]=n,e),{})}var e8=n(6458);let e6=u.n2;var e9=n(5375);let e7=(e,t,n)=>{let r,i;return s=>{t.value>=0&&(s||n)&&((i=t.value-(r||0))||void 0===r)&&(r=t.value,t.delta=i,e(t))}},te=()=>`v3-${Date.now()}-${Math.floor(Math.random()*(9e12-1))+1e12}`,tt=()=>{let e=e6.performance.timing,t=e6.performance.navigation.type,n={entryType:"navigation",startTime:0,type:2==t?"back_forward":1===t?"reload":"navigate"};for(let r in e)"navigationStart"!==r&&"toJSON"!==r&&(n[r]=Math.max(e[r]-e.navigationStart,0));return n},tn=()=>e6.__WEB_VITALS_POLYFILL__?e6.performance&&(performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]||tt()):e6.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0],tr=()=>{let e=tn();return e&&e.activationStart||0},ti=(e,t)=>{let n=tn(),r="navigate";return n&&(r=e6.document.prerendering||tr()>0?"prerender":n.type.replace(/_/g,"-")),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:te(),navigationType:r}},ts=(e,t,n)=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){let r=new PerformanceObserver(e=>{t(e.getEntries())});return r.observe(Object.assign({type:e,buffered:!0},n||{})),r}}catch(i){}},ta=(e,t)=>{let n=r=>{("pagehide"===r.type||"hidden"===e6.document.visibilityState)&&(e(r),t&&(removeEventListener("visibilitychange",n,!0),removeEventListener("pagehide",n,!0)))};addEventListener("visibilitychange",n,!0),addEventListener("pagehide",n,!0)},to=e=>{let t;let n=ti("CLS",0),r=0,i=[],s=e=>{e.forEach(e=>{if(!e.hadRecentInput){let s=i[0],a=i[i.length-1];r&&0!==i.length&&e.startTime-a.startTime<1e3&&e.startTime-s.startTime<5e3?(r+=e.value,i.push(e)):(r=e.value,i=[e]),r>n.value&&(n.value=r,n.entries=i,t&&t())}})},a=ts("layout-shift",s);a&&(t=e7(e,n),ta(()=>{s(a.takeRecords()),t(!0)}))},tl=-1,tu=()=>"hidden"!==e6.document.visibilityState||e6.document.prerendering?1/0:0,tc=()=>{ta(({timeStamp:e})=>{tl=e},!0)},td=()=>(tl<0&&(tl=tu(),tc()),{get firstHiddenTime(){return tl}}),th=e=>{let t;let n=td(),r=ti("FID"),i=e=>{e.startTime<n.firstHiddenTime&&(r.value=e.processingStart-e.startTime,r.entries.push(e),t(!0))},s=e=>{e.forEach(i)},a=ts("first-input",s);t=e7(e,r),a&&ta(()=>{s(a.takeRecords()),a.disconnect()},!0)},tf={},tp=e=>{let t;let n=td(),r=ti("LCP"),i=e=>{let i=e[e.length-1];if(i){let s=Math.max(i.startTime-tr(),0);s<n.firstHiddenTime&&(r.value=s,r.entries=[i],t())}},s=ts("largest-contentful-paint",i);if(s){t=e7(e,r);let a=()=>{tf[r.id]||(i(s.takeRecords()),s.disconnect(),tf[r.id]=!0,t(!0))};["keydown","click"].forEach(e=>{addEventListener(e,a,{once:!0,capture:!0})}),ta(a,!0)}};function t_(e){return"number"==typeof e&&isFinite(e)}function tm(e,{startTimestamp:t,...n}){return t&&e.startTimestamp>t&&(e.startTimestamp=t),e.startChild({startTimestamp:t,...n})}function tg(){return e6&&e6.addEventListener&&e6.performance}let ty=0,tv={};function tb(e,t,n,r,i,s){let a=s?t[s]:t[`${n}End`],o=t[`${n}Start`];o&&a&&tm(e,{op:"browser",description:(0,e9.h)(i,()=>n),startTimestamp:r+(0,eK.XL)(o),endTimestamp:r+(0,eK.XL)(a)})}let tE=["localhost",/^\//],tw={traceFetch:!0,traceXHR:!0,tracingOrigins:tE,tracePropagationTargets:tE},tS={idleTimeout:e8.nT,finalTimeout:e8.mg,heartbeatInterval:e8.hd,markBackgroundTransactions:!0,routingInstrumentation:function(e,t=!0,n=!0){let r;if(!e6||!e6.location){("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&m.kg.warn("Could not initialize routing instrumentation due to invali
14d location");return}let i=e6.location.href;t&&(r=e({name:e6.location.pathname,op:"pageload",metadata:{source:"url"}})),n&&(0,j.o)("history",({to:t,from:n})=>{if(void 0===n&&i&&-1!==i.indexOf(t)){i=void 0;return}n!==t&&(i=void 0,r&&(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&m.kg.log(`[Tracing] Finishing current transaction with op: ${r.op}`),r.finish()),r=e({name:e6.location.pathname,op:"navigation",metadata:{source:"url"}}))})},startTransactionOnLocationChange:!0,startTransactionOnPageLoad:!0,_experiments:{enableLongTask:!0},...tw};class tx{__init(){this.name="BrowserTracing"}constructor(e){tx.prototype.__init.call(this),this.options={...tS,...e},e&&!e.tracePropagationTargets&&e.tracingOrigins&&(this.options.tracePropagationTargets=e.tracingOrigins),function(){let e=tg();e&&M.Z1&&(e.mark&&e6.performance.mark("sentry-tracing-init"),to(e=>{let t=e.entries.pop();t&&(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&m.kg.log("[Measurements] Adding CLS"),tv.cls={value:e.value,unit:""},s=t)}),tp(e=>{let t=e.entries.pop();t&&(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&m.kg.log("[Measurements] Adding LCP"),tv.lcp={value:e.value,unit:"millisecond"},i=t)}),th(e=>{let t=e.entries.pop();if(!t)return;let n=(0,eK.XL)(M.Z1),r=(0,eK.XL)(t.startTime);("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&m.kg.log("[Measurements] Adding FID"),tv.fid={value:e.value,unit:"millisecond"},tv["mark.fid"]={value:n+r,unit:"second"}}))}(),c([this,"access",e=>e.options,"access",e=>e._experiments,"optionalAccess",e=>e.enableLongTask])&&function(){let e=e=>{for(let t of e){let n=(0,eK.x1)();if(!n)return;let r=(0,eK.XL)(M.Z1+t.startTime),i=(0,eK.XL)(t.duration);n.startChild({description:"Main UI thread blocked",op:"ui.long-task",startTimestamp:r,endTimestamp:r+i})}};ts("longtask",e)}()}setupOnce(e,t){this._getCurrentHub=t;let{routingInstrumentation:n,startTransactionOnLocationChange:r,startTransactionOnPageLoad:i,markBackgroundTransactions:s,traceFetch:a,traceXHR:o,tracePropagationTargets:l,shouldCreateSpanForRequest:u}=this.options;n(e=>this._createRouteTransaction(e),i,r),s&&(e6&&e6.document?e6.document.addEventListener("visibilitychange",()=>{let e=(0,eK.x1)();if(e6.document.hidden&&e){let t="cancelled";("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&m.kg.log(`[Tracing] Transaction: ${t} -> since tab moved to the background, op: ${e.op}`),e.status||e.setStatus(t),e.setTag("visibilitychange","document.hidden"),e.finish()}}):("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&m.kg.warn("[Tracing] Could not set up background tab detection due to lack of global document")),function(e){let{traceFetch:t,traceXHR:n,tracePropagationTargets:r,tracingOrigins:i,shouldCreateSpanForRequest:s}={traceFetch:tw.traceFetch,traceXHR:tw.traceXHR,...e},a="function"==typeof s?s:e=>!0,o=e=>(0,y.U0)(e,r||i||tE),l={};t&&(0,j.o)("fetch",e=>{(function(e,t,n,r){if(!(0,eK.zu)()||!(e.fetchData&&t(e.fetchData.url)))return;if(e.endTimestamp){let i=e.fetchData.__span;if(!i)return;let s=r[i];s&&(e.response?s.setHttpStatus(e.response.status):e.error&&s.setStatus("internal_error"),s.finish(),delete r[i]);return}let a=(0,eK.x1)();if(a){let o=a.startChild({data:{...e.fetchData,type:"fetch"},description:`${e.fetchData.method} ${e.fetchData.url}`,op:"http.client"});e.fetchData.__span=o.spanId,r[o.spanId]=o;let l=e.args[0];e.args[1]=e.args[1]||{};let u=e.args[1];n(e.fetchData.url)&&(u.headers=function(e,t,n,r){let i=e4(t),s=n.toTraceparent(),a="undefined"!=typeof Request&&(0,A.V9)(e,Request)?e.headers:r.headers;if(!a)return{"sentry-trace":s,baggage:i};if("undefined"!=typeof Headers&&(0,A.V9)(a,Headers)){let o=new Headers(a);return o.append("sentry-trace",s),i&&o.append(e0,i),o}if(Array.isArray(a)){let l=[...a,["sentry-trace",s]];return i&&l.push([e0,i]),l}{let u="baggage"in a?a.baggage:void 0,c=[];return Array.isArray(u)?c.push(...u):u&&c.push(u),i&&c.push(i),{...a,"sentry-trace":s,baggage:c.length>0?c.join(","):void 0}}}(l,a.getDynamicSamplingContext(),o,u),a.metadata.propagations++)}})(e,a,o,l)}),n&&(0,j.o)("xhr",e=>{(function(e,t,n,r){if(!(0,eK.zu)()||e.xhr&&e.xhr.__sentry_own_request__||!(e.xhr&&e.xhr.__sentry_xhr__&&t(e.xhr.__sentry_xhr__.url)))return;let i=e.xhr.__sentry_xhr__;if(e.endTimestamp){let s=e.xhr.__sentry_xhr_span_id__;if(!s)return;let a=r[s];a&&(a.setHttpStatus(i.status_code),a.finish(),delete r[s]);return}let o=(0,eK.x1)();if(o){let l=o.startChild({data:{...i.data,type:"xhr",method:i.method,url:i.url},description:`${i.method} ${i.url}`,op:"http.client"});if(e.xhr.__sentry_xhr_span_id__=l.spanId,r[e.xhr.__sentry_xhr_span_id__]=l,e.xhr.setRequestHeader&&n(e.xhr.__sentry_xhr__.url))try{e.xhr.setRequestHeader("sentry-trace",l.toTraceparent());let u=o.getDynamicSamplingContext(),c=e4(u);c&&e.xhr.setRequestHeader(e0,c),o.metadata.propagations++}catch(d){}}})(e,a,o,l)})}({traceFetch:a,traceXHR:o,tracePropagationTargets:l,shouldCreateSpanForRequest:u})}_createRouteTransaction(e){if(!this._getCurrentHub){("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&m.kg.warn(`[Tracing] Did not create ${e.op}
14 transaction because _getCurrentHub is invalid.`);return}let{beforeNavigate:t,idleTimeout:n,finalTimeout:r,heartbeatInterval:a}=this.options,o="pageload"===e.op,l=o?tT("sentry-trace"):null,u=o?tT("baggage"):null,c=l?eQ(l):void 0,d=u?e3(u):void 0,h={...e,...c,metadata:{...e.metadata,dynamicSamplingContext:c&&!d?{}:d},trimEnd:!0},f="function"==typeof t?t(h):h,p=void 0===f?{...h,sampled:!1}:f;p.metadata=p.name!==h.name?{...p.metadata,source:"custom"}:p.metadata,!1===p.sampled&&("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&m.kg.log(`[Tracing] Will not send ${p.op} transaction because of beforeNavigate.`),("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&m.kg.log(`[Tracing] Starting ${p.op} transaction on scope`);let _=this._getCurrentHub(),{location:g}=e6,y=(0,eW.lb)(_,p,n,r,!0,{location:g},a);return y.registerBeforeFinishCallback(e=>{!function(e){let t,n;let r=tg();if(!r||!e6.performance.getEntries||!M.Z1)return;("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&m.kg.log("[Tracing] Adding & adjusting spans using Performance API");let a=(0,eK.XL)(M.Z1),o=r.getEntries();if(o.slice(ty).forEach(r=>{let i=(0,eK.XL)(r.startTime),s=(0,eK.XL)(r.duration);if("navigation"!==e.op||!(a+i<e.startTimestamp))switch(r.entryType){case"navigation":["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(t=>{tb(e,r,t,a)}),tb(e,r,"secureConnection",a,"TLS/SSL","connectEnd"),tb(e,r,"fetch",a,"cache","domainLookupStart"),tb(e,r,"domainLookup",a,"DNS"),tm(e,{op:"browser",description:"request",startTimestamp:a+(0,eK.XL)(r.requestStart),endTimestamp:a+(0,eK.XL)(r.responseEnd)}),tm(e,{op:"browser",description:"response",startTimestamp:a+(0,eK.XL)(r.responseStart),endTimestamp:a+(0,eK.XL)(r.responseEnd)}),t=a+(0,eK.XL)(r.responseStart),n=a+(0,eK.XL)(r.requestStart);break;case"mark":case"paint":case"measure":{(function(e,t,n,r,i){let s=i+n;tm(e,{description:t.name,endTimestamp:s+r,op:t.entryType,startTimestamp:s})})(e,r,i,s,a);let o=td(),l=r.startTime<o.firstHiddenTime;"first-paint"===r.name&&l&&(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&m.kg.log("[Measurements] Adding FP"),tv.fp={value:r.startTime,unit:"millisecond"}),"first-contentful-paint"===r.name&&l&&(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&m.kg.log("[Measurements] Adding FCP"),tv.fcp={value:r.startTime,unit:"millisecond"});break}case"resource":{let u=r.name.replace(e6.location.origin,"");(function(e,t,n,r,i,s){if("xmlhttprequest"===t.initiatorType||"fetch"===t.initiatorType)return;let a={};"transferSize"in t&&(a["Transfer Size"]=t.transferSize),"encodedBodySize"in t&&(a["Encoded Body Size"]=t.encodedBodySize),"decodedBodySize"in t&&(a["Decoded Body Size"]=t.decodedBodySize);let o=s+r;tm(e,{description:n,endTimestamp:o+i,op:t.initiatorType?`resource.${t.initiatorType}`:"resource.other",startTimestamp:o,data:a})})(e,r,u,i,s,a)}}}),ty=Math.max(o.length-1,0),function(e){let t=e6.navigator;if(!t)return;let n=t.connection;n&&(n.effectiveType&&e.setTag("effectiveConnectionType",n.effectiveType),n.type&&e.setTag("connectionType",n.type),t_(n.rtt)&&(tv["connection.rtt"]={value:n.rtt,unit:"millisecond"})),t_(t.deviceMemory)&&e.setTag("deviceMemory",`${t.deviceMemory} GB`),t_(t.hardwareConcurrency)&&e.setTag("hardwareConcurrency",String(t.hardwareConcurrency))}(e),"pageload"===e.op){"number"==typeof t&&(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&m.kg.log("[Measurements] Adding TTFB"),tv.ttfb={value:(t-e.startTimestamp)*1e3,unit:"millisecond"},"number"==typeof n&&n<=t&&(tv["ttfb.requestTime"]={value:(t-n)*1e3,unit:"millisecond"})),["fcp","fp","lcp"].forEach(t=>{if(!tv[t]||a>=e.startTimestamp)return;let n=tv[t].value,r=a+(0,eK.XL)(n),i=Math.abs((r-e.startTimestamp)*1e3);("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&m.kg.log(`[Measurements] Normalized ${t} from ${n} to ${i} (${i-n})`),tv[t].value=i});let l=tv["mark.fid"];l&&tv.fid&&(tm(e,{description:"first input delay",endTimestamp:l.value+(0,eK.XL)(tv.fid.value),op:"ui.action",startTimestamp:l.value}),delete tv["mark.fid"]),"fcp"in tv||delete tv.cls,Object.keys(tv).forEach(t=>{e.setMeasurement(t,tv[t].value,tv[t].unit)}),i&&(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&m.kg.log("[Measurements] Adding LCP Data"),i.element&&e.setTag("lcp.element",(0,ei.Rt)(i.element)),i.id&&e.setTag("lcp.id",i.id),i.url&&e.setTag("lcp.url",i.url.trim().slice(0,200)),e.setTag("lcp.size",i.size)),s&&s.sources&&(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&m.kg.log("[Measurements] Adding CLS Data"),s.sources.forEac
14h((t,n)=>e.setTag(`cls.source.${n+1}`,(0,ei.Rt)(t.node))))}i=void 0,s=void 0,tv={}}(e)}),y}}function tT(e){let t=(0,ei.qT)(`meta[name=${e}]`);return t?t.getAttribute("content"):null}("undefined"==typeof __SENTRY_TRACING__||__SENTRY_TRACING__)&&(0,eW.ro)();var tk=n(1163),tR=n.n(tk);let tO={"routing.instrumentation":"next-router"},tj=(0,x.Gd)().getClient();function tN(e,t=!0,n=!0){let{route:r,traceParentData:i,baggage:s,params:a}=function(){let e;let t=et.document.getElementById("__NEXT_DATA__");if(t&&t.innerHTML)try{e=JSON.parse(t.innerHTML)}catch(n){("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&m.kg.warn("Could not extract __NEXT_DATA__")}if(!e)return{};let r={},{page:i,query:s,props:a}=e;return r.route=i,r.params=s,a&&a.pageProps&&(a.pageProps._sentryBaggage&&(r.baggage=a.pageProps._sentryBaggage),a.pageProps._sentryTraceData&&(r.traceParentData=eQ(a.pageProps._sentryTraceData))),r}();if(l=r||et.location.pathname,t){let u=e3(s);o=e({name:l,op:"pageload",tags:tO,...a&&tj&&tj.getOptions().sendDefaultPii&&{data:a},...i,metadata:{source:r?"route":"url",dynamicSamplingContext:i&&!u?{}:u}})}n&&tR().events.on("routeChangeStart",t=>{let n,r;let i=function(e){let t=(et.__BUILD_MANIFEST||{}).sortedPages;if(t)return t.find(t=>{let n=function(e){let t=e.split("/"),n="";t[t.length-1].match(/^\[\[\.\.\..+\]\]$/)&&(t.pop(),n="(?:/(.+?))?");let r=t.map(e=>e.replace(/^\[\.\.\..+\]$/,"(.+?)").replace(/^\[.*\]$/,"([^/]+?)")).join("/");return RegExp(`^${r}${n}(?:/)?$`)}(t);return e.match(n)})}(t.split(/[\?#]/,1)[0]);i?(n=i,r="route"):(n=t,r="url");let s={...tO,from:l};l=n,o&&o.finish();let a=e({name:n,op:"navigation",tags:s,metadata:{source:r}});if(a){let u=a.startChild({op:"ui.nextjs.route-change",description:"Next.js Route Change"}),c=()=>{u.finish(),tR().events.off("routeChangeComplete",c)};tR().events.on("routeChangeComplete",c)}})}function tD(e,t,n={}){return Array.isArray(t)?tC(e,t,n):function(e,t,n){let r=r=>{let i=t(r);if(e.allowExclusionByUser){let s=i.find(t=>t.name===e.name);if(!s)return i}return tC(e,i,n)};return r}(e,t,n)}function tC(e,t,n){let r=t.find(t=>t.name===e.name);if(r){for(let[i,s]of Object.entries(n))!function e(t,n,r){let i=n.match(/([a-z_]+)\.(.*)/i);if(null===i)t[n]=r;else{let s=t[i[1]];e(s,i[2],r)}}(r,i,s);return t}return[...t,e]}var tP=n(3454);window.__rewriteFramesAssetPrefixPath__="";let tA=u.n2;tA.SENTRY_RELEASE={id:"dee9038c837fb3edf244392ebc8f9557dca207ad"},tA.SENTRY_RELEASES=tA.SENTRY_RELEASES||{},tA.SENTRY_RELEASES["magicevents@impronta-advance-srl"]={id:"dee9038c837fb3edf244392ebc8f9557dca207ad"};let tI=tP.env.SENTRY_DSN||"https://[email protected]/6216254";!function(e){var t,r;if("string"==typeof EdgeRuntime){("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&m.kg.log("Vercel Edge Runtime detected. Will not initialize SDK.");return}(t=e)._metadata=t._metadata||{},t._metadata.sdk=t._metadata.sdk||{name:"sentry.javascript.nextjs",packages:["nextjs","react"].map(e=>({name:`npm:@sentry/${e}`,version:_})),version:_},e.environment=e.environment||"production",function(e){let t=e.integrations||[],r=n.g.__rewriteFramesAssetPrefixPath__||"",i=new p({iteratee(e){try{let{origin:t}=new URL(e.filename);e.filename=c([e,"access",e=>e.filename,"optionalAccess",e=>e.replace,"call",e=>e(t,"app://"),"access",e=>e.replace,"call",e=>e(r,"")])}catch(n){}return e}});if(t=tD(i,t),("undefined"==typeof __SENTRY_TRACING__||__SENTRY_TRACING__)&&(0,eK.zu)(e)){let s=new tx({tracingOrigins:[...tw.tracingOrigins,/^(api\/)/],routingInstrumentation:tN});t=tD(s,t,{"options.routingInstrumentation":tN})}e.integrations=t}(e),(r=e)._metadata=r._metadata||{},r._metadata.sdk=r._metadata.sdk||{name:"sentry.javascript.react",packages:[{name:"npm:@sentry/react",version:_}],version:_},function(e={}){void 0===e.defaultIntegrations&&(e.defaultIntegrations=eV),void 0===e.release&&("string"==typeof __SENTRY_RELEASE__&&(e.release=__SENTRY_RELEASE__),et.SENTRY_RELEASE&&et.SENTRY_RELEASE.id&&(e.release=et.SENTRY_RELEASE.id)),void 0===e.autoSessionTracking&&(e.autoSessionTracking=!0),void 0===e.sendClientReports&&(e.sendClientReports=!0);let t={...e,stackParser:(0,R.Sq)(e.stackParser||eS),integrations:function(e){let t;let n=e.defaultIntegrations||[],r=e.integrations;
14n.forEach(e=>{e.isDefaultInstance=!0}),t=Array.isArray(r)?[...n,...r]:"function"==typeof r?(0,g.lE)(r(n)):n;let i=function(e){let t={};return e.forEach(e=>{let{name:n}=e,r=t[n];r&&!r.isDefaultInstance&&e.isDefaultInstance||(t[n]=e)}),Object.values(t)}(t),s=i.findIndex(e=>"Debug"===e.name);if(-1!==s){let[a]=i.splice(s,1);i.push(a)}return i}(e),transport:e.transport||((0,O.Ak)()?eH:eq)};(function(e,t){!0===t.debug&&("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__?m.kg.enable():console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle."));let n=(0,x.Gd)(),r=n.getScope();r&&r.update(t.initialScope);let i=new e(t);n.bindClient(i)})(ef,t),e.autoSessionTracking&&function(){if(void 0===et.document){("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&m.kg.warn("Session tracking in non-browser environment with @sentry/browser is not supported.");return}let e=(0,x.Gd)();e.captureSession&&(eJ(e),(0,j.o)("history",({from:e,to:t})=>{void 0===e||e===t||eJ((0,x.Gd)())}))}()}(r),(0,ee.e)(e=>{e.setTag("runtime","browser");let t=e=>"transaction"===e.type&&"/404"===e.transaction?null:e;t.id="NextClient404Filter",e.addEventProcessor(t)})}({dsn:tI,tracesSampleRate:1})},227:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDomainLocale=function(e,t,n,r){return!1},("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},9749:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(6495).Z,i=n(2648).Z,s=n(1598).Z,a=n(7273).Z,o=s(n(7294)),l=i(n(3121)),u=n(2675),c=n(139),d=n(8730);n(7238);var h=i(n(9824));let f={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[16,32,48,64,96,128,256,384],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!1};function p(e){return void 0!==e.default}function _(e){return"number"==typeof e||void 0===e?e:"string"==typeof e&&/^[0-9]+$/.test(e)?parseInt(e,10):NaN}function m(e,t,n,i,s){if(!e||e["data-loaded-src"]===t)return;e["data-loaded-src"]=t;let a="decode"in e?e.decode():Promise.resolve();a.catch(()=>{}).then(()=>{if(e.parentNode){if(null==n?void 0:n.current){let t=new Event("load");Object.defineProperty(t,"target",{writable:!1,value:e});let s=!1,a=!1;n.current(r({},t,{nativeEvent:t,currentTarget:e,target:e,isDefaultPrevented:()=>s,isPropagationStopped:()=>a,persist(){},preventDefault(){s=!0,t.preventDefault()},stopPropagation(){a=!0,t.stopPropagation()}}))}(null==i?void 0:i.current)&&i.current(e)}})}let g=o.forwardRef((e,t)=>{var{imgAttributes:n,heightInt:i,widthInt:s,qualityInt:l,className:u,imgStyle:c,blurStyle:d,isLazy:h,fill:f,placeholder:p,loading:_,srcString:g,config:y,unoptimized:v,loader:b,onLoadRef:E,onLoadingCompleteRef:w,onLoad:S,onError:x}=e,T=a(e,["imgAttributes","heightInt","widthInt","qualityInt","className","imgStyle","blurStyle","isLazy","fill","placeholder","loading","srcString","config","unoptimized","loader","onLoadRef","onLoadingCompleteRef","onLoad","onError"]);return _=h?"lazy":_,o.default.createElement(o.default.Fragment,null,o.default.createElement("img",Object.assign({},T,n,{width:s,height:i,decoding:"async","data-nimg":f?"fill":"1",className:u,loading:_,style:r({},c,d),ref:o.useCallback(e=>{t&&("function"==typeof t?t(e):"object"==typeof t&&(t.current=e)),e&&(x&&(e.src=e.src),e.complete&&m(e,g,E,w,v))},[g,E,w,x,v,t]),onLoad(e){let t=e.currentTarget;m(t,g,E,w,v)},onError(e){let{style:t}=e.currentTarget;"transparent"===t.color&&(t.color=""),"blur"===p&&t.backgroundImage&&(t.backgroundSize="",t.backgroundPosition="",t.backgroundRepeat="",t.backgroundImage=""),x&&x(e)}})))}),y=o.forwardRef((e,t)=>{let n,i;var s,{src:m,sizes:y,unoptimized:v=!1,priority:b=!1,loading:E,className:w,quality:S,width:x,height:T,fill:k,style:R,onLoad:O,onLoadingComplete:j,placeholder:N="empty",blurDataURL:D,layout:C,objectFit:P,objectPosition:A,lazyBoundary:I,lazyRoot:$}=e,U=a(e,["src","sizes","unoptimized","priority","loading","className","quality","width","height","fill","style","onLoad","onLoadingComplete","placeholder","blurDataURL","layout","objectFit","objectPosition","lazyBoundary","lazyRoot"]);let B=o.useContext(d.ImageConfigContext),L=o.useMemo(()=>{let e=f||B||c.imageConfigDefault,t=[...e.deviceSizes,...e.imageSizes].sort((e,t)=>
14e-t),n=e.deviceSizes.sort((e,t)=>e-t);return r({},e,{allSizes:t,deviceSizes:n})},[B]),G=U,z=G.loader||h.default;if(delete G.loader,"__next_img_default"in z){if("custom"===L.loader)throw Error('Image with src "'.concat(m,'" is missing "loader" prop.')+"\nRead more: https://nextjs.org/docs/messages/next-image-missing-loader")}else{let M=z;z=e=>{let{config:t}=e,n=a(e,["config"]);return M(n)}}if(C){"fill"===C&&(k=!0);let Y={intrinsic:{maxWidth:"100%",height:"auto"},responsive:{width:"100%",height:"auto"}}[C];Y&&(R=r({},R,Y));let Z={responsive:"100vw",fill:"100vw"}[C];Z&&!y&&(y=Z)}let F="",H=_(x),q=_(T);if("object"==typeof(s=m)&&(p(s)||void 0!==s.src)){let V=p(m)?m.default:m;if(!V.src)throw Error("An object should only be passed to the image component src parameter if it comes from a static image import. It must include src. Received ".concat(JSON.stringify(V)));if(!V.height||!V.width)throw Error("An object should only be passed to the image component src parameter if it comes from a static image import. It must include height and width. Received ".concat(JSON.stringify(V)));if(n=V.blurWidth,i=V.blurHeight,D=D||V.blurDataURL,F=V.src,!k){if(H||q){if(H&&!q){let J=H/V.width;q=Math.round(V.height*J)}else if(!H&&q){let W=q/V.height;H=Math.round(V.width*W)}}else H=V.width,q=V.height}}let K=!b&&("lazy"===E||void 0===E);((m="string"==typeof m?m:F).startsWith("data:")||m.startsWith("blob:"))&&(v=!0,K=!1),L.unoptimized&&(v=!0);let X=_(S),Q=Object.assign(k?{position:"absolute",height:"100%",width:"100%",left:0,top:0,right:0,bottom:0,objectFit:P,objectPosition:A}:{},{color:"transparent"},R),ee="blur"===N&&D?{backgroundSize:Q.objectFit||"cover",backgroundPosition:Q.objectPosition||"50% 50%",backgroundRepeat:"no-repeat",backgroundImage:'url("data:image/svg+xml;charset=utf-8,'.concat(u.getImageBlurSvg({widthInt:H,heightInt:q,blurWidth:n,blurHeight:i,blurDataURL:D}),'")')}:{},et=function(e){let{config:t,src:n,unoptimized:r,width:i,quality:s,sizes:a,loader:o}=e;if(r)return{src:n,srcSet:void 0,sizes:void 0};let{widths:l,kind:u}=function(e,t,n){let{deviceSizes:r,allSizes:i}=e;if(n){let s=/(^|\s)(1?\d?\d)vw/g,a=[];for(let o;o=s.exec(n);o)a.push(parseInt(o[2]));if(a.length){let l=.01*Math.min(...a);return{widths:i.filter(e=>e>=r[0]*l),kind:"w"}}return{widths:i,kind:"w"}}if("number"!=typeof t)return{widths:r,kind:"w"};let u=[...new Set([t,2*t].map(e=>i.find(t=>t>=e)||i[i.length-1]))];return{widths:u,kind:"x"}}(t,i,a),c=l.length-1;return{sizes:a||"w"!==u?a:"100vw",srcSet:l.map((e,r)=>"".concat(o({config:t,src:n,quality:s,width:e})," ").concat("w"===u?e:r+1).concat(u)).join(", "),src:o({config:t,src:n,quality:s,width:l[c]})}}({config:L,src:m,unoptimized:v,width:H,quality:X,sizes:y,loader:z}),en=m,er={imageSrcSet:et.srcSet,imageSizes:et.sizes,crossOrigin:G.crossOrigin},ei=o.useRef(O);o.useEffect(()=>{ei.current=O},[O]);let es=o.useRef(j);o.useEffect(()=>{es.current=j},[j]);let ea=r({isLazy:K,imgAttributes:et,heightInt:q,widthInt:H,qualityInt:X,className:w,imgStyle:Q,blurStyle:ee,loading:E,config:L,fill:k,unoptimized:v,placeholder:N,loader:z,srcString:en,onLoadRef:ei,onLoadingCompleteRef:es},G);return o.default.createElement(o.default.Fragment,null,o.default.createElement(g,Object.assign({},ea,{ref:t})),b?o.default.createElement(l.default,null,o.default.createElement("link",Object.assign({key:"__nimg-"+et.src+et.srcSet+et.sizes,rel:"preload",as:"image",href:et.srcSet?void 0:et.src},er))):null)});t.default=y,("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},1551:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(2648).Z,i=n(7273).Z,s=r(n(7294)),a=n(1003),o=n(7795),l=n(4465),u=n(2692),c=n(8245),d=n(9246),h=n(227),f=n(3468);let p=new Set;function _(e,t,n,r){if(a.isLocalURL(t)){if(!r.bypassPrefetchedCheck){let i=void 0!==r.locale?r.locale:"locale"in e?e.locale:void 0,s=t+"%"+n+"%"+i;if(p.has(s))return;p.add(s)}Promise.resolve(e.prefetch(t,n,r)).catch(e=>{})}}function m(e){return"string"==typeof e?e:o.formatUrl(e)}let g=s.default.forwardRef(function(e,t){let n,r;let{href:o,as:p,children:g,prefetch:y,passHref:v,replace:b,shallow:E,scroll:w,locale:S,onClick:x,onMouseEnter:T,onTouchStart:k,legacyBehavior:R=!1}=e,O=i(e,["href","as","children","prefetch","passHref","replace","shallow","scroll","locale","onClick","onMouseEnter","onTouchStart","legacyBehavior"]);n=g,R&&("string"==typeof n||"number"==typeof n)&&(n=s.default.createElement("a",null,n));let j=!1!==y,N=s.default.useContext(u.RouterContext),D=s.default.useContext(c.AppRouterContext),C=null!=N?N:D,P=!N,{href:A,as:I}=s.default.useMemo(()=>
14{if(!N){let e=m(o);return{href:e,as:p?m(p):e}}let[t,n]=a.resolveHref(N,o,!0);return{href:t,as:p?a.resolveHref(N,p):n||t}},[N,o,p]),$=s.default.useRef(A),U=s.default.useRef(I);R&&(r=s.default.Children.only(n));let B=R?r&&"object"==typeof r&&r.ref:t,[L,G,z]=d.useIntersection({rootMargin:"200px"}),M=s.default.useCallback(e=>{(U.current!==I||$.current!==A)&&(z(),U.current=I,$.current=A),L(e),B&&("function"==typeof B?B(e):"object"==typeof B&&(B.current=e))},[I,B,A,z,L]);s.default.useEffect(()=>{C&&G&&j&&_(C,A,I,{locale:S})},[I,A,G,S,j,null==N?void 0:N.locale,C]);let Y={ref:M,onClick(e){R||"function"!=typeof x||x(e),R&&r.props&&"function"==typeof r.props.onClick&&r.props.onClick(e),C&&!e.defaultPrevented&&function(e,t,n,r,i,o,l,u,c,d){let{nodeName:h}=e.currentTarget,f="A"===h.toUpperCase();if(f&&(function(e){let{target:t}=e.currentTarget;return t&&"_self"!==t||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.nativeEvent&&2===e.nativeEvent.which}(e)||!a.isLocalURL(n)))return;e.preventDefault();let p=()=>{"beforePopState"in t?t[i?"replace":"push"](n,r,{shallow:o,locale:u,scroll:l}):t[i?"replace":"push"](r||n,{forceOptimisticNavigation:!d})};c?s.default.startTransition(p):p()}(e,C,A,I,b,E,w,S,P,j)},onMouseEnter(e){R||"function"!=typeof T||T(e),R&&r.props&&"function"==typeof r.props.onMouseEnter&&r.props.onMouseEnter(e),C&&(j||!P)&&_(C,A,I,{locale:S,priority:!0,bypassPrefetchedCheck:!0})},onTouchStart(e){R||"function"!=typeof k||k(e),R&&r.props&&"function"==typeof r.props.onTouchStart&&r.props.onTouchStart(e),C&&(j||!P)&&_(C,A,I,{locale:S,priority:!0,bypassPrefetchedCheck:!0})}};if(!R||v||"a"===r.type&&!("href"in r.props)){let Z=void 0!==S?S:null==N?void 0:N.locale,F=(null==N?void 0:N.isLocaleDomain)&&h.getDomainLocale(I,Z,null==N?void 0:N.locales,null==N?void 0:N.domainLocales);Y.href=F||f.addBasePath(l.addLocale(I,Z,null==N?void 0:N.defaultLocale))}return R?s.default.cloneElement(r,Y):s.default.createElement("a",Object.assign({},O,Y),n)});t.default=g,("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},9246:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useIntersection=function(e){let{rootRef:t,rootMargin:n,disabled:l}=e,u=l||!s,[c,d]=r.useState(!1),[h,f]=r.useState(null);r.useEffect(()=>{if(s){if(!u&&!c&&h&&h.tagName){let e=function(e,t,n){let{id:r,observer:i,elements:s}=function(e){let t;let n={root:e.root||null,margin:e.rootMargin||""},r=o.find(e=>e.root===n.root&&e.margin===n.margin);if(r&&(t=a.get(r)))return t;let i=new Map,s=new IntersectionObserver(e=>{e.forEach(e=>{let t=i.get(e.target),n=e.isIntersecting||e.intersectionRatio>0;t&&n&&t(n)})},e);return t={id:n,observer:s,elements:i},o.push(n),a.set(n,t),t}(n);return s.set(e,t),i.observe(e),function(){if(s.delete(e),i.unobserve(e),0===s.size){i.disconnect(),a.delete(r);let t=o.findIndex(e=>e.root===r.root&&e.margin===r.margin);t>-1&&o.splice(t,1)}}}(h,e=>e&&d(e),{root:null==t?void 0:t.current,rootMargin:n});return e}}else if(!c){let r=i.requestIdleCallback(()=>d(!0));return()=>i.cancelIdleCallback(r)}},[h,u,n,t,c]);let p=r.useCallback(()=>{d(!1)},[]);return[f,c,p]};var r=n(7294),i=n(4686);let s="function"==typeof IntersectionObserver,a=new Map,o=[];("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},2675:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getImageBlurSvg=function(e){let{widthInt:t,heightInt:n,blurWidth:r,blurHeight:i,blurDataURL:s}=e,a=r||t,o=i||n,l=s.startsWith("data:image/jpeg")?"%3CfeComponentTransfer%3E%3CfeFuncA type='discrete' tableValues='1 1'/%3E%3C/feComponentTransfer%3E%":"";return a&&o?"%3Csvg xmlns='http%3A//www.w3.org/2000/svg' viewBox='0 0 ".concat(a," ").concat(o,"'%3E%3Cfilter id='b' color-interpolation-filters='sRGB'%3E%3CfeGaussianBlur stdDeviation='").concat(r&&i?"1":"20","'/%3E").concat(l,"%3C/filter%3E%3Cimage preserveAspectRatio='none' filter='url(%23b)' x='0' y='0' height='100%25' width='100%25' href='").concat(s,"'/%3E%3C/svg%3E"):"%3Csvg xmlns='http%3A//www.w3.org/2000/svg'%3E%3Cimage style='filter:blur(20px)' x='0' y='0' height='100%25' width='100%25' href='".concat(s,"'/%3E%3C/svg%3E")}},9824:function(e,t){"use strict";
14function n(e){let{config:t,src:n,width:r,quality:i}=e;return n.endsWith(".svg")&&!t.dangerouslyAllowSVG?n:"".concat(t.path,"?url=").concat(encodeURIComponent(n),"&w=").concat(r,"&q=").concat(i||75)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n.__next_img_default=!0,t.default=n},10:function(e,t,n){"use strict";t.Z=["modern","legacy","standard","pioneer","vintage","commander","centurion","pauper","draft","sealed"]},5856:function(e,t,n){"use strict";n.d(t,{Aj:function(){return d},aF:function(){return c},dr:function(){return u}});var r=n(5893),i=n(7294),s=n(2660),a=n(8189),o=n(6756);let l=(0,i.createContext)({user:null,loading:!1,logout:()=>Promise.reject("Not implemented")}),u=e=>{let{children:t}=e,[n,s]=(0,i.useState)(),[u,c]=(0,i.useState)(!0),[d,h]=(0,i.useState)(null);(0,i.useCallback)(async(e,t)=>{let{data:n,error:r}=await a.Z.auth.signInWithPassword({email:e,password:t})},[]),(0,i.useCallback)(async(e,t)=>{let{data:n,error:r}=await a.Z.auth.signUp({email:e,password:t})},[]);let f=(0,i.useCallback)(async()=>{await a.Z.auth.signOut()},[]);return(0,i.useEffect)(()=>{a.Z.auth.getSession().then(async e=>{let{data:{session:t},error:n}=e;if(n)throw n;if(t)try{let r=await (0,o.aM)(t.user.id);h(r)}catch(i){console.error(i)}c(!1)});let{data:{subscription:e}}=a.Z.auth.onAuthStateChange(async(e,t)=>{if(console.log(e,t),"SIGNED_IN"===e||"TOKEN_REFRESHED"===e||"USER_UPDATED"===e)try{let n=await (0,o.aM)(t.user.id);h(n)}catch(r){console.error(r)}("SIGNED_OUT"===e||"USER_DELETED"===e)&&h(null)});return()=>e.unsubscribe()},[]),(0,r.jsx)(l.Provider,{value:{user:d,loading:u,logout:f},children:t})},c=()=>(0,i.useContext)(l),d=()=>{let{user:e,...t}=c();if(!(0,s.G)(e))throw Error("Admin required!");return{user:e,...t}}},733:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return eh}});var r,i,s,a,o,l,u,c=n(5893),d=n(1163),h=n(9008),f=n.n(h),p=n(4298),_=n.n(p);function m(){return(0,c.jsx)("footer",{className:"bg-blue-dark mt-8 px-4 py-6",children:(0,c.jsxs)("div",{className:"container text-white h-full mx-auto",children:[(0,c.jsxs)("p",{className:"text-md text-center my-4",children:["Developed with â¤ï¸ by @takeno, mainly on"," ",(0,c.jsx)("a",{className:"text-primary underline",href:"https://www.twitch.tv/takenodev",target:"_blank",rel:"noreferrer",children:"Twitch"})," ","-"," ",(0,c.jsx)("a",{className:"text-primary underline",href:"https://github.com/Takeno/magic-events-gg/",target:"_blank",rel:"noreferrer",children:"Github Repo"})]}),(0,c.jsx)("p",{className:"text-[12px] text-center",children:"Wizards of the Coast, Magic: The Gathering, and their logos are trademarks of Wizards of the Coast LLC. All rights reserved. Magic-events.gg is not affiliated with Wizards of the Coast LLC."})]})})}var g=n(5675),y=n.n(g),v=n(1664),b=n.n(v),E=n(7294);function w(e,t,...n){if(e in t){let r=t[e];return"function"==typeof r?r(...n):r}let i=Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(e=>`"${e}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(i,w),i}var S=((r=S||{})[r.None=0]="None",r[r.RenderStrategy=1]="RenderStrategy",r[r.Static=2]="Static",r),x=((i=x||{})[i.Unmount=0]="Unmount",i[i.Hidden=1]="Hidden",i);function T({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:i,visible:s=!0,name:a}){let o=R(t,e);if(s)return k(o,n,r,a);let l=null!=i?i:0;if(2&l){let{static:u=!1,...c}=o;if(u)return k(c,n,r,a)}if(1&l){let{unmount:d=!0,...h}=o;return w(d?0:1,{0:()=>null,1:()=>k({...h,hidden:!0,style:{display:"none"}},n,r,a)})}return k(o,n,r,a)}function k(e,t={},n,r){let{as:i=n,children:s,refName:a="ref",...o}=N(e,["unmount","static"]),l=void 0!==e.ref?{[a]:e.ref}:{},u="function"==typeof s?s(t):s;o.className&&"function"==typeof o.className&&(o.className=o.className(t));let c={};if(t){let d=!1,h=[];for(let[f,p]of Object.entries(t))"boolean"==typeof p&&(d=!0),!0===p&&h.push(f);d&&(c["data-headlessui-state"]=h.join(" "))}if(i===E.Fragment&&Object.keys(j(o)).length>0){if(!(0,E.isValidElement)(u)||Array.isArray(u)&&u.length>1)throw Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(o).map(e=>` - ${e}`).join(` 15`),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(e=>` - ${e}`).join(` 16`)].join(` 17`));return(0,E.cloneElement)(u,Object.assign({},R(u.props,j(N(o,["ref"]))),c,l,function(...e){return{ref:e.every(e=>null==e)?void 0:t=>{for(let n of e)null!=n&&("function"==typeof n?n(t):n.current=t)}}}(u.ref,l.ref)))}return(0,E.createElement)(i,Object.assign({},N(o,["ref"]),i!==E.Fragment&&l,i!==E.Fragment&&c),u)}function R(...e){if(0===e.length)return{};if(1===e.length)return e[0];let t={},n={};for(let r of e)for(let i in r)i.startsWith("on")&&"function"==typeof r[i]?(null!=n[i]||(n[i]=[]),n[i].push(r[i])):t[i]=r[i];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(n).map(e=>[e,void 0])));for(let s in n)Object.assign(t,{[s](e,...t){for(let r of n[s]){if((e instanceof Event||(null==e?void 0:e.nativeEvent)instanceof Event)&&e.defaultPrevented)return;r(e,...t)}}});return t}function O(e){var t;return Object.assign((0,E.forwardRef)(e),{displayName:null!=(t=e.displayName)?t:e.name})}function j(e){let t=Object.assign({},e);for(let n in t)void 0===t[n]&&delete t[n];return t}function N(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}let D="undefined"==typeof window||"undefined"==typeof document,C=D?E.useEffect:E.useLayoutEffect,P=function(e){let t;let n=(t=(0,E.useRef)(e),C(()=>{t.current=e},[e]),t);return E.useCallback((...e)=>n.current(...e),[n])},A=Symbol();function I(...e){let t=(0,E.useRef)(e);(0,E.useEffect)(()=>{t.current=e},[e]);let n=P(e=>{for(let n of t.current)null!=n&&("function"==typeof n?n(e):n.current=e)});return e.every(e=>null==e||(null==e?void 0:e[A]))?void 0:n}let $={serverHandoffComplete:!1},U=0;function B(){return++U}let L=null!=(u=E.useId)?u:function(){let e=function(){let[e,t]=(0,E.useState)($.serverHandoffComplete);return(0,E.useEffect)(()=>{!0!==e&&t(!0)},[e]),(0,E.useEffect)(()=>{!1===$.serverHandoffComplete&&($.serverHandoffComplete=!0)},[]),e}(),[t,n]=E.useState(e?B:null);return C(()=>{null===t&&n(B())},[t]),null!=t?""+t:void 0};var G=((s=G||{}).Space=" ",s.Enter="Enter",s.Escape="Escape",s.Backspace="Backspace",s.Delete="Delete",s.ArrowLeft="ArrowLeft",s.ArrowUp="ArrowUp",s.ArrowRight="ArrowRight",s.ArrowDown="ArrowDown",s.Home="Home",s.End="End",s.PageUp="PageUp",s.PageDown="PageDown",s.Tab="Tab",s);let z=(0,E.createContext)(null);z.displayName="OpenClosedContext";var M=((a=M||{})[a.Open=0]="Open",a[a.Closed=1]="Closed",a);function Y({value:e,children:t}){return E.createElement(z.Provider,{value:e},t)}function Z(e){var t;if(e.type)return e.type;let n=null!=(t=e.as)?t:"button";if("string"==typeof n&&"button"===n.toLowerCase())return"button"}var F=((o=F||{})[o.Open=0]="Open",o[o.Closed=1]="Closed",o),H=((l=H||{})[l.ToggleDisclosure=0]="ToggleDisclosure",l[l.CloseDisclosure=1]="CloseDisclosure",l[l.SetButtonId=2]="SetButtonId",l[l.SetPanelId=3]="SetPanelId",l[l.LinkPanel=4]="LinkPanel",l[l.UnlinkPanel=5]="UnlinkPanel",l);let q={0:e=>({...e,disclosureState:w(e.disclosureState,{0:1,1:0})}),1:e=>1===e.disclosureState?e:{...e,disclosureState:1},4:e=>!0===e.linkedPanel?e:{...e,linkedPanel:!0},5:e=>!1===e.linkedPanel?e:{...e,linkedPanel:!1},2:(e,t)=>e.buttonId===t.buttonId?e:{...e,buttonId:t.buttonId},3:(e,t)=>
17e.panelId===t.panelId?e:{...e,panelId:t.panelId}},V=(0,E.createContext)(null);function J(e){let t=(0,E.useContext)(V);if(null===t){let n=Error(`<${e} /> is missing a parent <Disclosure /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,J),n}return t}V.displayName="DisclosureContext";let W=(0,E.createContext)(null);W.displayName="DisclosureAPIContext";let K=(0,E.createContext)(null);function X(e,t){return w(t.type,q,e,t)}K.displayName="DisclosurePanelContext";let Q=E.Fragment,ee=O(function(e,t){let{defaultOpen:n=!1,...r}=e,i=(0,E.useRef)(null),s=I(t,function(e,t=!0){return Object.assign(e,{[A]:t})}(e=>{i.current=e},void 0===e.as||e.as===E.Fragment)),a=(0,E.useRef)(null),o=(0,E.useRef)(null),l=(0,E.useReducer)(X,{disclosureState:n?0:1,linkedPanel:!1,buttonRef:o,panelRef:a,buttonId:null,panelId:null}),[{disclosureState:u,buttonId:c},d]=l,h=P(e=>{d({type:1});let t=D?null:i instanceof Node?i.ownerDocument:null!=i&&i.hasOwnProperty("current")&&i.current instanceof Node?i.current.ownerDocument:document;if(!t||!c)return;let n=e?e instanceof HTMLElement?e:e.current instanceof HTMLElement?e.current:t.getElementById(c):t.getElementById(c);null==n||n.focus()}),f=(0,E.useMemo)(()=>({close:h}),[h]),p=(0,E.useMemo)(()=>({open:0===u,close:h}),[u,h]);return E.createElement(V.Provider,{value:l},E.createElement(W.Provider,{value:f},E.createElement(Y,{value:w(u,{0:M.Open,1:M.Closed})},T({ourProps:{ref:s},theirProps:r,slot:p,defaultTag:Q,name:"Disclosure"}))))}),et=O(function(e,t){let n=L(),{id:r=`headlessui-disclosure-button-${n}`,...i}=e,[s,a]=J("Disclosure.Button"),o=(0,E.useContext)(K),l=null!==o&&o===s.panelId,u=(0,E.useRef)(null),c=I(u,t,l?null:s.buttonRef);(0,E.useEffect)(()=>{if(!l)return a({type:2,buttonId:r}),()=>{a({type:2,buttonId:null})}},[r,a,l]);let d=P(e=>{var t;if(l){if(1===s.disclosureState)return;switch(e.key){case G.Space:case G.Enter:e.preventDefault(),e.stopPropagation(),a({type:0}),null==(t=s.buttonRef.current)||t.focus()}}else switch(e.key){case G.Space:case G.Enter:e.preventDefault(),e.stopPropagation(),a({type:0})}}),h=P(e=>{e.key===G.Space&&e.preventDefault()}),f=P(t=>{var n;(function(e){let t=e.parentElement,n=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(n=t),t=t.parentElement;let r=(null==t?void 0:t.getAttribute("disabled"))==="";return!(r&&function(e){if(!e)return!1;let t=e.previousElementSibling;for(;null!==t;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}(n))&&r})(t.currentTarget)||e.disabled||(l?(a({type:0}),null==(n=s.buttonRef.current)||n.focus()):a({type:0}))}),p=(0,E.useMemo)(()=>({open:0===s.disclosureState}),[s]),_=function(e,t){let[n,r]=(0,E.useState)(()=>Z(e));return C(()=>{r(Z(e))},[e.type,e.as]),C(()=>{n||!t.current||t.current instanceof HTMLButtonElement&&!t.current.hasAttribute("type")&&r("button")},[n,t]),n}(e,u);return T({ourProps:l?{ref:c,type:_,onKeyDown:d,onClick:f}:{ref:c,id:r,type:_,"aria-expanded":e.disabled?void 0:0===s.disclosureState,"aria-controls":s.linkedPanel?s.panelId:void 0,onKeyDown:d,onKeyUp:h,onClick:f},theirProps:i,slot:p,defaultTag:"button",name:"Disclosure.Button"})}),en=S.RenderStrategy|S.Static,er=Object.assign(ee,{Button:et,Panel:O(function(e,t){let n=L(),{id:r=`headlessui-disclosure-panel-${n}`,...i}=e,[s,a]=J("Disclosure.Panel"),{close:o}=function e(t){let n=(0,E.useContext)(W);if(null===n){let r=Error(`<${t} /> is missing a parent <Disclosure /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,e),r}return n}("Disclosure.Panel"),l=I(t,s.panelRef,e=>{a({type:e?4:5})});(0,E.useEffect)(()=>(a({type:3,panelId:r}),()=>{a({type:3,panelId:null})}),[r,a]);let u=(0,E.useContext)(z),c=null!==u?u===M.Open:0===s.disclosureState,d=(0,E.useMemo)(()=>({open:0===s.disclosureState,close:o}),[s,o]);return E.createElement(K.Provider,{value:s.panelId},T({ourProps:{ref:l,id:r},theirProps:i,slot:d,defaultTag:"div",features:en,visible:c,name:"Disclosure.Panel"}))})});var ei={src:"/_next/static/media/king.b9f6484d.png",height:234,width:172,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAICAMAAADtGH4KAAAATlBMVEVMaXFoZHNoSDIsMExgSz1cUVGYazpyUzqHWS9tVUJ5cHWfbz6VZzRcST//qB5mRjKRWid2bnT/sAA0MUAyN1dER1teST9RPjuLZTkqMEyJWDDqAAAAE3RSTlMA/qj7zPr8glef/Pxr9RPVO/oNPAHG5wAAAAlwS
17FlzAAALEwAACxMBAJqcGAAAADdJREFUCJkFwQcCgCAMALFjtrhQytD/f9SEJimVC51vngd+5X1Faneun/jxbCNy2xdMQc0EQAr8P6oCDjg1cg0AAAAASUVORK5CYII=",blurWidth:6,blurHeight:8},es=n(5856),ea=n(2660);function eo(){let{user:e,logout:t}=(0,es.aF)();return(0,c.jsx)(er,{as:"nav",className:"bg-blue-dark sticky top-0 z-10",children(n){let{open:r,close:i}=n;return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("div",{className:"container mx-auto",children:(0,c.jsxs)("div",{className:"relative flex items-center justify-between h-20",children:[(0,c.jsx)("div",{className:"absolute inset-y-0 left-0 flex items-center lg:hidden px-2",children:(0,c.jsxs)(er.Button,{className:"inline-flex items-center justify-center p-2 rounded-md text-gray-400 hover:text-white hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-white",children:[(0,c.jsx)("span",{className:"sr-only",children:"Open main menu"}),r?(0,c.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"block h-6 w-6","aria-hidden":"true",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}):(0,c.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"block h-6 w-6","aria-hidden":"true",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})]})}),(0,c.jsxs)("div",{className:"flex-1 flex items-center justify-end lg:items-stretch lg:justify-between",children:[(0,c.jsxs)("div",{className:"flex-shrink-0 flex items-center",children:[(0,c.jsx)("span",{className:"lg:absolute translate-y-1 lg:translate-y-9 h-20 lg:h-auto",children:(0,c.jsx)(b(),{href:"/",children:(0,c.jsx)(y(),{src:ei,alt:"magic-events.gg",width:"86",height:"117",priority:!0})})}),(0,c.jsx)(b(),{href:"/",children:(0,c.jsx)("h1",{className:"text-primary text-xl font-bold lg:pl-24 hidden lg:block",children:"magic-events.gg"})})]}),(0,c.jsx)("div",{className:"hidden lg:block sm:ml-6 h-full",children:(0,c.jsxs)("div",{className:"flex space-x-4",children:[(0,c.jsx)(b(),{href:"/organizzatori",className:"text-gray-300 hover:bg-gray-700 hover:text-white px-3 py-2 rounded-md text-md font-medium",children:"Organizzatori"}),(0,ea.G)(e)&&(0,c.jsx)(b(),{href:"/admin",className:"text-gray-300 hover:bg-gray-700 hover:text-white px-3 py-2 rounded-md text-md font-medium",children:"Area Admin"}),e?(0,c.jsx)("button",{onClick:t,className:"text-gray-300 hover:bg-gray-700 hover:text-white px-3 py-2 rounded-md text-md font-medium",children:"Logout"}):(0,c.jsx)(b(),{href:"/login",className:"text-gray-300 hover:bg-gray-700 hover:text-white px-3 py-2 rounded-md text-md font-medium",children:"Accedi"}),(0,c.jsx)(b(),{href:"/contatti",className:"text-gray-300 hover:bg-gray-700 hover:text-white px-3 py-2 rounded-md text-md font-medium",children:"Contatti"}),(0,c.jsx)("a",{href:"https://www.facebook.com/magiceventsgg",target:"_blank",rel:"noreferrer",className:"text-gray-300 hover:bg-gray-700 hover:text-white px-3 py-2 rounded-md text-md font-medium",children:(0,c.jsx)("svg",{fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 30 30",className:"h-6 w-6",children:(0,c.jsx)("path",{d:"M15,3C8.373,3,3,8.373,3,15c0,6.016,4.432,10.984,10.206,11.852V18.18h-2.969v-3.154h2.969v-2.099c0-3.475,1.693-5,4.581-5 c1.383,0,2.115,0.103,2.461,0.149v2.753h-1.97c-1.226,0-1.654,1.163-1.654,2.473v1.724h3.593L19.73,18.18h-3.106v8.697 C22.481,26.083,27,21.075,27,15C27,8.373,21.627,3,15,3z"})})})]})})]})]})}),(0,c.jsx)(er.Panel,{className:"lg:hidden",children:(0,c.jsxs)("div",{className:"px-2 pt-2 pb-3 space-y-1",children:[(0,c.jsx)(b(),{href:"/organizzatori",onClick:()=>i(),className:"text-gray-300 hover:bg-gray-700 hover:text-white block px-3 py-2 rounded-md text-base font-medium",children:"Organizzatori"}),(0,c.jsx)(b(),{href:"/leghe-e-circuiti",onClick:()=>i(),className:"text-gray-300 hover:bg-gray-700 hover:text-white block px-3 py-2 rounded-md text-base font-medium",children:"Leghe"}),(0,c.jsx)(b(),{href:"/i-miei-eventi",onClick:()=>i(),className:"text-gray-300 hover:bg-gray-700 hover:text-white block px-3 py-2 rounded-md text-base font-medium",children:"I miei eventi"}),e?(0,c.jsxs)(c.Fragment,{children:[(0,ea.G)(e)&&(0,c.jsx)(b(),{href:"/admin",onClick:()=>i(),className:"text-gray-300 hover:bg-gray-700 hover:text-white block px-3 py-2 rounded-md text-base font-medium",children:"Gestione negozio"}),(0,c.jsx)("a",{onClick:()=>i(),className:"text-gray-300 hover:bg-gray-700 hover:text-white block px-3 py-2 rounded-md text-base font-medium",children:"Logout"})]}):(0,c.jsx)(b(),{href:"/login",onClick:()=>i(),className:"text-gray-300 hover:bg-gray-700 hover:text-white block px-3 py-2 rounded-md text-base font-medium",children:"Accedi"}),(0,c.jsx)(b(),{href:"/contatti",onClick:()=>i(),className:"text-gray-300 hover:bg-gray-700 hover:text-white block px-3 py-2 rounded-md text-base font-medium",children:"Contatti"}),(0,c.jsx)("a",{onClick:()=>i(),href:"https://www.facebook.com/magiceventsgg",target:"_blank",rel:"noreferrer",className:"text-gray-300 hover:bg-gray-700 hover:text-white block px-3 py-2 rounded-md text-base font-medium",children:"Seguici su Facebook"})]})})]})}})}var el=n(2983);n(2968);var eu={src:"/_next/static/media/graph-image.7bd3fe5a.png",height:630,width:1200,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAECAMAAACEE47CAAAAMFBMVEVLQlBgSlVCRlpYVFhFOUh2c3xmXmaXkpVtWFVUUFeDh5NlZnE2OUpVP00wMj+Ee4N43CJnAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAKElEQVQImQXBhwEAIAjAsLIEnP9/a8IaqkdEmWFdxSZf2xC/ZOAO9gENeQCw16kPCwAAAABJRU5ErkJggg==",blurWidth:8,blurHeight:4},ec=n(9734);let ed=e=>{let{user:t,loading:n}=(0,es.aF)(),r=(0,d.useRouter)();return 0!==r.asPath.indexOf("/admin")?(0,c.jsx)(c.Fragment,{children:e.children}):n?(0,c.jsx)("h1",{children:"Loading..."}):(0,ea.G)(t)?(0,c.jsx)(c.Fragment,{children:e.children}):(0,c.jsx)("h1",{children:"Unauthenticated"})};var eh=function(e){let{Component:t,pageProps:n}=e;return(0,c.jsx)(ec.J$,{value:n.swr,children:(0,c.jsxs)(es.dr,{children:[(0,c.jsxs)(f(),{children:[(0,c.jsx)("meta",{property:"og:image",content:(0,el.C)(eu.src)},"og:image"),(0,c.jsx)("link",{rel:"manifest",href:"/manifest.json"}),(0,c.jsx)("meta",{name:"application-name",content:"magic-events.gg"}),(0,c.jsx)("meta",{name:"apple-mobile-web-app-capable",content:"yes"}),(0,c.jsx)("meta",{name:"apple-mobile-web-app-status-bar-style",content:"default"}),(0,c.jsx)("meta",{name:"apple-mobile-web-app-title",content:"magic-events.gg"}),(0,c.jsx)("meta",{name:"description",content:"The best locator for your magic events"}),(0,c.jsx)("meta",{name:"format-detection",content:"telephone=no"}),(0,c.jsx)("meta",{name:"mobile-web-app-capable",content:"yes"}),(0,c.jsx)("meta",{name:"theme-color",content:"#131431"}),(0,c.jsx)("link",{rel:"apple-touch-icon",sizes:"57x57",href:"/app-icons/apple-icon-57x57.png"}),(0,c.jsx)("link",{rel:"apple-touch-icon",sizes:"60x60",href:"/app-icons/apple-icon-60x60.png"}),(0,c.jsx)("link",{rel:"apple-touch-icon",sizes:"72x72",href:"/app-icons/apple-icon-72x72.png"}),(0,c.jsx)("link",{rel:"apple-touch-icon",sizes:"76x76",href:"/app-icons/apple-icon-76x76.png"}),(0,c.jsx)("link",{rel:"apple-touch-icon",sizes:"114x114",href:"/app-icons/apple-icon-114x114.png"}),(0,c.jsx)("link",{rel:"apple-touch-icon",sizes:"120x120",href:"/app-icons/apple-icon-120x120.png"}),(0,c.jsx)("link",{rel:"apple-touch-icon",sizes:"144x144",href:"/app-icons/apple-icon-144x144.png"}),(0,c.jsx)("link",{rel:"apple-touch-icon",sizes:"152x152",href:"/app-icons/apple-icon-152x152.png"}),(0,c.jsx)("link",{rel:"apple-touch-icon",sizes:"180x180",href:"/app-icons/apple-icon-180x180.png"}),(0,c.jsx)("link",{rel:"icon",type:"image/png",sizes:"192x192",href:"/app-icons/android-icon-192x192.png"}),(0,c.jsx)("link",{rel:"icon",type:"image/png",sizes:"32x32",href:"/app-icons/favicon-32x32.png"}),(0,c.jsx)("link",{rel:"icon",type:"image/png",sizes:"96x96",href:"/app-icons/favicon-96x96.png"}),(0,c.jsx)("link",{rel:"icon",type:"image/png",sizes:"16x16",href:"/app-icons/favicon-16x16.png"})]}),(0,c.jsxs)("main",{className:"min-h-screen flex flex-col",children:[(0,c.jsx)(eo,{}),(0,c.jsx)("div",{className:"flex flex-col flex-1",children:(0,c.jsx)(ed,{children:(0,c.jsx)(t,{...n})})}),(0,c.jsx)(m,{})]}),(0,c.jsx)(_(),{id:"google-tag-manager",strategy:"afterInteractive",children:"(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;
17j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','".concat("GTM-KFST2QK","');")})]})})}},2660:function(e,t,n){"use strict";n.d(t,{G:function(){return i}});var r=n(4487);function i(e){return null!==e&&(void 0===e.roles?(r.Tb("user.roles is undefined",{extra:{user:e}}),!1):e.roles.some(e=>"manager"===e.role))}},6756:function(e,t,n){"use strict";n.d(t,{HW:function(){return u},IG:function(){return w},aM:function(){return g},bW:function(){return v},eJ:function(){return _},fb:function(){return c},r5:function(){return E},vc:function(){return d},yM:function(){return f}});var r=n(8189),i=n(1604),s=n(10);let a=i.z.object({location:i.z.object({venue:i.z.string().default(""),address:i.z.string().default(""),city:i.z.string().default(""),province:i.z.string().default(""),country:i.z.string().default(""),latitude:i.z.number().default(0),longitude:i.z.number().default(0)}),onlineEvent:i.z.literal(!1)}),o=i.z.object({location:i.z.null(),onlineEvent:i.z.literal(!0)}),l=i.z.object({id:i.z.string(),format:i.z.enum(s.Z),startDate:i.z.string().datetime({offset:!0}),startDateTz:i.z.string(),title:i.z.string().nullable().default(null),description:i.z.string().nullable().default(null),registrationLink:i.z.string().nullable().default(null),organizer:i.z.object({id:i.z.string(),name:i.z.string(),logo:i.z.string().nullable()})}).and(i.z.discriminatedUnion("onlineEvent",[a,o]));async function u(e){let{data:t,error:n}=await r.Z.from("tournaments").select("*, organizer:organizers(id, name, logo)").eq("id",e).maybeSingle();if(n)throw n;return null===t?null:l.parse({id:t.id,format:t.formats[0],startDate:t.start_date,startDateTz:t.start_date_tz,title:t.title,description:t.description,registrationLink:t.registration_link,location:t.address,organizer:t.organizer,onlineEvent:t.online_event})}async function c(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5,s=arguments.length>3?arguments[3]:void 0,{data:a,error:o}=await (void 0!==s?r.Z.rpc("nearby_tournaments_formats",{lat:e,long:t,max_distance:1e3*n,wanted_formats:[].concat(s)}):r.Z.rpc("nearby_tournaments",{lat:e,long:t,max_distance:1e3*n}));if(o)throw o;return i.z.array(l).parse(a.map(e=>({id:e.id,format:e.formats[0],startDate:e.start_date,startDateTz:e.start_date_tz,title:e.title,text:e.description,registrationLink:e.registration_link,location:e.address,organizer:e.organizer,onlineEvent:e.online_event})))}async function d(e){let{data:t,error:n}=await r.Z.from("tournaments").select("*, organizer:organizers(id, name, logo)").eq("organizer_id",e).gte("start_date",new Date().toISOString()).order("start_date",{ascending:!0});if(n)throw n;return i.z.array(l).parse(t.map(e=>({id:e.id,format:e.formats[0],startDate:e.start_date,startDateTz:e.start_date_tz,title:e.title,text:e.description,registrationLink:e.registration_link,location:e.address,organizer:e.organizer,onlineEvent:e.online_event})))}let h=i.z.object({format:i.z.enum(s.Z),startDate:i.z.string().datetime(),startDateTz:i.z.string(),title:i.z.string().nullable().default(null),description:i.z.string().nullable().default(null),registrationLink:i.z.string().nullable().default(null),organizer:i.z.string()}).and(i.z.discriminatedUnion("onlineEvent",[a,o]));async function f(e){let t=h.parse(e),{data:n,error:i}=await r.Z.from("tournaments").insert({title:t.title,description:t.description,formats:[t.format],start_date:t.startDate,start_date_tz:t.startDateTz,registration_link:t.registrationLink,organizer_id:t.organizer,online_event:t.onlineEvent,address:t.location,location:t.location?"POINT(".concat(t.location.longitude," ").concat(t.location.latitude,")"):null}).select().single();if(i)throw i;return n.id}let p=i.z.object({format:i.z.enum(s.Z),startDate:i.z.string().datetime(),startDateTz:i.z.string(),title:i.z.string().nullable().default(null),description:i.z.string().nullable().default(null),registrationLink:i.z.string().nullable().default(null)}).and(i.z.discriminatedUnion("onlineEvent",[a,o]));async function _(e,t){let n=p.parse(t),{data:i,error:s}
17=await r.Z.from("tournaments").update({title:n.title,description:n.description,formats:[n.format],start_date:n.startDate,start_date_tz:n.startDateTz,registration_link:n.registrationLink,online_event:n.onlineEvent,address:n.location,location:n.location?"POINT(".concat(n.location.longitude," ").concat(n.location.latitude,")"):null}).eq("id",e).select("id").single();if(s)throw s;return i.id}let m=i.z.object({id:i.z.string(),email:i.z.string(),roles:i.z.object({organizer:i.z.string(),role:i.z.enum(["manager"])}).array()});async function g(e){let{data:t,error:n}=await r.Z.from("profiles").select("*, roles:profiles_roles(*)").eq("id",e).single();if(n)throw n;return m.parse({...t,roles:t.roles.map(e=>({...e,organizer:e.organizer_id}))})}let y=i.z.object({id:i.z.string(),name:i.z.string(),description:i.z.string().nullable(),logo:i.z.string().nullable(),contacts:i.z.object({facebook:i.z.string().nullable().default(null),email:i.z.string().nullable().default(null),whatsapp:i.z.string().nullable().default(null),website:i.z.string().nullable().default(null),discord:i.z.string().nullable().default(null)}),address:i.z.object({address:i.z.string().default(""),city:i.z.string().default(""),province:i.z.string().default(""),country:i.z.string().default(""),latitude:i.z.number().default(0),longitude:i.z.number().default(0)}).nullable()});async function v(e){let{data:t,error:n}=await r.Z.from("organizers").select("*").eq("id",e).maybeSingle();if(n)throw n;return y.parse(t)}let b=y.pick({description:!0,contacts:!0});async function E(e,t){let n=b.parse(t),{data:i,error:s}=await r.Z.from("organizers").update(n).eq("id",e).select().single();if(s)throw s;return y.parse(i)}async function w(e){let{data:t,error:n}=await r.Z.from("organizers").select("*, profiles_roles!inner(*)").eq("profiles_roles.profile_id",e);if(n)throw n;return y.array().parse(t)}},8189:function(e,t,n){"use strict";n.d(t,{Z:function(){return ta}});let r=e=>{let t;return t=e||("undefined"==typeof fetch?(...e)=>{var t,r,i,s;return t=void 0,r=void 0,i=void 0,s=function*(){return yield(yield Promise.resolve().then(n.t.bind(n,4098,23))).fetch(...e)},new(i||(i=Promise))(function(e,n){function a(e){try{l(s.next(e))}catch(t){n(t)}}function o(e){try{l(s.throw(e))}catch(t){n(t)}}function l(t){var n;t.done?e(t.value):((n=t.value)instanceof i?n:new i(function(e){e(n)})).then(a,o)}l((s=s.apply(t,r||[])).next())})}:fetch),(...e)=>t(...e)};class i extends Error{constructor(e,t="FunctionsError",n){super(e),super.name=t,this.context=n}}class s extends i{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}}class a extends i{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}}class o extends i{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}}class l{constructor(e,{headers:t={},customFetch:n}={}){this.url=e,this.headers=t,this.fetch=r(n)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e,t={}){var n,r,i,l,u;return r=this,i=void 0,l=void 0,u=function*(){try{let r,i;let{headers:l,body:u}=t,c={};u&&(l&&!Object.prototype.hasOwnProperty.call(l,"Content-Type")||!l)&&("undefined"!=typeof Blob&&u instanceof Blob||u instanceof ArrayBuffer?(c["Content-Type"]="application/octet-stream",r=u):"string"==typeof u?(c["Content-Type"]="text/plain",r=u):"undefined"!=typeof FormData&&u instanceof FormData?r=u:(c["Content-Type"]="application/json",r=JSON.stringify(u)));let d=yield this.fetch(`${this.url}/${e}`,{method:"POST",headers:Object.assign(Object.assign(Object.assign({},c),this.headers),l),body:r}).catch(e=>{throw new s(e)}),h=d.headers.get("x-relay-error");if(h&&"true"===h)throw new a(d);if(!d.ok)throw new o(d);let f=(null!==(n=d.headers.get("Content-Type"))&&void 0!==n?n:"text/plain").split(";")[0].trim();return i="application/json"===f?yield d.json():"application/octet-stream"===f?yield d.blob():"multipart/form-data"===f?yield d.formData():yield d.text(),{data:i,error:null}}catch(p){return{data:null,error:p}}},new(l||(l=Promise))(function(e,t){function n(e){try{a(u.next(e))}catch(n){t(n)}}function s(e){try{a(u.throw(e))}catch(n){t(n)}}function a(t){var r;t.done?e(t.value):((r=t.value)instanceof l?r:new l(function(e){e(r)})).then(n,s)}a((u=u.apply(r,i||[])).next())})}}var u,c,d,h,f,p,_,m,g,y,v,b,E,w,S,x,T,k,R,O=n(4098),j=n.n(O);class N{constructor(e){this.shouldThrowOnError=!1,this.method=e.method,this.url=e.url,this.headers=e.headers,this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=e.shouldThrowOnError,this.signal=e.signal,this.allowEmpty=e.allowEmpty,e.fetch?this.fetch=e.fetch:"undefined"==typeof fetch?this.fetch=j():this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}then(e,t){void 0===this.schema||(["GET","HEAD"].includes(this.method)?this.headers["Accept-Profile"]=this.schema:this.headers["Content-Profile"]=this.schema),"GET"!==this.method&&"HEAD"!==this.method&&(this.headers["Content-Type"]="application/json");let n=this.fetch,r=n(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async e=>{var t,n,r;let i=null,s=null,a=null,o=e.status,l=e.statusText;if(e.ok){if("HEAD"!==this.method){let u=await e.text();""===u||(s="text/csv"===this.headers.Accept?u:this.headers.Accept&&this.headers.Accept.includes("application/vnd.pgrst.plan+text")?u:JSON.parse(u))}let c=null===(t=this.headers.Prefer)||void 0===t?void 0:t.match(/count=(exact|planned|estimated)/),d=null===(n=e.headers.get("content-range"))||void 0===n?void 0:n.split("/");c&&d&&d.length>1&&(a=parseInt(d[1]))}else{let h=await e.text();try{i=JSON.parse(h),Array.isArray(i)&&404===e.status&&(s=[],i=null,o=200,l="OK")}catch(f){404===e.status&&""===h?(o=204,l="No Content"):i={message:h}}if(i&&this.allowEmpty&&(null===(r=null==i?void 0:i.details)||void 0===r?void 0:r.includes("Results contain 0 rows"))&&(i=null,o=200,l="OK"),i&&this.shouldThrowOnError)throw i}let p={error:i,data:s,count:a,status:o,statusText:l};return p});return this.shouldThrowOnError||(r=r.catch(e=>({error:{message:`FetchError: ${e.message}`,details:"",hint:"",code:e.code||""},data:null,count:null,status:0,statusText:""}))),r.then(e,t)}}class D extends N{select(e){let t=!1,n=(null!=e?e:"*").split("").map(e=>/\s/.test(e)&&!t?"":('"'===e&&(t=!t),e)).join("");return this.url.searchParams.set("select",n),this.headers.Prefer&&(this.headers.Prefer+=","),this.headers.Prefer+="return=representation",this}order(e,{ascending:t=!0,nullsFirst:n,foreignTable:r}={}){let i=r?`${r}.order`:"order",s=this.url.searchParams.get(i);return this.url.searchParams.set(i,`${s?`${s},`:""}${e}.${t?"asc":"desc"}${void 0===n?"":n?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:t}={}){let n=void 0===t?"limit":`${t}.limit`;return this.url.searchParams.set(n,`${e}`),this}range(e,t,{foreignTable:n}={}){let r=void 0===n?"offset":`${n}.offset`,i=void 0===n?"limit":`${n}.limit`;return this.url.searchParams.set(r,`${e}`),this.url.searchParams.set(i,`${t-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.Accept="application/vnd.pgrst.object+json",this}maybeSingle(){return this.headers.Accept="application/vnd.pgrst.object+json",this.allowEmpty=!0,this}csv(){return this.headers.Accept="text/csv",this}geojson(){return this.headers.Accept="application/geo+json",this}
17explain({analyze:e=!1,verbose:t=!1,settings:n=!1,buffers:r=!1,wal:i=!1,format:s="text"}={}){let a=[e?"analyze":null,t?"verbose":null,n?"settings":null,r?"buffers":null,i?"wal":null].filter(Boolean).join("|"),o=this.headers.Accept;return this.headers.Accept=`application/vnd.pgrst.plan+${s}; for="${o}"; options=${a};`,this}rollback(){var e;return(null!==(e=this.headers.Prefer)&&void 0!==e?e:"").trim().length>0?this.headers.Prefer+=",tx=rollback":this.headers.Prefer="tx=rollback",this}returns(){return this}}class C extends D{eq(e,t){return this.url.searchParams.append(e,`eq.${t}`),this}neq(e,t){return this.url.searchParams.append(e,`neq.${t}`),this}gt(e,t){return this.url.searchParams.append(e,`gt.${t}`),this}gte(e,t){return this.url.searchParams.append(e,`gte.${t}`),this}lt(e,t){return this.url.searchParams.append(e,`lt.${t}`),this}lte(e,t){return this.url.searchParams.append(e,`lte.${t}`),this}like(e,t){return this.url.searchParams.append(e,`like.${t}`),this}ilike(e,t){return this.url.searchParams.append(e,`ilike.${t}`),this}is(e,t){return this.url.searchParams.append(e,`is.${t}`),this}in(e,t){let n=t.map(e=>"string"==typeof e&&RegExp("[,()]").test(e)?`"${e}"`:`${e}`).join(",");return this.url.searchParams.append(e,`in.(${n})`),this}contains(e,t){return"string"==typeof t?this.url.searchParams.append(e,`cs.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cs.{${t.join(",")}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(t)}`),this}containedBy(e,t){return"string"==typeof t?this.url.searchParams.append(e,`cd.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cd.{${t.join(",")}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(t)}`),this}rangeGt(e,t){return this.url.searchParams.append(e,`sr.${t}`),this}rangeGte(e,t){return this.url.searchParams.append(e,`nxl.${t}`),this}rangeLt(e,t){return this.url.searchParams.append(e,`sl.${t}`),this}rangeLte(e,t){return this.url.searchParams.append(e,`nxr.${t}`),this}rangeAdjacent(e,t){return this.url.searchParams.append(e,`adj.${t}`),this}overlaps(e,t){return"string"==typeof t?this.url.searchParams.append(e,`ov.${t}`):this.url.searchParams.append(e,`ov.{${t.join(",")}}`),this}textSearch(e,t,{config:n,type:r}={}){let i="";"plain"===r?i="pl":"phrase"===r?i="ph":"websearch"===r&&(i="w");let s=void 0===n?"":`(${n})`;return this.url.searchParams.append(e,`${i}fts${s}.${t}`),this}match(e){return Object.entries(e).forEach(([e,t])=>{this.url.searchParams.append(e,`eq.${t}`)}),this}not(e,t,n){return this.url.searchParams.append(e,`not.${t}.${n}`),this}or(e,{foreignTable:t}={}){let n=t?`${t}.or`:"or";return this.url.searchParams.append(n,`(${e})`),this}filter(e,t,n){return this.url.searchParams.append(e,`${t}.${n}`),this}}class P{constructor(e,{headers:t={},schema:n,fetch:r}){this.url=e,this.headers=t,this.schema=n,this.fetch=r}select(e,{head:t=!1,count:n}={}){let r=!1,i=(null!=e?e:"*").split("").map(e=>/\s/.test(e)&&!r?"":('"'===e&&(r=!r),e)).join("");return this.url.searchParams.set("select",i),n&&(this.headers.Prefer=`count=${n}`),new C({method:t?"HEAD":"GET",url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}insert(e,{count:t}={}){let n=[];if(t&&n.push(`count=${t}`),this.headers.Prefer&&n.unshift(this.headers.Prefer),this.headers.Prefer=n.join(","),Array.isArray(e)){let r=e.reduce((e,t)=>e.concat(Object.keys(t)),[]);if(r.length>0){let i=[...new Set(r)].map(e=>`"${e}"`);this.url.searchParams.set("columns",i.join(","))}}return new C({method:"POST",url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:this.fetch,allowEmpty:!1})}upsert(e,{onConflict:t,ignoreDuplicates:n=!1,count:r}={}){let i=[`resolution=${n?"ignore":"merge"}-duplicates`];return void 0!==t&&this.url.searchParams.set("on_conflict",t),r&&i.push(`count=${r}`),this.headers.Prefer&&i.unshift(this.headers.Prefer),this.headers.Prefer=i.join(","),new C({method:"POST",url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:this.fetch,allowEmpty:!1})}update(e,{count:t}={}){let n=[];return t&&n.push(`count=${t}`),this.headers.Prefer&&n.unshift(this.headers.Prefer),this.headers.Prefer=n.join(","),new C({method:"PATCH",url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:this.fetch,allowEmpty:!1})}delete({count:e}={}){let t=[];return e&&t.push(`count=${e}`),this.headers.Prefer&&t.unshift(this.headers.Prefer),this.headers.Prefer=t.join(","),new C({method:"DELETE",url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}}let A={"X-Client-Info":"postgrest-js/1.4.0"};class I{constructor(e,{headers:t={},schema:n,fetch:r}={}){this.url=e,this.headers=Object.assign(Object.assign({},A),t),this.schema=n,this.fetch=r}from(e){let t=new URL(`${this.url}/${e}`);return new P(t,{headers:Object.assign({},this.headers),schema:this.schema,fetch:this.fetch})}rpc(e,t={},{head:n=!1,count:r}={}){let i,s;let a=new URL(`${this.url}/rpc/${e}`);n?(i="HEAD",Object.entries(t).forEach(([e,t])=>{a.searchParams.append(e,`${t}`)})):(i="POST",s=t);let o=Object.assign({},this.headers);return r&&(o.Prefer=`count=${r}`),new C({method:i,url:a,headers:o,schema:this.schema,body:s,fetch:this.fetch,allowEmpty:!1})}}var $=n(5840);let U={"X-Client-Info":"realtime-js/2.6.0"};(v=u||(u={}))[v.connecting=0]="connecting",v[v.open=1]="open",v[v.closing=2]="closing",v[v.closed=3]="closed",(b=c||(c={})).closed="closed",b.errored="errored",b.joined="joined",b.joining="joining",b.leaving="leaving",(E=d||(d={})).close="phx_close",E.error="phx_error",E.join="phx_join",E.reply="phx_reply",E.leave="phx_leave",E.access_token="access_token",(h||(h={})).websocket="websocket",(w=f||(f={}
17)).Connecting="connecting",w.Open="open",w.Closing="closing",w.Closed="closed";class B{constructor(e,t){this.callback=e,this.timerCalc=t,this.timer=void 0,this.tries=0,this.callback=e,this.timerCalc=t}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}}class L{constructor(){this.HEADER_LENGTH=1}decode(e,t){return e.constructor===ArrayBuffer?t(this._binaryDecode(e)):"string"==typeof e?t(JSON.parse(e)):t({})}_binaryDecode(e){let t=new DataView(e),n=new TextDecoder;return this._decodeBroadcast(e,t,n)}_decodeBroadcast(e,t,n){let r=t.getUint8(1),i=t.getUint8(2),s=this.HEADER_LENGTH+2,a=n.decode(e.slice(s,s+r));s+=r;let o=n.decode(e.slice(s,s+i));s+=i;let l=JSON.parse(n.decode(e.slice(s,e.byteLength)));return{ref:null,topic:a,event:o,payload:l}}}class G{constructor(e,t,n={},r=1e4){this.channel=e,this.event=t,this.payload=n,this.timeout=r,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],this.refEvent=null,this.rateLimited=!1}resend(e){this.timeout=e,this._cancelRefEvent(),this.ref="",this.refEvent=null,this.receivedResp=null,this.sent=!1,this.send()}send(){if(this._hasReceived("timeout"))return;this.startTimeout(),this.sent=!0;let e=this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload,ref:this.ref,join_ref:this.channel._joinRef()});"rate limited"===e&&(this.rateLimited=!0)}updatePayload(e){this.payload=Object.assign(Object.assign({},this.payload),e)}receive(e,t){var n;return this._hasReceived(e)&&t(null===(n=this.receivedResp)||void 0===n?void 0:n.response),this.recHooks.push({status:e,callback:t}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);let e=e=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=e,this._matchReceive(e)};this.channel._on(this.refEvent,{},e),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}trigger(e,t){this.refEvent&&this.channel._trigger(this.refEvent,{status:e,response:t})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel._off(this.refEvent,{})}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}_matchReceive({status:e,response:t}){this.recHooks.filter(t=>t.status===e).forEach(e=>e.callback(t))}_hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}}(S=p||(p={})).SYNC="sync",S.JOIN="join",S.LEAVE="leave";class z{constructor(e,t){this.channel=e,this.state={},this.pendingDiffs=[],this.joinRef=null,this.caller={onJoin(){},onLeave(){},onSync(){}};let n=(null==t?void 0:t.events)||{state:"presence_state",diff:"presence_diff"};this.channel._on(n.state,{},e=>{let{onJoin:t,onLeave:n,onSync:r}=this.caller;this.joinRef=this.channel._joinRef(),this.state=z.syncState(this.state,e,t,n),this.pendingDiffs.forEach(e=>{this.state=z.syncDiff(this.state,e,t,n)}),this.pendingDiffs=[],r()}),this.channel._on(n.diff,{},e=>{let{onJoin:t,onLeave:n,onSync:r}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(e):(this.state=z.syncDiff(this.state,e,t,n),r())}),this.onJoin((e,t,n)=>{this.channel._trigger("presence",{event:"join",key:e,currentPresences:t,newPresences:n})}),this.onLeave((e,t,n)=>{this.channel._trigger("presence",{event:"leave",key:e,currentPresences:t,leftPresences:n})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(e,t,n,r){let i=this.cloneDeep(e),s=this.transformState(t),a={},o={};return this.map(i,(e,t)=>{s[e]||(o[e]=t)}),this.map(s,(e,t)=>{let n=i[e];if(n){let r=t.map(e=>e.presence_ref),s=n.map(e=>e.presence_ref),l=t.filter(e=>0>s.indexOf(e.presence_ref)),u=n.filter(e=>0>r.indexOf(e.presence_ref));l.length>0&&(a[e]=l),u.length>0&&(o[e]=u)}else a[e]=t}),this.syncDiff(i,{joins:a,leaves:o},n,r)}static syncDiff(e,t,n,r){let{joins:i,leaves:s}={joins:this.transformState(t.joins),leaves:this.transformState(t.leaves)};return n||(n=()=>{}),r||(r=()=>{}),this.map(i,(t,r)=>{var i;let s=null!==(i=e[t])&&void 0!==i?i:[];if(e[t]=this.cloneDeep(r),s.length>0){let a=e[t].map(e=>e.presence_ref),o=s.filter(e=>0>a.indexOf(e.presence_ref));e[t].unshift(...o)}n(t,s,r)}),this.map(s,(t,n)=>{let i=e[t];if(!i)return;let s=n.map(e=>e.presence_ref);i=i.filter(e=>0>s.indexOf(e.presence_ref)),e[t]=i,r(t,i,n),0===i.length&&delete e[t]}),e}static map(e,t){return Object.getOwnPropertyNames(e).map(n=>t(n,e[n]))}static transformState(e){return Object.getOwnPropertyNames(e=this.cloneDeep(e)).reduce((t,n)=>{let r=e[n];return"metas"in r?t[n]=r.metas.map(e=>(e.presence_ref=e.phx_ref,delete e.phx_ref,delete e.phx_ref_prev,e)):t[n]=r,t},{})}static cloneDeep(e){return JSON.parse(JSON.stringify(e))}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}}(x=_||(_={})).abstime="abstime",x.bool="bool",x.date="date",x.daterange="daterange",x.float4="float4",x.float8="float8",x.int2="int2",x.int4="int4",x.int4range="int4range",x.int8="int8",x.int8range="int8range",x.json="json",x.jsonb="jsonb",x.money="money",x.numeric="numeric",x.oid="oid",x.reltime="reltime",x.text="text",x.time="time",x.timestamp="timestamp",x.timestamptz="timestamptz",x.timetz="timetz",x.tsrange="tsrange",x.tstzrange="tstzrange";let M=(e,t,n={})=>{var r;let i=null!==(r=n.skipTypes)&&void 0!==r?r:[];return Object.keys(t).reduce((n,r)=>(n[r]=Y(r,e,t,i),n),{})},Y=(e,t,n,r)=>{let i=t.find(t=>t.name===e),s=null==i?void 0:i.type,a=n[e];return s&&!r.includes(s)?Z(s,a):F(a)},Z=(e,t)=>{if("_"===e.charAt(0)){let n=e.slice(1,e.length);return J(t,n)}switch(e){case _.bool:return H(t);case _.float4:case _.float8:case _.int2:case _.int4:case _.int8:case _.numeric:case _.oid:return q(t);case _.json:case _.jsonb:return V(t);case _.timestamp:return W(t);case _.abstime:case _.date:case _.daterange:case _.int4range:case _.int8range:case _.money:case _.reltime:case _.text:case _.time:case _.timestamptz:case _.timetz:case _.tsrange:case _.tstzrange:default:return F(t)}},F=e=>e,H=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},q=e=>{if("string"==typeof e){let t=parseFloat(e);
17if(!Number.isNaN(t))return t}return e},V=e=>{if("string"==typeof e)try{return JSON.parse(e)}catch(t){console.log(`JSON parse error: ${t}`)}return e},J=(e,t)=>{if("string"!=typeof e)return e;let n=e.length-1,r=e[n],i=e[0];if("{"===i&&"}"===r){let s;let a=e.slice(1,n);try{s=JSON.parse("["+a+"]")}catch(o){s=a?a.split(","):[]}return s.map(e=>Z(t,e))}return e},W=e=>"string"==typeof e?e.replace(" ","T"):e;var K=function(e,t,n,r){return new(n||(n=Promise))(function(i,s){function a(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?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,o)}l((r=r.apply(e,t||[])).next())})};(T=m||(m={})).ALL="*",T.INSERT="INSERT",T.UPDATE="UPDATE",T.DELETE="DELETE",(k=g||(g={})).BROADCAST="broadcast",k.PRESENCE="presence",k.POSTGRES_CHANGES="postgres_changes",(R=y||(y={})).SUBSCRIBED="SUBSCRIBED",R.TIMED_OUT="TIMED_OUT",R.CLOSED="CLOSED",R.CHANNEL_ERROR="CHANNEL_ERROR";class X{constructor(e,t={config:{}},n){this.topic=e,this.params=t,this.socket=n,this.bindings={},this.state=c.closed,this.joinedOnce=!1,this.pushBuffer=[],this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:""}},t.config),this.timeout=this.socket.timeout,this.joinPush=new G(this,d.join,this.params,this.timeout),this.rejoinTimer=new B(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=c.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(e=>e.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=c.closed,this.socket._remove(this)}),this._onError(e=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,e),this.state=c.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=c.errored,this.rejoinTimer.scheduleTimeout())}),this._on(d.reply,{},(e,t)=>{this._trigger(this._replyEventName(t),e)}),this.presence=new z(this)}subscribe(e,t=this.timeout){var n,r;if(this.joinedOnce)throw"tried to subscribe multiple times. 'subscribe' can only be called a single time per channel instance";{let{config:{broadcast:i,presence:s}}=this.params;this._onError(t=>e&&e("CHANNEL_ERROR",t)),this._onClose(()=>e&&e("CLOSED"));let a={},o={broadcast:i,presence:s,postgres_changes:null!==(r=null===(n=this.bindings.postgres_changes)||void 0===n?void 0:n.map(e=>e.filter))&&void 0!==r?r:[]};this.socket.accessToken&&(a.access_token=this.socket.accessToken),this.updateJoinPayload(Object.assign({config:o},a)),this.joinedOnce=!0,this._rejoin(t),this.joinPush.receive("ok",({postgres_changes:t})=>{var n;if(this.socket.accessToken&&this.socket.setAuth(this.socket.accessToken),void 0===t){e&&e("SUBSCRIBED");return}{let r=this.bindings.postgres_changes,i=null!==(n=null==r?void 0:r.length)&&void 0!==n?n:0,s=[];for(let a=0;a<i;
17a++){let o=r[a],{filter:{event:l,schema:u,table:c,filter:d}}=o,h=t&&t[a];if(h&&h.event===l&&h.schema===u&&h.table===c&&h.filter===d)s.push(Object.assign(Object.assign({},o),{id:h.id}));else{this.unsubscribe(),e&&e("CHANNEL_ERROR",Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=s,e&&e("SUBSCRIBED");return}}).receive("error",t=>{e&&e("CHANNEL_ERROR",Error(JSON.stringify(Object.values(t).join(", ")||"error")))}).receive("timeout",()=>{e&&e("TIMED_OUT")})}return this}presenceState(){return this.presence.state}track(e,t={}){return K(this,void 0,void 0,function*(){return yield this.send({type:"presence",event:"track",payload:e},t.timeout||this.timeout)})}untrack(e={}){return K(this,void 0,void 0,function*(){return yield this.send({type:"presence",event:"untrack"},e)})}on(e,t,n){return this._on(e,t,n)}send(e,t={}){return new Promise(n=>{var r,i,s;let a=this._push(e.type,e,t.timeout||this.timeout);a.rateLimited&&n("rate limited"),"broadcast"!==e.type||(null===(s=null===(i=null===(r=this.params)||void 0===r?void 0:r.config)||void 0===i?void 0:i.broadcast)||void 0===s?void 0:s.ack)||n("ok"),a.receive("ok",()=>n("ok")),a.receive("timeout",()=>n("timed out"))})}updateJoinPayload(e){this.joinPush.updatePayload(e)}unsubscribe(e=this.timeout){this.state=c.leaving;let t=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(d.close,"leave",this._joinRef())};return this.rejoinTimer.reset(),this.joinPush.destroy(),new Promise(n=>{let r=new G(this,d.leave,{},e);r.receive("ok",()=>{t(),n("ok")}).receive("timeout",()=>{t(),n("timed out")}).receive("error",()=>{n("error")}),r.send(),this._canPush()||r.trigger("ok",{})})}_push(e,t,n=this.timeout){if(!this.joinedOnce)throw`tried to push '${e}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let r=new G(this,e,t,n);return this._canPush()?r.send():(r.startTimeout(),this.pushBuffer.push(r)),r}_onMessage(e,t,n){return t}_isMember(e){return this.topic===e}_joinRef(){return this.joinPush.ref}_trigger(e,t,n){var r,i;let s=e.toLocaleLowerCase(),{close:a,error:o,leave:l,join:u}=d;if(n&&[a,o,l,u].indexOf(s)>=0&&n!==this._joinRef())return;let c=this._onMessage(s,t,n);if(t&&!c)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(s)?null===(r=this.bindings.postgres_changes)||void 0===r||r.filter(e=>{var t,n,r;return(null===(t=e.filter)||void 0===t?void 0:t.event)==="*"||(null===(r=null===(n=e.filter)||void 0===n?void 0:n.event)||void 0===r?void 0:r.toLocaleLowerCase())===s}).map(e=>e.callback(c,n)):null===(i=this.bindings[s])||void 0===i||i.filter(e=>{var n,r,i,a,o,l;if(!["broadcast","presence","postgres_changes"].includes(s))return e.type.toLocaleLowerCase()===s;if("id"in e){let u=e.id,c=null===(n=e.filter)||void 0===n?void 0:n.event;return u&&(null===(r=t.ids)||void 0===r?void 0:r.includes(u))&&("*"===c||(null==c?void 0:c.toLocaleLowerCase())===(null===(i=t.data)||void 0===i?void 0:i.type.toLocaleLowerCase()))}{let d=null===(o=null===(a=null==e?void 0:e.filter)||void 0===a?void 0:a.event)||void 0===o?void 0:o.toLocaleLowerCase();return"*"===d||d===(null===(l=null==t?void 0:t.event)||void 0===l?void 0:l.toLocaleLowerCase())}}).map(e=>{if("object"==typeof c&&"ids"in c){let t=c.data,{schema:r,table:i,commit_timestamp:s,type:a,errors:o}=t;c=Object.assign(Object.assign({},{schema:r,table:i,commit_timestamp:s,eventType:a,new:{},old:{},errors:o}),this._getPayloadRecords(t))}e.callback(c,n)})}_isClosed(){return this.state===c.closed}_isJoined(){return this.state===c.joined}_isJoining(){return this.state===c.joining}_isLeaving(){return this.state===c.leaving}_replyEventName(e){return`chan_reply_${e}`}_on(e,t,n){let r=e.toLocaleLowerCase(),i={type:r,filter:t,callback:n};return this.bindings[r]?this.bindings[r].push(i):this.bindings[r]=[i],this}_off(e,t){let n=e.toLocaleLowerCase();return this.bindings[n]=this.bindings[n].filter(e=>{var r;return!((null===(r=e.type)||void 0===r?void 0:r.toLocaleLowerCase())===n&&X.isEqual(e.filter,t))}),this}static isEqual(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(e){this._on(d.close,{},e)}_onError(e){this._on(d.error,{},t=>e(t))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(e=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=c.joining,this.joinPush.resend(e))}_getPayloadRecords(e){let t={new:{},old:{}};return("INSERT"===e.type||"UPDATE"===e.type)&&(t.new=M(e.columns,e.record)),("UPDATE"===e.type||"DELET
17E"===e.type)&&(t.old=M(e.columns,e.old_record)),t}}let Q=()=>{};class ee{constructor(e,t){var n;this.accessToken=null,this.channels=[],this.endPoint="",this.headers=U,this.params={},this.timeout=1e4,this.transport=$.w3cwebsocket,this.heartbeatIntervalMs=3e4,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.ref=0,this.logger=Q,this.conn=null,this.sendBuffer=[],this.serializer=new L,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.eventsPerSecondLimitMs=100,this.inThrottle=!1,this.endPoint=`${e}/${h.websocket}`,(null==t?void 0:t.params)&&(this.params=t.params),(null==t?void 0:t.headers)&&(this.headers=Object.assign(Object.assign({},this.headers),t.headers)),(null==t?void 0:t.timeout)&&(this.timeout=t.timeout),(null==t?void 0:t.logger)&&(this.logger=t.logger),(null==t?void 0:t.transport)&&(this.transport=t.transport),(null==t?void 0:t.heartbeatIntervalMs)&&(this.heartbeatIntervalMs=t.heartbeatIntervalMs);let r=null===(n=null==t?void 0:t.params)||void 0===n?void 0:n.eventsPerSecond;r&&(this.eventsPerSecondLimitMs=Math.floor(1e3/r)),this.reconnectAfterMs=(null==t?void 0:t.reconnectAfterMs)?t.reconnectAfterMs:e=>[1e3,2e3,5e3,1e4][e-1]||1e4,this.encode=(null==t?void 0:t.encode)?t.encode:(e,t)=>t(JSON.stringify(e)),this.decode=(null==t?void 0:t.decode)?t.decode:this.serializer.decode.bind(this.serializer),this.reconnectTimer=new B(()=>{var e,t,n,r;return e=this,t=void 0,r=function*(){this.disconnect(),this.connect()},new(n=void 0,n=Promise)(function(i,s){function a(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?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,o)}l((r=r.apply(e,t||[])).next())})},this.reconnectAfterMs)}connect(){!this.conn&&(this.conn=new this.transport(this._endPointURL(),[],null,this.headers),this.conn&&(this.conn.binaryType="arraybuffer",this.conn.onopen=()=>this._onConnOpen(),this.conn.onerror=e=>this._onConnError(e),this.conn.onmessage=e=>this._onConnMessage(e),this.conn.onclose=e=>this._onConnClose(e)))}disconnect(e,t){this.conn&&(this.conn.onclose=function(){},e?this.conn.close(e,null!=t?t:""):this.conn.close(),this.conn=null,this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.reconnectTimer.reset())}getChannels(){return this.channels}removeChannel(e){return e.unsubscribe().then(e=>(0===this.channels.length&&this.disconnect(),e))}removeAllChannels(){return Promise.all(this.channels.map(e=>e.unsubscribe())).then(e=>(this.disconnect(),e))}log(e,t,n){this.logger(e,t,n)}connectionState(){switch(this.conn&&this.conn.readyState){case u.connecting:return f.Connecting;case u.open:return f.Open;case u.closing:return f.Closing;default:return f.Closed}}isConnected(){return this.connectionState()===f.Open}channel(e,t={config:{}}){this.isConnected()||this.connect();let n=new X(`realtime:${e}`,t,this);return this.channels.push(n),n}push(e){let{topic:t,event:n,payload:r,ref:i}=e,s=()=>{this.encode(e,e=>{var t;null===(t=this.conn)||void 0===t||t.send(e)})};if(this.log("push",`${t} ${n} (${i})`,r),this.isConnected()){if(["broadcast","presence","postgres_changes"].includes(n)){let a=this._throttle(s)();if(a)return"rate limited"}else s()}else this.sendBuffer.push(s)}setAuth(e){this.accessToken=e,this.channels.forEach(t=>{e&&t.updateJoinPayload({access_token:e}),t.joinedOnce&&t._isJoined()&&t._push(d.access_token,{access_token:e})})}_makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}_leaveOpenTopic(e){let t=this.channels.find(t=>t.topic===e&&(t._isJoined()||t._isJoining()));t&&(this.log("transport",`leaving duplicate topic "${e}"`),t.unsubscribe())}_remove(e){this.channels=this.channels.filter(t=>t._joinRef()!==e._joinRef())}_endPointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:"1.0.0"}))}_onConnMessage(e){this.decode(e.data,e=>{let{topic:t,event:n,payload:r,ref:i}=e;(i&&i===this.pendingHeartbeatRef||n===(null==r?void 0:r.type))&&(this.pendingHeartbeatRef=null),this.log("receive",`${r.status||""} ${t} ${n} ${i&&"("+i+")"||""}`,r),this.channels.filter(e=>
17e._isMember(t)).forEach(e=>e._trigger(n,r,i)),this.stateChangeCallbacks.message.forEach(t=>t(e))})}_onConnOpen(){this.log("transport",`connected to ${this._endPointURL()}`),this._flushSendBuffer(),this.reconnectTimer.reset(),this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this._sendHeartbeat(),this.heartbeatIntervalMs),this.stateChangeCallbacks.open.forEach(e=>e())}_onConnClose(e){this.log("transport","close",e),this._triggerChanError(),this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.reconnectTimer.scheduleTimeout(),this.stateChangeCallbacks.close.forEach(t=>t(e))}_onConnError(e){this.log("transport",e.message),this._triggerChanError(),this.stateChangeCallbacks.error.forEach(t=>t(e))}_triggerChanError(){this.channels.forEach(e=>e._trigger(d.error))}_appendParams(e,t){if(0===Object.keys(t).length)return e;let n=e.match(/\?/)?"&":"?",r=new URLSearchParams(t);return`${e}${n}${r}`}_flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}_sendHeartbeat(){var e;if(this.isConnected()){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection"),null===(e=this.conn)||void 0===e||e.close(1e3,"hearbeat timeout");return}this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef}),this.setAuth(this.accessToken)}}_throttle(e,t=this.eventsPerSecondLimitMs){return()=>!!this.inThrottle||(e(),t>0&&(this.inThrottle=!0,setTimeout(()=>{this.inThrottle=!1},t)),!1)}}class et extends Error{constructor(e){super(e),this.__isStorageError=!0,this.name="StorageError"}}function en(e){return"object"==typeof e&&null!==e&&"__isStorageError"in e}class er extends et{constructor(e,t){super(e),this.name="StorageApiError",this.status=t}toJSON(){return{name:this.name,message:this.message,status:this.status}}}class ei extends et{constructor(e,t){super(e),this.name="StorageUnknownError",this.originalError=t}}var es=function(e,t,n,r){return new(n||(n=Promise))(function(i,s){function a(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?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,o)}l((r=r.apply(e,t||[])).next())})};let ea=e=>{let t;return t=e||("undefined"==typeof fetch?(...e)=>es(void 0,void 0,void 0,function*(){return yield(yield Promise.resolve().then(n.t.bind(n,4098,23))).fetch(...e)}):fetch),(...e)=>t(...e)},eo=()=>es(void 0,void 0,void 0,function*(){return"undefined"==typeof Response?(yield Promise.resolve().then(n.t.bind(n,4098,23))).Response:Response});var el=function(e,t,n,r){return new(n||(n=Promise))(function(i,s){function a(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?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,o)}l((r=r.apply(e,t||[])).next())})};let eu=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),ec=(e,t)=>el(void 0,void 0,void 0,function*(){let n=yield eo();e instanceof n?e.json().then(n=>{t(new er(eu(n),e.status||500))}):t(new ei(eu(e),e))}),ed=(e,t,n,r)=>{let i={method:e,headers:(null==t?void 0:t.headers)||{}};return"GET"===e?i:(i.headers=Object.assign({"Content-Type":"application/json"},null==t?void 0:t.headers),i.body=JSON.stringify(r),Object.assign(Object.assign({},i),n))};function eh(e,t,n,r,i,s){return el(this,void 0,void 0,function*(){return new Promise((a,o)=>{e(n,ed(t,r,i,s)).then(e=>{if(!e.ok)throw e;return(null==r?void 0:r.noResolveJson)?e:e.json()}).then(e=>a(e)).catch(e=>ec(e,o))})})}function ef(e,t,n,r){return el(this,void 0,void 0,function*(){return eh(e,"GET",t,n,r)})}function ep(e,t,n,r,i){return el(this,void 0,void 0,function*(){return eh(e,"POST",t,r,i,n)})}function e_(e,t,n,r,i){return el(this,void 0,void 0,function*(){return eh(e,"DELETE",t,r,i,n)})}var em=function(e,t,n,r){return new(n||(n=Promise))(function(i,s){function a(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?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,o)}l((r=r.apply(e,t||[])).next())})};let eg={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},ey={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};class ev{constructor(e,t={},n,r){this.url=e,this.headers=t,this.bucketId=n,this.fetch=ea(r)}uploadOrUpdate(e,t,n,r){return em(this,void 0,void 0,function*(){try{let i;let s=Object.assign(Object.assign({},ey),r),a=Object.assign(Object.assign({},this.headers),"POST"===e&&{"x-upsert":String(s.upsert)});"undefined"!=typeof Blob&&n instanceof Blob?((i=new FormData).append("cacheControl",s.cacheControl),i.append("",n)):"undefined"!=typeof FormData&&n instanceof FormData?(i=n).append("cacheControl",s.cacheControl):(i=n,a["cache-control"]=`max-age=${s.cacheControl}`,a["content-type"]=s.contentType);let o=this._removeEmptyFolders(t),l=this._getFinalPath(o),u=yield this.fetch(`${this.url}/object/${l}`,{method:e,body:i,headers:a});if(u.ok)return{data:{path:o},error:null};{let c=yield u.json();return{data:null,error:c}}}catch(d){if(en(d))return{data:null,error:d};throw d}})}upload(e,t,n){return em(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",e,t,n)})}update(e,t,n){return em(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",e,t,n)})}move(e,t){return em(this,void 0,void 0,function*(){try{let n=yield ep(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:e,destinationKey:t},{headers:this.headers});return{data:n,error:null}}catch(r){if(en(r))return{data:null,error:r};throw r}})}copy(e,t){return em(this,void 0,void 0,function*(){try{let n=yield ep(this.fetch,`${this.url}/object/copy`,{bucketId:this.bucketId,sourceKey:e,destinationKey:t},{headers:this.headers});return{data:{path:n.Key},error:null}}catch(r){if(en(r))return{data:null,error:r};throw r}})}createSignedUrl(e,t,n){return em(this,void 0,void 0,function*(){try{let r=yield ep(this.fetch,`${this.url}/object/sign/${this._getFinalPath(e)}
17`,Object.assign({expiresIn:t},(null==n?void 0:n.transform)?{transform:n.transform}:{}),{headers:this.headers}),i=(null==n?void 0:n.download)?`&download=${!0===n.download?"":n.download}`:"",s=encodeURI(`${this.url}${r.signedURL}${i}`);return r={signedUrl:s},{data:r,error:null}}catch(a){if(en(a))return{data:null,error:a};throw a}})}createSignedUrls(e,t,n){return em(this,void 0,void 0,function*(){try{let r=yield ep(this.fetch,`${this.url}/object/sign/${this.bucketId}`,{expiresIn:t,paths:e},{headers:this.headers}),i=(null==n?void 0:n.download)?`&download=${!0===n.download?"":n.download}`:"";return{data:r.map(e=>Object.assign(Object.assign({},e),{signedUrl:e.signedURL?encodeURI(`${this.url}${e.signedURL}${i}`):null})),error:null}}catch(s){if(en(s))return{data:null,error:s};throw s}})}download(e,t){return em(this,void 0,void 0,function*(){let n=void 0!==(null==t?void 0:t.transform),r=this.transformOptsToQueryString((null==t?void 0:t.transform)||{}),i=r?`?${r}`:"";try{let s=this._getFinalPath(e),a=yield ef(this.fetch,`${this.url}/${n?"render/image/authenticated":"object"}/${s}${i}`,{headers:this.headers,noResolveJson:!0}),o=yield a.blob();return{data:o,error:null}}catch(l){if(en(l))return{data:null,error:l};throw l}})}getPublicUrl(e,t){let n=this._getFinalPath(e),r=[],i=(null==t?void 0:t.download)?`download=${!0===t.download?"":t.download}`:"";""!==i&&r.push(i);let s=void 0!==(null==t?void 0:t.transform),a=this.transformOptsToQueryString((null==t?void 0:t.transform)||{});""!==a&&r.push(a);let o=r.join("&");return""!==o&&(o=`?${o}`),{data:{publicUrl:encodeURI(`${this.url}/${s?"render/image":"object"}/public/${n}${o}`)}}}remove(e){return em(this,void 0,void 0,function*(){try{let t=yield e_(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:e},{headers:this.headers});return{data:t,error:null}}catch(n){if(en(n))return{data:null,error:n};throw n}})}list(e,t,n){return em(this,void 0,void 0,function*(){try{let r=Object.assign(Object.assign(Object.assign({},eg),t),{prefix:e||""}),i=yield ep(this.fetch,`${this.url}/object/list/${this.bucketId}`,r,{headers:this.headers},n);return{data:i,error:null}}catch(s){if(en(s))return{data:null,error:s};throw s}})}_getFinalPath(e){return`${this.bucketId}/${e}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(e){let t=[];return e.width&&t.push(`width=${e.width}`),e.height&&t.push(`height=${e.height}`),e.resize&&t.push(`resize=${e.resize}`),e.format&&t.push(`format=${e.format}`),e.quality&&t.push(`quality=${e.quality}`),t.join("&")}}let eb={"X-Client-Info":"storage-js/2.3.0"};var eE=function(e,t,n,r){return new(n||(n=Promise))(function(i,s){function a(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?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,o)}l((r=r.apply(e,t||[])).next())})};class ew{constructor(e,t={},n){this.url=e,this.headers=Object.assign(Object.assign({},eb),t),this.fetch=ea(n)}listBuckets(){return eE(this,void 0,void 0,function*(){try{let e=yield ef(this.fetch,`${this.url}/bucket`,{headers:this.headers});return{data:e,error:null}}catch(t){if(en(t))return{data:null,error:t};throw t}})}getBucket(e){return eE(this,void 0,void 0,function*(){try{let t=yield ef(this.fetch,`${this.url}/bucket/${e}`,{headers:this.headers});return{data:t,error:null}}catch(n){if(en(n))return{data:null,error:n};throw n}})}createBucket(e,t={public:!1}){return eE(this,void 0,void 0,function*(){try{let n=yield ep(this.fetch,`${this.url}/bucket`,{id:e,name:e,public:t.public},{headers:this.headers});return{data:n,error:null}}catch(r){if(en(r))return{data:null,error:r};throw r}})}updateBucket(e,t){return eE(this,void 0,void 0,function*(){try{let n=yield function(e,t,n,r,i){return el(this,void 0,void 0,function*(){return eh(e,"PUT",t,r,void 0,n)})}(this.fetch,`${this.url}/bucket/${e}`,{id:e,name:e,public:t.public},{headers:this.headers});return{data:n,error:null}}catch(r){if(en(r))return{data:null,error:r};throw r}})}emptyBucket(e){return eE(this,void 0,void 0,function*(){try{let t=yield ep(this.fetch,`${this.url}/bucket/${e}/empty`,{},{headers:this.headers});return{data:t,error:null}}catch(n){if(en(n))return{data:null,error:n};throw n}})}deleteBucket(e){return eE(this,void 0,void 0,function*(){try{let t=yield e_(this.fetch,`${this.url}/bucket/${e}`,{},{headers:this.headers});return{data:t,error:null}}catch(n){if(en(n))return{data:null,error:n};throw n}})}}class eS extends ew{constructor(e,t={},n){super(e,t,n)}from(e){return new ev(this.url,this.headers,e,this.fetch)}}let ex=e=>{let t;return t=e||("undefined"==typeof fetch?j():fetch),(...e)=>t(...e)},eT=()=>"undefined"==typeof Headers?O.Headers:Headers,ek=(e,t,n)=>{let r=ex(n),i=eT();return(n,s)=>{var a,o,l,u;return a=void 0,o=void 0,l=void 0,u=function*(){var a;let o=null!==(a=yield t())&&void 0!==a?a:e,l=new i(null==s?void 0:s.headers);return l.has("apikey")||l.set("apikey",e),l.has("Authorization")||l.set("Authorization",`Bearer ${o}`),r(n,Object.assign(Object.assign({},s),{headers:l}))},new(l||(l=Promise))(function(e,t){function n(e){try{i(u.next(e))}catch(n){t(n)}}function r(e){try{i(u.throw(e))}catch(n){t(n)}}function i(t){var i;t.done?e(t.value):((i=t.value)instanceof l?i:new l(function(e){e(i)})).then(n,r)}i((u=u.apply(a,o||[])).next())})}};
17var eR=function(e,t,n,r){return new(n||(n=Promise))(function(i,s){function a(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?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,o)}l((r=r.apply(e,t||[])).next())})};let eO=()=>"undefined"!=typeof document;function ej(e,t){var n;t||(t=(null===(n=null==window?void 0:window.location)||void 0===n?void 0:n.href)||""),e=e.replace(/[\[\]]/g,"\\$&");let r=RegExp("[?&#]"+e+"(=([^&#]*)|&|#|$)"),i=r.exec(t);return i?i[2]?decodeURIComponent(i[2].replace(/\+/g," ")):"":null}let eN=e=>{let t;return t=e||("undefined"==typeof fetch?(...e)=>eR(void 0,void 0,void 0,function*(){return yield(yield Promise.resolve().then(n.t.bind(n,4098,23))).fetch(...e)}):fetch),(...e)=>t(...e)},eD=e=>"object"==typeof e&&null!==e&&"status"in e&&"ok"in e&&"json"in e&&"function"==typeof e.json,eC=(e,t,n)=>eR(void 0,void 0,void 0,function*(){yield e.setItem(t,JSON.stringify(n))}),eP=(e,t)=>eR(void 0,void 0,void 0,function*(){let n=yield e.getItem(t);if(!n)return null;try{return JSON.parse(n)}catch(r){return n}}),eA=(e,t)=>eR(void 0,void 0,void 0,function*(){yield e.removeItem(t)});class eI{constructor(){this.promise=new eI.promiseConstructor((e,t)=>{this.resolve=e,this.reject=t})}}function e$(e){let t=e.split(".");if(3!==t.length)throw Error("JWT is not valid: not a JWT structure");if(!/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}=?$|[a-z0-9_-]{2}(==)?$)$/i.test(t[1]))throw Error("JWT is not valid: payload is not in base64url format");let n=t[1];return JSON.parse(function(e){let t,n,r,i,s,a,o;let l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",u="",c=0;for(e=e.replace("-","+").replace("_","/");c<e.length;)i=l.indexOf(e.charAt(c++)),s=l.indexOf(e.charAt(c++)),a=l.indexOf(e.charAt(c++)),o=l.indexOf(e.charAt(c++)),t=i<<2|s>>4,n=(15&s)<<4|a>>2,r=(3&a)<<6|o,u+=String.fromCharCode(t),64!=a&&0!=n&&(u+=String.fromCharCode(n)),64!=o&&0!=r&&(u+=String.fromCharCode(r));return u}(n))}eI.promiseConstructor=Promise;class eU extends Error{constructor(e,t){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=t}}function eB(e){return"object"==typeof e&&null!==e&&"__isAuthError"in e}class eL extends eU{constructor(e,t){super(e,t),this.name="AuthApiError",this.status=t}toJSON(){return{name:this.name,message:this.message,status:this.status}}}class eG extends eU{constructor(e,t){super(e),this.name="AuthUnknownError",this.originalError=t}}class ez extends eU{constructor(e,t,n){super(e),this.name=t,this.status=n}toJSON(){return{name:this.name,message:this.message,status:this.status}}}class eM extends ez{constructor(){super("Auth session missing!","AuthSessionMissingError",400)}}class eY extends ez{constructor(e){super(e,"AuthInvalidCredentialsError",400)}}class eZ extends ez{constructor(e,t=null){super(e,"AuthImplicitGrantRedirectError",500),this.details=null,this.details=t}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class eF extends ez{constructor(e,t){super(e,"AuthRetryableFetchError",t)}}var eH=function(e,t,n,r){return new(n||(n=Promise))(function(i,s){function a(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?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,o)}l((r=r.apply(e,t||[])).next())})},eq=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};let eV=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),eJ=(e,t)=>eH(void 0,void 0,void 0,function*(){eD(e)?[502,503,504].includes(e.status)?t(new eF(eV(e),e.status)):e.json().then(n=>{t(new eL(eV(n),e.status||500))}).catch(e=>{t(new eG(eV(e),e))}):t(new eF(eV(e),0))}),eW=(e,t,n,r)=>{let i={method:e,headers:(null==t?void 0:t.headers)||{}};return"GET"===e?i:(i.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},null==t?void 0:t.headers),i.body=JSON.stringify(r),Object.assign(Object.assign({},i),n))};function eK(e,t,n,r){var i;return eH(this,void 0,void 0,function*(){let s=Object.assign({},null==r?void 0:r.headers);(null==r?void 0:r.jwt)&&(s.Authorization=`Bearer ${r.jwt}`);let a=null!==(i=null==r?void 0:r.query)&&void 0!==i?i:{};(null==r?void 0:r.redirectTo)&&(a.redirect_to=r.redirectTo);let o=Object.keys(a).length?"?"+new URLSearchParams(a).toString():"",l=yield function(e,t,n,r,i,s){return eH(this,void 0,void 0,function*(){return new Promise((a,o)=>{e(n,eW(t,r,i,s)).then(e=>{if(!e.ok)throw e;return(null==r?void 0:r.noResolveJson)?e:e.json()}).then(e=>a(e)).catch(e=>eJ(e,o))})})}(e,t,n+o,{headers:s,noResolveJson:null==r?void 0:r.noResolveJson},{},null==r?void 0:r.body);return(null==r?void 0:r.xform)?null==r?void 0:r.xform(l):{data:Object.assign({},l),error:null}})}function eX(e){var t;let n=null;e.access_token&&e.refresh_token&&e.expires_in&&((n=Object.assign({},e)).expires_at=function(e){let t=Math.round(Date.now()/1e3);return t+e}(e.expires_in));let r=null!==(t=e.user)&&void 0!==t?t:e;return{data:{session:n,user:r},error:null}}function eQ(e){var t;let n=null!==(t=e.user)&&void 0!==t?t:e;return{data:{user:n},error:null}}function e0(e){return{data:e,error:null}}function e1(e){let{action_link:t,email_otp:n,hashed_token:r,redirect_to:i,verification_type:s}=e,a=eq(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),o=Object.assign({},a);return{data:{properties:{action_link:t,email_otp:n,hashed_token:r,redirect_to:i,verification_type:s},user:o},error:null}}function e2(e){return e}
17var e3=function(e,t,n,r){return new(n||(n=Promise))(function(i,s){function a(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?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,o)}l((r=r.apply(e,t||[])).next())})},e4=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};class e5{constructor({url:e="",headers:t={},fetch:n}){this.url=e,this.headers=t,this.fetch=eN(n),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)}}signOut(e){return e3(this,void 0,void 0,function*(){try{return yield eK(this.fetch,"POST",`${this.url}/logout`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(t){if(eB(t))return{data:null,error:t};throw t}})}inviteUserByEmail(e,t={}){return e3(this,void 0,void 0,function*(){try{return yield eK(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:t.data},headers:this.headers,redirectTo:t.redirectTo,xform:eQ})}catch(n){if(eB(n))return{data:{user:null},error:n};throw n}})}generateLink(e){return e3(this,void 0,void 0,function*(){try{let{options:t}=e,n=e4(e,["options"]),r=Object.assign(Object.assign({},n),t);return"newEmail"in n&&(r.new_email=null==n?void 0:n.newEmail,delete r.newEmail),yield eK(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:r,headers:this.headers,xform:e1,redirectTo:null==t?void 0:t.redirectTo})}catch(i){if(eB(i))return{data:{properties:null,user:null},error:i};throw i}})}createUser(e){return e3(this,void 0,void 0,function*(){try{return yield eK(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:eQ})}catch(t){if(eB(t))return{data:{user:null},error:t};throw t}})}listUsers(e){var t,n,r,i,s,a,o;return e3(this,void 0,void 0,function*(){try{let l={nextPage:null,lastPage:0,total:0},u=yield eK(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:null!==(n=null===(t=null==e?void 0:e.page)||void 0===t?void 0:t.toString())&&void 0!==n?n:"",per_page:null!==(i=null===(r=null==e?void 0:e.perPage)||void 0===r?void 0:r.toString())&&void 0!==i?i:""},xform:e2});if(u.error)throw u.error;let c=yield u.json(),d=null!==(s=u.headers.get("x-total-count"))&&void 0!==s?s:0,h=null!==(o=null===(a=u.headers.get("link"))||void 0===a?void 0:a.split(","))&&void 0!==o?o:[];return h.length>0&&(h.forEach(e=>{let t=parseInt(e.split(";")[0].split("=")[1].substring(0,1)),n=JSON.parse(e.split(";")[1].split("=")[1]);l[`${n}Page`]=t}),l.total=parseInt(d)),{data:Object.assign(Object.assign({},c),l),error:null}}catch(f){if(eB(f))return{data:{users:[]},error:f};throw f}})}getUserById(e){return e3(this,void 0,void 0,function*(){try{return yield eK(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:eQ})}catch(t){if(eB(t))return{data:{user:null},error:t};throw t}})}updateUserById(e,t){return e3(this,void 0,void 0,function*(){try{return yield eK(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:t,headers:this.headers,xform:eQ})}catch(n){if(eB(n))return{data:{user:null},error:n};throw n}})}deleteUser(e,t=!1){return e3(this,void 0,void 0,function*(){try{return yield eK(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:t},xform:eQ})}catch(n){if(eB(n))return{data:{user:null},error:n};throw n}})}_listFactors(e){return e3(this,void 0,void 0,function*(){try{let{data:t,error:n}=yield eK(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:e=>({data:{factors:e},error:null})});return{data:t,error:n}}catch(r){if(eB(r))return{data:null,error:r};throw r}})}_deleteFactor(e){return e3(this,void 0,void 0,function*(){try{let t=yield eK(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers});return{data:t,error:null}}catch(n){if(eB(n))return{data:null,error:n};throw n}})}}var e8={getItem:e=>eO()?globalThis.localStorage.getItem(e):null,setItem(e,t){eO()&&globalThis.localStorage.setItem(e,t)},removeItem(e){eO()&&globalThis.localStorage.removeItem(e)}}
17,e6=function(e,t,n,r){return new(n||(n=Promise))(function(i,s){function a(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?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,o)}l((r=r.apply(e,t||[])).next())})};!function(){if("object"!=typeof globalThis)try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch(e){"undefined"!=typeof self&&(self.globalThis=self)}}();let e9={url:"http://localhost:9999",storageKey:"supabase.auth.token",autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:{"X-Client-Info":"gotrue-js/2.11.0"}};class e7{constructor(e){this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.broadcastChannel=null;let t=Object.assign(Object.assign({},e9),e);this.inMemorySession=null,this.storageKey=t.storageKey,this.autoRefreshToken=t.autoRefreshToken,this.persistSession=t.persistSession,this.storage=t.storage||e8,this.admin=new e5({url:t.url,headers:t.headers,fetch:t.fetch}),this.url=t.url,this.headers=t.headers,this.fetch=eN(t.fetch),this.detectSessionInUrl=t.detectSessionInUrl,this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this)},eO()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey&&(this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey),this.broadcastChannel.addEventListener("message",e=>{this._notifyAllSubscribers(e.data.event,e.data.session,!1)})),this.initialize()}initialize(){return this.initializePromise||(this.initializePromise=this._initialize()),this.initializePromise}_initialize(){return e6(this,void 0,void 0,function*(){if(this.initializePromise)return this.initializePromise;try{if(this.detectSessionInUrl&&this._isImplicitGrantFlow()){let{data:e,error:t}=yield this._getSessionFromUrl();if(t)return yield this._removeSession(),{error:t};let{session:n,redirectType:r}=e;return yield this._saveSession(n),this._notifyAllSubscribers("SIGNED_IN",n),"recovery"===r&&this._notifyAllSubscribers("PASSWORD_RECOVERY",n),{error:null}}return yield this._recoverAndRefresh(),{error:null}}catch(i){if(eB(i))return{error:i};return{error:new eG("Unexpected error during initialization",i)}}finally{yield this._handleVisibilityChange()}})}signUp(e){var t,n;return e6(this,void 0,void 0,function*(){try{let r;if(yield this._removeSession(),"email"in e){let{email:i,password:s,options:a}=e;r=yield eK(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:null==a?void 0:a.emailRedirectTo,body:{email:i,password:s,data:null!==(t=null==a?void 0:a.data)&&void 0!==t?t:{},gotrue_meta_security:{captcha_token:null==a?void 0:a.captchaToken}},xform:eX})}else if("phone"in e){let{phone:o,password:l,options:u}=e;r=yield eK(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:o,password:l,data:null!==(n=null==u?void 0:u.data)&&void 0!==n?n:{},gotrue_meta_security:{captcha_token:null==u?void 0:u.captchaToken}},xform:eX})}else throw new eY("You must provide either an email or phone number and a password");let{data:c,error:d}=r;if(d||!c)return{data:{user:null,session:null},error:d};let h=c.session,f=c.user;return c.session&&(yield this._saveSession(c.session),this._notifyAllSubscribers("SIGNED_IN",h)),{data:{user:f,session:h},error:null}}catch(p){if(eB(p))return{data:{user:null,session:null},error:p};throw p}})}signInWithPassword(e){var t,n;return e6(this,void 0,void 0,function*(){try{let r;if(yield this._removeSession(),"email"in e){let{email:i,password:s,options:a}=e;r=yield eK(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:i,password:s,data:null!==(t=null==a?void 0:a.data)&&void 0!==t?t:{},gotrue_meta_security:{captcha_token:null==a?void 0:a.captchaToken}},xform:eX})}else if("phone"in e){let{phone:o,password:l,options:u}=e;r=yield eK(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:o,password:l,data:null!==(n=null==u?void 0:u.data)&&void 0!==n?n:{},gotrue_meta_security:{captcha_token:null==u?void 0:u.captchaToken}},xform:eX})}else throw new eY("You must provide either an email or phone number and a password");let{data:c,error:d}=r;if(d||!c)return{data:{user:null,session:null},error:d};return c.session&&(yield this._saveSession(c.session),this._notifyAllSubscribers("SIGNED_IN",c.session)),{data:c,error:d}}catch(h){if(eB(h))return{data:{user:null,session:null},error:h};throw h}})}signInWithOAuth(e){var t,n,r,i;return e6(this,void 0,void 0,function*(){return yield this._removeSession(),this._handleProviderSignIn(e.provider,{redirectTo:null===(t=e.options)||void 0===t?void 0:t.redirectTo,scopes:null===(n=e.options)||void 0===n?void 0:n.scopes,queryParams:null===(r=e.options)||void 0===r?void 0:r.queryParams,skipBrowserRedirect:null===(i=e.options)||void 0===i?void 0:i.skipBrowserRedirect})})}signInWithOtp(e){var t,n,r,i;return e6(this,void 0,void 0,function*(){try{if(yield this._removeSession(),"email"in e){let{email:s,options:a}=e,{error:o}=yield eK(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:s,data:null!==(t=null==a?void 0:a.data)&&void 0!==t?t:{}
17,create_user:null===(n=null==a?void 0:a.shouldCreateUser)||void 0===n||n,gotrue_meta_security:{captcha_token:null==a?void 0:a.captchaToken}},redirectTo:null==a?void 0:a.emailRedirectTo});return{data:{user:null,session:null},error:o}}if("phone"in e){let{phone:l,options:u}=e,{error:c}=yield eK(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:l,data:null!==(r=null==u?void 0:u.data)&&void 0!==r?r:{},create_user:null===(i=null==u?void 0:u.shouldCreateUser)||void 0===i||i,gotrue_meta_security:{captcha_token:null==u?void 0:u.captchaToken}}});return{data:{user:null,session:null},error:c}}throw new eY("You must provide either an email or phone number.")}catch(d){if(eB(d))return{data:{user:null,session:null},error:d};throw d}})}verifyOtp(e){var t,n;return e6(this,void 0,void 0,function*(){try{yield this._removeSession();let{data:r,error:i}=yield eK(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:null===(t=e.options)||void 0===t?void 0:t.captchaToken}}),redirectTo:null===(n=e.options)||void 0===n?void 0:n.redirectTo,xform:eX});if(i)throw i;if(!r)throw"An error occurred on token verification.";let s=r.session,a=r.user;return(null==s?void 0:s.access_token)&&(yield this._saveSession(s),this._notifyAllSubscribers("SIGNED_IN",s)),{data:{user:a,session:s},error:null}}catch(o){if(eB(o))return{data:{user:null,session:null},error:o};throw o}})}signInWithSSO(e){var t,n,r;return e6(this,void 0,void 0,function*(){try{return yield this._removeSession(),yield eK(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in e?{provider_id:e.providerId}:null),"domain"in e?{domain:e.domain}:null),{redirect_to:null!==(n=null===(t=e.options)||void 0===t?void 0:t.redirectTo)&&void 0!==n?n:void 0}),(null===(r=null==e?void 0:e.options)||void 0===r?void 0:r.captchaToken)?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0}),headers:this.headers,xform:e0})}catch(i){if(eB(i))return{data:null,error:i};throw i}})}getSession(){return e6(this,void 0,void 0,function*(){yield this.initializePromise;let e=null;if(this.persistSession){let t=yield eP(this.storage,this.storageKey);null!==t&&(this._isValidSession(t)?e=t:yield this._removeSession())}else e=this.inMemorySession;if(!e)return{data:{session:null},error:null};let n=!!e.expires_at&&e.expires_at<=Date.now()/1e3;if(!n)return{data:{session:e},error:null};let{session:r,error:i}=yield this._callRefreshToken(e.refresh_token);return i?{data:{session:null},error:i}:{data:{session:r},error:null}})}getUser(e){var t,n;return e6(this,void 0,void 0,function*(){try{if(!e){let{data:r,error:i}=yield this.getSession();if(i)throw i;e=null!==(n=null===(t=r.session)||void 0===t?void 0:t.access_token)&&void 0!==n?n:void 0}return yield eK(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:eQ})}catch(s){if(eB(s))return{data:{user:null},error:s};throw s}})}updateUser(e){return e6(this,void 0,void 0,function*(){try{let{data:t,error:n}=yield this.getSession();if(n)throw n;if(!t.session)throw new eM;let r=t.session,{data:i,error:s}=yield eK(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,body:e,jwt:r.access_token,xform:eQ});if(s)throw s;return r.user=i.user,yield this._saveSession(r),this._notifyAllSubscribers("USER_UPDATED",r),{data:{user:r.user},error:null}}catch(a){if(eB(a))return{data:{user:null},error:a};throw a}})}_decodeJWT(e){return e$(e)}setSession(e){return e6(this,void 0,void 0,function*(){try{if(!e.access_token||!e.refresh_token)throw new eM;let t=Date.now()/1e3,n=t,r=!0,i=null,s=e$(e.access_token);if(s.exp&&(r=(n=s.exp)<=t),r){let{session:a,error:o}=yield this._callRefreshToken(e.refresh_token);if(o)return{data:{user:null,session:null},error:o};if(!a)return{data:{user:null,session:null},error:null};i=a}else{let{data:l,error:u}=yield this.getUser(e.access_token);if(u)throw u;yield this._saveSession(i={access_token:e.access_token,refresh_token:e.refresh_token,user:l.user,token_type:"bearer",expires_in:n-t,expires_at:n}),this._notifyAllSubscribers("SIGNED_IN",i)}return{data:{user:i.user,session:i},error:null}}catch(c){if(eB(c))return{data:{session:null,user:null},error:c};throw c}})}refreshSession(e){var t;return e6(this,void 0,void 0,function*(){try{if(!e){let{data:n,error:r}
17=yield this.getSession();if(r)throw r;e=null!==(t=n.session)&&void 0!==t?t:void 0}if(!(null==e?void 0:e.refresh_token))throw new eM;let{session:i,error:s}=yield this._callRefreshToken(e.refresh_token);if(s)return{data:{user:null,session:null},error:s};if(!i)return{data:{user:null,session:null},error:null};return{data:{user:i.user,session:i},error:null}}catch(a){if(eB(a))return{data:{user:null,session:null},error:a};throw a}})}_getSessionFromUrl(){return e6(this,void 0,void 0,function*(){try{if(!eO())throw new eZ("No browser detected.");if(!this._isImplicitGrantFlow())throw new eZ("Not a valid implicit grant flow url.");let e=ej("error_description");if(e){let t=ej("error_code");if(!t)throw new eZ("No error_code detected.");let n=ej("error");if(!n)throw new eZ("No error detected.");throw new eZ(e,{error:n,code:t})}let r=ej("provider_token"),i=ej("provider_refresh_token"),s=ej("access_token");if(!s)throw new eZ("No access_token detected.");let a=ej("expires_in");if(!a)throw new eZ("No expires_in detected.");let o=ej("refresh_token");if(!o)throw new eZ("No refresh_token detected.");let l=ej("token_type");if(!l)throw new eZ("No token_type detected.");let u=Math.round(Date.now()/1e3),c=u+parseInt(a),{data:d,error:h}=yield this.getUser(s);if(h)throw h;let f=d.user,p={provider_token:r,provider_refresh_token:i,access_token:s,expires_in:parseInt(a),expires_at:c,refresh_token:o,token_type:l,user:f},_=ej("type");return window.location.hash="",{data:{session:p,redirectType:_},error:null}}catch(m){if(eB(m))return{data:{session:null,redirectType:null},error:m};throw m}})}_isImplicitGrantFlow(){return eO()&&(Boolean(ej("access_token"))||Boolean(ej("error_description")))}signOut(){var e;return e6(this,void 0,void 0,function*(){let{data:t,error:n}=yield this.getSession();if(n)return{error:n};let r=null===(e=t.session)||void 0===e?void 0:e.access_token;if(r){let{error:i}=yield this.admin.signOut(r);if(i&&!(eB(i)&&"AuthApiError"===i.name&&(404===i.status||401===i.status)))return{error:i}}return yield this._removeSession(),this._notifyAllSubscribers("SIGNED_OUT",null),{error:null}})}onAuthStateChange(e){let t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){let t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)}),n={id:t,callback:e,unsubscribe:()=>{this.stateChangeEmitters.delete(t)}};return this.stateChangeEmitters.set(t,n),{data:{subscription:n}}}resetPasswordForEmail(e,t={}){return e6(this,void 0,void 0,function*(){try{return yield eK(this.fetch,"POST",`${this.url}/recover`,{body:{email:e,gotrue_meta_security:{captcha_token:t.captchaToken}},headers:this.headers,redirectTo:t.redirectTo})}catch(n){if(eB(n))return{data:null,error:n};throw n}})}_refreshAccessToken(e){return e6(this,void 0,void 0,function*(){try{let t=Date.now();return yield function(e,t){let n=new Promise((n,r)=>{eR(this,void 0,void 0,function*(){for(let i=0;i<1/0;i++)try{let s=yield e(i);if(!t(i,null,s)){n(s);return}}catch(a){if(!t(i,a)){r(a);return}}})});return n}(t=>e6(this,void 0,void 0,function*(){var n;return yield(n=200*t,new Promise(e=>{setTimeout(()=>e(null),n)})),yield eK(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:eX})}),(e,n,r)=>r&&r.error&&r.error instanceof eF&&Date.now()+(e+1)*200-t<1e4)}catch(n){if(eB(n))return{data:{session:null,user:null},error:n};throw n}})}_isValidSession(e){return"object"==typeof e&&null!==e&&"access_token"in e&&"refresh_token"in e&&"expires_at"in e}_handleProviderSignIn(e,t={}){let n=this._getUrlForProvider(e,{redirectTo:t.redirectTo,scopes:t.scopes,queryParams:t.queryParams});return eO()&&!t.skipBrowserRedirect&&window.location.assign(n),{data:{provider:e,url:n},error:null}}_recoverAndRefresh(){var e;return e6(this,void 0,void 0,function*(){try{let t=yield eP(this.storage,this.storageKey);if(!this._isValidSession(t)){null!==t&&(yield this._removeSession());return}let n=Math.round(Date.now()/1e3);if((null!==(e=t.expires_at)&&void 0!==e?e:1/0)<n+10){if(this.autoRefreshToken&&t.refresh_token){let{error:r}=yield this._callRefreshToken(t.refresh_token);r&&(console.log(r.message),yield this._removeSession())}else yield this._removeSession()}else this.persistSession&&(yield this._saveSession(t)),this._notifyAllSubscribers("SIGNED_IN",t)}catch(i){console.error(i);return}})}_callRefreshToken(e){var t,n;return e6(this,void 0,void 0,function*(){if(this.refreshingDeferred)return this.refreshingDeferred.promise;try{if(this.refreshingDeferred=new eI,!e)throw new eM;let{data:r,error:i}=yield this._refreshAccessToken(e);if(i)throw i;if(!r.session)throw new eM;yield this._saveSession(r.session),this._notifyAllSubscribers("TOKEN_REFRESHED",r.session);let s={session:r.session,error:null};return this.refreshingDeferred.resolve(s),s}catch(o){if(eB(o)){let a={session:null,error:o};return null===(t=this.refreshingDeferred)||void 0===t||t.resolve(a),a}throw null===(n=this.refreshingDeferred)||void 0===n||n.reject(o),o}finally{this.refreshingDeferred=null}})}_notifyAllSubscribers(e,t,n=!0){this.broadcastChannel&&n&&this.broadcastChannel.postMessage({event:e,session:t}
17),this.stateChangeEmitters.forEach(n=>n.callback(e,t))}_saveSession(e){return e6(this,void 0,void 0,function*(){this.persistSession||(this.inMemorySession=e),this.persistSession&&e.expires_at&&(yield this._persistSession(e))})}_persistSession(e){return eC(this.storage,this.storageKey,e)}_removeSession(){return e6(this,void 0,void 0,function*(){this.persistSession?yield eA(this.storage,this.storageKey):this.inMemorySession=null})}_removeVisibilityChangedCallback(){let e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&eO()&&(null==window?void 0:window.removeEventListener)&&window.removeEventListener("visibilitychange",e)}catch(t){console.error("removing visibilitychange callback failed",t)}}_startAutoRefresh(){return e6(this,void 0,void 0,function*(){yield this._stopAutoRefresh();let e=setInterval(()=>this._autoRefreshTokenTick(),1e4);this.autoRefreshTicker=e,e&&"object"==typeof e&&"function"==typeof e.unref&&e.unref(),yield this._autoRefreshTokenTick()})}_stopAutoRefresh(){return e6(this,void 0,void 0,function*(){let e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e)})}startAutoRefresh(){return e6(this,void 0,void 0,function*(){this._removeVisibilityChangedCallback(),yield this._startAutoRefresh()})}stopAutoRefresh(){return e6(this,void 0,void 0,function*(){this._removeVisibilityChangedCallback(),yield this._stopAutoRefresh()})}_autoRefreshTokenTick(){return e6(this,void 0,void 0,function*(){let e=Date.now();try{let{data:{session:t},error:n}=yield this.getSession();if(!t||!t.refresh_token||!t.expires_at)return;let r=Math.floor((1e3*t.expires_at-e)/1e4);r<3&&(yield this._callRefreshToken(t.refresh_token))}catch(i){console.error("Auto refresh tick failed with error. This is likely a transient error.",i)}})}_handleVisibilityChange(){return e6(this,void 0,void 0,function*(){if(!eO()||!(null==window?void 0:window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=()=>e6(this,void 0,void 0,function*(){return yield this._onVisibilityChanged(!1)}),null==window||window.addEventListener("visibilitychange",this.visibilityChangedCallback),yield this._onVisibilityChanged(!0)}catch(e){console.error("_handleVisibilityChange",e)}})}_onVisibilityChanged(e){return e6(this,void 0,void 0,function*(){"visible"===document.visibilityState?(e||(yield this.initializePromise,yield this._recoverAndRefresh()),this.autoRefreshToken&&this._startAutoRefresh()):"hidden"===document.visibilityState&&this.autoRefreshToken&&this._stopAutoRefresh()})}_getUrlForProvider(e,t){let n=[`provider=${encodeURIComponent(e)}`];if((null==t?void 0:t.redirectTo)&&n.push(`redirect_to=${encodeURIComponent(t.redirectTo)}`),(null==t?void 0:t.scopes)&&n.push(`scopes=${encodeURIComponent(t.scopes)}`),null==t?void 0:t.queryParams){let r=new URLSearchParams(t.queryParams);n.push(r.toString())}return`${this.url}/authorize?${n.join("&")}`}_unenroll(e){var t;return e6(this,void 0,void 0,function*(){try{let{data:n,error:r}=yield this.getSession();if(r)return{data:null,error:r};return yield eK(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:null===(t=null==n?void 0:n.session)||void 0===t?void 0:t.access_token})}catch(i){if(eB(i))return{data:null,error:i};throw i}})}_enroll(e){var t,n;return e6(this,void 0,void 0,function*(){try{let{data:r,error:i}=yield this.getSession();if(i)return{data:null,error:i};let{data:s,error:a}=yield eK(this.fetch,"POST",`${this.url}/factors`,{body:{friendly_name:e.friendlyName,factor_type:e.factorType,issuer:e.issuer},headers:this.headers,jwt:null===(t=null==r?void 0:r.session)||void 0===t?void 0:t.access_token});if(a)return{data:null,error:a};return(null===(n=null==s?void 0:s.totp)||void 0===n?void 0:n.qr_code)&&(s.totp.qr_code=`data:image/svg+xml;utf-8,${s.totp.qr_code}`),{data:s,error:null}}catch(o){if(eB(o))return{data:null,error:o};throw o}})}_verify(e){var t;return e6(this,void 0,void 0,function*(){try{let{data:n,error:r}=yield this.getSession();if(r)return{data:null,error:r};let{data:i,error:s}=yield eK(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:{code:e.code,challenge_id:e.challengeId},headers:this.headers,jwt:null===(t=null==n?void 0:n.session)||void 0===t?void 0:t.access_token});if(s)return{data:null,error:s};return yield this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+i.expires_in},i)),this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",i),{data:i,error:s}}catch(a){if(eB(a))return{data:null,error:a};throw a}})}_challenge(e){var t;return e6(this,void 0,void 0,function*(){try{let{data:n,error:r}
17=yield this.getSession();if(r)return{data:null,error:r};return yield eK(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{headers:this.headers,jwt:null===(t=null==n?void 0:n.session)||void 0===t?void 0:t.access_token})}catch(i){if(eB(i))return{data:null,error:i};throw i}})}_challengeAndVerify(e){return e6(this,void 0,void 0,function*(){let{data:t,error:n}=yield this._challenge({factorId:e.factorId});return n?{data:null,error:n}:yield this._verify({factorId:e.factorId,challengeId:t.id,code:e.code})})}_listFactors(){return e6(this,void 0,void 0,function*(){let{data:{user:e},error:t}=yield this.getUser();if(t)return{data:null,error:t};let n=(null==e?void 0:e.factors)||[],r=n.filter(e=>"totp"===e.factor_type&&"verified"===e.status);return{data:{all:n,totp:r},error:null}})}_getAuthenticatorAssuranceLevel(){var e,t;return e6(this,void 0,void 0,function*(){let{data:{session:n},error:r}=yield this.getSession();if(r)return{data:null,error:r};if(!n)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};let i=this._decodeJWT(n.access_token),s=null;i.aal&&(s=i.aal);let a=s,o=null!==(t=null===(e=n.user.factors)||void 0===e?void 0:e.filter(e=>"verified"===e.status))&&void 0!==t?t:[];o.length>0&&(a="aal2");let l=i.amr||[];return{data:{currentLevel:s,nextLevel:a,currentAuthenticationMethods:l},error:null}})}}class te extends e7{constructor(e){super(e)}}let tt={headers:{"X-Client-Info":"supabase-js/2.7.1"}},tn={schema:"public"},tr={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0},ti={},ts=new class{constructor(e,t,n){var r,i,s,a,o,l,u,c;if(this.supabaseUrl=e,this.supabaseKey=t,!e)throw Error("supabaseUrl is required.");if(!t)throw Error("supabaseKey is required.");let d=e.replace(/\/$/,"");this.realtimeUrl=`${d}/realtime/v1`.replace(/^http/i,"ws"),this.authUrl=`${d}/auth/v1`,this.storageUrl=`${d}/storage/v1`;let h=d.match(/(supabase\.co)|(supabase\.in)/);if(h){let f=d.split(".");this.functionsUrl=`${f[0]}.functions.${f[1]}.${f[2]}`}else this.functionsUrl=`${d}/functions/v1`;let p=`sb-${new URL(this.authUrl).hostname.split(".")[0]}-auth-token`,_={db:tn,realtime:ti,auth:Object.assign(Object.assign({},tr),{storageKey:p}),global:tt},m=function(e,t){let{db:n,auth:r,realtime:i,global:s}=e,{db:a,auth:o,realtime:l,global:u}=t;return{db:Object.assign(Object.assign({},a),n),auth:Object.assign(Object.assign({},o),r),realtime:Object.assign(Object.assign({},l),i),global:Object.assign(Object.assign({},u),s)}}(null!=n?n:{},_);this.storageKey=null!==(i=null===(r=m.auth)||void 0===r?void 0:r.storageKey)&&void 0!==i?i:"",this.headers=null!==(a=null===(s=m.global)||void 0===s?void 0:s.headers)&&void 0!==a?a:{},this.auth=this._initSupabaseAuthClient(null!==(o=m.auth)&&void 0!==o?o:{},this.headers,null===(l=m.global)||void 0===l?void 0:l.fetch),this.fetch=ek(t,this._getAccessToken.bind(this),null===(u=m.global)||void 0===u?void 0:u.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers},m.realtime)),this.rest=new I(`${d}/rest/v1`,{headers:this.headers,schema:null===(c=m.db)||void 0===c?void 0:c.schema,fetch:this.fetch}),this._listenForAuthEvents()}get functions(){return new l(this.functionsUrl,{headers:this.headers,customFetch:this.fetch})}get storage(){return new eS(this.storageUrl,this.headers,this.fetch)}from(e){return this.rest.from(e)}rpc(e,t={},n){return this.rest.rpc(e,t,n)}channel(e,t={config:{}}){return this.realtime.channel(e,t)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}_getAccessToken(){var e,t,n,r,i,s;return n=this,r=void 0,i=void 0,s=function*(){let{data:n}=yield this.auth.getSession();return null!==(t=null===(e=n.session)||void 0===e?void 0:e.access_token)&&void 0!==t?t:null},new(i||(i=Promise))(function(e,t){function a(e){try{l(s.next(e))}catch(n){t(n)}}function o(e){try{l(s.throw(e))}catch(n){t(n)}}function l(t){var n;t.done?e(t.value):((n=t.value)instanceof i?n:new i(function(e){e(n)})).then(a,o)}l((s=s.apply(n,r||[])).next())})}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:n,storage:r,storageKey:i},s,a){let o={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new te({url:this.authUrl,headers:Object.assign(Object.assign({},o),s),storageKey:i,autoRefreshToken:e,persistSession:t,detectSessionInUrl:n,storage:r,fetch:a})}_initRealtimeClient(e){return new ee(this.realtimeUrl,Object.assign(Object.assign({},e),{params:Object.assign({apikey:this.supabaseKey},null==e?void 0:e.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((e,t)=>{this._handleTokenChanged(e,null==t?void 0:t.access_token,"CLIENT")})}_handleTokenChanged(e,t,n){("TOKEN_REFRESHED"===e||"SIGNED_IN"===e)&&this.changedAccessToken!==t?(this.realtime.setAuth(null!=t?t:null),this.changedAccessToken=t):("SIGNED_OUT"===e||"USER_DELET
17ED"===e)&&(this.realtime.setAuth(this.supabaseKey),"STORAGE"==n&&this.auth.signOut(),this.changedAccessToken=void 0)}}("https://ctcensyqhcmqcmatpytk.supabase.co","eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImN0Y2Vuc3lxaGNtcWNtYXRweXRrIiwicm9sZSI6ImFub24iLCJpYXQiOjE2ODA5NzI4OTAsImV4cCI6MTk5NjU0ODg5MH0.R7Nli6bldo4H-vM125-hhAtOh7rkG_9YKcrZ74pRBoE",void 0);var ta=ts},2983:function(e,t,n){"use strict";n.d(t,{C:function(){return r}});let r=e=>"https://".concat("magic-events.gg")+e},2968:function(){},7663:function(e){!function(){var t={229:function(e){var t,n,r,i=e.exports={};function s(){throw Error("setTimeout has not been defined")}function a(){throw Error("clearTimeout has not been defined")}function o(e){if(t===setTimeout)return setTimeout(e,0);if((t===s||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:s}catch(e){t=s}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(r){n=a}}();var l=[],u=!1,c=-1;function d(){u&&r&&(u=!1,r.length?l=r.concat(l):c=-1,l.length&&h())}function h(){if(!u){var e=o(d);u=!0;for(var t=l.length;t;){for(r=l,l=[];++c<t;)r&&r[c].run();c=-1,t=l.length}r=null,u=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===a||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(r){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function f(e,t){this.fun=e,this.array=t}function p(){}i.nextTick=function(e){var t=Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];l.push(new f(e,t)),1!==l.length||u||o(h)},f.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=p,i.addListener=p,i.once=p,i.off=p,i.removeListener=p,i.removeAllListeners=p,i.emit=p,i.prependListener=p,i.prependOnceListener=p,i.listeners=function(e){return[]},i.binding=function(e){throw Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw Error("process.chdir is not supported")},i.umask=function(){return 0}}},n={};function r(e){var i=n[e];if(void 0!==i)return i.exports;var s=n[e]={exports:{}},a=!0;try{t[e](s,s.exports,r),a=!1}finally{a&&delete n[e]}return s.exports}r.ab="//";var i=r(229);e.exports=i}()},9008:function(e,t,n){e.exports=n(3121)},5675:function(e,t,n){e.exports=n(9749)},1664:function(e,t,n){e.exports=n(1551)},1163:function(e,t,n){e.exports=n(880)},4298:function(e,t,n){e.exports=n(3573)},3250:function(e,t,n){"use strict";/** 18 * @license React 19 * use-sync-external-store-shim.production.min.js 20 * 21 * Copyright (c) Facebook, Inc. and its affiliates. 22 * 23 * This source code is licensed under the MIT license found in the 24 * LICENSE file in the root directory of this source tree. 25 */ var r=n(7294),i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},s=r.useState,a=r.useEffect,o=r.useLayoutEffect,l=r.useDebugValue;function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch(r){return!0}}var c="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=s({inst:{value:n,getSnapshot:t}}),i=r[0].inst,c=r[1];return o(function(){i.value=n,i.getSnapshot=t,u(i)&&c({inst:i})},[e,n,t]),a(function(){return u(i)&&c({inst:i}),e(function(){u(i)&&c({inst:i})})},[e]),l(n),n};t.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:c},1688:function(e,t,n){"use strict";e.exports=n(3250)},5840:function(e,t,n){if("object"==typeof globalThis)i=globalThis;else try{i=n(284)}catch(r){}finally{if(i||"undefined"==typeof window||(i=window),!i)throw Error("Could not determine global this")}var i,s=i.WebSocket||i.MozWebSocket,a=n(9387);function o(e,t){return t?new s(e,t):new s(e)}s&&["CONNECTING","OPEN","CLOSING","CLOSED"].forEach(function(e){Object.defineProperty(o,e,{get:function(){return s[e]}})}),e.exports={w3cwebsocket:s?o:null,version:a}},9387:function(e,t,n){e.exports=n(9794).version},9734:function(e,t,n){"use strict";n.d(t,{J$:function(){return es},ZP:function(){return ea}});var r=n(7294),i=n(1688);let s=new WeakMap,a={},o={},l=()=>{},u=l(),c=Object,d=e=>e===u,h=e=>"function"==typeof e,f=(e,t)=>({...e,...t}),p="undefined",_=typeof window!=p,m=typeof document!=p,g=()=>_&&typeof window.requestAnimationFrame!=p,y=(e,t)=>{let n=s.get(e);return[()=>e.get(t)||a,r=>{if(!d(t)){let i=e.get(t);t in o||(o[t]=i),n[5](t,f(i,r),i||a)}},n[6],()=>!d(t)&&t in o?o[t]:e.get(t)||a]},v=new WeakMap,b=0,E=e=>{let t,n;let r=typeof e,i=e&&e.constructor,s=i==Date;if(c(e)!==e||s||i==RegExp)t=s?e.toJSON():"symbol"==r?e.toString():"string"==r?JSON.stringify(e):""+e;else{if(t=v.get(e))return t;if(t=++b+"~",v.set(e,t),i==Array){for(n=0,t="@";n<e.length;n++)t+=E(e[n])+",";v.set(e,t)}if(i==c){t="#";let a=c.keys(e).sort();for(;!d(n=a.pop());
25)d(e[n])||(t+=n+":"+E(e[n])+",");v.set(e,t)}}return t},w=!0,[S,x]=_&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[l,l],T=()=>{let e=m&&document.visibilityState;return d(e)||"hidden"!==e},k=e=>(m&&document.addEventListener("visibilitychange",e),S("focus",e),()=>{m&&document.removeEventListener("visibilitychange",e),x("focus",e)}),R=e=>{let t=()=>{w=!0,e()},n=()=>{w=!1};return S("online",t),S("offline",n),()=>{x("online",t),x("offline",n)}},O={initFocus:k,initReconnect:R},j=!r.useId,N=!_||"Deno"in window,D=e=>g()?window.requestAnimationFrame(e):setTimeout(e,1),C=N?r.useEffect:r.useLayoutEffect,P="undefined"!=typeof navigator&&navigator.connection,A=!N&&P&&(["slow-2g","2g"].includes(P.effectiveType)||P.saveData),I=e=>{if(h(e))try{e=e()}catch(t){e=""}let n=e;return[e="string"==typeof e?e:(Array.isArray(e)?e.length:e)?E(e):"",n]},$=0,U=()=>++$;var B={__proto__:null,FOCUS_EVENT:0,RECONNECT_EVENT:1,MUTATE_EVENT:2};async function L(...e){let[t,n,r,i]=e,a=f({populateCache:!0,throwOnError:!0},"boolean"==typeof i?{revalidate:i}:i||{}),o=a.populateCache,l=a.rollbackOnError,c=a.optimisticData,p=!1!==a.revalidate,_=e=>"function"==typeof l?l(e):!1!==l,m=a.throwOnError;if(h(n)){let g=[],v=t.keys();for(let b=v.next();!b.done;b=v.next()){let E=b.value;!E.startsWith("$inf$")&&n(t.get(E)._k)&&g.push(E)}return Promise.all(g.map(w))}return w(n);async function w(n){let i;let[a]=I(n);if(!a)return;let[l,f]=y(t,a),[g,v,b]=s.get(t),E=g[a],w=()=>p&&(delete b[a],E&&E[0])?E[0](2).then(()=>l().data):l().data;if(e.length<3)return w();let S=r,x=U();v[a]=[x,0];let T=!d(c),k=l(),R=k.data,O=k._c,j=d(O)?R:O;if(T&&f({data:c=h(c)?c(j):c,_c:j}),h(S))try{S=S(j)}catch(N){i=N}if(S&&h(S.then)){if(S=await S.catch(e=>{i=e}),x!==v[a][0]){if(i)throw i;return S}i&&T&&_(i)&&(o=!0,S=j,f({data:S,_c:u}))}o&&!i&&(h(o)&&(S=o(S,j)),f({data:S,_c:u})),v[a][1]=U();let D=await w();if(f({_c:u}),i){if(m)throw i;return}return o?D:S}}let G=(e,t)=>{for(let n in e)e[n][0]&&e[n][0](t)},z=(e,t)=>{if(!s.has(e)){let n=f(O,t),r={},i=L.bind(u,e),a=l,o={},c=(e,t)=>{let n=o[e]||[];return o[e]=n,n.push(t),()=>n.splice(n.indexOf(t),1)},d=(t,n,r)=>{e.set(t,n);let i=o[t];if(i)for(let s=i.length;s--;)i[s](n,r)},h=()=>{if(!s.has(e)&&(s.set(e,[r,{},{},{},i,d,c]),!N)){let t=n.initFocus(setTimeout.bind(u,G.bind(u,r,0))),o=n.initReconnect(setTimeout.bind(u,G.bind(u,r,1)));a=()=>{t&&t(),o&&o(),s.delete(e)}}};return h(),[e,i,h,a]}return[e,s.get(e)[4]]},M=(e,t,n,r,i)=>{let s=n.errorRetryCount,a=i.retryCount,o=~~((Math.random()+.5)*(1<<(a<8?a:8)))*n.errorRetryInterval;(d(s)||!(a>s))&&setTimeout(r,o,i)},Y=(e,t)=>E(e)==E(t),[Z,F]=z(new Map),H=f({onLoadingSlow:l,onSuccess:l,onError:l,onErrorRetry:M,onDiscarded:l,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:A?1e4:5e3,focusThrottleInterval:5e3,dedupingInterval:2e3,loadingTimeout:A?5e3:3e3,compare:Y,isPaused:()=>!1,cache:Z,mutate:F,fallback:{}},{isOnline:()=>w,isVisible:T}),q=(e,t)=>{let n=f(e,t);if(t){let{use:r,fallback:i}=e,{use:s,fallback:a}=t;r&&s&&(n.use=r.concat(s)),i&&a&&(n.fallback=f(i,a))}return n},V=(0,r.createContext)({}),J=e=>{let{value:t}=e,n=(0,r.useContext)(V),i=h(t),s=(0,r.useMemo)(()=>i?t(n):t,[i,n,t]),a=(0,r.useMemo)(()=>i?s:q(n,s),[i,n,s]),o=s&&s.provider,[l]=(0,r.useState)(()=>o?z(o(a.cache||Z),s):u);return l&&(a.cache=l[0],a.mutate=l[1]),C(()=>{if(l)return l[2]&&l[2](),l[3]},[]),(0,r.createElement)(V.Provider,f(e,{value:a}))},W=_&&window.__SWR_DEVTOOLS_USE__,K=W?window.__SWR_DEVTOOLS_USE__:[],X=e=>h(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(null===e[1]?e[2]:e[1])||{}],Q=()=>f(H,(0,r.useContext)(V)),ee=e=>(t,n,r)=>{let i=n&&((...e)=>{let r=I(t)[0],[,,,i]=s.get(Z),a=i[r];return a?(delete i[r],a):n(...e)});return e(t,i,r)},et=K.concat(ee),en=(e,t,n)=>{let r=t[e]||(t[e]=[]);return r.push(n),()=>{let e=r.indexOf(n);e>=0&&(r[e]=r[r.length-1],r.pop())}};W&&(window.__SWR_DEVTOOLS_REACT__=r);let er={dedupe:!0},ei=(e,t,n)=>{let{cache:a,compare:o,suspense:l,fallbackData:c,revalidateOnMount:p,revalidateIfStale:_,refreshInterval:m,refreshWhenHidden:g,refreshWhenOffline:v,keepPreviousData:b}=n,[E,w,S]=s.get(a),[x,T]=I(e),k=(0,r.useRef)(!1),R=(0,r.useRef)(!1),O=(0,r.useRef)(x),P=(0,r.useRef)(t),A=(0,r.useRef)(n),$=()=>A.current,G=()=>$().isVisible()&&$().isOnline(),[z,M,Y,Z]=y(a,x),F=(0,r.useRef)({}).current,H=d(c)?n.fallback[x]:c,q=(e,t)=>
25{let n=!0;for(let r in F){let i=r;"data"===i?o(t[i],e[i])||d(e[i])&&o(t[i],ei)||(n=!1):t[i]!==e[i]&&(n=!1)}return n},V=(0,r.useMemo)(()=>{let e=!!x&&!!t&&(d(p)?!$().isPaused()&&!l&&(!!d(_)||_):p),n=t=>{let n=f(t);return(delete n._k,e)?{isValidating:!0,isLoading:!0,...n}:n},r=n(z()),i=n(Z());return[()=>{let e=n(z());return q(e,r)?r:r=e},()=>i]},[a,x]),J=(0,i.useSyncExternalStore)((0,r.useCallback)(e=>Y(x,(t,n)=>{q(n,t)||e()}),[a,x]),V[0],V[1]),W=!k.current,K=E[x]&&E[x].length>0,X=J.data,Q=d(X)?H:X,ee=J.error,et=(0,r.useRef)(Q),ei=b?d(X)?et.current:X:Q,es=(!K||!!d(ee))&&(W&&!d(p)?p:!$().isPaused()&&(l?!d(Q)&&_:d(Q)||_)),ea=!!(x&&t&&W&&es),eo=d(J.isValidating)?ea:J.isValidating,el=d(J.isLoading)?ea:J.isLoading,eu=(0,r.useCallback)(async e=>{let t,r;let i=P.current;if(!x||!i||R.current||$().isPaused())return!1;let s=!0,a=e||{},l=!S[x]||!a.dedupe,c=()=>j?!R.current&&x===O.current&&k.current:x===O.current,f={isValidating:!1,isLoading:!1},p=()=>{M(f)},_=()=>{let e=S[x];e&&e[1]===r&&delete S[x]},m={isValidating:!0};d(z().data)&&(m.isLoading=!0);try{if(l&&(M(m),n.loadingTimeout&&d(z().data)&&setTimeout(()=>{s&&c()&&$().onLoadingSlow(x,n)},n.loadingTimeout),S[x]=[i(T),U()]),[t,r]=S[x],t=await t,l&&setTimeout(_,n.dedupingInterval),!S[x]||S[x][1]!==r)return l&&c()&&$().onDiscarded(x),!1;f.error=u;let g=w[x];if(!d(g)&&(r<=g[0]||r<=g[1]||0===g[1]))return p(),l&&c()&&$().onDiscarded(x),!1;let y=z().data;f.data=o(y,t)?y:t,l&&c()&&$().onSuccess(t,x,n)}catch(E){_();let v=$(),{shouldRetryOnError:b}=v;!v.isPaused()&&(f.error=E,l&&c()&&(v.onError(E,x,v),(!0===b||h(b)&&b(E))&&G()&&v.onErrorRetry(E,x,v,eu,{retryCount:(a.retryCount||0)+1,dedupe:!0})))}return s=!1,p(),!0},[x,a]),ec=(0,r.useCallback)((...e)=>L(a,O.current,...e),[]);if(C(()=>{P.current=t,A.current=n,d(X)||(et.current=X)}),C(()=>{if(!x)return;let e=eu.bind(u,er),t=0,n=n=>{if(n==B.FOCUS_EVENT){let r=Date.now();$().revalidateOnFocus&&r>t&&G()&&(t=r+$().focusThrottleInterval,e())}else if(n==B.RECONNECT_EVENT)$().revalidateOnReconnect&&G()&&e();else if(n==B.MUTATE_EVENT)return eu()},r=en(x,E,n);return R.current=!1,O.current=x,k.current=!0,M({_k:T}),es&&(d(Q)||N?e():D(e)),()=>{R.current=!0,r()}},[x]),C(()=>{let e;function t(){let t=h(m)?m(Q):m;t&&-1!==e&&(e=setTimeout(n,t))}function n(){!z().error&&(g||$().isVisible())&&(v||$().isOnline())?eu(er).then(t):t()}return t(),()=>{e&&(clearTimeout(e),e=-1)}},[m,g,v,x]),(0,r.useDebugValue)(ei),l&&d(Q)&&x){if(!j&&N)throw Error("Fallback data is required when using suspense in SSR.");throw P.current=t,A.current=n,R.current=!1,d(ee)?eu(er):ee}return{mutate:ec,get data(){return F.data=!0,ei},get error(){return F.error=!0,ee},get isValidating(){return F.isValidating=!0,eo},get isLoading(){return F.isLoading=!0,el}}},es=c.defineProperty(J,"defaultValue",{value:H});var ea=function(...e){let t=Q(),[n,r,i]=X(e),s=q(t,i),a=ei,{use:o}=s,l=(o||[]).concat(et);for(let u=l.length;u--;)a=l[u](a);return a(n,r||s.fetcher||null,s)}},1604:function(e,t,n){"use strict";n.d(t,{jm:function(){return o},z:function(){return e8}}),(eQ=e2||(e2={})).assertEqual=e=>e,eQ.assertIs=function(e){},eQ.assertNever=function(e){throw Error()},eQ.arrayToEnum=e=>{let t={};for(let n of e)t[n]=n;return t},eQ.getValidEnumValues=e=>{let t=eQ.objectKeys(e).filter(t=>"number"!=typeof e[e[t]]),n={};for(let r of t)n[r]=e[r];return eQ.objectValues(n)},eQ.objectValues=e=>eQ.objectKeys(e).map(function(t){return e[t]}),eQ.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{let t=[];for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},eQ.find=(e,t)=>{for(let n of e)if(t(n))return n},eQ.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,eQ.joinValues=function(e,t=" | "){return e.map(e=>"string"==typeof e?`'${e}'`:e).join(t)},eQ.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t;let r=e2.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),i=e=>{switch(typeof e){case"undefined":return r.undefined;case"string":return r.string;case"number":return isNaN(e)?r.nan:r.number;case"boolean":return r.boolean;case"function":return r.function;case"bigint":return r.bigint;case"symbol":return r.symbol;case"object":if(Array.isArray(e))return r.array;if(null===e)return r.null;if(e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch)return r.promise;if("undefined"!=typeof Map&&e instanceof Map)return r.map;if("undefined"!=typeof Set&&e instanceof Set)return r.set;if("undefined"!=typeof Date&&e instanceof Date)return r.date;return r.object;default:return r.unknown}}
25,s=e2.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"]),a=e=>{let t=JSON.stringify(e,null,2);return t.replace(/"([^"]+)":/g,"$1:")};class o extends Error{constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(let i of e.issues)if("invalid_union"===i.code)i.unionErrors.map(r);else if("invalid_return_type"===i.code)r(i.returnTypeError);else if("invalid_arguments"===i.code)r(i.argumentsError);else if(0===i.path.length)n._errors.push(t(i));else{let s=n,a=0;for(;a<i.path.length;){let o=i.path[a],l=a===i.path.length-1;l?(s[o]=s[o]||{_errors:[]},s[o]._errors.push(t(i))):s[o]=s[o]||{_errors:[]},s=s[o],a++}}};return r(this),n}toString(){return this.message}get message(){return JSON.stringify(this.issues,e2.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){let t={},n=[];for(let r of this.issues)r.path.length>0?(t[r.path[0]]=t[r.path[0]]||[],t[r.path[0]].push(e(r))):n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}o.create=e=>{let t=new o(e);return t};let l=(e,t)=>{let n;switch(e.code){case s.invalid_type:n=e.received===r.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case s.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,e2.jsonStringifyReplacer)}`;break;case s.unrecognized_keys:n=`Unrecognized key(s) in object: ${e2.joinValues(e.keys,", ")}`;break;case s.invalid_union:n="Invalid input";break;case s.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${e2.joinValues(e.options)}`;break;case s.invalid_enum_value:n=`Invalid enum value. Expected ${e2.joinValues(e.options)}, received '${e.received}'`;break;case s.invalid_arguments:n="Invalid function arguments";break;case s.invalid_return_type:n="Invalid function return type";break;case s.invalid_date:n="Invalid date";break;case s.invalid_string:"object"==typeof e.validation?"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:e2.assertNever(e.validation):n="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case s.too_small:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(e.minimum)}`:"Invalid input";break;case s.too_big:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(e.maximum)}`:"Invalid input";break;case s.custom:n="Invalid input";break;case s.invalid_intersection_types:n="Intersection results could not be merged";break;case s.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case s.not_finite:n="Number must be finite";break;default:n=t.defaultError,e2.assertNever(e)}return{message:n}},u=l,c=e=>
25{let{data:t,path:n,errorMaps:r,issueData:i}=e,s=[...n,...i.path||[]],a={...i,path:s},o="",l=r.filter(e=>!!e).slice().reverse();for(let u of l)o=u(a,{data:t,defaultError:o}).message;return{...i,path:s,message:i.message||o}};function d(e,t){let n=c({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,u,l].filter(e=>!!e)});e.common.issues.push(n)}class h{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){let n=[];for(let r of t){if("aborted"===r.status)return f;"dirty"===r.status&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){let n=[];for(let r of t)n.push({key:await r.key,value:await r.value});return h.mergeObjectSync(e,n)}static mergeObjectSync(e,t){let n={};for(let r of t){let{key:i,value:s}=r;if("aborted"===i.status||"aborted"===s.status)return f;"dirty"===i.status&&e.dirty(),"dirty"===s.status&&e.dirty(),(void 0!==s.value||r.alwaysSet)&&(n[i.value]=s.value)}return{status:e.value,value:n}}}let f=Object.freeze({status:"aborted"}),p=e=>({status:"dirty",value:e}),_=e=>({status:"valid",value:e}),m=e=>"aborted"===e.status,g=e=>"dirty"===e.status,y=e=>"valid"===e.status,v=e=>"undefined"!=typeof Promise&&e instanceof Promise;(e0=e3||(e3={})).errToObj=e=>"string"==typeof e?{message:e}:e||{},e0.toString=e=>"string"==typeof e?e:null==e?void 0:e.message;class b{constructor(e,t,n,r){this.parent=e,this.data=t,this._path=n,this._key=r}get path(){return this._path.concat(this._key)}}let E=(e,t)=>{if(y(t))return{success:!0,data:t.value};{if(!e.common.issues.length)throw Error("Validation failed but no issues detected.");let n=new o(e.common.issues);return{success:!1,error:n}}};function w(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');if(t)return{errorMap:t,description:i};let s=(e,t)=>"invalid_type"!==e.code?{message:t.defaultError}:void 0===t.data?{message:null!=r?r:t.defaultError}:{message:null!=n?n:t.defaultError};return{errorMap:s,description:i}}class S{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.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return i(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:i(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new h,ctx:{common:e.parent.common,data:e.data,parsedType:i(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(v(t))throw Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){var n;let r={common:{issues:[],async:null!==(n=null==t?void 0:t.async)&&void 0!==n&&n,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:i(e)},s=this._parseSync({data:e,path:r.path,parent:r});return E(r,s)}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:i(e)},r=this._parse({data:e,path:n.path,parent:n}),s=await (v(r)?r:Promise.resolve(r));return E(n,s)}refine(e,t){let n=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement((t,r)=>{let i=e(t),a=()=>r.addIssue({code:s.custom,...n(t)});return"undefined"!=typeof Promise&&i instanceof Promise?i.then(e=>!!e||(a(),!1)):!!i||(a(),!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 ei({schema:this,typeName:e5.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return es.create(this,this._def)}nullable(){return ea.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return z.create(this,this._def)}promise(){return er.create(this,this._def)}or(e){return Y.create([this,e],this._def)}and(e){return H.create(this,e,this._def)}transform(e){return new ei({...w(this._def),schema:this,typeName:e5.ZodEffects,effect:{type:"transform",transform:e}})}default(e){return new eo({...w(this._def),innerType:this,defaultValue:"function"==typeof e?e:()=>e,typeName:e5.ZodDefault})}brand(){return new ed({typeName:e5.ZodBranded,type:this,...w(this._def)})}catch(e){return new el({...w(this._def),innerType:this,catchValue:"function"==typeof e?e:()=>e,typeName:e5.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return eh.create(this,e)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}let x=/^c[^\s-]{8,}$/i,T=/^[a-z][a-z0-9]*$/,k=/^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i,R=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|([^-]([a-zA-Z0-9-]*\.)+[a-zA-Z]{2,}))$/,O=e=>e.precision?e.offset?RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}Z$`):0===e.precision?e.offset?RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):e.offset?RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");class j extends S{constructor(){super(...arguments),this._regex=(e,t,n)=>this.refinement(t=>e.test(t),{validation:t,code:s.invalid_string,...e3.errToObj(n)}),this.nonempty=e=>this.min(1,e3.errToObj(e)),this.trim=()=>new j({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}_parse(e){let t;this._def.coerce&&(e.data=String(e.data));let n=this._getType(e);if(n!==r.string){let i=this._getOrReturnCtx(e);return d(i,{code:s.invalid_type,expected:r.string,received:i.parsedType}),f}let a=new h;for(let o of this._def.checks)if("min"===o.kind)e.data.length<o.value&&(d(t=this._getOrReturnCtx(e,t),{code:s.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),a.dirty());else if("max"===o.kind)e.data.length>o.value&&(d(t=this._getOrReturnCtx(e,t),{code:s.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),a.dirty());else if("length"===o.kind){let l=e.data.length>o.value,u=e.data.length<o.value;(l||u)&&(t=this._getOrReturnCtx(e,t),l?d(t,{code:s.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):u&&d(t,{code:s.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),a.dirty())}else if("email"===o.kind)R.test(e.data)||(d(t=this._getOrReturnCtx(e,t),{validation:"email",code:s.invalid_string,message:o.message}),a.dirty());else if("uuid"===o.kind)k.test(e.data)||(d(t=this._getOrReturnCtx(e,t),{validation:"uuid",code:s.invalid_string,message:o.message}),a.dirty());else if("cuid"===o.kind)x.test(e.data)||(d(t=this._getOrReturnCtx(e,t),{validation:"cuid",code:s.invalid_string,message:o.message}),a.dirty());else if("cuid2"===o.kind)T.test(e.data)||(d(t=this._getOrReturnCtx(e,t),{validation:"cuid2",code:s.invalid_string,message:o.message}),a.dirty());else if("url"===o.kind)try{new URL(e.data)}catch(c){d(t=this._getOrReturnCtx(e,t),{validation:"url",code:s.invalid_string,message:o.message}),a.dirty()}else if("regex"===o.kind){o.regex.lastIndex=0;let p=o.regex.test(e.data);p||(d(t=this._getOrReturnCtx(e,t),{validation:"regex",code:s.invalid_string,message:o.message}),a.dirty())}else if("trim"===o.kind)e.data=e.data.trim();else if("startsWith"===o.kind)e.data.startsWith(o.value)||(d(t=this._getOrReturnCtx(e,t),{code:s.invalid_string,validation:{startsWith:o.value},message:o.message}),a.dirty());else if("endsWith"===o.kind)e.data.endsWith(o.value)||(d(t=this._getOrReturnCtx(e,t),{code:s.invalid_string,validation:{endsWith:o.value},message:o.message}),a.dirty());else if("datetime"===o.kind){let _=O(o);_.test(e.data)||(d(t=this._getOrReturnCtx(e,t),{code:s.invalid_string,validation:"datetime",message:o.message}),a.dirty())}else e2.assertNever(o);return{status:a.value,value:e.data}}_addCheck(e){return new j({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...e3.errToObj(e)})}url(e){return this._addCheck({kind:"url",...e3.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...e3.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...e3.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...e3.errToObj(e)})}datetime(e){var t;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,...e3.errToObj(null==e?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...e3.errToObj(t)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...e3.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...e3.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...e3.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...e3.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...e3.errToObj(t)})}get isDatetime(){return!!this._def.checks.find(e=>"datetime"===e.kind)}get isEmail(){return!!this._def.checks.find(e=>"email"===e.kind)}get isURL(){return!!this._def.checks.find(e=>"url"===e.kind)}
25get isUUID(){return!!this._def.checks.find(e=>"uuid"===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 minLength(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}j.create=e=>{var t;return new j({checks:[],typeName:e5.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...w(e)})};class N extends S{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){let t;this._def.coerce&&(e.data=Number(e.data));let n=this._getType(e);if(n!==r.number){let i=this._getOrReturnCtx(e);return d(i,{code:s.invalid_type,expected:r.number,received:i.parsedType}),f}let a=new h;for(let o of this._def.checks)if("int"===o.kind)e2.isInteger(e.data)||(d(t=this._getOrReturnCtx(e,t),{code:s.invalid_type,expected:"integer",received:"float",message:o.message}),a.dirty());else if("min"===o.kind){let l=o.inclusive?e.data<o.value:e.data<=o.value;l&&(d(t=this._getOrReturnCtx(e,t),{code:s.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),a.dirty())}else if("max"===o.kind){let u=o.inclusive?e.data>o.value:e.data>=o.value;u&&(d(t=this._getOrReturnCtx(e,t),{code:s.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),a.dirty())}else"multipleOf"===o.kind?0!==function(e,t){let n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r,s=parseInt(e.toFixed(i).replace(".","")),a=parseInt(t.toFixed(i).replace(".",""));return s%a/Math.pow(10,i)}(e.data,o.value)&&(d(t=this._getOrReturnCtx(e,t),{code:s.not_multiple_of,multipleOf:o.value,message:o.message}),a.dirty()):"finite"===o.kind?Number.isFinite(e.data)||(d(t=this._getOrReturnCtx(e,t),{code:s.not_finite,message:o.message}),a.dirty()):e2.assertNever(o);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,e3.toString(t))}gt(e,t){return this.setLimit("min",e,!1,e3.toString(t))}lte(e,t){return this.setLimit("max",e,!0,e3.toString(t))}lt(e,t){return this.setLimit("max",e,!1,e3.toString(t))}setLimit(e,t,n,r){return new N({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:e3.toString(r)}]})}_addCheck(e){return new N({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:e3.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:e3.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:e3.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:e3.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:e3.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:e3.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:e3.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let 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&&e2.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let 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)}}N.create=e=>new N({checks:[],typeName:e5.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...w(e)});class D extends S{_parse(e){this._def.coerce&&(e.data=BigInt(e.data));let t=this._getType(e);if(t!==r.bigint){let n=this._getOrReturnCtx(e);return d(n,{code:s.invalid_type,expected:r.bigint,received:n.parsedType}),f}return _(e.data)}}D.create=e=>{var t;return new D({typeName:e5.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...w(e)})};class C extends S{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));let t=this._getType(e);if(t!==r.boolean){let n=this._getOrReturnCtx(e);return d(n,{code:s.invalid_type,expected:r.boolean,received:n.parsedType}),f}return _(e.data)}}C.create=e=>new C({typeName:e5.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...w(e)});class P extends S{_parse(e){let t;this._def.coerce&&(e.data=new Date(e.data));let n=this._getType(e);if(n!==r.date){let i=this._getOrReturnCtx(e);return d(i,{code:s.invalid_type,expected:r.date,received:i.parsedType}),f}if(isNaN(e.data.getTime())){let a=this._getOrReturnCtx(e);return d(a,{code:s.invalid_date}),f}let o=new h;for(let l of this._def.checks)"min"===l.kind?e.data.getTime()<l.value&&(d(t=this._getOrReturnCtx(e,t),{code:s.too_small,message:l.message,inclusive:!0,exact:!1,minimum:l.value,type:"date"}),o.dirty()):"max"===l.kind?e.data.getTime()>l.value&&(d(t=this._getOrReturnCtx(e,t),{code:s.too_big,message:l.message,inclusive:!0,exact:!1,maximum:l.value,type:"date"}),o.dirty()):e2.assertNever(l);return{status:o.value,value:new Date(e.data.getTime())}}_addCheck(e){return new P({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:e3.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:e3.toString(t)})}
25get minDate(){let e=null;for(let 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(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}P.create=e=>new P({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:e5.ZodDate,...w(e)});class A extends S{_parse(e){let t=this._getType(e);if(t!==r.symbol){let n=this._getOrReturnCtx(e);return d(n,{code:s.invalid_type,expected:r.symbol,received:n.parsedType}),f}return _(e.data)}}A.create=e=>new A({typeName:e5.ZodSymbol,...w(e)});class I extends S{_parse(e){let t=this._getType(e);if(t!==r.undefined){let n=this._getOrReturnCtx(e);return d(n,{code:s.invalid_type,expected:r.undefined,received:n.parsedType}),f}return _(e.data)}}I.create=e=>new I({typeName:e5.ZodUndefined,...w(e)});class $ extends S{_parse(e){let t=this._getType(e);if(t!==r.null){let n=this._getOrReturnCtx(e);return d(n,{code:s.invalid_type,expected:r.null,received:n.parsedType}),f}return _(e.data)}}$.create=e=>new $({typeName:e5.ZodNull,...w(e)});class U extends S{constructor(){super(...arguments),this._any=!0}_parse(e){return _(e.data)}}U.create=e=>new U({typeName:e5.ZodAny,...w(e)});class B extends S{constructor(){super(...arguments),this._unknown=!0}_parse(e){return _(e.data)}}B.create=e=>new B({typeName:e5.ZodUnknown,...w(e)});class L extends S{_parse(e){let t=this._getOrReturnCtx(e);return d(t,{code:s.invalid_type,expected:r.never,received:t.parsedType}),f}}L.create=e=>new L({typeName:e5.ZodNever,...w(e)});class G extends S{_parse(e){let t=this._getType(e);if(t!==r.undefined){let n=this._getOrReturnCtx(e);return d(n,{code:s.invalid_type,expected:r.void,received:n.parsedType}),f}return _(e.data)}}G.create=e=>new G({typeName:e5.ZodVoid,...w(e)});class z extends S{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),i=this._def;if(t.parsedType!==r.array)return d(t,{code:s.invalid_type,expected:r.array,received:t.parsedType}),f;if(null!==i.exactLength){let a=t.data.length>i.exactLength.value,o=t.data.length<i.exactLength.value;(a||o)&&(d(t,{code:a?s.too_big:s.too_small,minimum:o?i.exactLength.value:void 0,maximum:a?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(null!==i.minLength&&t.data.length<i.minLength.value&&(d(t,{code:s.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),null!==i.maxLength&&t.data.length>i.maxLength.value&&(d(t,{code:s.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((e,n)=>i.type._parseAsync(new b(t,e,t.path,n)))).then(e=>h.mergeArray(n,e));let l=[...t.data].map((e,n)=>i.type._parseSync(new b(t,e,t.path,n)));return h.mergeArray(n,l)}get element(){return this._def.type}min(e,t){return new z({...this._def,minLength:{value:e,message:e3.toString(t)}})}max(e,t){return new z({...this._def,maxLength:{value:e,message:e3.toString(t)}})}length(e,t){return new z({...this._def,exactLength:{value:e,message:e3.toString(t)}})}nonempty(e){return this.min(1,e)}}z.create=(e,t)=>new z({type:e,minLength:null,maxLength:null,exactLength:null,typeName:e5.ZodArray,...w(t)}),(e4||(e4={})).mergeShapes=(e,t)=>({...e,...t});class M extends S{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;let e=this._def.shape(),t=e2.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){let t=this._getType(e);if(t!==r.object){let n=this._getOrReturnCtx(e);return d(n,{code:s.invalid_type,expected:r.object,received:n.parsedType}),f}let{status:i,ctx:a}=this._processInputParams(e),{shape:o,keys:l}=this._getCached(),u=[];if(!(this._def.catchall instanceof L&&"strip"===this._def.unknownKeys))for(let c in a.data)l.includes(c)||u.push(c);let p=[];for(let _ of l){let m=o[_],g=a.data[_];p.push({key:{status:"valid",value:_},value:m._parse(new b(a,g,a.path,_)),alwaysSet:_ in a.data})}if(this._def.catchall instanceof L){let y=this._def.unknownKeys;
25if("passthrough"===y)for(let v of u)p.push({key:{status:"valid",value:v},value:{status:"valid",value:a.data[v]}});else if("strict"===y)u.length>0&&(d(a,{code:s.unrecognized_keys,keys:u}),i.dirty());else if("strip"===y);else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let E=this._def.catchall;for(let w of u){let S=a.data[w];p.push({key:{status:"valid",value:w},value:E._parse(new b(a,S,a.path,w)),alwaysSet:w in a.data})}}return a.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of p){let n=await t.key;e.push({key:n,value:await t.value,alwaysSet:t.alwaysSet})}return e}).then(e=>h.mergeObjectSync(i,e)):h.mergeObjectSync(i,p)}get shape(){return this._def.shape()}strict(e){return e3.errToObj,new M({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,n)=>{var r,i,s,a;let o=null!==(s=null===(i=(r=this._def).errorMap)||void 0===i?void 0:i.call(r,t,n).message)&&void 0!==s?s:n.defaultError;return"unrecognized_keys"===t.code?{message:null!==(a=e3.errToObj(e).message)&&void 0!==a?a:o}:{message:o}}}:{}})}strip(){return new M({...this._def,unknownKeys:"strip"})}passthrough(){return new M({...this._def,unknownKeys:"passthrough"})}extend(e){return new M({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){let t=new M({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>e4.mergeShapes(this._def.shape(),e._def.shape()),typeName:e5.ZodObject});return t}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new M({...this._def,catchall:e})}pick(e){let t={};return e2.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n])}),new M({...this._def,shape:()=>t})}omit(e){let t={};return e2.objectKeys(this.shape).forEach(n=>{e[n]||(t[n]=this.shape[n])}),new M({...this._def,shape:()=>t})}deepPartial(){return function e(t){if(t instanceof M){let n={};for(let r in t.shape){let i=t.shape[r];n[r]=es.create(e(i))}return new M({...t._def,shape:()=>n})}return t instanceof z?z.create(e(t.element)):t instanceof es?es.create(e(t.unwrap())):t instanceof ea?ea.create(e(t.unwrap())):t instanceof q?q.create(t.items.map(t=>e(t))):t}(this)}partial(e){let t={};return e2.objectKeys(this.shape).forEach(n=>{let r=this.shape[n];e&&!e[n]?t[n]=r:t[n]=r.optional()}),new M({...this._def,shape:()=>t})}required(e){let t={};return e2.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])t[n]=this.shape[n];else{let r=this.shape[n],i=r;for(;i instanceof es;)i=i._def.innerType;t[n]=i}}),new M({...this._def,shape:()=>t})}keyof(){return ee(e2.objectKeys(this.shape))}}M.create=(e,t)=>new M({shape:()=>e,unknownKeys:"strip",catchall:L.create(),typeName:e5.ZodObject,...w(t)}),M.strictCreate=(e,t)=>new M({shape:()=>e,unknownKeys:"strict",catchall:L.create(),typeName:e5.ZodObject,...w(t)}),M.lazycreate=(e,t)=>new M({shape:e,unknownKeys:"strip",catchall:L.create(),typeName:e5.ZodObject,...w(t)});class Y extends S{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;if(t.common.async)return Promise.all(n.map(async e=>{let n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}})).then(function(e){for(let n of e)if("valid"===n.result.status)return n.result;for(let r of e)if("dirty"===r.result.status)return t.common.issues.push(...r.ctx.common.issues),r.result;let i=e.map(e=>new o(e.ctx.common.issues));return d(t,{code:s.invalid_union,unionErrors:i}),f});{let r;let i=[];for(let a of n){let l={...t,common:{...t.common,issues:[]},parent:null},u=a._parseSync({data:t.data,path:t.path,parent:l});if("valid"===u.status)return u;"dirty"!==u.status||r||(r={result:u,ctx:l}),l.common.issues.length&&i.push(l.common.issues)}if(r)return t.common.issues.push(...r.ctx.common.issues),r.result;let c=i.map(e=>new o(e));return d(t,{code:s.invalid_union,unionErrors:c}),f}}get options(){return this._def.options}}Y.create=(e,t)=>new Y({options:e,typeName:e5.ZodUnion,...w(t)});let Z=e=>{if(e instanceof X)return Z(e.schema);if(e instanceof ei)return Z(e.innerType());if(e instanceof Q)return[e.value];if(e instanceof et)return e.options;if(e instanceof en)return Object.keys(e.enum);if(e instanceof eo)return Z(e._def.innerType);if(e instanceof I)return[void 0];else if(e instanceof $)return[null];else return null};class F extends S{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==r.object)return d(t,{code:s.invalid_type,expected:r.object,received:t.parsedType}),f;let n=this.discriminator,i=t.data[n],a=this.optionsMap.get(i);return a?t.common.async?a._parseAsync({data:t.data,path:t.path,parent:t}):a._parseSync({data:t.data,path:t.path,parent:t}):(d(t,{code:s.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),f)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){let r=new Map;for(let i of t){let s=Z(i.shape[e]);if(!s)throw Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let a of s){if(r.has(a))throw Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);r.set(a,i)}}return new F({typeName:e5.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...w(n)})}}class H extends S{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),a=(e,a)=>{if(m(e)||m(a))return f;let o=function e(t,n){let s=i(t),a=i(n);if(t===n)return{valid:!0,data:t};if(s===r.object&&a===r.object){let o=e2.objectKeys(n),l=e2.objectKeys(t).filter(e=>-1!==o.indexOf(e)),u={...t,...n};for(let c of l){let d=e(t[c],n[c]);if(!d.valid)return{valid:!1};u[c]=d.data}return{valid:!0,data:u}}if(s===r.array&&a===r.array){if(t.length!==n.length)return{valid:!1};let h=[];for(let f=0;f<t.length;f++){let p=t[f],_=n[f],m=e(p,_);if(!m.valid)return{valid:!1};h.push(m.data)}return{valid:!0,data:h}}return s===r.date&&a===r.date&&+t==+n?{valid:!0,data:t}:{valid:!1}}(e.value,a.value);return o.valid?((g(e)||g(a))&&t.dirty(),{status:t.value,value:o.data}):(d(n,{code:s.invalid_intersection_types}),f)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([e,t])=>a(e,t)):a(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}
25H.create=(e,t,n)=>new H({left:e,right:t,typeName:e5.ZodIntersection,...w(n)});class q extends S{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==r.array)return d(n,{code:s.invalid_type,expected:r.array,received:n.parsedType}),f;if(n.data.length<this._def.items.length)return d(n,{code:s.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),f;let i=this._def.rest;!i&&n.data.length>this._def.items.length&&(d(n,{code:s.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let a=[...n.data].map((e,t)=>{let r=this._def.items[t]||this._def.rest;return r?r._parse(new b(n,e,n.path,t)):null}).filter(e=>!!e);return n.common.async?Promise.all(a).then(e=>h.mergeArray(t,e)):h.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new q({...this._def,rest:e})}}q.create=(e,t)=>{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new q({items:e,typeName:e5.ZodTuple,rest:null,...w(t)})};class V extends S{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==r.object)return d(n,{code:s.invalid_type,expected:r.object,received:n.parsedType}),f;let i=[],a=this._def.keyType,o=this._def.valueType;for(let l in n.data)i.push({key:a._parse(new b(n,l,n.path,l)),value:o._parse(new b(n,n.data[l],n.path,l))});return n.common.async?h.mergeObjectAsync(t,i):h.mergeObjectSync(t,i)}get element(){return this._def.valueType}static create(e,t,n){return new V(t instanceof S?{keyType:e,valueType:t,typeName:e5.ZodRecord,...w(n)}:{keyType:j.create(),valueType:e,typeName:e5.ZodRecord,...w(t)})}}class J extends S{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==r.map)return d(n,{code:s.invalid_type,expected:r.map,received:n.parsedType}),f;let i=this._def.keyType,a=this._def.valueType,o=[...n.data.entries()].map(([e,t],r)=>({key:i._parse(new b(n,e,n.path,[r,"key"])),value:a._parse(new b(n,t,n.path,[r,"value"]))}));if(n.common.async){let l=new Map;return Promise.resolve().then(async()=>{for(let e of o){let n=await e.key,r=await e.value;if("aborted"===n.status||"aborted"===r.status)return f;("dirty"===n.status||"dirty"===r.status)&&t.dirty(),l.set(n.value,r.value)}return{status:t.value,value:l}})}{let u=new Map;for(let c of o){let h=c.key,p=c.value;if("aborted"===h.status||"aborted"===p.status)return f;("dirty"===h.status||"dirty"===p.status)&&t.dirty(),u.set(h.value,p.value)}return{status:t.value,value:u}}}}J.create=(e,t,n)=>new J({valueType:t,keyType:e,typeName:e5.ZodMap,...w(n)});class W extends S{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==r.set)return d(n,{code:s.invalid_type,expected:r.set,received:n.parsedType}),f;let i=this._def;null!==i.minSize&&n.data.size<i.minSize.value&&(d(n,{code:s.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),t.dirty()),null!==i.maxSize&&n.data.size>i.maxSize.value&&(d(n,{code:s.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),t.dirty());let a=this._def.valueType;function o(e){let n=new Set;for(let r of e){if("aborted"===r.status)return f;"dirty"===r.status&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}let l=[...n.data.values()].map((e,t)=>a._parse(new b(n,e,n.path,t)));return n.common.async?Promise.all(l).then(e=>o(e)):o(l)}min(e,t){return new W({...this._def,minSize:{value:e,message:e3.toString(t)}})}max(e,t){return new W({...this._def,maxSize:{value:e,message:e3.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}W.create=(e,t)=>new W({valueType:e,minSize:null,maxSize:null,typeName:e5.ZodSet,...w(t)});class K extends S{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==r.function)return d(t,{code:s.invalid_type,expected:r.function,received:t.parsedType}),f;function n(e,n){return c({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,u,l].filter(e=>!!e),issueData:{code:s.invalid_arguments,argumentsError:n}})}function i(e,n){return c({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,u,l].filter(e=>!!e),issueData:{code:s.invalid_return_type,returnTypeError:n}})}let a={errorMap:t.common.contextualErrorMap},h=t.data;return this._def.returns instanceof er?_(async(...e)=>{let t=new o([]),r=await this._def.args.parseAsync(e,a).catch(r=>{throw t.addIssue(n(e,r)),t}),s=await h(...r),l=await this._def.returns._def.type.parseAsync(s,a).catch(e=>{throw t.addIssue(i(s,e)),t});return l}):_((...e)=>{let t=this._def.args.safeParse(e,a);if(!t.success)throw new o([n(e,t.error)]);let r=h(...t.data),s=this._def.returns.safeParse(r,a);if(!s.success)throw new o([i(r,s.error)]);return s.data})}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new K({...this._def,args:q.create(e).rest(B.create())})}returns(e){return new K({...this._def,returns:e})}implement(e){let t=this.parse(e);return t}strictImplement(e){let t=this.parse(e);return t}static create(e,t,n){return new K({args:e||q.create([]).rest(B.create()),returns:t||B.create(),typeName:e5.ZodFunction,...w(n)})}}class X extends S{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.getter();return n._parse({data:t.data,path:t.path,parent:t})}}X.create=(e,t)=>
25new X({getter:e,typeName:e5.ZodLazy,...w(t)});class Q extends S{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return d(t,{received:t.data,code:s.invalid_literal,expected:this._def.value}),f}return{status:"valid",value:e.data}}get value(){return this._def.value}}function ee(e,t){return new et({values:e,typeName:e5.ZodEnum,...w(t)})}Q.create=(e,t)=>new Q({value:e,typeName:e5.ZodLiteral,...w(t)});class et extends S{_parse(e){if("string"!=typeof e.data){let t=this._getOrReturnCtx(e),n=this._def.values;return d(t,{expected:e2.joinValues(n),received:t.parsedType,code:s.invalid_type}),f}if(-1===this._def.values.indexOf(e.data)){let r=this._getOrReturnCtx(e),i=this._def.values;return d(r,{received:r.data,code:s.invalid_enum_value,options:i}),f}return _(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e){return et.create(e)}exclude(e){return et.create(this.options.filter(t=>!e.includes(t)))}}et.create=ee;class en extends S{_parse(e){let t=e2.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==r.string&&n.parsedType!==r.number){let i=e2.objectValues(t);return d(n,{expected:e2.joinValues(i),received:n.parsedType,code:s.invalid_type}),f}if(-1===t.indexOf(e.data)){let a=e2.objectValues(t);return d(n,{received:n.data,code:s.invalid_enum_value,options:a}),f}return _(e.data)}get enum(){return this._def.values}}en.create=(e,t)=>new en({values:e,typeName:e5.ZodNativeEnum,...w(t)});class er extends S{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==r.promise&&!1===t.common.async)return d(t,{code:s.invalid_type,expected:r.promise,received:t.parsedType}),f;let n=t.parsedType===r.promise?t.data:Promise.resolve(t.data);return _(n.then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}}er.create=(e,t)=>new er({type:e,typeName:e5.ZodPromise,...w(t)});class ei extends S{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===e5.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null;if("preprocess"===r.type){let i=r.transform(n.data);return n.common.async?Promise.resolve(i).then(e=>this._def.schema._parseAsync({data:e,path:n.path,parent:n})):this._def.schema._parseSync({data:i,path:n.path,parent:n})}let s={addIssue(e){d(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),"refinement"===r.type){let a=e=>{let t=r.refinement(e,s);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1!==n.common.async)return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(e=>"aborted"===e.status?f:("dirty"===e.status&&t.dirty(),a(e.value).then(()=>({status:t.value,value:e.value}))));{let o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===o.status?f:("dirty"===o.status&&t.dirty(),a(o.value),{status:t.value,value:o.value})}}if("transform"===r.type){if(!1!==n.common.async)return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(e=>y(e)?Promise.resolve(r.transform(e.value,s)).then(e=>({status:t.value,value:e})):e);{let l=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!y(l))return l;let u=r.transform(l.value,s);if(u instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:u}}}e2.assertNever(r)}}ei.create=(e,t,n)=>new ei({schema:e,typeName:e5.ZodEffects,effect:t,...w(n)}),ei.createWithPreprocess=(e,t,n)=>new ei({schema:t,effect:{type:"preprocess",transform:e},typeName:e5.ZodEffects,...w(n)});class es extends S{_parse(e){let t=this._getType(e);return t===r.undefined?_(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}es.create=(e,t)=>
25new es({innerType:e,typeName:e5.ZodOptional,...w(t)});class ea extends S{_parse(e){let t=this._getType(e);return t===r.null?_(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ea.create=(e,t)=>new ea({innerType:e,typeName:e5.ZodNullable,...w(t)});class eo extends S{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===r.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}eo.create=(e,t)=>new eo({innerType:e,typeName:e5.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...w(t)});class el extends S{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.innerType._parse({data:t.data,path:t.path,parent:{...t,common:{...t.common,issues:[]}}});return v(n)?n.then(e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue()})):{status:"valid",value:"valid"===n.status?n.value:this._def.catchValue()}}removeCatch(){return this._def.innerType}}el.create=(e,t)=>new el({innerType:e,typeName:e5.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...w(t)});class eu extends S{_parse(e){let t=this._getType(e);if(t!==r.nan){let n=this._getOrReturnCtx(e);return d(n,{code:s.invalid_type,expected:r.nan,received:n.parsedType}),f}return{status:"valid",value:e.data}}}eu.create=e=>new eu({typeName:e5.ZodNaN,...w(e)});let ec=Symbol("zod_brand");class ed extends S{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class eh extends S{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async){let r=async()=>{let e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?f:"dirty"===e.status?(t.dirty(),p(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})};return r()}{let i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===i.status?f:"dirty"===i.status?(t.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(e,t){return new eh({in:e,out:t,typeName:e5.ZodPipeline})}}let ef=(e,t={},n)=>e?U.create().superRefine((r,i)=>{if(!e(r)){let s="function"==typeof t?t(r):t;i.addIssue({code:"custom",..."string"==typeof s?{message:s}:s,fatal:n})}}):U.create(),ep={object:M.lazycreate};(e1=e5||(e5={})).ZodString="ZodString",e1.ZodNumber="ZodNumber",e1.ZodNaN="ZodNaN",e1.ZodBigInt="ZodBigInt",e1.ZodBoolean="ZodBoolean",e1.ZodDate="ZodDate",e1.ZodSymbol="ZodSymbol",e1.ZodUndefined="ZodUndefined",e1.ZodNull="ZodNull",e1.ZodAny="ZodAny",e1.ZodUnknown="ZodUnknown",e1.ZodNever="ZodNever",e1.ZodVoid="ZodVoid",e1.ZodArray="ZodArray",e1.ZodObject="ZodObject",e1.ZodUnion="ZodUnion",e1.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e1.ZodIntersection="ZodIntersection",e1.ZodTuple="ZodTuple",e1.ZodRecord="ZodRecord",e1.ZodMap="ZodMap",e1.ZodSet="ZodSet",e1.ZodFunction="ZodFunction",e1.ZodLazy="ZodLazy",e1.ZodLiteral="ZodLiteral",e1.ZodEnum="ZodEnum",e1.ZodEffects="ZodEffects",e1.ZodNativeEnum="ZodNativeEnum",e1.ZodOptional="ZodOptional",e1.ZodNullable="ZodNullable",e1.ZodDefault="ZodDefault",e1.ZodCatch="ZodCatch",e1.ZodPromise="ZodPromise",e1.ZodBranded="ZodBranded",e1.ZodPipeline="ZodPipeline";let e_=(e,t={message:`Input not instance of ${e.name}`})=>ef(t=>t instanceof e,t,!0),em=j.create,eg=N.create,ey=eu.create,ev=D.create,eb=C.create,eE=P.create,ew=A.create,eS=I.create,ex=$.create,eT=U.create,ek=B.create,eR=L.create,eO=G.create,ej=z.create,eN=M.create,eD=M.strictCreate,eC=Y.create,eP=F.create,eA=H.create,eI=q.create,e$=V.create,eU=J.create,eB=W.create,eL=K.create,eG=X.create,ez=Q.create,eM=et.create,eY=en.create,eZ=er.create,eF=ei.create,eH=es.create,eq=ea.create,eV=ei.createWithPreprocess,eJ=eh.create,eW=()=>em().optional(),eK=()=>eg().optional(),eX=()=>eb().optional();var eQ,e0,e1,e2,e3,e4,e5,e8=Object.freeze({__proto__:null,defaultErrorMap:l,setErrorMap:function(e){u=e},getErrorMap:function(){return u},makeIssue:c,EMPTY_PATH:[],addIssueToContext:d,ParseStatus:h,INVALID:f,DIRTY:p,OK:_,isAborted:m,isDirty:g,isValid:y,isAsync:v,get util(){return e2},ZodParsedType:r,getParsedType:i,ZodType:S,ZodString:j,ZodNumber:N,ZodBigInt:D,ZodBoolean:C,ZodDate:P,ZodSymbol:A,ZodUndefined:I,ZodNull:$,ZodAny:U,ZodUnknown:B,ZodNever:L,ZodVoid:G,ZodArray:z,get objectUtil(){return e4},ZodObject:M,ZodUnion:Y,ZodDiscriminatedUnion:F,ZodIntersection:H,ZodTuple:q,ZodRecord:V,ZodMap:J,ZodSet:W,ZodFunction:K,ZodLazy:X,ZodLiteral:Q,ZodEnum:et,ZodNativeEnum:en,ZodPromise:er,ZodEffects:ei,ZodTransformer:ei,ZodOptional:es,ZodNullable:ea,ZodDefault:eo,ZodCatch:el,ZodNaN:eu,BRAND:ec,ZodBranded:ed,ZodPipeline:eh,custom:ef,Schema:S,ZodSchema:S,late:ep,get ZodFirstPartyTypeKind(){return e5},coerce:{string:e=>j.create({...e,coerce:!0}),number:e=>N.create({...e,coerce:!0}),boolean:e=>C.create({...e,coerce:!0}),bigint:e=>D.create({...e,coerce:!0}),date:e=>P.create({...e,coerce:!0})},any:eT,array:ej,bigint:ev,boolean:eb,date:eE,discriminatedUnion:eP,effect:eF,enum:eM,function:eL,instanceof:e_,intersection:eA,lazy:eG,literal:ez,map:eU,nan:ey,nativeEnum:eY,never:eR,null:ex,nullable:eq,number:eg,object:eN,oboolean:eX,onumber:eK,optional:eH,ostring:eW,pipeline:eJ,preprocess:eV,promise:eZ,record:e$,set:eB,strictObject:eD,string:em,symbol:ew,transformer:eF,tuple:eI,undefined:eS,union:eC,unknown:ek,void:eO,NEVER:f,ZodIssueCode:s,quotelessJson:a,ZodError:o})},9794:function(e){"use strict";e.exports={version:"1.0.34"}}},function(e){var t=function(t){return e(e.s=t)};e.O(0,[774,179],function(){return t(3517),t(6840),t(880)}),_N_E=e.O()}]); 26//# sourceMappingURL=_app-68c65a09ee424488.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.