From b74a76fd30254cd4b5676df6fd95aa3539d377dc Mon Sep 17 00:00:00 2001 From: josephdadams Date: Thu, 13 Jul 2023 01:51:13 +0000 Subject: [PATCH] update sony-bravia to v2.0.2 --- sony-bravia/.build-info | 6 +++--- sony-bravia/companion/manifest.json | 2 +- sony-bravia/main.js | 2 +- sony-bravia/package.json | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sony-bravia/.build-info b/sony-bravia/.build-info index 4cbd0251..e78f8512 100644 --- a/sony-bravia/.build-info +++ b/sony-bravia/.build-info @@ -1,4 +1,4 @@ MODULE_NAME=sony-bravia -GIT_REF=v2.0.1 -RUN_URL=https://github.com/bitfocus/companion-bundled-modules/actions/runs/5523228784 -UPDATE_DATE=2023-07-11 +GIT_REF=v2.0.2 +RUN_URL=https://github.com/bitfocus/companion-bundled-modules/actions/runs/5538199844 +UPDATE_DATE=2023-07-13 diff --git a/sony-bravia/companion/manifest.json b/sony-bravia/companion/manifest.json index 59c76a49..8b6c91ac 100644 --- a/sony-bravia/companion/manifest.json +++ b/sony-bravia/companion/manifest.json @@ -1 +1 @@ -{"id":"sony-bravia","name":"sony-bravia","shortname":"sony-bravia","description":"","version":"2.0.1","license":"MIT","repository":"git+https://github.com/bitfocus/companion-module-sony-bravia.git","bugs":"https://github.com/bitfocus/companion-module-sony-bravia/issues","maintainers":[{"name":"Joseph Adams","email":"josephdadams@gmail.com"}],"legacyIds":[],"runtime":{"type":"node18","api":"nodejs-ipc","apiVersion":"1.4.1","entrypoint":"../main.js"},"manufacturer":"Sony","products":["Bravia"],"keywords":["TV"]} \ No newline at end of file +{"id":"sony-bravia","name":"sony-bravia","shortname":"sony-bravia","description":"","version":"2.0.2","license":"MIT","repository":"git+https://github.com/bitfocus/companion-module-sony-bravia.git","bugs":"https://github.com/bitfocus/companion-module-sony-bravia/issues","maintainers":[{"name":"Joseph Adams","email":"josephdadams@gmail.com"}],"legacyIds":[],"runtime":{"type":"node18","api":"nodejs-ipc","apiVersion":"1.4.1","entrypoint":"../main.js"},"manufacturer":"Sony","products":["Bravia"],"keywords":["TV"]} \ No newline at end of file diff --git a/sony-bravia/main.js b/sony-bravia/main.js index ba844d50..6fa7d50a 100644 --- a/sony-bravia/main.js +++ b/sony-bravia/main.js @@ -1,2 +1,2 @@ /*! For license information please see main.js.LICENSE.txt */ -(()=>{var t={6010:(t,e,n)=>{const{InstanceBase:r,InstanceStatus:i,runEntrypoint:s}=n(8049),o=n(4556),a=n(9182),c=n(5144),u=n(7417),l=n(4049),p=n(3125),d=n(5965);s(class extends r{constructor(t){super(t),Object.assign(this,{...a,...c,...u,...l,...p,...d}),this.INTERVAL=null,this.DATA={powerState:!1,volumeLevel:0,muteState:!1,input:"",inputs:[]},this.CHOICES_INPUTS=[{id:"extInput:component?port=1",label:"Component 1"},{id:"extInput:component?port=2",label:"Component 2"},{id:"extInput:hdmi?port=1",label:"HDMI 1"},{id:"extInput:hdmi?port=2",label:"HDMI 2"}]}async destroy(){let t=this;t.INTERVAL&&(clearInterval(t.INTERVAL),t.INTERVAL=null)}async init(t){this.configUpdated(t)}async configUpdated(t){this.config=t,this.config.verbose&&this.log("info","Verbose mode enabled. Log entries will contain detailed information."),this.updateStatus(i.Connecting),this.initConnection(),this.initActions(),this.initFeedbacks(),this.initVariables(),this.initPresets(),this.checkFeedbacks(),this.checkVariables()}},o)},7056:(t,e,n)=>{"use strict";const r=n(4063);r.code='require("ajv/dist/runtime/equal").default',e.Z=r},758:(t,e,n)=>{"use strict";n.d(e,{r:()=>o});var r=n(5659),i=n(6890),s=n(2176);function o(){(0,i.T)(),(0,s.KV)()&&function(){const e=(0,r.cu)();if(!e.__SENTRY__)return;const n={mongodb:()=>new((0,s.l$)(t,"./node/integrations/mongo").Mongo),mongoose:()=>new((0,s.l$)(t,"./node/integrations/mongo").Mongo),mysql:()=>new((0,s.l$)(t,"./node/integrations/mysql").Mysql),pg:()=>new((0,s.l$)(t,"./node/integrations/postgres").Postgres)},i=Object.keys(n).filter((t=>!!(0,s.$y)(t))).map((t=>{try{return n[t]()}catch(t){return}})).filter((t=>t));i.length>0&&(e.__SENTRY__.integrations=[...e.__SENTRY__.integrations||[],...i])}()}t=n.hmd(t)},2716:(t,e,n)=>{"use strict";n.d(e,{_:()=>l});var r=n(4307),i=n(2176),s=n(2343),o=n(535),a=n(2844),c=n(7597),u=n(7990);class l{static __initStatic(){this.id="Apollo"}__init(){this.name=l.id}constructor(t={useNestjs:!1}){l.prototype.__init.call(this),this._useNest=!!t.useNestjs}loadDependency(){return this._useNest?this._module=this._module||(0,i.$y)("@nestjs/graphql"):this._module=this._module||(0,i.$y)("apollo-server-core"),this._module}setupOnce(t,e){if((0,u.K)(e))("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&s.kg.log("Apollo Integration is skipped because of instrumenter configuration.");else if(this._useNest){const t=this.loadDependency();if(!t)return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&s.kg.error("Apollo-NestJS Integration was unable to require @nestjs/graphql package."));(0,o.hl)(t.GraphQLFactory.prototype,"mergeWithSchema",(function(t){return function(...n){return(0,o.hl)(this.resolversExplorerService,"explore",(function(t){return function(){return p((0,a.lE)(t.call(this)),e)}})),t.call(this,...n)}}))}else{const t=this.loadDependency();if(!t)return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&s.kg.error("Apollo Integration was unable to require apollo-server-core package."));(0,o.hl)(t.ApolloServerBase.prototype,"constructSchema",(function(t){return function(){if(!this.config.resolvers)return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&(this.config.schema?(s.kg.warn("Apollo integration is not able to trace `ApolloServer` instances constructed via `schema` property.If you are using NestJS with Apollo, please use `Sentry.Integrations.Apollo({ useNestjs: true })` instead."),s.kg.warn()):this.config.modules&&s.kg.warn("Apollo integration is not able to trace `ApolloServer` instances constructed via `modules` property."),s.kg.error("Skipping tracing as no resolvers found on the `ApolloServer` instance.")),t.call(this);const n=(0,a.lE)(this.config.resolvers);return this.config.resolvers=p(n,e),t.call(this)}}))}}}function p(t,e){return t.map((t=>(Object.keys(t).forEach((n=>{Object.keys(t[n]).forEach((i=>{"function"==typeof t[n][i]&&function(t,e,n,i){(0,o.hl)(t[e],n,(function(t){return function(...s){const o=i().getScope(),a=(0,r.x)([o,"optionalAccess",t=>t.getSpan,"call",t=>t()]),u=(0,r.x)([a,"optionalAccess",t=>t.startChild,"call",t=>t({description:`${e}.${n}`,op:"graphql.resolve"})]),l=t.call(this,...s);return(0,c.J8)(l)?l.then((t=>((0,r.x)([u,"optionalAccess",t=>t.finish,"call",t=>t()]),t))):((0,r.x)([u,"optionalAccess",t=>t.finish,"call",t=>t()]),l)}}))}(t,n,i,e)}))})),t)))}l.__initStatic()},8737:(t,e,n)=>{"use strict";n.d(e,{N:()=>u});var r=n(4307),i=n(2343),s=n(6956),o=n(442),a=n(7597),c=n(7990);class u{static __initStatic(){this.id="Express"}__init(){this.name=u.id}constructor(t={}){u.prototype.__init.call(this),this._router=t.router||t.app,this._methods=(Array.isArray(t.methods)?t.methods:[]).concat("use")}setupOnce(t,e){this._router?(0,c.K)(e)?("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&i.kg.log("Express Integration is skipped because of instrumenter configuration."):(function(t,e=[]){e.forEach((e=>function(t,e){const n=t[e];return t[e]=function(...t){return n.call(this,...function(t,e){return t.map((t=>"function"==typeof t?l(t,e):Array.isArray(t)?t.map((t=>"function"==typeof t?l(t,e):t)):t))}(t,e))},t}(t,e)))}(this._router,this._methods),function(t){const e="settings"in t;e&&void 0===t._router&&t.lazyrouter&&t.lazyrouter();const n=e?t._router:t;if(!n)return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&i.kg.debug("Cannot instrument router for URL Parameterization (did not find a valid router)."),void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&i.kg.debug("Routing instrumentation is currently only supported in Express 4."));const c=Object.getPrototypeOf(n),u=c.process_params;c.process_params=function(t,e,n,i,c){n._reconstructedRoute||(n._reconstructedRoute="");const{layerRoutePath:l,isRegex:p,isArray:d,numExtraSegments:h}=function(t){const e=(0,r.x)([t,"access",t=>t.route,"optionalAccess",t=>t.path]),n=(0,a.Kj)(e),i=Array.isArray(e);if(!e)return{isRegex:n,isArray:i,numExtraSegments:0};const o=i?Math.max(e.reduce(((t,e)=>t+(0,s.$A)(e.toString())),0)-(0,s.$A)(t.path||""),0):0,c=function(t,e){return t?e.map((t=>t.toString())).join(","):e&&e.toString()}(i,e);return{layerRoutePath:c,isRegex:n,isArray:i,numExtraSegments:o}}(t);(l||p||d)&&(n._hasParameters=!0);const f=(l||t.path||"").split("/").filter((t=>t.length>0&&(p||d||!t.includes("*")))).join("/");if(f&&f.length>0&&(n._reconstructedRoute+=`/${f}${p?"/":""}`),(0,s.$A)(n.originalUrl||"")+h===(0,s.$A)(n._reconstructedRoute)){n._hasParameters||n._reconstructedRoute!==n.originalUrl&&(n._reconstructedRoute=n.originalUrl?(0,s.rt)(n.originalUrl):n.originalUrl);const t=i.__sentry_transaction;if(t&&"custom"!==t.metadata.source){const e=n._reconstructedRoute||"/";t.setName(...(0,o.oA)(n,{path:!0,method:!0,customRoute:e}))}}return u.call(this,t,e,n,i,c)}}(this._router)):("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&i.kg.error("ExpressIntegration is missing an Express instance")}}function l(t,e){const n=t.length;switch(n){case 2:return function(n,r){const i=r.__sentry_transaction;if(i){const n=i.startChild({description:t.name,op:`middleware.express.${e}`});r.once("finish",(()=>{n.finish()}))}return t.call(this,n,r)};case 3:return function(n,i,s){const o=i.__sentry_transaction,a=(0,r.x)([o,"optionalAccess",t=>t.startChild,"call",n=>n({description:t.name,op:`middleware.express.${e}`})]);t.call(this,n,i,(function(...t){(0,r.x)([a,"optionalAccess",t=>t.finish,"call",t=>t()]),s.call(this,...t)}))};case 4:return function(n,i,s,o){const a=s.__sentry_transaction,c=(0,r.x)([a,"optionalAccess",t=>t.startChild,"call",n=>n({description:t.name,op:`middleware.express.${e}`})]);t.call(this,n,i,s,(function(...t){(0,r.x)([c,"optionalAccess",t=>t.finish,"call",t=>t()]),o.call(this,...t)}))};default:throw new Error(`Express middleware takes 2-4 arguments. Got: ${n}`)}}u.__initStatic()},1791:(t,e,n)=>{"use strict";n.d(e,{k:()=>u});var r=n(4307),i=n(2176),s=n(2343),o=n(535),a=n(7597),c=n(7990);class u{constructor(){u.prototype.__init.call(this)}static __initStatic(){this.id="GraphQL"}__init(){this.name=u.id}loadDependency(){return this._module=this._module||(0,i.$y)("graphql/execution/execute.js")}setupOnce(t,e){if((0,c.K)(e))return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&s.kg.log("GraphQL Integration is skipped because of instrumenter configuration."));const n=this.loadDependency();n?(0,o.hl)(n,"execute",(function(t){return function(...n){const i=e().getScope(),s=(0,r.x)([i,"optionalAccess",t=>t.getSpan,"call",t=>t()]),o=(0,r.x)([s,"optionalAccess",t=>t.startChild,"call",t=>t({description:"execute",op:"graphql.execute"})]);(0,r.x)([i,"optionalAccess",t=>t.setSpan,"call",t=>t(o)]);const c=t.call(this,...n);return(0,a.J8)(c)?c.then((t=>((0,r.x)([o,"optionalAccess",t=>t.finish,"call",t=>t()]),(0,r.x)([i,"optionalAccess",t=>t.setSpan,"call",t=>t(s)]),t))):((0,r.x)([o,"optionalAccess",t=>t.finish,"call",t=>t()]),(0,r.x)([i,"optionalAccess",t=>t.setSpan,"call",t=>t(s)]),c)}})):("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&s.kg.error("GraphQL Integration was unable to require graphql/execution package.")}}u.__initStatic()},6046:(t,e,n)=>{"use strict";n.d(e,{G:()=>i});var r=n(2176);t=n.hmd(t);const i=[()=>new((0,r.l$)(t,"./apollo").Apollo),()=>new((0,r.l$)(t,"./apollo").Apollo)({useNestjs:!0}),()=>new((0,r.l$)(t,"./graphql").GraphQL),()=>new((0,r.l$)(t,"./mongo").Mongo),()=>new((0,r.l$)(t,"./mongo").Mongo)({mongoose:!0}),()=>new((0,r.l$)(t,"./mysql").Mysql),()=>new((0,r.l$)(t,"./postgres").Postgres)]},6169:(t,e,n)=>{"use strict";n.d(e,{_:()=>p});var r=n(4307),i=n(2176),s=n(2343),o=n(535),a=n(7597),c=n(7990);const u=["aggregate","bulkWrite","countDocuments","createIndex","createIndexes","deleteMany","deleteOne","distinct","drop","dropIndex","dropIndexes","estimatedDocumentCount","find","findOne","findOneAndDelete","findOneAndReplace","findOneAndUpdate","indexes","indexExists","indexInformation","initializeOrderedBulkOp","insertMany","insertOne","isCapped","mapReduce","options","parallelCollectionScan","rename","replaceOne","stats","updateMany","updateOne"],l={bulkWrite:["operations"],countDocuments:["query"],createIndex:["fieldOrSpec"],createIndexes:["indexSpecs"],deleteMany:["filter"],deleteOne:["filter"],distinct:["key","query"],dropIndex:["indexName"],find:["query"],findOne:["query"],findOneAndDelete:["filter"],findOneAndReplace:["filter","replacement"],findOneAndUpdate:["filter","update"],indexExists:["indexes"],insertMany:["docs"],insertOne:["doc"],mapReduce:["map","reduce"],rename:["newName"],replaceOne:["filter","doc"],updateMany:["filter","update"],updateOne:["filter","update"]};class p{static __initStatic(){this.id="Mongo"}__init(){this.name=p.id}constructor(t={}){p.prototype.__init.call(this),this._operations=Array.isArray(t.operations)?t.operations:u,this._describeOperations=!("describeOperations"in t)||t.describeOperations,this._useMongoose=!!t.useMongoose}loadDependency(){const t=this._useMongoose?"mongoose":"mongodb";return this._module=this._module||(0,i.$y)(t)}setupOnce(t,e){if((0,c.K)(e))return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&s.kg.log("Mongo Integration is skipped because of instrumenter configuration."));const n=this.loadDependency();if(n)this._instrumentOperations(n.Collection,this._operations,e);else{const t=this._useMongoose?"mongoose":"mongodb";("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&s.kg.error(`Mongo Integration was unable to require \`${t}\` package.`)}}_instrumentOperations(t,e,n){e.forEach((e=>this._patchOperation(t,e,n)))}_patchOperation(t,e,n){if(!(e in t.prototype))return;const i=this._getSpanContextFromOperationArguments.bind(this);(0,o.hl)(t.prototype,e,(function(t){return function(...s){const o=s[s.length-1],c=n().getScope(),u=(0,r.x)([c,"optionalAccess",t=>t.getSpan,"call",t=>t()]);if("function"!=typeof o||"mapReduce"===e&&2===s.length){const n=(0,r.x)([u,"optionalAccess",t=>t.startChild,"call",t=>t(i(this,e,s))]),o=t.call(this,...s);if((0,a.J8)(o))return o.then((t=>((0,r.x)([n,"optionalAccess",t=>t.finish,"call",t=>t()]),t)));if((l=o)&&"object"==typeof l&&l.once&&"function"==typeof l.once){const t=o;try{t.once("close",(()=>{(0,r.x)([n,"optionalAccess",t=>t.finish,"call",t=>t()])}))}catch(t){(0,r.x)([n,"optionalAccess",t=>t.finish,"call",t=>t()])}return t}return(0,r.x)([n,"optionalAccess",t=>t.finish,"call",t=>t()]),o}var l;const p=(0,r.x)([u,"optionalAccess",t=>t.startChild,"call",t=>t(i(this,e,s.slice(0,-1)))]);return t.call(this,...s.slice(0,-1),(function(t,e){(0,r.x)([p,"optionalAccess",t=>t.finish,"call",t=>t()]),o(t,e)}))}}))}_getSpanContextFromOperationArguments(t,e,n){const r={collectionName:t.collectionName,dbName:t.dbName,namespace:t.namespace,"db.system":"mongodb"},i={op:"db",description:e,data:r},s=l[e],o=Array.isArray(this._describeOperations)?this._describeOperations.includes(e):this._describeOperations;if(!s||!o)return i;try{if("mapReduce"===e){const[t,e]=n;r[s[0]]="string"==typeof t?t:t.name||"",r[s[1]]="string"==typeof e?e:e.name||""}else for(let t=0;t{"use strict";n.d(e,{m:()=>c});var r=n(4307),i=n(2176),s=n(2343),o=n(535),a=n(7990);class c{constructor(){c.prototype.__init.call(this)}static __initStatic(){this.id="Mysql"}__init(){this.name=c.id}loadDependency(){return this._module=this._module||(0,i.$y)("mysql/lib/Connection.js")}setupOnce(t,e){if((0,a.K)(e))return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&s.kg.log("Mysql Integration is skipped because of instrumenter configuration."));const n=this.loadDependency();n?(0,o.hl)(n,"createQuery",(function(t){return function(n,i,s){const o=e().getScope(),a=(0,r.x)([o,"optionalAccess",t=>t.getSpan,"call",t=>t()]),c=(0,r.x)([a,"optionalAccess",t=>t.startChild,"call",t=>t({description:"string"==typeof n?n:n.sql,op:"db",data:{"db.system":"mysql"}})]);return"function"==typeof s?t.call(this,n,i,(function(t,e,n){(0,r.x)([c,"optionalAccess",t=>t.finish,"call",t=>t()]),s(t,e,n)})):"function"==typeof i?t.call(this,n,(function(t,e,n){(0,r.x)([c,"optionalAccess",t=>t.finish,"call",t=>t()]),i(t,e,n)})):t.call(this,n,i,s)}})):("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&s.kg.error("Mysql Integration was unable to require `mysql` package.")}}c.__initStatic()},1370:(t,e,n)=>{"use strict";n.d(e,{E:()=>u});var r=n(4307),i=n(2176),s=n(2343),o=n(535),a=n(7597),c=n(7990);class u{static __initStatic(){this.id="Postgres"}__init(){this.name=u.id}constructor(t={}){u.prototype.__init.call(this),this._usePgNative=!!t.usePgNative}loadDependency(){return this._module=this._module||(0,i.$y)("pg")}setupOnce(t,e){if((0,c.K)(e))return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&s.kg.log("Postgres Integration is skipped because of instrumenter configuration."));const n=this.loadDependency();if(!n)return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&s.kg.error("Postgres Integration was unable to require `pg` package."));if(this._usePgNative&&!(0,r.x)([n,"access",t=>t.native,"optionalAccess",t=>t.Client]))return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&s.kg.error("Postgres Integration was unable to access 'pg-native' bindings."));const{Client:i}=this._usePgNative?n.native:n;(0,o.hl)(i.prototype,"query",(function(t){return function(n,i,s){const o=e().getScope(),c=(0,r.x)([o,"optionalAccess",t=>t.getSpan,"call",t=>t()]),u=(0,r.x)([c,"optionalAccess",t=>t.startChild,"call",t=>t({description:"string"==typeof n?n:n.text,op:"db",data:{"db.system":"postgresql"}})]);if("function"==typeof s)return t.call(this,n,i,(function(t,e){(0,r.x)([u,"optionalAccess",t=>t.finish,"call",t=>t()]),s(t,e)}));if("function"==typeof i)return t.call(this,n,(function(t,e){(0,r.x)([u,"optionalAccess",t=>t.finish,"call",t=>t()]),i(t,e)}));const l=void 0!==i?t.call(this,n,i):t.call(this,n);return(0,a.J8)(l)?l.then((t=>((0,r.x)([u,"optionalAccess",t=>t.finish,"call",t=>t()]),t))):((0,r.x)([u,"optionalAccess",t=>t.finish,"call",t=>t()]),l)}}))}}u.__initStatic()},9889:(t,e,n)=>{"use strict";n.d(e,{g:()=>o});var r=n(1250),i=n(2343),s=n(7990);class o{static __initStatic(){this.id="Prisma"}__init(){this.name=o.id}constructor(t={}){var e;o.prototype.__init.call(this),(e=t.client)&&e.$use?this._client=t.client:("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&i.kg.warn(`Unsupported Prisma client provided to PrismaIntegration. Provided client: ${JSON.stringify(t.client)}`)}setupOnce(t,e){this._client?(0,s.K)(e)?("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&i.kg.log("Prisma Integration is skipped because of instrumenter configuration."):this._client.$use(((t,e)=>{const n=t.action,i=t.model;return(0,r.g)({name:i?`${i} ${n}`:n,op:"db.sql.prisma",data:{"db.system":"prisma"}},(()=>e(t)))})):("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&i.kg.error("PrismaIntegration is missing a Prisma Client Instance")}}o.__initStatic()},7990:(t,e,n)=>{"use strict";n.d(e,{K:()=>i});var r=n(4307);function i(t){const e=(0,r.x)([t,"call",t=>t(),"access",t=>t.getClient,"call",t=>t(),"optionalAccess",t=>t.getOptions,"call",t=>t()]);return"sentry"!==((0,r.x)([e,"optionalAccess",t=>t.instrumenter])||"sentry")}},1131:(t,e,n)=>{"use strict";n.d(e,{J:()=>r});const r="production"},5659:(t,e,n)=>{"use strict";n.d(e,{$b:()=>y,Gd:()=>_,Ok:()=>b,Xb:()=>d,cu:()=>h,j0:()=>w,pj:()=>f,uZ:()=>g,vi:()=>E});var r=n(2844),i=n(1170),s=n(2343),o=n(1235),a=n(1131),c=n(350),u=n(9015);const l=4,p=100;class d{constructor(t,e=new c.s,n=l){this._version=n,this._stack=[{scope:e}],t&&this.bindClient(t)}isOlderThan(t){return this._version{r.captureException(t,{originalException:t,syntheticException:i,...e,event_id:n},s)})),n}captureMessage(t,e,n){const i=this._lastEventId=n&&n.event_id?n.event_id:(0,r.DM)(),s=new Error(t);return this._withClient(((r,o)=>{r.captureMessage(t,e,{originalException:t,syntheticException:s,...n,event_id:i},o)})),i}captureEvent(t,e){const n=e&&e.event_id?e.event_id:(0,r.DM)();return t.type||(this._lastEventId=n),this._withClient(((r,i)=>{r.captureEvent(t,{...e,event_id:n},i)})),n}lastEventId(){return this._lastEventId}addBreadcrumb(t,e){const{scope:n,client:r}=this.getStackTop();if(!r)return;const{beforeBreadcrumb:o=null,maxBreadcrumbs:a=p}=r.getOptions&&r.getOptions()||{};if(a<=0)return;const c={timestamp:(0,i.yW)(),...t},u=o?(0,s.Cf)((()=>o(c,e))):c;null!==u&&(r.emit&&r.emit("beforeAddBreadcrumb",u,e),n.addBreadcrumb(u,a))}setUser(t){this.getScope().setUser(t)}setTags(t){this.getScope().setTags(t)}setExtras(t){this.getScope().setExtras(t)}setTag(t,e){this.getScope().setTag(t,e)}setExtra(t,e){this.getScope().setExtra(t,e)}setContext(t,e){this.getScope().setContext(t,e)}configureScope(t){const{scope:e,client:n}=this.getStackTop();n&&t(e)}run(t){const e=f(this);try{t(this)}finally{f(e)}}getIntegration(t){const e=this.getClient();if(!e)return null;try{return e.getIntegration(t)}catch(e){return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&s.kg.warn(`Cannot retrieve integration ${t.id} from the current Hub`),null}}startTransaction(t,e){const n=this._callExtensionMethod("startTransaction",t,e);return"undefined"!=typeof __SENTRY_DEBUG__&&!__SENTRY_DEBUG__||n||console.warn("Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':\nSentry.addTracingExtensions();\nSentry.init({...});\n"),n}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(t=!1){if(t)return this.endSession();this._sendSessionUpdate()}endSession(){const t=this.getStackTop().scope,e=t.getSession();e&&(0,u.RJ)(e),this._sendSessionUpdate(),t.setSession()}startSession(t){const{scope:e,client:n}=this.getStackTop(),{release:r,environment:i=a.J}=n&&n.getOptions()||{},{userAgent:s}=o.n2.navigator||{},c=(0,u.Hv)({release:r,environment:i,user:e.getUser(),...s&&{userAgent:s},...t}),l=e.getSession&&e.getSession();return l&&"ok"===l.status&&(0,u.CT)(l,{status:"exited"}),this.endSession(),e.setSession(c),c}shouldSendDefaultPii(){const t=this.getClient(),e=t&&t.getOptions();return Boolean(e&&e.sendDefaultPii)}_sendSessionUpdate(){const{scope:t,client:e}=this.getStackTop(),n=t.getSession();n&&e&&e.captureSession&&e.captureSession(n)}_withClient(t){const{scope:e,client:n}=this.getStackTop();n&&t(n,e)}_callExtensionMethod(t,...e){const n=h().__SENTRY__;if(n&&n.extensions&&"function"==typeof n.extensions[t])return n.extensions[t].apply(this,e);("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&s.kg.warn(`Extension method ${t} couldn't be found, doing nothing.`)}}function h(){return o.n2.__SENTRY__=o.n2.__SENTRY__||{extensions:{},hub:void 0},o.n2}function f(t){const e=h(),n=E(e);return w(e,t),n}function _(){const t=h();if(t.__SENTRY__&&t.__SENTRY__.acs){const e=t.__SENTRY__.acs.getCurrentHub();if(e)return e}return m(t)}function m(t=h()){return v(t)&&!E(t).isOlderThan(l)||w(t,new d),E(t)}function g(t,e=m()){if(!v(t)||E(t).isOlderThan(l)){const n=e.getStackTop();w(t,new d(n.client,c.s.clone(n.scope)))}}function y(t){const e=h();e.__SENTRY__=e.__SENTRY__||{},e.__SENTRY__.acs=t}function b(t,e={}){const n=h();return n.__SENTRY__&&n.__SENTRY__.acs?n.__SENTRY__.acs.runWithAsyncContext(t,e):t()}function v(t){return!!(t&&t.__SENTRY__&&t.__SENTRY__.hub)}function E(t){return(0,o.YO)("hub",(()=>new d),t)}function w(t,e){return!!t&&((t.__SENTRY__=t.__SENTRY__||{}).hub=e,!0)}},350:(t,e,n)=>{"use strict";n.d(e,{c:()=>d,s:()=>l});var r=n(7597),i=n(1170),s=n(6893),o=n(2343),a=n(2844),c=n(1235),u=n(9015);class l{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={}}static clone(t){const e=new l;return t&&(e._breadcrumbs=[...t._breadcrumbs],e._tags={...t._tags},e._extra={...t._extra},e._contexts={...t._contexts},e._user=t._user,e._level=t._level,e._span=t._span,e._session=t._session,e._transactionName=t._transactionName,e._fingerprint=t._fingerprint,e._eventProcessors=[...t._eventProcessors],e._requestSession=t._requestSession,e._attachments=[...t._attachments],e._sdkProcessingMetadata={...t._sdkProcessingMetadata}),e}addScopeListener(t){this._scopeListeners.push(t)}addEventProcessor(t){return this._eventProcessors.push(t),this}setUser(t){return this._user=t||{},this._session&&(0,u.CT)(this._session,{user:t}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(t){return this._requestSession=t,this}setTags(t){return this._tags={...this._tags,...t},this._notifyScopeListeners(),this}setTag(t,e){return this._tags={...this._tags,[t]:e},this._notifyScopeListeners(),this}setExtras(t){return this._extra={...this._extra,...t},this._notifyScopeListeners(),this}setExtra(t,e){return this._extra={...this._extra,[t]:e},this._notifyScopeListeners(),this}setFingerprint(t){return this._fingerprint=t,this._notifyScopeListeners(),this}setLevel(t){return this._level=t,this._notifyScopeListeners(),this}setTransactionName(t){return this._transactionName=t,this._notifyScopeListeners(),this}setContext(t,e){return null===e?delete this._contexts[t]:this._contexts[t]=e,this._notifyScopeListeners(),this}setSpan(t){return this._span=t,this._notifyScopeListeners(),this}getSpan(){return this._span}getTransaction(){const t=this.getSpan();return t&&t.transaction}setSession(t){return t?this._session=t:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;if("function"==typeof t){const e=t(this);return e instanceof l?e:this}return t instanceof l?(this._tags={...this._tags,...t._tags},this._extra={...this._extra,...t._extra},this._contexts={...this._contexts,...t._contexts},t._user&&Object.keys(t._user).length&&(this._user=t._user),t._level&&(this._level=t._level),t._fingerprint&&(this._fingerprint=t._fingerprint),t._requestSession&&(this._requestSession=t._requestSession)):(0,r.PO)(t)&&(this._tags={...this._tags,...t.tags},this._extra={...this._extra,...t.extra},this._contexts={...this._contexts,...t.contexts},t.user&&(this._user=t.user),t.level&&(this._level=t.level),t.fingerprint&&(this._fingerprint=t.fingerprint),t.requestSession&&(this._requestSession=t.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(t,e){const n="number"==typeof e?e:100;if(n<=0)return this;const r={timestamp:(0,i.yW)(),...t};return this._breadcrumbs=[...this._breadcrumbs,r].slice(-n),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(t){return this._attachments.push(t),this}getAttachments(){return this._attachments}clearAttachments(){return this._attachments=[],this}applyToEvent(t,e={}){if(this._extra&&Object.keys(this._extra).length&&(t.extra={...this._extra,...t.extra}),this._tags&&Object.keys(this._tags).length&&(t.tags={...this._tags,...t.tags}),this._user&&Object.keys(this._user).length&&(t.user={...this._user,...t.user}),this._contexts&&Object.keys(this._contexts).length&&(t.contexts={...this._contexts,...t.contexts}),this._level&&(t.level=this._level),this._transactionName&&(t.transaction=this._transactionName),this._span){t.contexts={trace:this._span.getTraceContext(),...t.contexts};const e=this._span.transaction;if(e){t.sdkProcessingMetadata={dynamicSamplingContext:e.getDynamicSamplingContext(),...t.sdkProcessingMetadata};const n=e.name;n&&(t.tags={transaction:n,...t.tags})}}return this._applyFingerprint(t),t.breadcrumbs=[...t.breadcrumbs||[],...this._breadcrumbs],t.breadcrumbs=t.breadcrumbs.length>0?t.breadcrumbs:void 0,t.sdkProcessingMetadata={...t.sdkProcessingMetadata,...this._sdkProcessingMetadata},this._notifyEventProcessors([...p(),...this._eventProcessors],t,e)}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...t},this}_notifyEventProcessors(t,e,n,i=0){return new s.cW(((s,a)=>{const c=t[i];if(null===e||"function"!=typeof c)s(e);else{const u=c({...e},n);("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&c.id&&null===u&&o.kg.log(`Event processor "${c.id}" dropped event`),(0,r.J8)(u)?u.then((e=>this._notifyEventProcessors(t,e,n,i+1).then(s))).then(null,a):this._notifyEventProcessors(t,u,n,i+1).then(s).then(null,a)}}))}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((t=>{t(this)})),this._notifyingListeners=!1)}_applyFingerprint(t){t.fingerprint=t.fingerprint?(0,a.lE)(t.fingerprint):[],this._fingerprint&&(t.fingerprint=t.fingerprint.concat(this._fingerprint)),t.fingerprint&&!t.fingerprint.length&&delete t.fingerprint}}function p(){return(0,c.YO)("globalEventProcessors",(()=>[]))}function d(t){p().push(t)}},9015:(t,e,n)=>{"use strict";n.d(e,{CT:()=>a,Hv:()=>o,RJ:()=>c});var r=n(1170),i=n(2844),s=n(535);function o(t){const e=(0,r.ph)(),n={sid:(0,i.DM)(),init:!0,timestamp:e,started:e,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(t){return(0,s.Jr)({sid:`${t.sid}`,init:t.init,started:new Date(1e3*t.started).toISOString(),timestamp:new Date(1e3*t.timestamp).toISOString(),status:t.status,errors:t.errors,did:"number"==typeof t.did||"string"==typeof t.did?`${t.did}`:void 0,duration:t.duration,attrs:{release:t.release,environment:t.environment,ip_address:t.ipAddress,user_agent:t.userAgent}})}(n)};return t&&a(n,t),n}function a(t,e={}){if(e.user&&(!t.ipAddress&&e.user.ip_address&&(t.ipAddress=e.user.ip_address),t.did||e.did||(t.did=e.user.id||e.user.email||e.user.username)),t.timestamp=e.timestamp||(0,r.ph)(),e.ignoreDuration&&(t.ignoreDuration=e.ignoreDuration),e.sid&&(t.sid=32===e.sid.length?e.sid:(0,i.DM)()),void 0!==e.init&&(t.init=e.init),!t.did&&e.did&&(t.did=`${e.did}`),"number"==typeof e.started&&(t.started=e.started),t.ignoreDuration)t.duration=void 0;else if("number"==typeof e.duration)t.duration=e.duration;else{const e=t.timestamp-t.started;t.duration=e>=0?e:0}e.release&&(t.release=e.release),e.environment&&(t.environment=e.environment),!t.ipAddress&&e.ipAddress&&(t.ipAddress=e.ipAddress),!t.userAgent&&e.userAgent&&(t.userAgent=e.userAgent),"number"==typeof e.errors&&(t.errors=e.errors),e.status&&(t.status=e.status)}function c(t,e){let n={};e?n={status:e}:"ok"===t.status&&(n={status:"exited"}),a(t,n)}},6890:(t,e,n)=>{"use strict";n.d(e,{T:()=>g,l:()=>m});var r=n(2343),i=n(7597),s=n(5659),o=n(7522),a=n(1688),c=n(9791);let u=!1;function l(){const t=(0,c.x1)();if(t){const e="internal_error";("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&r.kg.log(`[Tracing] Transaction: ${e} -> Global error occured`),t.setStatus(e)}}l.tag="sentry_tracingErrorCallback";var p=n(5544),d=n(8069);function h(){const t=this.getScope().getSpan();return t?{"sentry-trace":t.toTraceparent()}:{}}function f(t,e,n){if(!(0,o.z)(e))return t.sampled=!1,t;if(void 0!==t.sampled)return t.setMetadata({sampleRate:Number(t.sampled)}),t;let s;return"function"==typeof e.tracesSampler?(s=e.tracesSampler(n),t.setMetadata({sampleRate:Number(s)})):void 0!==n.parentSampled?s=n.parentSampled:void 0!==e.tracesSampleRate?(s=e.tracesSampleRate,t.setMetadata({sampleRate:Number(s)})):(s=1,t.setMetadata({sampleRate:s})),a=s,((0,i.i2)(a)||"number"!=typeof a&&"boolean"!=typeof a?(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&r.kg.warn(`[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(a)} of type ${JSON.stringify(typeof a)}.`),0):!(a<0||a>1)||(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&r.kg.warn(`[Tracing] Given sample rate is invalid. Sample rate must be between 0 and 1. Got ${a}.`),0))?s?(t.sampled=Math.random(){"use strict";n.d(e,{AT:()=>a,io:()=>l});var r=n(1170),i=n(2343),s=n(8903),o=n(8069);const a={idleTimeout:1e3,finalTimeout:3e4,heartbeatInterval:5e3},c=["heartbeatFailed","idleTimeout","documentHidden","finalTimeout","externalFinish","cancelled"];class u extends s.gB{constructor(t,e,n,r){super(r),this._pushActivity=t,this._popActivity=e,this.transactionSpanId=n}add(t){t.spanId!==this.transactionSpanId&&(t.finish=e=>{t.endTimestamp="number"==typeof e?e:(0,r.ph)(),this._popActivity(t.spanId)},void 0===t.endTimestamp&&this._pushActivity(t.spanId)),super.add(t)}}class l extends o.Y{__init(){this.activities={}}__init2(){this._heartbeatCounter=0}__init3(){this._finished=!1}__init4(){this._idleTimeoutCanceledPermanently=!1}__init5(){this._beforeFinishCallbacks=[]}__init6(){this._finishReason=c[4]}constructor(t,e,n=a.idleTimeout,r=a.finalTimeout,s=a.heartbeatInterval,o=!1){super(t,e),this._idleHub=e,this._idleTimeout=n,this._finalTimeout=r,this._heartbeatInterval=s,this._onScope=o,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),o&&(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&i.kg.log(`Setting idle transaction on scope. Span ID: ${this.spanId}`),e.configureScope((t=>t.setSpan(this)))),this._restartIdleTimeout(),setTimeout((()=>{this._finished||(this.setStatus("deadline_exceeded"),this._finishReason=c[3],this.finish())}),this._finalTimeout)}finish(t=(0,r.ph)()){if(this._finished=!0,this.activities={},"ui.action.click"===this.op&&this.setTag("finishReason",this._finishReason),this.spanRecorder){("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&i.kg.log("[Tracing] finishing IdleTransaction",new Date(1e3*t).toISOString(),this.op);for(const e of this._beforeFinishCallbacks)e(this,t);this.spanRecorder.spans=this.spanRecorder.spans.filter((e=>{if(e.spanId===this.spanId)return!0;e.endTimestamp||(e.endTimestamp=t,e.setStatus("cancelled"),("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&i.kg.log("[Tracing] cancelling span since transaction ended early",JSON.stringify(e,void 0,2)));const n=e.startTimestamp{this._finished||this._pushActivity(t)},n=t=>{this._finished||this._popActivity(t)};this.spanRecorder=new u(e,n,this.spanId,t),("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&i.kg.log("Starting heartbeat"),this._pingHeartbeat()}this.spanRecorder.add(this)}cancelIdleTimeout(t,{restartOnChildSpanChange:e}={restartOnChildSpanChange:!0}){this._idleTimeoutCanceledPermanently=!1===e,this._idleTimeoutID&&(clearTimeout(this._idleTimeoutID),this._idleTimeoutID=void 0,0===Object.keys(this.activities).length&&this._idleTimeoutCanceledPermanently&&(this._finishReason=c[5],this.finish(t)))}setFinishReason(t){this._finishReason=t}_restartIdleTimeout(t){this.cancelIdleTimeout(),this._idleTimeoutID=setTimeout((()=>{this._finished||0!==Object.keys(this.activities).length||(this._finishReason=c[1],this.finish(t))}),this._idleTimeout)}_pushActivity(t){this.cancelIdleTimeout(void 0,{restartOnChildSpanChange:!this._idleTimeoutCanceledPermanently}),("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&i.kg.log(`[Tracing] pushActivity: ${t}`),this.activities[t]=!0,("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&i.kg.log("[Tracing] new activities count",Object.keys(this.activities).length)}_popActivity(t){if(this.activities[t]&&(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&i.kg.log(`[Tracing] popActivity ${t}`),delete this.activities[t],("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&i.kg.log("[Tracing] new activities count",Object.keys(this.activities).length)),0===Object.keys(this.activities).length){const t=(0,r.ph)();this._idleTimeoutCanceledPermanently?(this._finishReason=c[5],this.finish(t)):this._restartIdleTimeout(t+this._idleTimeout/1e3)}}_beat(){if(this._finished)return;const t=Object.keys(this.activities).join("");t===this._prevHeartbeatString?this._heartbeatCounter++:this._heartbeatCounter=1,this._prevHeartbeatString=t,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._finishReason=c[0],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)}}},8903:(t,e,n)=>{"use strict";n.d(e,{Dr:()=>c,Zd:()=>u,gB:()=>a});var r=n(2844),i=n(1170),s=n(2343),o=n(535);class a{__init(){this.spans=[]}constructor(t=1e3){a.prototype.__init.call(this),this._maxlen=t}add(t){this.spans.length>this._maxlen?t.spanRecorder=void 0:this.spans.push(t)}}class c{__init2(){this.traceId=(0,r.DM)()}__init3(){this.spanId=(0,r.DM)().substring(16)}__init4(){this.startTimestamp=(0,i.ph)()}__init5(){this.tags={}}__init6(){this.data={}}__init7(){this.instrumenter="sentry"}constructor(t){if(c.prototype.__init2.call(this),c.prototype.__init3.call(this),c.prototype.__init4.call(this),c.prototype.__init5.call(this),c.prototype.__init6.call(this),c.prototype.__init7.call(this),!t)return this;t.traceId&&(this.traceId=t.traceId),t.spanId&&(this.spanId=t.spanId),t.parentSpanId&&(this.parentSpanId=t.parentSpanId),"sampled"in t&&(this.sampled=t.sampled),t.op&&(this.op=t.op),t.description&&(this.description=t.description),t.data&&(this.data=t.data),t.tags&&(this.tags=t.tags),t.status&&(this.status=t.status),t.startTimestamp&&(this.startTimestamp=t.startTimestamp),t.endTimestamp&&(this.endTimestamp=t.endTimestamp),t.instrumenter&&(this.instrumenter=t.instrumenter)}startChild(t){const e=new c({...t,parentSpanId:this.spanId,sampled:this.sampled,traceId:this.traceId});if(e.spanRecorder=this.spanRecorder,e.spanRecorder&&e.spanRecorder.add(e),e.transaction=this.transaction,("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&e.transaction){const n=`[Tracing] Starting '${t&&t.op||"< unknown op >"}' span on transaction '${e.transaction.name||"< unknown name >"}' (${e.transaction.spanId}).`;e.transaction.metadata.spanMetadata[e.spanId]={logMessage:n},s.kg.log(n)}return e}setTag(t,e){return this.tags={...this.tags,[t]:e},this}setData(t,e){return this.data={...this.data,[t]:e},this}setStatus(t){return this.status=t,this}setHttpStatus(t){this.setTag("http.status_code",String(t));const e=u(t);return"unknown_error"!==e&&this.setStatus(e),this}isSuccess(){return"ok"===this.status}finish(t){if(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&this.transaction&&this.transaction.spanId!==this.spanId){const{logMessage:t}=this.transaction.metadata.spanMetadata[this.spanId];t&&s.kg.log(t.replace("Starting","Finishing"))}this.endTimestamp="number"==typeof t?t:(0,i.ph)()}toTraceparent(){let t="";return void 0!==this.sampled&&(t=this.sampled?"-1":"-0"),`${this.traceId}-${this.spanId}${t}`}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(t){return this.data=t.data||{},this.description=t.description,this.endTimestamp=t.endTimestamp,this.op=t.op,this.parentSpanId=t.parentSpanId,this.sampled=t.sampled,this.spanId=t.spanId||this.spanId,this.startTimestamp=t.startTimestamp||this.startTimestamp,this.status=t.status,this.tags=t.tags||{},this.traceId=t.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})}}function u(t){if(t<400&&t>=100)return"ok";if(t>=400&&t<500)switch(t){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(t>=500&&t<600)switch(t){case 501:return"unimplemented";case 503:return"unavailable";case 504:return"deadline_exceeded";default:return"internal_error"}return"unknown_error"}},1250:(t,e,n)=>{"use strict";n.d(e,{g:()=>s});var r=n(7597),i=n(5659);function s(t,e,n=(()=>{})){const s={...t};void 0!==s.name&&void 0===s.description&&(s.description=s.name);const o=(0,i.Gd)(),a=o.getScope(),c=a.getSpan(),u=c?c.startChild(s):o.startTransaction(s);function l(){u&&u.finish(),o.getScope().setSpan(c)}let p;a.setSpan(u);try{p=e(u)}catch(t){throw u&&u.setStatus("internal_error"),n(t),l(),t}return(0,r.J8)(p)?Promise.resolve(p).then((()=>{l()}),(t=>{u&&u.setStatus("internal_error"),n(t),l()})):l(),p}},8069:(t,e,n)=>{"use strict";n.d(e,{Y:()=>c});var r=n(2343),i=n(535),s=n(1131),o=n(5659),a=n(8903);class c extends a.Dr{__init(){this._measurements={}}__init2(){this._contexts={}}__init3(){this._frozenDynamicSamplingContext=void 0}constructor(t,e){super(t),c.prototype.__init.call(this),c.prototype.__init2.call(this),c.prototype.__init3.call(this),this._hub=e||(0,o.Gd)(),this._name=t.name||"",this.metadata={source:"custom",...t.metadata,spanMetadata:{}},this._trimEnd=t.trimEnd,this.transaction=this;const n=this.metadata.dynamicSamplingContext;n&&(this._frozenDynamicSamplingContext={...n})}get name(){return this._name}set name(t){this.setName(t)}setName(t,e="custom"){this._name=t,this.metadata.source=e}initSpanRecorder(t=1e3){this.spanRecorder||(this.spanRecorder=new a.gB(t)),this.spanRecorder.add(this)}setContext(t,e){null===e?delete this._contexts[t]:this._contexts[t]=e}setMeasurement(t,e,n=""){this._measurements[t]={value:e,unit:n}}setMetadata(t){this.metadata={...this.metadata,...t}}finish(t){if(void 0!==this.endTimestamp)return;this.name||(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&r.kg.warn("Transaction has no name, falling back to ``."),this.name=""),super.finish(t);const e=this._hub.getClient();if(e&&e.emit&&e.emit("finishTransaction",this),!0!==this.sampled)return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&r.kg.log("[Tracing] Discarding transaction because its trace was not chosen to be sampled."),void(e&&e.recordDroppedEvent("sample_rate","transaction"));const n=this.spanRecorder?this.spanRecorder.spans.filter((t=>t!==this&&t.endTimestamp)):[];this._trimEnd&&n.length>0&&(this.endTimestamp=n.reduce(((t,e)=>t.endTimestamp&&e.endTimestamp?t.endTimestamp>e.endTimestamp?t:e:t)).endTimestamp);const i=this.metadata,s={contexts:{...this._contexts,trace:this.getTraceContext()},spans:n,start_timestamp:this.startTimestamp,tags:this.tags,timestamp:this.endTimestamp,transaction:this.name,type:"transaction",sdkProcessingMetadata:{...i,dynamicSamplingContext:this.getDynamicSamplingContext()},...i.source&&{transaction_info:{source:i.source}}};return Object.keys(this._measurements).length>0&&(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&r.kg.log("[Measurements] Adding measurements to transaction",JSON.stringify(this._measurements,void 0,2)),s.measurements=this._measurements),("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&r.kg.log(`[Tracing] Finishing ${this.op} transaction: ${this.name}.`),this._hub.captureEvent(s)}toContext(){const t=super.toContext();return(0,i.Jr)({...t,name:this.name,trimEnd:this._trimEnd})}updateWithContext(t){return super.updateWithContext(t),this.name=t.name||"",this._trimEnd=t.trimEnd,this}getDynamicSamplingContext(){if(this._frozenDynamicSamplingContext)return this._frozenDynamicSamplingContext;const t=this._hub||(0,o.Gd)(),e=t&&t.getClient();if(!e)return{};const{environment:n,release:r}=e.getOptions()||{},{publicKey:a}=e.getDsn()||{},c=this.metadata.sampleRate,u=void 0!==c?c.toString():void 0,{segment:l}=t.getScope().getUser()||{},p=this.metadata.source,d=p&&"url"!==p?this.name:void 0,h=(0,i.Jr)({environment:n||s.J,release:r,transaction:d,user_segment:l,public_key:a,trace_id:this.traceId,sample_rate:u});return e.emit&&e.emit("createDsc",h),h}setHub(t){this._hub=t}}},9791:(t,e,n)=>{"use strict";n.d(e,{x1:()=>i});var r=n(5659);function i(t){return(t||(0,r.Gd)()).getScope().getTransaction()}},7522:(t,e,n)=>{"use strict";n.d(e,{z:()=>i});var r=n(5659);function i(t){if("boolean"==typeof __SENTRY_TRACING__&&!__SENTRY_TRACING__)return!1;const e=(0,r.Gd)().getClient(),n=t||e&&e.getOptions();return!!n&&(n.enableTracing||"tracesSampleRate"in n||"tracesSampler"in n)}},4776:(t,e,n)=>{"use strict";n.r(e),n.d(e,{DEFAULT_USER_INCLUDES:()=>Ie,Handlers:()=>i,Hub:()=>y.Xb,Integrations:()=>un,NodeClient:()=>Dt,SDK_VERSION:()=>g,Scope:()=>nt.s,addBreadcrumb:()=>T,addGlobalEventProcessor:()=>nt.c,addRequestDataToEvent:()=>De,autoDiscoverNodePerformanceMonitoringIntegrations:()=>ct,captureCheckIn:()=>A,captureEvent:()=>E,captureException:()=>b,captureMessage:()=>v,close:()=>Ge,configureScope:()=>w,createTransport:()=>tt,deepReadDirSync:()=>He,defaultIntegrations:()=>Fe,defaultStackParser:()=>Ve,extractRequestData:()=>Oe,extractTraceparentData:()=>rt.q,flush:()=>$e,getActiveTransaction:()=>it.x1,getCurrentHub:()=>y.Gd,getHubFromCarrier:()=>y.vi,getSentryRelease:()=>Ye,init:()=>Be,lastEventId:()=>Le,makeMain:()=>y.pj,makeNodeTransport:()=>Mt,runWithAsyncContext:()=>y.Ok,setContext:()=>S,setExtra:()=>x,setExtras:()=>I,setTag:()=>D,setTags:()=>O,setUser:()=>N,spanStatusfromHttpCode:()=>st.Zd,startTransaction:()=>k,trace:()=>ot.g,withScope:()=>C});var r={};n.r(r),n.d(r,{FunctionToString:()=>u,InboundFilters:()=>_});var i={};n.r(i),n.d(i,{errorHandler:()=>Qe,extractRequestData:()=>We,parseRequest:()=>Je,requestHandler:()=>Xe,tracingHandler:()=>Ke,trpcMiddleware:()=>tn});var s={};n.r(s),n.d(s,{Console:()=>Ht,Context:()=>fe,ContextLines:()=>se,Http:()=>Xt,LinkedErrors:()=>ae,LocalVariables:()=>Ue,Modules:()=>le,OnUncaughtException:()=>ee,OnUnhandledRejection:()=>ne,RequestData:()=>Ce,Undici:()=>je.Y});var o={};n.r(o),n.d(o,{Apollo:()=>en._,Express:()=>nn.N,GraphQL:()=>rn.k,Mongo:()=>sn._,Mysql:()=>on.m,Postgres:()=>an.E,Prisma:()=>cn.g});var a=n(535);let c;class u{constructor(){u.prototype.__init.call(this)}static __initStatic(){this.id="FunctionToString"}__init(){this.name=u.id}setupOnce(){c=Function.prototype.toString;try{Function.prototype.toString=function(...t){const e=(0,a.HK)(this)||this;return c.apply(e,t)}}catch(t){}}}u.__initStatic();var l=n(2343),p=n(2844),d=n(7321);const h=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/],f=[/^.*healthcheck.*$/,/^.*healthy.*$/,/^.*live.*$/,/^.*ready.*$/,/^.*heartbeat.*$/,/^.*\/health$/,/^.*\/healthz$/];class _{static __initStatic(){this.id="InboundFilters"}__init(){this.name=_.id}constructor(t={}){this._options=t,_.prototype.__init.call(this)}setupOnce(t,e){const n=t=>{const n=e();if(n){const e=n.getIntegration(_);if(e){const r=n.getClient(),i=r?r.getOptions():{},s=function(t={},e={}){return{allowUrls:[...t.allowUrls||[],...e.allowUrls||[]],denyUrls:[...t.denyUrls||[],...e.denyUrls||[]],ignoreErrors:[...t.ignoreErrors||[],...e.ignoreErrors||[],...t.disableErrorDefaults?[]:h],ignoreTransactions:[...t.ignoreTransactions||[],...e.ignoreTransactions||[],...t.disableTransactionDefaults?[]:f],ignoreInternal:void 0===t.ignoreInternal||t.ignoreInternal}}(e._options,i);return function(t,e){return e.ignoreInternal&&function(t){try{return"SentryError"===t.exception.values[0].type}catch(t){}return!1}(t)?(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&l.kg.warn(`Event dropped due to being internal Sentry Error.\nEvent: ${(0,p.jH)(t)}`),!0):function(t,e){return!(t.type||!e||!e.length)&&function(t){if(t.message)return[t.message];if(t.exception){const{values:e}=t.exception;try{const{type:t="",value:n=""}=e&&e[e.length-1]||{};return[`${n}`,`${t}: ${n}`]}catch(e){return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&l.kg.error(`Cannot extract message for event ${(0,p.jH)(t)}`),[]}}return[]}(t).some((t=>(0,d.U0)(t,e)))}(t,e.ignoreErrors)?(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&l.kg.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${(0,p.jH)(t)}`),!0):function(t,e){if("transaction"!==t.type||!e||!e.length)return!1;const n=t.transaction;return!!n&&(0,d.U0)(n,e)}(t,e.ignoreTransactions)?(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&l.kg.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.\nEvent: ${(0,p.jH)(t)}`),!0):function(t,e){if(!e||!e.length)return!1;const n=m(t);return!!n&&(0,d.U0)(n,e)}(t,e.denyUrls)?(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&l.kg.warn(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${(0,p.jH)(t)}.\nUrl: ${m(t)}`),!0):!function(t,e){if(!e||!e.length)return!0;const n=m(t);return!n||(0,d.U0)(n,e)}(t,e.allowUrls)&&(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&l.kg.warn(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${(0,p.jH)(t)}.\nUrl: ${m(t)}`),!0)}(t,s)?null:t}}return t};n.id=this.name,t(n)}}function m(t){try{let e;try{e=t.exception.values[0].stacktrace.frames}catch(t){}return e?function(t=[]){for(let e=t.length-1;e>=0;e--){const n=t[e];if(n&&""!==n.filename&&"[native code]"!==n.filename)return n.filename||null}return null}(e):null}catch(e){return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&l.kg.error(`Cannot extract url for event ${(0,p.jH)(t)}`),null}}_.__initStatic();const g="7.56.0";var y=n(5659);function b(t,e){return(0,y.Gd)().captureException(t,{captureContext:e})}function v(t,e){const n="string"==typeof e?e:void 0,r="string"!=typeof e?{captureContext:e}:void 0;return(0,y.Gd)().captureMessage(t,n,r)}function E(t,e){return(0,y.Gd)().captureEvent(t,e)}function w(t){(0,y.Gd)().configureScope(t)}function T(t){(0,y.Gd)().addBreadcrumb(t)}function S(t,e){(0,y.Gd)().setContext(t,e)}function I(t){(0,y.Gd)().setExtras(t)}function x(t,e){(0,y.Gd)().setExtra(t,e)}function O(t){(0,y.Gd)().setTags(t)}function D(t,e){(0,y.Gd)().setTag(t,e)}function N(t){(0,y.Gd)().setUser(t)}function C(t){(0,y.Gd)().withScope(t)}function k(t,e){return(0,y.Gd)().startTransaction({...t},e)}function A(t,e){const n=(0,y.Gd)().getClient();if(n){if(n.captureCheckIn)return n.captureCheckIn(t,e);("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&l.kg.warn("Cannot capture check-in. Client does not support sending check-ins.")}else("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&l.kg.warn("Cannot capture check-in. No client defined.");return(0,p.DM)()}class R extends Error{constructor(t,e="warn"){super(t),this.message=t,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=e}}var P=n(6893);const U=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function j(t,e=!1){const{host:n,path:r,pass:i,port:s,projectId:o,protocol:a,publicKey:c}=t;return`${a}://${c}${e&&i?`:${i}`:""}@${n}${s?`:${s}`:""}/${r?`${r}/`:r}${o}`}function M(t){return{protocol:t.protocol,publicKey:t.publicKey||"",pass:t.pass||"",host:t.host,port:t.port||"",path:t.path||"",projectId:t.projectId}}var F=n(7597),B=n(6147);function L(t,e=100,n=1/0){try{return G("",t,e,n)}catch(t){return{ERROR:`**non-serializable** (${t})`}}}function $(t,e=3,n=102400){const r=L(t,e);return i=r,function(t){return~-encodeURI(t).split(/%..|./).length}(JSON.stringify(i))>n?$(t,e-1,n):r;var i}function G(t,e,n=1/0,r=1/0,i=function(){const t="function"==typeof WeakSet,e=t?new WeakSet:[];return[function(n){if(t)return!!e.has(n)||(e.add(n),!1);for(let t=0;t=r){p[t]="[MaxProperties ~]";break}const e=h[t];p[t]=G(t,e,u-1,r,i),d++}return o(e),p}function q(t,e=[]){return[t,e]}function Y(t,e){const[n,r]=t;return[n,[...r,e]]}function V(t,e){const n=t[1];for(const t of n)if(e(t,t[0].type))return!0;return!1}function H(t,e){return(e||new TextEncoder).encode(t)}function z(t,e){const[n,r]=t;let i=JSON.stringify(n);function s(t){"string"==typeof i?i="string"==typeof t?i+t:[H(i,e),t]:i.push("string"==typeof t?H(t,e):t)}for(const t of r){const[e,n]=t;if(s(`\n${JSON.stringify(e)}\n`),"string"==typeof n||n instanceof Uint8Array)s(n);else{let t;try{t=JSON.stringify(n)}catch(e){t=JSON.stringify(L(n))}s(t)}}return"string"==typeof i?i:function(t){const e=t.reduce(((t,e)=>t+e.length),0),n=new Uint8Array(e);let r=0;for(const e of t)n.set(e,r),r+=e.length;return n}(i)}function W(t,e){const n="string"==typeof t.data?H(t.data,e):t.data;return[(0,a.Jr)({type:"attachment",length:n.length,filename:t.filename,content_type:t.contentType,attachment_type:t.attachmentType}),n]}const J={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor"};function K(t){return J[t]}function X(t){if(!t||!t.sdk)return;const{name:e,version:n}=t.sdk;return{name:e,version:n}}const Z=6e4;const Q=30;function tt(t,e,n=function(t){const e=[];function n(t){return e.splice(e.indexOf(t),1)[0]}return{$:e,add:function(r){if(!(void 0===t||e.lengthn(i))).then(null,(()=>n(i).then(null,(()=>{})))),i},drain:function(t){return new P.cW(((n,r)=>{let i=e.length;if(!i)return n(!0);const s=setTimeout((()=>{t&&t>0&&n(!1)}),t);e.forEach((t=>{(0,P.WD)(t).then((()=>{--i||(clearTimeout(s),n(!0))}),r)}))}))}}}(t.bufferSize||Q)){let r={};function i(i){const s=[];if(V(i,((e,n)=>{const i=K(n);if(function(t,e,n=Date.now()){return function(t,e){return t[e]||t.all||0}(t,e)>n}(r,i)){const r=et(e,n);t.recordDroppedEvent("ratelimit_backoff",i,r)}else s.push(e)})),0===s.length)return(0,P.WD)();const o=q(i[0],s),a=e=>{V(o,((n,r)=>{const i=et(n,r);t.recordDroppedEvent(e,K(r),i)}))};return n.add((()=>e({body:z(o,t.textEncoder)}).then((t=>(void 0!==t.statusCode&&(t.statusCode<200||t.statusCode>=300)&&("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&l.kg.warn(`Sentry responded with status code ${t.statusCode} to sent event.`),r=function(t,{statusCode:e,headers:n},r=Date.now()){const i={...t},s=n&&n["x-sentry-rate-limits"],o=n&&n["retry-after"];if(s)for(const t of s.trim().split(",")){const[e,n]=t.split(":",2),s=parseInt(e,10),o=1e3*(isNaN(s)?60:s);if(n)for(const t of n.split(";"))i[t]=r+o;else i.all=r+o}else o?i.all=r+function(t,e=Date.now()){const n=parseInt(`${t}`,10);if(!isNaN(n))return 1e3*n;const r=Date.parse(`${t}`);return isNaN(r)?Z:r-e}(o,r):429===e&&(i.all=r+6e4);return i}(r,t),t)),(t=>{throw a("network_error"),t})))).then((t=>t),(t=>{if(t instanceof R)return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&l.kg.error("Skipped sending event because buffer is full."),a("queue_overflow"),(0,P.WD)();throw t}))}return i.__sentry__baseTransport__=!0,{send:i,flush:t=>n.drain(t)}}function et(t,e){if("event"===e||"transaction"===e)return Array.isArray(t)?t[1]:void 0}var nt=n(350),rt=n(7638),it=n(9791),st=n(8903),ot=n(1250),at=n(6046);function ct(){const t=at.G.map((t=>{try{return t()}catch(t){return}})).filter((t=>!!t));return 0===t.length&&l.kg.warn("Performance monitoring integrations could not be automatically loaded."),t.filter((t=>!!t.loadDependency()))}var ut=n(4307);const lt=[];function pt(t){const e=t.defaultIntegrations||[],n=t.integrations;let r;e.forEach((t=>{t.isDefaultInstance=!0})),r=Array.isArray(n)?[...e,...n]:"function"==typeof n?(0,p.lE)(n(e)):e;const i=function(t){const e={};return t.forEach((t=>{const{name:n}=t,r=e[n];r&&!r.isDefaultInstance&&t.isDefaultInstance||(e[n]=t)})),Object.keys(e).map((t=>e[t]))}(r),s=function(t,e){for(let e=0;e1&&(c=l.slice(0,-1).join("/"),u=l.pop()),u){const t=u.match(/^\d+/);t&&(u=t[0])}return M({host:s,pass:i,path:c,projectId:u,port:o,protocol:n,publicKey:r})}(t):M(t);if(e&&function(t){if("undefined"!=typeof __SENTRY_DEBUG__&&!__SENTRY_DEBUG__)return!0;const{port:e,projectId:n,protocol:r}=t;return!(["protocol","publicKey","host","projectId"].find((e=>!t[e]&&(l.kg.error(`Invalid Sentry Dsn: ${e} missing`),!0)))||(n.match(/^\d+$/)?function(t){return"http"===t||"https"===t}(r)?e&&isNaN(parseInt(e,10))&&(l.kg.error(`Invalid Sentry Dsn: Invalid port ${e}`),1):(l.kg.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),1):(l.kg.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),1)))}(e))return e}(t.dsn):("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&l.kg.warn("No DSN provided, client will not do anything."),this._dsn){const e=function(t,e={}){const n="string"==typeof e?e:e.tunnel,r="string"!=typeof e&&e._metadata?e._metadata.sdk:void 0;return n||`${function(t){return`${function(t){const e=t.protocol?`${t.protocol}:`:"",n=t.port?`:${t.port}`:"";return`${e}//${t.host}${n}${t.path?`/${t.path}`:""}/api/`}(t)}${t.projectId}/envelope/`}(t)}?${function(t,e){return(0,a._j)({sentry_key:t.publicKey,sentry_version:"7",...e&&{sentry_client:`${e.name}/${e.version}`}})}(t,r)}`}(this._dsn,t);this._transport=t.transport({recordDroppedEvent:this.recordDroppedEvent.bind(this),...t.transportOptions,url:e})}}captureException(t,e,n){if((0,p.YO)(t))return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&l.kg.log(yt));let r=e&&e.event_id;return this._process(this.eventFromException(t,e).then((t=>this._captureEvent(t,e,n))).then((t=>{r=t}))),r}captureMessage(t,e,n,r){let i=n&&n.event_id;const s=(0,F.pt)(t)?this.eventFromMessage(String(t),e,n):this.eventFromException(t,n);return this._process(s.then((t=>this._captureEvent(t,n,r))).then((t=>{i=t}))),i}captureEvent(t,e,n){if(e&&e.originalException&&(0,p.YO)(e.originalException))return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&l.kg.log(yt));let r=e&&e.event_id;return this._process(this._captureEvent(t,e,n).then((t=>{r=t}))),r}captureSession(t){this._isEnabled()?"string"!=typeof t.release?("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&l.kg.warn("Discarded session because of missing or non-string release"):(this.sendSession(t),(0,ht.CT)(t,{init:!1})):("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&l.kg.warn("SDK not enabled, will not capture session.")}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(t){const e=this._transport;return e?this._isClientDoneProcessing(t).then((n=>e.flush(t).then((t=>n&&t)))):(0,P.WD)(!0)}close(t){return this.flush(t).then((t=>(this.getOptions().enabled=!1,t)))}setupIntegrations(){this._isEnabled()&&!this._integrationsInitialized&&(this._integrations=function(t){const e={};return t.forEach((t=>{t&&dt(t,e)})),e}(this._options.integrations),this._integrationsInitialized=!0)}getIntegrationById(t){return this._integrations[t]}getIntegration(t){try{return this._integrations[t.id]||null}catch(e){return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&l.kg.warn(`Cannot retrieve integration ${t.id} from the current Client`),null}}addIntegration(t){dt(t,this._integrations)}sendEvent(t,e={}){if(this._dsn){let n=function(t,e,n,r){const i=X(n),s=t.type&&"replay_event"!==t.type?t.type:"event";!function(t,e){e&&(t.sdk=t.sdk||{},t.sdk.name=t.sdk.name||e.name,t.sdk.version=t.sdk.version||e.version,t.sdk.integrations=[...t.sdk.integrations||[],...e.integrations||[]],t.sdk.packages=[...t.sdk.packages||[],...e.packages||[]])}(t,n&&n.sdk);const o=function(t,e,n,r){const i=t.sdkProcessingMetadata&&t.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:t.event_id,sent_at:(new Date).toISOString(),...e&&{sdk:e},...!!n&&{dsn:j(r)},...i&&{trace:(0,a.Jr)({...i})}}}(t,i,r,e);return delete t.sdkProcessingMetadata,q(o,[[{type:s},t]])}(t,this._dsn,this._options._metadata,this._options.tunnel);for(const t of e.attachments||[])n=Y(n,W(t,this._options.transportOptions&&this._options.transportOptions.textEncoder));const r=this._sendEnvelope(n);r&&r.then((e=>this.emit("afterSendEvent",t,e)),null)}}sendSession(t){if(this._dsn){const e=function(t,e,n,r){const i=X(n);return q({sent_at:(new Date).toISOString(),...i&&{sdk:i},...!!r&&{dsn:j(e)}},["aggregates"in t?[{type:"sessions"},t]:[{type:"session"},t.toJSON()]])}(t,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(e)}}recordDroppedEvent(t,e,n){if(this._options.sendClientReports){const n=`${t}:${e}`;("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&l.kg.log(`Adding outcome: "${n}"`),this._outcomes[n]=this._outcomes[n]+1||1}}on(t,e){this._hooks[t]||(this._hooks[t]=[]),this._hooks[t].push(e)}emit(t,...e){this._hooks[t]&&this._hooks[t].forEach((t=>t(...e)))}_updateSessionFromEvent(t,e){let n=!1,r=!1;const i=e.exception&&e.exception.values;if(i){r=!0;for(const t of i){const e=t.mechanism;if(e&&!1===e.handled){n=!0;break}}}const s="ok"===t.status;(s&&0===t.errors||s&&n)&&((0,ht.CT)(t,{...n&&{status:"crashed"},errors:t.errors||Number(r||n)}),this.captureSession(t))}_isClientDoneProcessing(t){return new P.cW((e=>{let n=0;const r=setInterval((()=>{0==this._numProcessing?(clearInterval(r),e(!0)):(n+=1,t&&n>=t&&(clearInterval(r),e(!1)))}),1)}))}_isEnabled(){return!1!==this.getOptions().enabled&&void 0!==this._dsn}_prepareEvent(t,e,n){const r=this.getOptions(),i=Object.keys(this._integrations);return!e.integrations&&i.length>0&&(e.integrations=i),function(t,e,n,r){const{normalizeDepth:i=3,normalizeMaxBreadth:s=1e3}=t,o={...e,event_id:e.event_id||n.event_id||(0,p.DM)(),timestamp:e.timestamp||(0,ft.yW)()},a=n.integrations||t.integrations.map((t=>t.name));!function(t,e){const{environment:n,release:r,dist:i,maxValueLength:s=250}=e;"environment"in t||(t.environment="environment"in e?n:mt.J),void 0===t.release&&void 0!==r&&(t.release=r),void 0===t.dist&&void 0!==i&&(t.dist=i),t.message&&(t.message=(0,d.$G)(t.message,s));const o=t.exception&&t.exception.values&&t.exception.values[0];o&&o.value&&(o.value=(0,d.$G)(o.value,s));const a=t.request;a&&a.url&&(a.url=(0,d.$G)(a.url,s))}(o,t),function(t,e){e.length>0&&(t.sdk=t.sdk||{},t.sdk.integrations=[...t.sdk.integrations||[],...e])}(o,a),void 0===e.type&&function(t,e){const n=_t.n2._sentryDebugIds;if(!n)return;let r;const i=gt.get(e);i?r=i:(r=new Map,gt.set(e,r));const s=Object.keys(n).reduce(((t,i)=>{let s;const o=r.get(i);o?s=o:(s=e(i),r.set(i,s));for(let e=s.length-1;e>=0;e--){const r=s[e];if(r.filename){t[r.filename]=n[i];break}}return t}),{});try{t.exception.values.forEach((t=>{t.stacktrace.frames.forEach((t=>{t.filename&&(t.debug_id=s[t.filename])}))}))}catch(t){}}(o,t.stackParser);let c=r;n.captureContext&&(c=nt.s.clone(c).update(n.captureContext));let u=(0,P.WD)(o);if(c){if(c.getAttachments){const t=[...n.attachments||[],...c.getAttachments()];t.length&&(n.attachments=t)}u=c.applyToEvent(o,n)}return u.then((t=>(t&&function(t){const e={};try{t.exception.values.forEach((t=>{t.stacktrace.frames.forEach((t=>{t.debug_id&&(t.abs_path?e[t.abs_path]=t.debug_id:t.filename&&(e[t.filename]=t.debug_id),delete t.debug_id)}))}))}catch(t){}if(0===Object.keys(e).length)return;t.debug_meta=t.debug_meta||{},t.debug_meta.images=t.debug_meta.images||[];const n=t.debug_meta.images;Object.keys(e).forEach((t=>{n.push({type:"sourcemap",code_file:t,debug_id:e[t]})}))}(t),"number"==typeof i&&i>0?function(t,e,n){if(!t)return null;const r={...t,...t.breadcrumbs&&{breadcrumbs:t.breadcrumbs.map((t=>({...t,...t.data&&{data:L(t.data,e,n)}})))},...t.user&&{user:L(t.user,e,n)},...t.contexts&&{contexts:L(t.contexts,e,n)},...t.extra&&{extra:L(t.extra,e,n)}};return t.contexts&&t.contexts.trace&&r.contexts&&(r.contexts.trace=t.contexts.trace,t.contexts.trace.data&&(r.contexts.trace.data=L(t.contexts.trace.data,e,n))),t.spans&&(r.spans=t.spans.map((t=>(t.data&&(t.data=L(t.data,e,n)),t)))),r}(t,i,s):t)))}(r,t,e,n)}_captureEvent(t,e={},n){return this._processEvent(t,e,n).then((t=>t.event_id),(t=>{if("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__){const e=t;"log"===e.logLevel?l.kg.log(e.message):l.kg.warn(e)}}))}_processEvent(t,e,n){const r=this.getOptions(),{sampleRate:i}=r;if(!this._isEnabled())return(0,P.$2)(new R("SDK not enabled, will not capture event.","log"));const s=Et(t),o=vt(t),a=t.type||"error",c=`before send for type \`${a}\``;if(o&&"number"==typeof i&&Math.random()>i)return this.recordDroppedEvent("sample_rate","error",t),(0,P.$2)(new R(`Discarding event because it's not included in the random sample (sampling rate = ${i})`,"log"));const u="replay_event"===a?"replay":a;return this._prepareEvent(t,e,n).then((n=>{if(null===n)throw this.recordDroppedEvent("event_processor",u,t),new R("An event processor returned `null`, will not send event.","log");if(e.data&&!0===e.data.__sentry__)return n;const i=function(t,e,n){const{beforeSend:r,beforeSendTransaction:i}=t;return vt(e)&&r?r(e,n):Et(e)&&i?i(e,n):e}(r,n,e);return function(t,e){const n=`${e} must return \`null\` or a valid event.`;if((0,F.J8)(t))return t.then((t=>{if(!(0,F.PO)(t)&&null!==t)throw new R(n);return t}),(t=>{throw new R(`${e} rejected with ${t}`)}));if(!(0,F.PO)(t)&&null!==t)throw new R(n);return t}(i,c)})).then((r=>{if(null===r)throw this.recordDroppedEvent("before_send",u,t),new R(`${c} returned \`null\`, will not send event.`,"log");const i=n&&n.getSession();!s&&i&&this._updateSessionFromEvent(i,r);const o=r.transaction_info;if(s&&o&&r.transaction!==t.transaction){const t="custom";r.transaction_info={...o,source:t}}return this.sendEvent(r,e),r})).then(null,(t=>{if(t instanceof R)throw t;throw this.captureException(t,{data:{__sentry__:!0},originalException:t}),new R(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${t}`)}))}_process(t){this._numProcessing++,t.then((t=>(this._numProcessing--,t)),(t=>(this._numProcessing--,t)))}_sendEnvelope(t){if(this._transport&&this._dsn)return this.emit("beforeEnvelope",t),this._transport.send(t).then(null,(t=>{("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&l.kg.error("Error while sending event:",t)}));("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&l.kg.error("Transport disabled")}_clearOutcomes(){const t=this._outcomes;return this._outcomes={},Object.keys(t).map((e=>{const[n,r]=e.split(":");return{reason:n,category:r,quantity:t[e]}}))}}function vt(t){return void 0===t.type}function Et(t){return"transaction"===t.type}var wt=n(6890);class Tt{__init(){this.flushTimeout=60}__init2(){this._pendingAggregates={}}__init3(){this._isEnabled=!0}constructor(t,e){Tt.prototype.__init.call(this),Tt.prototype.__init2.call(this),Tt.prototype.__init3.call(this),this._client=t,this._intervalId=setInterval((()=>this.flush()),1e3*this.flushTimeout),this._sessionAttrs=e}flush(){const t=this.getSessionAggregates();0!==t.aggregates.length&&(this._pendingAggregates={},this._client.sendSession(t))}getSessionAggregates(){const t=Object.keys(this._pendingAggregates).map((t=>this._pendingAggregates[parseInt(t)])),e={attrs:this._sessionAttrs,aggregates:t};return(0,a.Jr)(e)}close(){clearInterval(this._intervalId),this._isEnabled=!1,this.flush()}incrementSessionStatusCount(){if(!this._isEnabled)return;const t=(0,y.Gd)().getScope(),e=t.getRequestSession();e&&e.status&&(this._incrementSessionStatusCount(e.status,new Date),t.setRequestSession(void 0))}_incrementSessionStatusCount(t,e){const n=new Date(e).setSeconds(0,0);this._pendingAggregates[n]=this._pendingAggregates[n]||{};const r=this._pendingAggregates[n];switch(r.started||(r.started=new Date(n).toISOString()),t){case"errored":return r.errored=(r.errored||0)+1,r.errored;case"ok":return r.exited=(r.exited||0)+1,r.exited;default:return r.crashed=(r.crashed||0)+1,r.crashed}}}var St=n(2037),It=n(3837);function xt(t,e){return t(e.stack||"",1)}function Ot(t,e){const n={type:e.name||e.constructor.name,value:e.message},r=xt(t,e);return r.length&&(n.stacktrace={frames:r}),n}class Dt extends bt{constructor(t){t._metadata=t._metadata||{},t._metadata.sdk=t._metadata.sdk||{name:"sentry.javascript.node",packages:[{name:"npm:@sentry/node",version:g}],version:g},t.transportOptions={textEncoder:new It.TextEncoder,...t.transportOptions},(0,wt.T)(),super(t)}captureException(t,e,n){if(this._options.autoSessionTracking&&this._sessionFlusher&&n){const t=n.getRequestSession();t&&"ok"===t.status&&(t.status="errored")}return super.captureException(t,e,n)}captureEvent(t,e,n){if(this._options.autoSessionTracking&&this._sessionFlusher&&n&&"exception"===(t.type||"exception")&&t.exception&&t.exception.values&&t.exception.values.length>0){const t=n.getRequestSession();t&&"ok"===t.status&&(t.status="errored")}return super.captureEvent(t,e,n)}close(t){return(0,ut.x)([this,"access",t=>t._sessionFlusher,"optionalAccess",t=>t.close,"call",t=>t()]),super.close(t)}initSessionFlusher(){const{release:t,environment:e}=this._options;t?this._sessionFlusher=new Tt(this,{release:t,environment:e}):("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&l.kg.warn("Cannot initialise an instance of SessionFlusher if no release is provided!")}eventFromException(t,e){return(0,P.WD)(function(t,e,n){let r=e;const i=n&&n.data&&n.data.mechanism||{handled:!0,type:"generic"};if(!(0,F.VZ)(e)){if((0,F.PO)(e)){const t=`Non-Error exception captured with keys: ${(0,a.zf)(e)}`,i=(0,y.Gd)(),s=i.getClient(),o=s&&s.getOptions().normalizeDepth;i.configureScope((t=>{t.setExtra("__serialized__",$(e,o))})),r=n&&n.syntheticException||new Error(t),r.message=t}else r=n&&n.syntheticException||new Error(e),r.message=e;i.synthetic=!0}const s={exception:{values:[Ot(t,r)]}};return(0,p.Db)(s,void 0,void 0),(0,p.EG)(s,i),{...s,event_id:n&&n.event_id}}(this._options.stackParser,t,e))}eventFromMessage(t,e="info",n){return(0,P.WD)(function(t,e,n="info",r,i){const s={event_id:r&&r.event_id,level:n,message:e};if(i&&r&&r.syntheticException){const n=xt(t,r.syntheticException);n.length&&(s.exception={values:[{value:e,stacktrace:{frames:n}}]})}return s}(this._options.stackParser,t,e,n,this._options.attachStacktrace))}captureCheckIn(t,e){const n="in_progress"!==t.status&&t.checkInId?t.checkInId:(0,p.DM)();if(!this._isEnabled())return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&l.kg.warn("SDK not enabled, will not capture checkin."),n;const r=this.getOptions(),{release:i,environment:s,tunnel:o}=r,a={check_in_id:n,monitor_slug:t.monitorSlug,status:t.status,release:i,environment:s};"in_progress"!==t.status&&(a.duration=t.duration),e&&(a.monitor_config={schedule:e.schedule,checkin_margin:e.checkinMargin,max_runtime:e.maxRuntime,timezone:e.timezone});const c=function(t,e,n,r){const i={sent_at:(new Date).toISOString(),...e&&e.sdk&&{sdk:{name:e.sdk.name,version:e.sdk.version}},...!!n&&!!r&&{dsn:j(r)}},s=function(t){return[{type:"check_in"},t]}(t);return q(i,[s])}(a,this.getSdkMetadata(),o,this.getDsn());return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&l.kg.info("Sending checkin:",t.monitorSlug,t.status),this._sendEnvelope(c),n}_prepareEvent(t,e,n){return t.platform=t.platform||"node",t.contexts={...t.contexts,runtime:(0,ut.x)([t,"access",t=>t.contexts,"optionalAccess",t=>t.runtime])||{name:"node",version:global.process.version}},t.server_name=t.server_name||this.getOptions().serverName||global.process.env.SENTRY_NAME||St.hostname(),super._prepareEvent(t,e,n)}_captureRequestSession(){this._sessionFlusher?this._sessionFlusher.incrementSessionStatusCount():("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&l.kg.warn("Discarded request mode session because autoSessionTracking option was disabled")}}function Nt(t,e){return null!=t?t:e()}var Ct=n(3685),kt=n(5687),At=n(6018),Rt=n(2781),Pt=n(7310),Ut=n(9796);const jt=32768;function Mt(t){let e;try{e=new Pt.URL(t.url)}catch(e){return console.warn("[@sentry/node]: Invalid dsn or tunnel option, will not send any events. The tunnel option must be a full URL when used."),tt(t,(()=>Promise.resolve({})))}const n="https:"===e.protocol,r=function(t,e){const{no_proxy:n}=process.env;return n&&n.split(",").some((e=>t.host.endsWith(e)||t.hostname.endsWith(e)))?void 0:e}(e,t.proxy||(n?process.env.https_proxy:void 0)||process.env.http_proxy),i=n?kt:Ct,s=void 0!==t.keepAlive&&t.keepAlive,o=r?new At.HttpsProxyAgent(r):new i.Agent({keepAlive:s,maxSockets:30,timeout:2e3}),a=function(t,e,n){const{hostname:r,pathname:i,port:s,protocol:o,search:a}=new Pt.URL(t.url);return function(c){return new Promise(((u,l)=>{let p=function(t){return new Rt.Readable({read(){this.push(t),this.push(null)}})}(c.body);const d={...t.headers};c.body.length>jt&&(d["content-encoding"]="gzip",p=p.pipe((0,Ut.createGzip)()));const h=e.request({method:"POST",agent:n,headers:d,hostname:r,path:`${i}${a}`,port:s,protocol:o,ca:t.caCerts},(t=>{t.on("data",(()=>{})),t.on("end",(()=>{})),t.setEncoding("utf8");const e=Nt(t.headers["retry-after"],(()=>null)),n=Nt(t.headers["x-sentry-rate-limits"],(()=>null));u({statusCode:t.statusCode,headers:{"retry-after":e,"x-sentry-rate-limits":Array.isArray(n)?n[0]:n}})}));h.on("error",l),p.pipe(h)}))}}(t,Nt(t.httpModule,(()=>i)),o);return tt(t,a)}var Ft=n(9656);const Bt=require("domain");function Lt(){return Bt.active}function $t(){const t=Lt();if(t)return(0,y.uZ)(t),(0,y.vi)(t)}function Gt(t,e){const n=Lt();if(n&&(0,ut.x)([e,"optionalAccess",t=>t.reuseExisting]))return t();const r=Bt.create(),i=function(t){const e={};return(0,y.uZ)(e,t),(0,y.vi)(e)}(n?(0,y.vi)(n):void 0);return(0,y.j0)(r,i),r.bind((()=>t()))()}const qt=require("async_hooks");function Yt(){Ft.V.major&&Ft.V.major>=14?function(){const t=new qt.AsyncLocalStorage;function e(){return t.getStore()}(0,y.$b)({getCurrentHub:e,runWithAsyncContext:function(n,r){const i=e();if(i&&(0,ut.x)([r,"optionalAccess",t=>t.reuseExisting]))return n();const s=function(t){const e={};return(0,y.uZ)(e,t),(0,y.vi)(e)}(i);return t.run(s,(()=>n()))}})}():(0,y.$b)({getCurrentHub:$t,runWithAsyncContext:Gt})}const Vt=["fatal","error","warning","log","info","debug"];class Ht{constructor(){Ht.prototype.__init.call(this)}static __initStatic(){this.id="Console"}__init(){this.name=Ht.id}setupOnce(){for(const t of["debug","info","warn","error","log"])(0,a.hl)(console,t,zt(t))}}function zt(t){return function(e){const n=function(t){return"warn"===t?"warning":Vt.includes(t)?t:"log"}(t);return function(){(0,y.Gd)().getIntegration(Ht)&&(0,y.Gd)().addBreadcrumb({category:"console",level:n,message:It.format.apply(void 0,arguments)},{input:[...arguments],level:t}),e.apply(this,arguments)}}}Ht.__initStatic();var Wt=n(9181),Jt=n(7612),Kt=n(7578);class Xt{static __initStatic(){this.id="Http"}__init(){this.name=Xt.id}constructor(t={}){Xt.prototype.__init.call(this),this._breadcrumbs=void 0===t.breadcrumbs||t.breadcrumbs,this._tracing=t.tracing?!0===t.tracing?{}:t.tracing:void 0}setupOnce(t,e){if(!this._breadcrumbs&&!this._tracing)return;const r=(0,ut.x)([e,"call",t=>t(),"access",t=>t.getClient,"call",t=>t(),"optionalAccess",t=>t.getOptions,"call",t=>t()]);if(r&&"sentry"!==r.instrumenter)return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&l.kg.log("HTTP Integration is skipped because of instrumenter configuration."));const i=this._tracing?{...r,...this._tracing}:void 0,s=n(3685),o=Zt(this._breadcrumbs,i,s);if((0,a.hl)(s,"get",o),(0,a.hl)(s,"request",o),Ft.V.major&&Ft.V.major>8){const t=n(5687),e=Zt(this._breadcrumbs,i,t);(0,a.hl)(t,"get",e),(0,a.hl)(t,"request",e)}}}function Zt(t,e,n){const r=new Jt.LRUMap(100),i=new Jt.LRUMap(100);return function(s){return function(...o){const a=(0,Kt.nY)(n,o),c=a[0],u=(0,Kt.lx)(c),p=(0,Kt.CA)(c);if((0,Kt.ZB)(p))return s.apply(n,a);let h,f;const _=(0,y.Gd)().getScope(),m=c.method||"GET",g={url:p,"http.method":m};if(c.hash&&(g["http.fragment"]=c.hash.substring(1)),c.search&&(g["http.query"]=c.search.substring(1)),_&&e&&(t=>{if(void 0===(0,ut.x)([e,"optionalAccess",t=>t.shouldCreateSpanForRequest]))return!0;const n=r.get(t);if(void 0!==n)return n;const i=e.shouldCreateSpanForRequest(t);return r.set(t,i),i})(u)&&(f=_.getSpan(),f))if(h=f.startChild({description:`${m} ${g.url}`,op:"http.client",data:g}),(t=>{if(void 0===(0,ut.x)([e,"optionalAccess",t=>t.tracePropagationTargets]))return!0;const n=i.get(t);if(void 0!==n)return n;const r=(0,d.U0)(t,e.tracePropagationTargets);return i.set(t,r),r})(u)){const t=h.toTraceparent();if(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&l.kg.log(`[Tracing] Adding sentry-trace header ${t} to outgoing request to "${p}": `),c.headers={...c.headers,"sentry-trace":t},f.transaction){const t=f.transaction.getDynamicSamplingContext(),e=(0,Wt.IQ)(t);let n;n=c.headers&&c.headers.baggage?e?Array.isArray(c.headers.baggage)?[...c.headers.baggage,e]:[c.headers.baggage,e]:c.headers.baggage:e,c.headers={...c.headers,...n&&{baggage:n}}}}else("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&l.kg.log(`[Tracing] Not adding sentry-trace header to outgoing request (${p}) due to mismatching tracePropagationTargets option.`);return s.apply(n,a).once("response",(function(e){t&&Qt("response",g,this,e),h&&(e.statusCode&&h.setHttpStatus(e.statusCode),h.description=(0,Kt.Dt)(h.description,c,this),h.finish())})).once("error",(function(){t&&Qt("error",g,this),h&&(h.setHttpStatus(500),h.description=(0,Kt.Dt)(h.description,c,this),h.finish())}))}}}function Qt(t,e,n,r){(0,y.Gd)().getIntegration(Xt)&&(0,y.Gd)().addBreadcrumb({category:"http",data:{status_code:r&&r.statusCode,...e},type:"http"},{event:t,request:n,response:r})}function te(t){console.error(t&&t.stack?t.stack:t);const e=(0,y.Gd)().getClient();void 0===e&&(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&l.kg.warn("No NodeClient was defined, we are exiting the process now."),global.process.exit(1));const n=e.getOptions(),r=n&&n.shutdownTimeout&&n.shutdownTimeout>0&&n.shutdownTimeout||2e3;e.close(r).then((t=>{t||("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&l.kg.warn("We reached the timeout for emptying the request buffer, still exiting now!"),global.process.exit(1)}),(t=>{("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&l.kg.error(t)}))}Xt.__initStatic();class ee{static __initStatic(){this.id="OnUncaughtException"}__init(){this.name=ee.id}__init2(){this.handler=this._makeErrorHandler()}constructor(t={}){ee.prototype.__init.call(this),ee.prototype.__init2.call(this),this._options={exitEvenIfOtherHandlersAreRegistered:!0,...t}}setupOnce(){global.process.on("uncaughtException",this.handler)}_makeErrorHandler(){let t,e=!1,n=!1,r=!1;return i=>{let s=te;const o=(0,y.Gd)().getClient();this._options.onFatalError?s=this._options.onFatalError:o&&o.getOptions().onFatalError&&(s=o.getOptions().onFatalError);const a=0===global.process.listeners("uncaughtException").reduce(((t,e)=>"domainUncaughtExceptionClear"===e.name||e.tag&&"sentry_tracingErrorCallback"===e.tag||e===this.handler?t:t+1),0),c=this._options.exitEvenIfOtherHandlersAreRegistered||a;if(e)c&&(r?(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&l.kg.warn("uncaught exception after calling fatal error shutdown callback - this is bad! forcing shutdown"),te(i)):n||(n=!0,setTimeout((()=>{r||(r=!0,s(t,i))}),2e3)));else{const n=(0,y.Gd)();t=i,e=!0,n.getIntegration(ee)?n.withScope((t=>{t.setLevel("fatal"),n.captureException(i,{originalException:i,data:{mechanism:{handled:!1,type:"onuncaughtexception"}}}),!r&&c&&(r=!0,s(i))})):!r&&c&&(r=!0,s(i))}}}}ee.__initStatic();class ne{static __initStatic(){this.id="OnUnhandledRejection"}__init(){this.name=ne.id}constructor(t={mode:"warn"}){this._options=t,ne.prototype.__init.call(this)}setupOnce(){global.process.on("unhandledRejection",this.sendUnhandledPromise.bind(this))}sendUnhandledPromise(t,e){const n=(0,y.Gd)();n.getIntegration(ne)&&n.withScope((r=>{r.setExtra("unhandledPromiseRejection",!0),n.captureException(t,{originalException:e,data:{mechanism:{handled:!1,type:"onunhandledrejection"}}})})),this._handleRejection(t)}_handleRejection(t){const e="This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:";"warn"===this._options.mode?(0,l.Cf)((()=>{console.warn(e),console.error(t&&t.stack?t.stack:t)})):"strict"===this._options.mode&&((0,l.Cf)((()=>{console.warn(e)})),te(t))}}ne.__initStatic();const re=require("fs"),ie=new Jt.LRUMap(100);class se{static __initStatic(){this.id="ContextLines"}__init(){this.name=se.id}constructor(t={}){this._options=t,se.prototype.__init.call(this)}get _contextLines(){return void 0!==this._options.frameContextLines?this._options.frameContextLines:7}setupOnce(t){t((t=>this.addSourceContext(t)))}async addSourceContext(t){const e={},n=[];if(this._contextLines>0&&(0,ut.x)([t,"access",t=>t.exception,"optionalAccess",t=>t.values]))for(const r of t.exception.values)if((0,ut.x)([r,"access",t=>t.stacktrace,"optionalAccess",t=>t.frames]))for(let t=r.stacktrace.frames.length-1;t>=0;t--){const i=r.stacktrace.frames[t];!i.filename||e[i.filename]||ie.get(i.filename)||(n.push(oe(i.filename)),e[i.filename]=1)}if(n.length>0&&await Promise.all(n),this._contextLines>0&&(0,ut.x)([t,"access",t=>t.exception,"optionalAccess",t=>t.values]))for(const e of t.exception.values)e.stacktrace&&e.stacktrace.frames&&await this.addSourceContextToFrames(e.stacktrace.frames);return t}addSourceContextToFrames(t){for(const e of t)if(e.filename&&void 0===e.context_line){const t=ie.get(e.filename);if(t)try{(0,p.go)(t,e,this._contextLines)}catch(t){}}}}async function oe(t){const e=ie.get(t);if(null===e)return null;if(void 0!==e)return e;let n=null;try{n=(await(r=t,new Promise(((t,e)=>{(0,re.readFile)(r,"utf8",((n,r)=>{n?e(n):t(r)}))})))).split("\n")}catch(t){}var r;return ie.set(t,n),n}se.__initStatic();class ae{static __initStatic(){this.id="LinkedErrors"}__init(){this.name=ae.id}constructor(t={}){ae.prototype.__init.call(this),this._key=t.key||"cause",this._limit=t.limit||5}setupOnce(){(0,nt.c)((async(t,e)=>{const n=(0,y.Gd)(),r=n.getIntegration(ae),i=n.getClient();return i&&r&&r._handler&&"function"==typeof r._handler&&await r._handler(i.getOptions().stackParser,t,e),t}))}_handler(t,e,n){return e.exception&&e.exception.values&&(0,F.V9)(n.originalException,Error)?new P.cW((r=>{this._walkErrorTree(t,n.originalException,this._key).then((t=>{e&&e.exception&&e.exception.values&&(e.exception.values=[...t,...e.exception.values]),r(e)})).then(null,(()=>{r(e)}))})):(0,P.WD)(e)}async _walkErrorTree(t,e,n,r=[]){if(!(0,F.V9)(e[n],Error)||r.length+1>=this._limit)return Promise.resolve(r);const i=Ot(t,e[n]),s=(0,y.Gd)().getIntegration(se);return s&&(0,ut.x)([i,"access",t=>t.stacktrace,"optionalAccess",t=>t.frames])&&await s.addSourceContextToFrames(i.stacktrace.frames),new Promise(((s,o)=>{this._walkErrorTree(t,e[n],n,[i,...r]).then(s).then(null,(()=>{o()}))}))}}ae.__initStatic();var ce=n(1017);let ue;class le{constructor(){le.prototype.__init.call(this)}static __initStatic(){this.id="Modules"}__init(){this.name=le.id}setupOnce(t,e){t((t=>e().getIntegration(le)?{...t,modules:{...t.modules,...this._getModules()}}:t))}_getModules(){return ue||(ue=function(){const t=n.c[n.s]&&n.c[n.s].paths||[],e=function(){try{return n.c?Object.keys(n.c):[]}catch(t){return[]}}(),r={},i={};return e.forEach((e=>{let n=e;const s=()=>{const e=n;if(n=(0,ce.dirname)(e),!n||e===n||i[e])return;if(t.indexOf(n)<0)return s();const o=(0,ce.join)(e,"package.json");if(i[e]=!0,!(0,re.existsSync)(o))return s();try{const t=JSON.parse((0,re.readFileSync)(o,"utf8"));r[t.name]=t.version}catch(t){}};s()})),r}()),ue}}le.__initStatic();const pe=require("child_process"),de=(0,It.promisify)(re.readFile),he=(0,It.promisify)(re.readdir);class fe{static __initStatic(){this.id="Context"}__init(){this.name=fe.id}constructor(t={app:!0,os:!0,device:!0,culture:!0}){this._options=t,fe.prototype.__init.call(this)}setupOnce(t){t((t=>this.addContext(t)))}async addContext(t){void 0===this._cachedContext&&(this._cachedContext=this._getContexts());const e=this._updateContext(await this._cachedContext);return t.contexts={...t.contexts,app:{...e.app,...(0,ut.x)([t,"access",t=>t.contexts,"optionalAccess",t=>t.app])},os:{...e.os,...(0,ut.x)([t,"access",t=>t.contexts,"optionalAccess",t=>t.os])},device:{...e.device,...(0,ut.x)([t,"access",t=>t.contexts,"optionalAccess",t=>t.device])},culture:{...e.culture,...(0,ut.x)([t,"access",t=>t.contexts,"optionalAccess",t=>t.culture])}},t}_updateContext(t){return(0,ut.x)([t,"optionalAccess",t=>t.app,"optionalAccess",t=>t.app_memory])&&(t.app.app_memory=process.memoryUsage().rss),(0,ut.x)([t,"optionalAccess",t=>t.device,"optionalAccess",t=>t.free_memory])&&(t.device.free_memory=St.freemem()),t}async _getContexts(){const t={};if(this._options.os&&(t.os=await async function(){const t=St.platform();switch(t){case"darwin":return async function(){const t={kernel_version:St.release(),name:"Mac OS X",version:"10."+(Number(St.release().split(".")[0])-4)};try{const e=await new Promise(((t,e)=>{(0,pe.execFile)("/usr/bin/sw_vers",((n,r)=>{n?e(n):t(r)}))}));t.name=ye(/^ProductName:\s+(.*)$/m,e),t.version=ye(/^ProductVersion:\s+(.*)$/m,e),t.build=ye(/^BuildVersion:\s+(.*)$/m,e)}catch(t){}return t}();case"linux":return async function(){const t={kernel_version:St.release(),name:"Linux"};try{const e=await he("/etc"),n=me.find((t=>e.includes(t.name)));if(!n)return t;const r=(0,ce.join)("/etc",n.name),i=(await de(r,{encoding:"utf-8"})).toLowerCase(),{distros:s}=n;t.name=s.find((t=>i.indexOf(be(t))>=0))||s[0];const o=be(t.name);t.version=ge[o](i)}catch(t){}return t}();default:return{name:_e[t]||t,version:St.release()}}}()),this._options.app&&(t.app=function(){const t=process.memoryUsage().rss;return{app_start_time:new Date(Date.now()-1e3*process.uptime()).toISOString(),app_memory:t}}()),this._options.device&&(t.device=function(t){const e={};let n;try{n=St.uptime&&St.uptime()}catch(t){}if("number"==typeof n&&(e.boot_time=new Date(Date.now()-1e3*n).toISOString()),e.arch=St.arch(),(!0===t||t.memory)&&(e.memory_size=St.totalmem(),e.free_memory=St.freemem()),!0===t||t.cpu){const t=St.cpus();if(t&&t.length){const n=t[0];e.processor_count=t.length,e.cpu_description=n.model,e.processor_frequency=n.speed}}return e}(this._options.device)),this._options.culture){const e=function(){try{if("string"!=typeof process.versions.icu)return;const t=new Date(9e8);if("enero"===new Intl.DateTimeFormat("es",{month:"long"}).format(t)){const t=Intl.DateTimeFormat().resolvedOptions();return{locale:t.locale,timezone:t.timeZone}}}catch(t){}}();e&&(t.culture=e)}return t}}fe.__initStatic();const _e={aix:"IBM AIX",freebsd:"FreeBSD",openbsd:"OpenBSD",sunos:"SunOS",win32:"Windows"},me=[{name:"fedora-release",distros:["Fedora"]},{name:"redhat-release",distros:["Red Hat Linux","Centos"]},{name:"redhat_version",distros:["Red Hat Linux"]},{name:"SuSE-release",distros:["SUSE Linux"]},{name:"lsb-release",distros:["Ubuntu Linux","Arch Linux"]},{name:"debian_version",distros:["Debian"]},{name:"debian_release",distros:["Debian"]},{name:"arch-release",distros:["Arch Linux"]},{name:"gentoo-release",distros:["Gentoo Linux"]},{name:"novell-release",distros:["SUSE Linux"]},{name:"alpine-release",distros:["Alpine Linux"]}],ge={alpine:t=>t,arch:t=>ye(/distrib_release=(.*)/,t),centos:t=>ye(/release ([^ ]+)/,t),debian:t=>t,fedora:t=>ye(/release (..)/,t),mint:t=>ye(/distrib_release=(.*)/,t),red:t=>ye(/release ([^ ]+)/,t),suse:t=>ye(/VERSION = (.*)\n/,t),ubuntu:t=>ye(/distrib_release=(.*)/,t)};function ye(t,e){const n=t.exec(e);return n?n[1]:void 0}function be(t){return t.split(" ")[0].toLowerCase()}var ve=n(442),Ee=n(6956),we=n(6489);const Te={ip:!1,request:!0,transaction:!0,user:!0},Se=["cookies","data","headers","method","query_string","url"],Ie=["id","username","email"];function xe(t,e={}){const n=t.method&&t.method.toUpperCase();let r="",i="url";e.customRoute||t.route?(r=e.customRoute||`${t.baseUrl||""}${t.route&&t.route.path}`,i="route"):(t.originalUrl||t.url)&&(r=(0,Ee.rt)(t.originalUrl||t.url||""));let s="";return e.method&&n&&(s+=n),e.method&&e.path&&(s+=" "),e.path&&r&&(s+=r),[s,i]}function Oe(t,e){const{include:n=Se}=e||{},r={},i=t.headers||{},s=t.method,o=t.hostname||t.host||i.host||"",a="https"===t.protocol||t.socket&&t.socket.encrypted?"https":"http",c=t.originalUrl||t.url||"",u=c.startsWith(a)?c:`${a}://${o}${c}`;return n.forEach((e=>{switch(e){case"headers":r.headers=i,n.includes("cookies")||delete r.headers.cookie;break;case"method":r.method=s;break;case"url":r.url=u;break;case"cookies":r.cookies=t.cookies||i.cookie&&we.Q(i.cookie)||{};break;case"query_string":r.query_string=function(t){let e=t.originalUrl||t.url||"";if(e)return e.startsWith("/")&&(e=`http://dogs.are.great${e}`),t.query||void 0!==typeof URL&&new URL(e).search.replace("?","")||Pt.parse(e).query||void 0}(t);break;case"data":if("GET"===s||"HEAD"===s)break;void 0!==t.body&&(r.data=(0,F.HD)(t.body)?t.body:JSON.stringify(L(t.body)));break;default:({}).hasOwnProperty.call(t,e)&&(r[e]=t[e])}})),r}function De(t,e,n){const r={...Te,...(0,ut.x)([n,"optionalAccess",t=>t.include])};if(r.request){const n=Array.isArray(r.request)?Oe(e,{include:r.request}):Oe(e);t.request={...t.request,...n}}if(r.user){const n=e.user&&(0,F.PO)(e.user)?function(t,e){const n={};return(Array.isArray(e)?e:Ie).forEach((e=>{t&&e in t&&(n[e]=t[e])})),n}(e.user,r.user):{};Object.keys(n).length&&(t.user={...t.user,...n})}if(r.ip){const n=e.ip||e.socket&&e.socket.remoteAddress;n&&(t.user={...t.user,ip_address:n})}return r.transaction&&!t.transaction&&(t.transaction=function(t,e){switch(e){case"path":return xe(t,{path:!0})[0];case"handler":return t.route&&t.route.stack&&t.route.stack[0]&&t.route.stack[0].name||"";default:return xe(t,{path:!0,method:!0})[0]}}(e,r.transaction)),t}const Ne={include:{cookies:!0,data:!0,headers:!0,ip:!1,query_string:!0,url:!0,user:{id:!0,username:!0,email:!0}},transactionNamingScheme:"methodPath"};class Ce{static __initStatic(){this.id="RequestData"}__init(){this.name=Ce.id}constructor(t={}){Ce.prototype.__init.call(this),this._addRequestData=De,this._options={...Ne,...t,include:{method:!0,...Ne.include,...t.include,user:t.include&&"boolean"==typeof t.include.user?t.include.user:{...Ne.include.user,...(t.include||{}).user}}}}setupOnce(t,e){const{transactionNamingScheme:n}=this._options;t((t=>{const r=e(),i=r.getIntegration(Ce),{sdkProcessingMetadata:s={}}=t,o=s.request;if(!i||!o)return t;const a=s.requestDataOptionsFromExpressHandler||s.requestDataOptionsFromGCPWrapper||function(t){const{transactionNamingScheme:e,include:{ip:n,user:r,...i}}=t,s=[];for(const[t,e]of Object.entries(i))e&&s.push(t);let o;if(void 0===r)o=!0;else if("boolean"==typeof r)o=r;else{const t=[];for(const[e,n]of Object.entries(r))n&&t.push(e);o=t}return{include:{ip:n,user:o,request:0!==s.length?s:void 0,transaction:e}}}(this._options),c=this._addRequestData(t,o,a);if("transaction"===t.type||"handler"===n)return c;const u=o._sentryTransaction;if(u){const t="sentry.javascript.nextjs"===function(t){try{return t.getClient().getOptions()._metadata.sdk.name}catch(t){return}}(r)?u.name.startsWith("/api"):"path"!==n,[e]=(0,ve.oA)(o,{path:!0,method:t,customRoute:u.name});c.transaction=e}return c}))}}function ke(t){let e=[],n=!1;function r(r){e=[],n||(n=!0,t(r))}return e.push(r),{add:function(t){e.push(t)},next:function(t){const n=e.pop()||r;try{n(t)}catch(e){r(t)}}}}Ce.__initStatic();class Ae{constructor(){const{Session:t}=n(1405);this._session=new t}configureAndConnect(t,e){this._session.connect(),this._session.on("Debugger.paused",(e=>{t(e,(()=>{this._session.post("Debugger.resume")}))})),this._session.post("Debugger.enable"),this._session.post("Debugger.setPauseOnExceptions",{state:e?"all":"uncaught"})}getLocalVariables(t,e){this._getProperties(t,(t=>{const{add:n,next:r}=ke(e);for(const e of t)if((0,ut.x)([e,"optionalAccess",t=>t.value,"optionalAccess",t=>t.objectId])&&"Array"===(0,ut.x)([e,"optionalAccess",t=>t.value,"access",t=>t.className])){const t=e.value.objectId;n((n=>this._unrollArray(t,e.name,n,r)))}else if((0,ut.x)([e,"optionalAccess",t=>t.value,"optionalAccess",t=>t.objectId])&&"Object"===(0,ut.x)([e,"optionalAccess",t=>t.value,"optionalAccess",t=>t.className])){const t=e.value.objectId;n((n=>this._unrollObject(t,e.name,n,r)))}else((0,ut.x)([e,"optionalAccess",t=>t.value,"optionalAccess",t=>t.value])||(0,ut.x)([e,"optionalAccess",t=>t.value,"optionalAccess",t=>t.description]))&&n((t=>this._unrollOther(e,t,r)));r({})}))}_getProperties(t,e){this._session.post("Runtime.getProperties",{objectId:t,ownProperties:!0},((t,n)=>{e(t?[]:n.result)}))}_unrollArray(t,e,n,r){this._getProperties(t,(t=>{n[e]=t.filter((t=>"length"!==t.name&&!isNaN(parseInt(t.name,10)))).sort(((t,e)=>parseInt(t.name,10)-parseInt(e.name,10))).map((t=>(0,ut.x)([t,"optionalAccess",t=>t.value,"optionalAccess",t=>t.value]))),r(n)}))}_unrollObject(t,e,n,r){this._getProperties(t,(t=>{n[e]=t.map((t=>[t.name,(0,ut.x)([t,"optionalAccess",t=>t.value,"optionalAccess",t=>t.value])])).reduce(((t,[e,n])=>(t[e]=n,t)),{}),r(n)}))}_unrollOther(t,e,n){(0,ut.x)([t,"optionalAccess",t=>t.value,"optionalAccess",t=>t.value])?e[t.name]=t.value.value:(0,ut.x)([t,"optionalAccess",t=>t.value,"optionalAccess",t=>t.description])&&"function"!==(0,ut.x)([t,"optionalAccess",t=>t.value,"optionalAccess",t=>t.type])&&(e[t.name]=`<${t.value.description}>`),n(e)}}function Re(t){return void 0!==t&&["","?",""].includes(t)}function Pe(t){if(void 0!==t)return t.slice(-10).reduce(((t,e)=>`${t},${e.function},${e.lineno},${e.colno}`),"")}class Ue{static __initStatic(){this.id="LocalVariables"}__init(){this.name=Ue.id}__init2(){this._cachedFrames=new Jt.LRUMap(20)}constructor(t={},e=function(){try{return new Ae}catch(t){return}}()){this._options=t,this._session=e,Ue.prototype.__init.call(this),Ue.prototype.__init2.call(this)}setupOnce(t,e){this._setup(t,(0,ut.x)([e,"call",t=>t(),"access",t=>t.getClient,"call",t=>t(),"optionalAccess",t=>t.getOptions,"call",t=>t()]))}_setup(t,e){if(this._session&&(0,ut.x)([e,"optionalAccess",t=>t.includeLocalVariables])){if((Ft.V.major||0)<18)return void l.kg.log("The `LocalVariables` integration is only supported on Node >= v18.");this._session.configureAndConnect(((t,n)=>this._handlePaused(e.stackParser,t,n)),!!this._options.captureAllExceptions),t((async t=>this._addLocalVariables(t)))}}_handlePaused(t,{params:{reason:e,data:n,callFrames:r}},i){if("exception"!==e&&"promiseRejection"!==e)return void i();const s=function(t,e){if(void 0!==e)return Pe(t(e,1))}(t,(0,ut.x)([n,"optionalAccess",t=>t.description]));if(null==s)return void i();const{add:o,next:a}=ke((t=>{this._cachedFrames.set(s,t),i()}));for(let t=0;t"local"===t.type)),c="global"!==i.className&&i.className?`${i.className}.${n}`:n;if(void 0===(0,ut.x)([s,"optionalAccess",t=>t.object,"access",t=>t.objectId]))o((e=>{e[t]={function:c},a(e)}));else{const e=s.object.objectId;o((n=>(0,ut.x)([this,"access",t=>t._session,"optionalAccess",t=>t.getLocalVariables,"call",r=>r(e,(e=>{n[t]={function:c,vars:e},a(n)}))])))}}a([])}_addLocalVariables(t){for(const e of(0,ut.x)([t,"optionalAccess",t=>t.exception,"optionalAccess",t=>t.values])||[])this._addLocalVariablesToException(e);return t}_addLocalVariablesToException(t){const e=Pe((0,ut.x)([t,"optionalAccess",t=>t.stacktrace,"optionalAccess",t=>t.frames]));if(void 0===e)return;const n=this._cachedFrames.delete(e);if(void 0===n)return;const r=(0,ut.x)([t,"access",t=>t.stacktrace,"optionalAccess",t=>t.frames,"optionalAccess",t=>t.length])||0;for(let e=0;et.stacktrace,"optionalAccess",t=>t.frames,"optionalAccess",t=>t[o]])||!n[e])break;void 0!==n[e].vars&&!1!==t.stacktrace.frames[o].in_app&&((i=t.stacktrace.frames[o].function)===(s=n[e].function)||Re(i)&&Re(s))&&(t.stacktrace.frames[o].vars=n[e].vars)}var i,s}}Ue.__initStatic();var je=n(1249);const Me="\\"===ce.sep,Fe=[new _,new u,new Ht,new Xt,new je.Y,new ee,new ne,new se,new Ue,new fe,new le,new Ce,new ae];function Be(t={}){const e=(0,y.cu)();Yt();const n=(0,ut.x)([e,"access",t=>t.__SENTRY__,"optionalAccess",t=>t.integrations])||[];if(t.defaultIntegrations=!1===t.defaultIntegrations?[]:[...Array.isArray(t.defaultIntegrations)?t.defaultIntegrations:Fe,...n],void 0===t.dsn&&process.env.SENTRY_DSN&&(t.dsn=process.env.SENTRY_DSN),void 0===t.tracesSampleRate&&process.env.SENTRY_TRACES_SAMPLE_RATE){const e=parseFloat(process.env.SENTRY_TRACES_SAMPLE_RATE);isFinite(e)&&(t.tracesSampleRate=e)}if(void 0===t.release){const e=Ye();void 0!==e?t.release=e:t.autoSessionTracking=!1}void 0===t.environment&&process.env.SENTRY_ENVIRONMENT&&(t.environment=process.env.SENTRY_ENVIRONMENT),void 0===t.autoSessionTracking&&void 0!==t.dsn&&(t.autoSessionTracking=!0),void 0===t.instrumenter&&(t.instrumenter="sentry");const r={...t,stackParser:(0,B.Sq)(t.stackParser||Ve),integrations:pt(t),transport:t.transport||Mt};!function(t,e){!0===e.debug&&("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__?l.kg.enable():console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle."));const n=(0,y.Gd)();n.getScope().update(e.initialScope);const r=new t(e);n.bindClient(r)}(Dt,r),t.autoSessionTracking&&function(){const t=(0,y.Gd)();t.startSession(),process.on("beforeExit",(()=>{const e=(0,ut.x)([t,"access",t=>t.getScope,"call",t=>t(),"optionalAccess",t=>t.getSession,"call",t=>t()]);e&&!["exited","crashed"].includes(e.status)&&t.endSession()}))}()}function Le(){return(0,y.Gd)().lastEventId()}async function $e(t){const e=(0,y.Gd)().getClient();return e?e.flush(t):(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&l.kg.warn("Cannot flush events. No client defined."),Promise.resolve(!1))}async function Ge(t){const e=(0,y.Gd)().getClient();return e?e.close(t):(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&l.kg.warn("Cannot flush events and disable SDK. No client defined."),Promise.resolve(!1))}function qe(t){if(void 0===t)return!1;const e=t&&t.getOptions();return!(!e||void 0===e.autoSessionTracking)&&e.autoSessionTracking}function Ye(t){return process.env.SENTRY_RELEASE?process.env.SENTRY_RELEASE:_t.n2.SENTRY_RELEASE&&_t.n2.SENTRY_RELEASE.id?_t.n2.SENTRY_RELEASE.id:process.env.GITHUB_SHA||process.env.COMMIT_REF||process.env.VERCEL_GIT_COMMIT_SHA||process.env.VERCEL_GITHUB_COMMIT_SHA||process.env.VERCEL_GITLAB_COMMIT_SHA||process.env.VERCEL_BITBUCKET_COMMIT_SHA||process.env.ZEIT_GITHUB_COMMIT_SHA||process.env.ZEIT_GITLAB_COMMIT_SHA||process.env.ZEIT_BITBUCKET_COMMIT_SHA||t}const Ve=(0,B.pE)((0,B.Ep)((function(t,e=Me){if(!t)return;const r=e?t.replace(/^[A-Z]:/,"").replace(/\\/g,"/"):t;let{root:i,dir:s,base:o,ext:a}=ce.posix.parse(r);const c=`${n.c[n.s]&&n.c[n.s].filename&&s||global.process.cwd()}/`;let u=o;".js"===a&&(u=u.slice(0,u.length-3)),i||s||(s=".");let l=s.lastIndexOf("/node_modules/");if(l>-1)return`${s.slice(l+14).replace(/\//g,".")}:${u}`;if(l=`${s}/`.lastIndexOf(c,0),0===l){let t=s.slice(c.length).replace(/\//g,".");return t&&(t+=":"),t+=u,t}return u})));function He(t){const e=ce.resolve(t);if(!re.existsSync(e))throw new Error(`Cannot read contents of ${e}. Directory does not exist.`);if(!re.statSync(e).isDirectory())throw new Error(`Cannot read contents of ${e}, because it is not a directory.`);const n=t=>re.readdirSync(t).reduce(((e,r)=>{const i=ce.join(t,r);return re.statSync(i).isDirectory()?e.concat(n(i)):(e.push(i),e)}),[]);return n(e).map((t=>ce.relative(e,t)))}var ze=n(7522);function We(t,e){return Oe(t,{include:e})}function Je(t,e,n={}){return De(t,e,{include:n})}function Ke(){return function(t,e,n){const r=(0,y.Gd)(),i=(0,ut.x)([r,"access",t=>t.getClient,"call",t=>t(),"optionalAccess",t=>t.getOptions,"call",t=>t()]);if(!i||"sentry"!==i.instrumenter||"OPTIONS"===(0,ut.x)([t,"access",t=>t.method,"optionalAccess",t=>t.toUpperCase,"call",t=>t()])||"HEAD"===(0,ut.x)([t,"access",t=>t.method,"optionalAccess",t=>t.toUpperCase,"call",t=>t()]))return n();if(!(0,ze.z)(i))return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&l.kg.warn("Sentry `tracingHandler` is being used, but tracing is disabled. Please enable tracing by setting either `tracesSampleRate` or `tracesSampler` in your `Sentry.init()` options."),n();const s=t.headers&&(0,F.HD)(t.headers["sentry-trace"])&&(0,rt.q)(t.headers["sentry-trace"]),o=(0,ut.x)([t,"access",t=>t.headers,"optionalAccess",t=>t.baggage]),a=(0,Wt.EN)(o),[c,u]=(0,ve.oA)(t,{path:!0,method:!0}),p=k({name:c,op:"http.server",...s,metadata:{dynamicSamplingContext:s&&!a?{}:a,request:t,source:u}},{request:Oe(t)});r.configureScope((t=>{t.setSpan(p)})),e.__sentry_transaction=p,e.once("finish",(()=>{setImmediate((()=>{(0,ve.dB)(p,t),p.setHttpStatus(e.statusCode),p.finish()}))})),n()}}function Xe(t){const e=function(t={}){let e;if("include"in t)e={include:t.include};else{const{ip:n,request:r,transaction:i,user:s}=t;(n||r||i||s)&&(e={include:(0,a.Jr)({ip:n,request:r,transaction:i,user:s})})}return e}(t),n=(0,y.Gd)(),r=n.getClient();if(r&&qe(r)){r.initSessionFlusher();const t=n.getScope();t&&t.getSession()&&t.setSession()}return function(n,r,i){if(t&&t.flushTimeout&&t.flushTimeout>0){const e=r.end;r.end=function(n,r,i){$e(t.flushTimeout).then((()=>{e.call(this,n,r,i)})).then(null,(t=>{("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&l.kg.error(t),e.call(this,n,r,i)}))}}(0,y.Ok)((()=>{const t=(0,y.Gd)();t.configureScope((r=>{if(r.setSDKProcessingMetadata({request:n,requestDataOptionsFromExpressHandler:e}),qe(t.getClient())){const e=t.getScope();e&&e.setRequestSession({status:"ok"})}})),r.once("finish",(()=>{const e=t.getClient();qe(e)&&setImmediate((()=>{e&&e._captureRequestSession&&e._captureRequestSession()}))})),i()}))}}function Ze(t){const e=function(t){const e=t.status||t.statusCode||t.status_code||t.output&&t.output.statusCode;return e?parseInt(e,10):500}(t);return e>=500}function Qe(t){return function(e,n,r,i){(t&&t.shouldHandleError||Ze)(e)?C((t=>{t.setSDKProcessingMetadata({request:n});const s=r.__sentry_transaction;s&&void 0===t.getSpan()&&t.setSpan(s);const o=(0,y.Gd)().getClient();if(o&&qe(o)&&void 0!==o._sessionFlusher){const e=t.getRequestSession();e&&void 0!==e.status&&(e.status="crashed")}const a=b(e);r.sentry=a,i(e)})):i(e)}}function tn(t={}){return function({path:e,type:n,next:r,rawInput:i}){const s=(0,y.Gd)(),o=(0,ut.x)([s,"access",t=>t.getClient,"call",t=>t(),"optionalAccess",t=>t.getOptions,"call",t=>t()]),a=(0,ut.x)([s,"access",t=>t.getScope,"call",t=>t(),"optionalAccess",t=>t.getTransaction,"call",t=>t()]);if(a){a.setName(`trpc/${e}`,"route"),a.op="rpc.server";const r={procedure_type:n};(void 0!==t.attachRpcInput?t.attachRpcInput:(0,ut.x)([o,"optionalAccess",t=>t.sendDefaultPii]))&&(r.input=L(i)),a.setContext("trpc",r)}return r()}}var en=n(2716),nn=n(8737),rn=n(1791),sn=n(6169),on=n(24),an=n(1370),cn=n(9889);const un={...r,...s,...o}},1249:(t,e,n)=>{"use strict";n.d(e,{Y:()=>p});var r,i=n(2176),s=n(6956),o=n(7321),a=n(9181),c=n(7612),u=n(9656),l=n(7578);t=n.hmd(t),function(t){t.RequestCreate="undici:request:create",t.RequestEnd="undici:request:headers",t.RequestError="undici:request:error"}(r||(r={}));class p{static __initStatic(){this.id="Undici"}__init(){this.name=p.id}__init2(){this._createSpanUrlMap=new c.LRUMap(100)}__init3(){this._headersUrlMap=new c.LRUMap(100)}constructor(t={}){p.prototype.__init.call(this),p.prototype.__init2.call(this),p.prototype.__init3.call(this),this._options={breadcrumbs:void 0===t.breadcrumbs||t.breadcrumbs,shouldCreateSpanForRequest:t.shouldCreateSpanForRequest}}setupOnce(e,n){if(u.V.major&&u.V.major<16)return;let c;try{c=(0,i.l$)(t,"diagnostics_channel")}catch(t){}if(!c||!c.subscribe)return;const d=t=>{if(void 0===this._options.shouldCreateSpanForRequest)return!0;const e=this._createSpanUrlMap.get(t);if(void 0!==e)return e;const n=this._options.shouldCreateSpanForRequest(t);return this._createSpanUrlMap.set(t,n),n};c.subscribe(r.RequestCreate,(t=>{const e=n();if(!e.getIntegration(p))return;const{request:r}=t,i=r.origin?r.origin.toString()+r.path:r.path,c=(0,s.en)(i);if((0,l.ZB)(i)||void 0!==r.__sentry__)return;const u=e.getClient(),h=e.getScope().getSpan();if(h&&u){const t=u.getOptions();if(d(i)){const e=r.method||"GET",n={"http.method":e};c.search&&(n["http.query"]=c.search),c.hash&&(n["http.fragment"]=c.hash);const u=h.startChild({op:"http.client",description:`${e} ${(0,s.tF)(c)}`,data:n});r.__sentry__=u;const l=e=>{if(void 0===t.tracePropagationTargets)return!0;const n=this._headersUrlMap.get(e);if(void 0!==n)return n;const r=(0,o.U0)(e,t.tracePropagationTargets);return this._headersUrlMap.set(e,r),r};if(l(i)&&(r.addHeader("sentry-trace",u.toTraceparent()),u.transaction)){const t=u.transaction.getDynamicSamplingContext(),e=(0,a.IQ)(t);e&&r.addHeader("baggage",e)}}}})),c.subscribe(r.RequestEnd,(t=>{const e=n();if(!e.getIntegration(p))return;const{request:r,response:i}=t,s=r.origin?r.origin.toString()+r.path:r.path;if((0,l.ZB)(s))return;const o=r.__sentry__;o&&(o.setHttpStatus(i.statusCode),o.finish()),this._options.breadcrumbs&&e.addBreadcrumb({category:"http",data:{method:r.method,status_code:i.statusCode,url:s},type:"http"},{event:"response",request:r,response:i})})),c.subscribe(r.RequestError,(t=>{const e=n();if(!e.getIntegration(p))return;const{request:r}=t,i=r.origin?r.origin.toString()+r.path:r.path;if((0,l.ZB)(i))return;const s=r.__sentry__;s&&(s.setStatus("internal_error"),s.finish()),this._options.breadcrumbs&&e.addBreadcrumb({category:"http",data:{method:r.method,url:i},level:"error",type:"http"},{event:"error",request:r})}))}}p.__initStatic()},7578:(t,e,n)=>{"use strict";n.d(e,{CA:()=>u,Dt:()=>l,ZB:()=>a,lx:()=>c,nY:()=>d});var r=n(4307),i=n(5659),s=n(7310),o=n(9656);function a(t){const e=(0,r.x)([i.Gd,"call",t=>t(),"access",t=>t.getClient,"call",t=>t(),"optionalAccess",t=>t.getDsn,"call",t=>t()]);return!!e&&t.includes(e.host)}function c(t){return`${t.protocol||""}//${t.hostname||t.host||""}${t.port&&80!==t.port&&443!==t.port?`:${t.port}`:""}${t.path?t.path:"/"}`}function u(t){const e=t.protocol||"",n=t.hostname||t.host||"",r=t.port&&80!==t.port&&443!==t.port?`:${t.port}`:"",i=t.pathname||"/";return`${e}//${t.auth?function(t){const[e,n]=t.split(":");return`${e?"[Filtered]":""}:${n?"[Filtered]":""}@`}(t.auth):""}${n}${r}${i}`}function l(t,e,n){if(!t)return t;let[i,s]=t.split(" ");return e.host&&!e.protocol&&(e.protocol=(0,r.x)([n,"optionalAccess",t=>t.agent,"optionalAccess",t=>t.protocol]),s=u(e)),(0,r.x)([s,"optionalAccess",t=>t.startsWith,"call",t=>t("///")])&&(s=s.slice(2)),`${i} ${s}`}function p(t){const e={protocol:t.protocol,hostname:"string"==typeof t.hostname&&t.hostname.startsWith("[")?t.hostname.slice(1,-1):t.hostname,hash:t.hash,search:t.search,pathname:t.pathname,path:`${t.pathname||""}${t.search||""}`,href:t.href};return""!==t.port&&(e.port=Number(t.port)),(t.username||t.password)&&(e.auth=`${t.username}:${t.password}`),e}function d(t,e){let n,i;return"function"==typeof e[e.length-1]&&(n=e.pop()),i="string"==typeof e[0]?p(new s.URL(e[0])):e[0]instanceof s.URL?p(e[0]):e[0],2===e.length&&(i={...i,...e[1]}),void 0===i.protocol&&(o.V.major&&o.V.major>8?i.protocol=(0,r.x)([(0,r.x)([t,"optionalAccess",t=>t.globalAgent]),"optionalAccess",t=>t.protocol])||(0,r.x)([i.agent,"optionalAccess",t=>t.protocol])||(0,r.x)([i._defaultAgent,"optionalAccess",t=>t.protocol]):i.protocol=(0,r.x)([i.agent,"optionalAccess",t=>t.protocol])||(0,r.x)([i._defaultAgent,"optionalAccess",t=>t.protocol])||(0,r.x)([(0,r.x)([t,"optionalAccess",t=>t.globalAgent]),"optionalAccess",t=>t.protocol])),n?[i,n]:[i]}},9656:(t,e,n)=>{"use strict";n.d(e,{V:()=>r});const r=(0,n(2844).J4)(process.versions.node)},5605:(t,e,n)=>{"use strict";n.r(e),n.d(e,{BROWSER_TRACING_INTEGRATION_ID:()=>ct,BrowserTracing:()=>et,IdleTransaction:()=>ht,Integrations:()=>gt,Span:()=>at,SpanStatus:()=>mt,TRACEPARENT_REGEXP:()=>dt,Transaction:()=>ot,addExtensionMethods:()=>nt,defaultRequestInstrumentationOptions:()=>ut,extractTraceparentData:()=>it,getActiveTransaction:()=>rt,hasTracingEnabled:()=>lt,instrumentOutgoingRequests:()=>ft,spanStatusfromHttpCode:()=>st,startIdleTransaction:()=>_t,stripUrlQueryAndFragment:()=>pt});var r=n(5544),i=n(6890),s=n(7638),o=n(9791),a=n(2343),c=n(9181),u=n(8464);const l=n(1235).n2;var p=n(1170);const d=(t,e,n)=>{let r,i;return s=>{e.value>=0&&(s||n)&&(i=e.value-(r||0),(i||void 0===r)&&(r=e.value,e.delta=i,t(e)))}},h=()=>l.__WEB_VITALS_POLYFILL__?l.performance&&(performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]||(()=>{const t=l.performance.timing,e=l.performance.navigation.type,n={entryType:"navigation",startTime:0,type:2==e?"back_forward":1===e?"reload":"navigate"};for(const e in t)"navigationStart"!==e&&"toJSON"!==e&&(n[e]=Math.max(t[e]-t.navigationStart,0));return n})()):l.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0],f=()=>{const t=h();return t&&t.activationStart||0},_=(t,e)=>{const n=h();let r="navigate";return n&&(r=l.document.prerendering||f()>0?"prerender":n.type.replace(/_/g,"-")),{name:t,value:void 0===e?-1:e,rating:"good",delta:0,entries:[],id:`v3-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:r}},m=(t,e,n)=>{try{if(PerformanceObserver.supportedEntryTypes.includes(t)){const r=new PerformanceObserver((t=>{e(t.getEntries())}));return r.observe(Object.assign({type:t,buffered:!0},n||{})),r}}catch(t){}},g=(t,e)=>{const n=r=>{"pagehide"!==r.type&&"hidden"!==l.document.visibilityState||(t(r),e&&(removeEventListener("visibilitychange",n,!0),removeEventListener("pagehide",n,!0)))};addEventListener("visibilitychange",n,!0),addEventListener("pagehide",n,!0)};let y=-1;const b=()=>(y<0&&(y="hidden"!==l.document.visibilityState||l.document.prerendering?1/0:0,g((({timeStamp:t})=>{y=t}),!0)),{get firstHiddenTime(){return y}}),v={};function E(t){return"number"==typeof t&&isFinite(t)}function w(t,{startTimestamp:e,...n}){return e&&t.startTimestamp>e&&(t.startTimestamp=e),t.startChild({startTimestamp:e,...n})}function T(t){return t/1e3}function S(){return l&&l.addEventListener&&l.performance}let I,x,O=0,D={};function N(){const t=S();if(t&&p.Z1){t.mark&&l.performance.mark("sentry-tracing-init"),(t=>{const e=b(),n=_("FID");let r;const i=t=>{t.startTime{t.forEach(i)},o=m("first-input",s);r=d(t,n),o&&g((()=>{s(o.takeRecords()),o.disconnect()}),!0)})((t=>{const e=t.entries.pop();if(!e)return;const n=T(p.Z1),r=T(e.startTime);("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&a.kg.log("[Measurements] Adding FID"),D.fid={value:t.value,unit:"millisecond"},D["mark.fid"]={value:n+r,unit:"second"}}));const e=(t=>{const e=_("CLS",0);let n,r=0,i=[];const s=t=>{t.forEach((t=>{if(!t.hadRecentInput){const s=i[0],o=i[i.length-1];r&&0!==i.length&&t.startTime-o.startTime<1e3&&t.startTime-s.startTime<5e3?(r+=t.value,i.push(t)):(r=t.value,i=[t]),r>e.value&&(e.value=r,e.entries=i,n&&n())}}))},o=m("layout-shift",s);if(o){n=d(t,e);const r=()=>{s(o.takeRecords()),n(!0)};return g(r),r}})((t=>{const e=t.entries.pop();e&&(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&a.kg.log("[Measurements] Adding CLS"),D.cls={value:t.value,unit:""},x=e)})),n=(t=>{const e=b(),n=_("LCP");let r;const i=t=>{const i=t[t.length-1];if(i){const t=Math.max(i.startTime-f(),0);t{v[n.id]||(i(s.takeRecords()),s.disconnect(),v[n.id]=!0,r(!0))};return["keydown","click"].forEach((t=>{addEventListener(t,e,{once:!0,capture:!0})})),g(e,!0),e}})((t=>{const e=t.entries.pop();e&&(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&a.kg.log("[Measurements] Adding LCP"),D.lcp={value:t.value,unit:"millisecond"},I=e)}));return()=>{e&&e(),n&&n()}}return()=>{}}function C(t,e,n,r,i,s){const o=s?e[s]:e[`${n}End`],a=e[`${n}Start`];a&&o&&w(t,{op:"browser",description:i||n,startTimestamp:r+T(a),endTimestamp:r+T(o)})}var k=n(7522),A=n(5659),R=n(1688),P=n(7321),U=n(7597);const j=["localhost",/^\/(?!\/)/],M={traceFetch:!0,traceXHR:!0,tracingOrigins:j,tracePropagationTargets:j};function F(t){const{traceFetch:e,traceXHR:n,tracePropagationTargets:r,tracingOrigins:i,shouldCreateSpanForRequest:s}={traceFetch:M.traceFetch,traceXHR:M.traceXHR,...t},o="function"==typeof s?s:t=>!0,a=t=>function(t,e){return(0,P.U0)(t,e||j)}(t,r||i),u={};e&&(0,R.oq)("fetch",(t=>{!function(t,e,n,r){if(!(0,k.z)()||!t.fetchData||!e(t.fetchData.url))return;if(t.endTimestamp){const e=t.fetchData.__span;if(!e)return;const n=r[e];if(n){if(t.response){n.setHttpStatus(t.response.status);const e=t.response&&t.response.headers&&t.response.headers.get("content-length"),r=parseInt(e);r>0&&n.setData("http.response_content_length",r)}else t.error&&n.setStatus("internal_error");n.finish(),delete r[e]}return}const i=(0,A.Gd)().getScope(),s=i&&i.getSpan(),o=s&&s.transaction;if(s&&o){const{method:e,url:i}=t.fetchData,a=s.startChild({data:{url:i,type:"fetch","http.method":e},description:`${e} ${i}`,op:"http.client"});t.fetchData.__span=a.spanId,r[a.spanId]=a;const u=t.args[0];t.args[1]=t.args[1]||{};const l=t.args[1];n(t.fetchData.url)&&(l.headers=function(t,e,n,r){const i=(0,c.IQ)(e),s=n.toTraceparent(),o="undefined"!=typeof Request&&(0,U.V9)(t,Request)?t.headers:r.headers;if(o){if("undefined"!=typeof Headers&&(0,U.V9)(o,Headers)){const t=new Headers(o);return t.append("sentry-trace",s),i&&t.append(c.bU,i),t}if(Array.isArray(o)){const t=[...o,["sentry-trace",s]];return i&&t.push([c.bU,i]),t}{const t="baggage"in o?o.baggage:void 0,e=[];return Array.isArray(t)?e.push(...t):t&&e.push(t),i&&e.push(i),{...o,"sentry-trace":s,baggage:e.length>0?e.join(","):void 0}}}return{"sentry-trace":s,baggage:i}}(u,o.getDynamicSamplingContext(),a,l))}}(t,o,a,u)})),n&&(0,R.oq)("xhr",(t=>{!function(t,e,n,r){const i=t.xhr,s=i&&i[R.xU];if(!(0,k.z)()||i&&i.__sentry_own_request__||!(i&&s&&e(s.url)))return;if(t.endTimestamp){const t=i.__sentry_xhr_span_id__;if(!t)return;const e=r[t];return void(e&&(e.setHttpStatus(s.status_code),e.finish(),delete r[t]))}const o=(0,A.Gd)().getScope(),a=o&&o.getSpan(),u=a&&a.transaction;if(a&&u){const t=a.startChild({data:{...s.data,type:"xhr","http.method":s.method,url:s.url},description:`${s.method} ${s.url}`,op:"http.client"});if(i.__sentry_xhr_span_id__=t.spanId,r[i.__sentry_xhr_span_id__]=t,i.setRequestHeader&&n(s.url))try{i.setRequestHeader("sentry-trace",t.toTraceparent());const e=u.getDynamicSamplingContext(),n=(0,c.IQ)(e);n&&i.setRequestHeader(c.bU,n)}catch(t){}}}(t,o,a,u)}))}const B="BrowserTracing",L={...r.AT,markBackgroundTransactions:!0,routingInstrumentation:function(t,e=!0,n=!0){if(!l||!l.location)return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&a.kg.warn("Could not initialize routing instrumentation due to invalid location"));let r,i=l.location.href;e&&(r=t({name:l.location.pathname,startTimestamp:p.Z1?p.Z1/1e3:void 0,op:"pageload",metadata:{source:"url"}})),n&&(0,R.oq)("history",(({to:e,from:n})=>{void 0===n&&i&&-1!==i.indexOf(e)?i=void 0:n!==e&&(i=void 0,r&&(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&a.kg.log(`[Tracing] Finishing current transaction with op: ${r.op}`),r.finish()),r=t({name:l.location.pathname,op:"navigation",metadata:{source:"url"}}))}))},startTransactionOnLocationChange:!0,startTransactionOnPageLoad:!0,enableLongTask:!0,_experiments:{},...M};class ${__init(){this.name=B}constructor(t){$.prototype.__init.call(this),(0,i.T)(),this.options={...L,...t},void 0!==this.options._experiments.enableLongTask&&(this.options.enableLongTask=this.options._experiments.enableLongTask),t&&!t.tracePropagationTargets&&t.tracingOrigins&&(this.options.tracePropagationTargets=t.tracingOrigins),this._collectWebVitals=N(),this.options.enableLongTask&&m("longtask",(t=>{for(const e of t){const t=(0,o.x1)();if(!t)return;const n=T(p.Z1+e.startTime),r=T(e.duration);t.startChild({description:"Main UI thread blocked",op:"ui.long-task",startTimestamp:n,endTimestamp:n+r})}})),this.options._experiments.enableInteractions&&m("event",(t=>{for(const e of t){const t=(0,o.x1)();if(!t)return;if("click"===e.name){const n=T(p.Z1+e.startTime),r=T(e.duration);t.startChild({description:(0,u.Rt)(e.target),op:`ui.interaction.${e.name}`,startTimestamp:n,endTimestamp:n+r})}}}),{durationThreshold:0})}setupOnce(t,e){this._getCurrentHub=e;const{routingInstrumentation:n,startTransactionOnLocationChange:r,startTransactionOnPageLoad:i,markBackgroundTransactions:s,traceFetch:c,traceXHR:u,tracePropagationTargets:p,shouldCreateSpanForRequest:d,_experiments:h}=this.options;n((t=>{const n=this._createRouteTransaction(t);return this.options._experiments.onStartRouteTransaction&&this.options._experiments.onStartRouteTransaction(n,t,e),n}),i,r),s&&(l&&l.document?l.document.addEventListener("visibilitychange",(()=>{const t=(0,o.x1)();if(l.document.hidden&&t){const e="cancelled";("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&a.kg.log(`[Tracing] Transaction: ${e} -> since tab moved to the background, op: ${t.op}`),t.status||t.setStatus(e),t.setTag("visibilitychange","document.hidden"),t.finish()}})):("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&a.kg.warn("[Tracing] Could not set up background tab detection due to lack of global document")),h.enableInteractions&&this._registerInteractionListener(),F({traceFetch:c,traceXHR:u,tracePropagationTargets:p,shouldCreateSpanForRequest:d})}_createRouteTransaction(t){if(!this._getCurrentHub)return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&a.kg.warn(`[Tracing] Did not create ${t.op} transaction because _getCurrentHub is invalid.`));const{beforeNavigate:e,idleTimeout:n,finalTimeout:r,heartbeatInterval:o}=this.options,d="pageload"===t.op,h=d?G("sentry-trace"):null,f=d?G("baggage"):null,_=h?(0,s.q)(h):void 0,m=f?(0,c.EN)(f):void 0,g={...t,..._,metadata:{...t.metadata,dynamicSamplingContext:_&&!m?{}:m},trimEnd:!0},y="function"==typeof e?e(g):g,v=void 0===y?{...g,sampled:!1}:y;v.metadata=v.name!==g.name?{...v.metadata,source:"custom"}:v.metadata,this._latestRouteName=v.name,this._latestRouteSource=v.metadata&&v.metadata.source,!1===v.sampled&&("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&a.kg.log(`[Tracing] Will not send ${v.op} transaction because of beforeNavigate.`),("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&a.kg.log(`[Tracing] Starting ${v.op} transaction on scope`);const N=this._getCurrentHub(),{location:k}=l,A=(0,i.l)(N,v,n,r,!0,{location:k},o);return A.registerBeforeFinishCallback((t=>{this._collectWebVitals(),function(t){const e=S();if(!e||!l.performance.getEntries||!p.Z1)return;("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&a.kg.log("[Tracing] Adding & adjusting spans using Performance API");const n=T(p.Z1),r=e.getEntries();let i,s;if(r.slice(O).forEach((e=>{const r=T(e.startTime),o=T(e.duration);if(!("navigation"===t.op&&n+r{C(t,e,r,n)})),C(t,e,"secureConnection",n,"TLS/SSL","connectEnd"),C(t,e,"fetch",n,"cache","domainLookupStart"),C(t,e,"domainLookup",n,"DNS"),function(t,e,n){w(t,{op:"browser",description:"request",startTimestamp:n+T(e.requestStart),endTimestamp:n+T(e.responseEnd)}),w(t,{op:"browser",description:"response",startTimestamp:n+T(e.responseStart),endTimestamp:n+T(e.responseEnd)})}(t,e,n)}(t,e,n),i=n+T(e.responseStart),s=n+T(e.requestStart);break;case"mark":case"paint":case"measure":{!function(t,e,n,r,i){const s=i+n,o=s+r;w(t,{description:e.name,endTimestamp:o,op:e.entryType,startTimestamp:s})}(t,e,r,o,n);const i=b(),s=e.startTime{if(!D[e]||n>=t.startTimestamp)return;const r=D[e].value,i=n+T(r),s=Math.abs(1e3*(i-t.startTimestamp)),o=s-r;("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&a.kg.log(`[Measurements] Normalized ${e} from ${r} to ${s} (${o})`),D[e].value=s}));const e=D["mark.fid"];e&&D.fid&&(w(t,{description:"first input delay",endTimestamp:e.value+T(D.fid.value),op:"ui.action",startTimestamp:e.value}),delete D["mark.fid"]),"fcp"in D||delete D.cls,Object.keys(D).forEach((e=>{t.setMeasurement(e,D[e].value,D[e].unit)})),function(t){I&&(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&a.kg.log("[Measurements] Adding LCP Data"),I.element&&t.setTag("lcp.element",(0,u.Rt)(I.element)),I.id&&t.setTag("lcp.id",I.id),I.url&&t.setTag("lcp.url",I.url.trim().slice(0,200)),t.setTag("lcp.size",I.size)),x&&x.sources&&(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&a.kg.log("[Measurements] Adding CLS Data"),x.sources.forEach(((e,n)=>t.setTag(`cls.source.${n+1}`,(0,u.Rt)(e.node)))))}(t)}I=void 0,x=void 0,D={}}(t)})),A}_registerInteractionListener(){let t;const e=()=>{const{idleTimeout:e,finalTimeout:n,heartbeatInterval:r}=this.options,s="ui.action.click",c=(0,o.x1)();if(c&&c.op&&["navigation","pageload"].includes(c.op))return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&a.kg.warn(`[Tracing] Did not create ${s} transaction because a pageload or navigation transaction is in progress.`));if(t&&(t.setFinishReason("interactionInterrupted"),t.finish(),t=void 0),!this._getCurrentHub)return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&a.kg.warn(`[Tracing] Did not create ${s} transaction because _getCurrentHub is invalid.`));if(!this._latestRouteName)return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&a.kg.warn(`[Tracing] Did not create ${s} transaction because _latestRouteName is missing.`));const u=this._getCurrentHub(),{location:p}=l,d={name:this._latestRouteName,op:s,trimEnd:!0,metadata:{source:this._latestRouteSource||"url"}};t=(0,i.l)(u,d,e,n,!0,{location:p},r)};["click"].forEach((t=>{addEventListener(t,e,{once:!1,capture:!0})}))}}function G(t){const e=(0,u.qT)(`meta[name=${t}]`);return e?e.getAttribute("content"):null}var q,Y=n(758),V=n(8903),H=n(8069),z=n(6956);!function(t){t.Ok="ok",t.DeadlineExceeded="deadline_exceeded",t.Unauthenticated="unauthenticated",t.PermissionDenied="permission_denied",t.NotFound="not_found",t.ResourceExhausted="resource_exhausted",t.InvalidArgument="invalid_argument",t.Unimplemented="unimplemented",t.Unavailable="unavailable",t.InternalError="internal_error",t.UnknownError="unknown_error",t.Cancelled="cancelled",t.AlreadyExists="already_exists",t.FailedPrecondition="failed_precondition",t.Aborted="aborted",t.OutOfRange="out_of_range",t.DataLoss="data_loss"}(q||(q={}));var W=n(2716),J=n(8737),K=n(1791),X=n(6169),Z=n(24),Q=n(1370),tt=n(9889);const et=$,nt=Y.r,rt=o.x1,it=s.q,st=V.Zd,ot=H.Y,at=V.Dr,ct=B,ut=M,lt=k.z,pt=z.rt,dt=s.K,ht=r.io,ft=F,_t=i.l,mt=q,gt={BrowserTracing:et,Apollo:W._,Express:J.N,GraphQL:K.k,Mongo:X._,Mysql:Z.m,Postgres:Q.E,Prisma:tt.g};("undefined"==typeof __SENTRY_TRACING__||__SENTRY_TRACING__)&&(0,Y.r)()},9181:(t,e,n)=>{"use strict";n.d(e,{EN:()=>u,IQ:()=>l,bU:()=>s});var r=n(7597),i=n(2343);const s="baggage",o="sentry-",a=/^sentry-/,c=8192;function u(t){if(!(0,r.HD)(t)&&!Array.isArray(t))return;let e={};if(Array.isArray(t))e=t.reduce(((t,e)=>({...t,...p(e)})),{});else{if(!t)return;e=p(t)}const n=Object.entries(e).reduce(((t,[e,n])=>(e.match(a)&&(t[e.slice(o.length)]=n),t)),{});return Object.keys(n).length>0?n:void 0}function l(t){return function(t){if(0!==Object.keys(t).length)return Object.entries(t).reduce(((t,[e,n],r)=>{const s=`${encodeURIComponent(e)}=${encodeURIComponent(n)}`,o=0===r?s:`${t},${s}`;return o.length>c?(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&i.kg.warn(`Not adding key: ${e} with val: ${n} to baggage header due to exceeding baggage size limits.`),t):o}),"")}(Object.entries(t).reduce(((t,[e,n])=>(n&&(t[`${o}${e}`]=n),t)),{}))}function p(t){return t.split(",").map((t=>t.split("=").map((t=>decodeURIComponent(t.trim()))))).reduce(((t,[e,n])=>(t[e]=n,t)),{})}},8464:(t,e,n)=>{"use strict";n.d(e,{Rt:()=>o,qT:()=>c});var r=n(7597);const i=(0,n(1235).Rf)(),s=80;function o(t,e={}){try{let n=t;const r=5,i=[];let o=0,c=0;const u=" > ",l=u.length;let p;const d=Array.isArray(e)?e:e.keyAttrs,h=!Array.isArray(e)&&e.maxStringLength||s;for(;n&&o++1&&c+i.length*l+p.length>=h));)i.push(p),c+=p.length,n=n.parentNode;return i.reverse().join(u)}catch(t){return""}}function a(t,e){const n=t,i=[];let s,o,a,c,u;if(!n||!n.tagName)return"";i.push(n.tagName.toLowerCase());const l=e&&e.length?e.filter((t=>n.getAttribute(t))).map((t=>[t,n.getAttribute(t)])):null;if(l&&l.length)l.forEach((t=>{i.push(`[${t[0]}="${t[1]}"]`)}));else if(n.id&&i.push(`#${n.id}`),s=n.className,s&&(0,r.HD)(s))for(o=s.split(/\s+/),u=0;u{"use strict";function r(t){let e,n=t[0],r=1;for(;rn.call(e,...t))),e=void 0)}return n}n.d(e,{x:()=>r})},1688:(t,e,n)=>{"use strict";n.d(e,{xU:()=>d,oq:()=>m});var r=n(7597),i=n(2343),s=n(535),o=n(6147),a=n(1235);const c=(0,a.Rf)();function u(t){return t&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(t.toString())}const l=(0,a.Rf)(),p=(0,a.Rf)(),d="__sentry_xhr_v2__",h={},f={};function _(t){if(!f[t])switch(f[t]=!0,t){case"console":"console"in p&&i.RU.forEach((function(t){t in p.console&&(0,s.hl)(p.console,t,(function(e){return function(...n){g("console",{args:n,level:t}),e&&e.apply(p.console,n)}}))}));break;case"dom":!function(){if(!("document"in p))return;const t=g.bind(null,"dom"),e=S(t,!0);p.document.addEventListener("click",e,!1),p.document.addEventListener("keypress",e,!1),["EventTarget","Node"].forEach((e=>{const n=p[e]&&p[e].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&((0,s.hl)(n,"addEventListener",(function(e){return function(n,r,i){if("click"===n||"keypress"==n)try{const r=this,s=r.__sentry_instrumentation_handlers__=r.__sentry_instrumentation_handlers__||{},o=s[n]=s[n]||{refCount:0};if(!o.handler){const r=S(t);o.handler=r,e.call(this,n,r,i)}o.refCount++}catch(t){}return e.call(this,n,r,i)}})),(0,s.hl)(n,"removeEventListener",(function(t){return function(e,n,r){if("click"===e||"keypress"==e)try{const n=this,i=n.__sentry_instrumentation_handlers__||{},s=i[e];s&&(s.refCount--,s.refCount<=0&&(t.call(this,e,s.handler,r),s.handler=void 0,delete i[e]),0===Object.keys(i).length&&delete n.__sentry_instrumentation_handlers__)}catch(t){}return t.call(this,e,n,r)}})))}))}();break;case"xhr":!function(){if(!("XMLHttpRequest"in p))return;const t=XMLHttpRequest.prototype;(0,s.hl)(t,"open",(function(t){return function(...e){const n=e[1],i=this[d]={method:(0,r.HD)(e[0])?e[0].toUpperCase():e[0],url:e[1],request_headers:{}};(0,r.HD)(n)&&"POST"===i.method&&n.match(/sentry_key/)&&(this.__sentry_own_request__=!0);const o=()=>{const t=this[d];if(t&&4===this.readyState){try{t.status_code=this.status}catch(t){}g("xhr",{args:e,endTimestamp:Date.now(),startTimestamp:Date.now(),xhr:this})}};return"onreadystatechange"in this&&"function"==typeof this.onreadystatechange?(0,s.hl)(this,"onreadystatechange",(function(t){return function(...e){return o(),t.apply(this,e)}})):this.addEventListener("readystatechange",o),(0,s.hl)(this,"setRequestHeader",(function(t){return function(...e){const[n,r]=e,i=this[d];return i&&(i.request_headers[n.toLowerCase()]=r),t.apply(this,e)}})),t.apply(this,e)}})),(0,s.hl)(t,"send",(function(t){return function(...e){const n=this[d];return n&&void 0!==e[0]&&(n.body=e[0]),g("xhr",{args:e,startTimestamp:Date.now(),xhr:this}),t.apply(this,e)}}))}();break;case"fetch":(function(){if(!function(){if(!("fetch"in c))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch(t){return!1}}())return!1;if(u(c.fetch))return!0;let t=!1;const e=c.document;if(e&&"function"==typeof e.createElement)try{const n=e.createElement("iframe");n.hidden=!0,e.head.appendChild(n),n.contentWindow&&n.contentWindow.fetch&&(t=u(n.contentWindow.fetch)),e.head.removeChild(n)}catch(t){("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&i.kg.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",t)}return t})()&&(0,s.hl)(p,"fetch",(function(t){return function(...e){const{method:n,url:r}=function(t){if(0===t.length)return{method:"GET",url:""};if(2===t.length){const[e,n]=t;return{url:b(e),method:y(n,"method")?String(n.method).toUpperCase():"GET"}}const e=t[0];return{url:b(e),method:y(e,"method")?String(e.method).toUpperCase():"GET"}}(e),i={args:e,fetchData:{method:n,url:r},startTimestamp:Date.now()};return g("fetch",{...i}),t.apply(p,e).then((t=>(g("fetch",{...i,endTimestamp:Date.now(),response:t}),t)),(t=>{throw g("fetch",{...i,endTimestamp:Date.now(),error:t}),t}))}}));break;case"history":!function(){if(!function(){const t=l.chrome,e=t&&t.app&&t.app.runtime,n="history"in l&&!!l.history.pushState&&!!l.history.replaceState;return!e&&n}())return;const t=p.onpopstate;function e(t){return function(...e){const n=e.length>2?e[2]:void 0;if(n){const t=v,e=String(n);v=e,g("history",{from:t,to:e})}return t.apply(this,e)}}p.onpopstate=function(...e){const n=p.location.href,r=v;if(v=n,g("history",{from:r,to:n}),t)try{return t.apply(this,e)}catch(t){}},(0,s.hl)(p.history,"pushState",e),(0,s.hl)(p.history,"replaceState",e)}();break;case"error":I=p.onerror,p.onerror=function(t,e,n,r,i){return g("error",{column:r,error:i,line:n,msg:t,url:e}),!(!I||I.__SENTRY_LOADER__)&&I.apply(this,arguments)},p.onerror.__SENTRY_INSTRUMENTED__=!0;break;case"unhandledrejection":x=p.onunhandledrejection,p.onunhandledrejection=function(t){return g("unhandledrejection",t),!(x&&!x.__SENTRY_LOADER__)||x.apply(this,arguments)},p.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0;break;default:return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&i.kg.warn("unknown instrumentation type:",t))}}function m(t,e){h[t]=h[t]||[],h[t].push(e),_(t)}function g(t,e){if(t&&h[t])for(const n of h[t]||[])try{n(e)}catch(e){("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&i.kg.error(`Error while triggering instrumentation handler.\nType: ${t}\nName: ${(0,o.$P)(n)}\nError:`,e)}}function y(t,e){return!!t&&"object"==typeof t&&!!t[e]}function b(t){return"string"==typeof t?t:t?y(t,"url")?t.url:t.toString?t.toString():"":""}let v;const E=1e3;let w,T;function S(t,e=!1){return n=>{if(!n||T===n)return;if(function(t){if("keypress"!==t.type)return!1;try{const e=t.target;if(!e||!e.tagName)return!0;if("INPUT"===e.tagName||"TEXTAREA"===e.tagName||e.isContentEditable)return!1}catch(t){}return!0}(n))return;const r="keypress"===n.type?"input":n.type;(void 0===w||function(t,e){if(!t)return!0;if(t.type!==e.type)return!0;try{if(t.target!==e.target)return!0}catch(t){}return!1}(T,n))&&(t({event:n,name:r,global:e}),T=n),clearTimeout(w),w=p.setTimeout((()=>{w=void 0}),E)}}let I=null,x=null},7597:(t,e,n)=>{"use strict";n.d(e,{Cy:()=>h,HD:()=>o,J8:()=>d,Kj:()=>p,PO:()=>c,V9:()=>_,VZ:()=>i,cO:()=>u,i2:()=>f,kK:()=>l,pt:()=>a});const r=Object.prototype.toString;function i(t){switch(r.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return _(t,Error)}}function s(t,e){return r.call(t)===`[object ${e}]`}function o(t){return s(t,"String")}function a(t){return null===t||"object"!=typeof t&&"function"!=typeof t}function c(t){return s(t,"Object")}function u(t){return"undefined"!=typeof Event&&_(t,Event)}function l(t){return"undefined"!=typeof Element&&_(t,Element)}function p(t){return s(t,"RegExp")}function d(t){return Boolean(t&&t.then&&"function"==typeof t.then)}function h(t){return c(t)&&"nativeEvent"in t&&"preventDefault"in t&&"stopPropagation"in t}function f(t){return"number"==typeof t&&t!=t}function _(t,e){try{return t instanceof e}catch(t){return!1}}},2343:(t,e,n)=>{"use strict";n.d(e,{Cf:()=>s,RU:()=>i,kg:()=>a});var r=n(1235);const i=["debug","info","warn","error","log","assert","trace"];function s(t){if(!("console"in r.n2))return t();const e=r.n2.console,n={};i.forEach((t=>{const r=e[t]&&e[t].__sentry_original__;t in e&&r&&(n[t]=e[t],e[t]=r)}));try{return t()}finally{Object.keys(n).forEach((t=>{e[t]=n[t]}))}}function o(){let t=!1;const e={enable:()=>{t=!0},disable:()=>{t=!1}};return"undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__?i.forEach((n=>{e[n]=(...e)=>{t&&s((()=>{r.n2.console[n](`Sentry Logger [${n}]:`,...e)}))}})):i.forEach((t=>{e[t]=()=>{}})),e}let a;a="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__?(0,r.YO)("logger",o):o()},2844:(t,e,n)=>{"use strict";n.d(e,{DM:()=>o,Db:()=>u,EG:()=>l,J4:()=>d,YO:()=>f,go:()=>h,jH:()=>c,lE:()=>_});var r=n(535),i=n(7321),s=n(1235);function o(){const t=s.n2,e=t.crypto||t.msCrypto;if(e&&e.randomUUID)return e.randomUUID().replace(/-/g,"");const n=e&&e.getRandomValues?()=>e.getRandomValues(new Uint8Array(1))[0]:()=>16*Math.random();return([1e7]+1e3+4e3+8e3+1e11).replace(/[018]/g,(t=>(t^(15&n())>>t/4).toString(16)))}function a(t){return t.exception&&t.exception.values?t.exception.values[0]:void 0}function c(t){const{message:e,event_id:n}=t;if(e)return e;const r=a(t);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"":n||""}function u(t,e,n){const r=t.exception=t.exception||{},i=r.values=r.values||[],s=i[0]=i[0]||{};s.value||(s.value=e||""),s.type||(s.type=n||"Error")}function l(t,e){const n=a(t);if(!n)return;const r=n.mechanism;if(n.mechanism={type:"generic",handled:!0,...r,...e},e&&"data"in e){const t={...r&&r.data,...e.data};n.mechanism.data=t}}const p=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/;function d(t){const e=t.match(p)||[],n=parseInt(e[1],10),r=parseInt(e[2],10),i=parseInt(e[3],10);return{buildmetadata:e[5],major:isNaN(n)?void 0:n,minor:isNaN(r)?void 0:r,patch:isNaN(i)?void 0:i,prerelease:e[4]}}function h(t,e,n=5){if(void 0===e.lineno)return;const r=t.length,s=Math.max(Math.min(r,e.lineno-1),0);e.pre_context=t.slice(Math.max(0,s-n),s).map((t=>(0,i.JM)(t,0))),e.context_line=(0,i.JM)(t[Math.min(r-1,s)],e.colno||0),e.post_context=t.slice(Math.min(s+1,r),s+1+n).map((t=>(0,i.JM)(t,0)))}function f(t){if(t&&t.__sentry_captured__)return!0;try{(0,r.xp)(t,"__sentry_captured__",!0)}catch(t){}return!1}function _(t){return Array.isArray(t)?t:[t]}},2176:(t,e,n)=>{"use strict";function r(){return!("undefined"!=typeof __SENTRY_BROWSER_BUNDLE__&&__SENTRY_BROWSER_BUNDLE__)&&"[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0)}function i(t,e){return t.require(e)}function s(e){let n;try{n=i(t,e)}catch(t){}try{const{cwd:r}=i(t,"process");n=i(t,`${r()}/node_modules/${e}`)}catch(t){}return n}n.d(e,{l$:()=>i,KV:()=>r,$y:()=>s}),t=n.hmd(t)},535:(t,e,n)=>{"use strict";n.d(e,{HK:()=>c,Jr:()=>f,Sh:()=>l,_j:()=>u,hl:()=>o,xp:()=>a,zf:()=>h});var r=n(8464),i=n(7597),s=n(7321);function o(t,e,n){if(!(e in t))return;const r=t[e],i=n(r);if("function"==typeof i)try{!function(t,e){const n=e.prototype||{};t.prototype=e.prototype=n,a(t,"__sentry_original__",e)}(i,r)}catch(t){}t[e]=i}function a(t,e,n){Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0})}function c(t){return t.__sentry_original__}function u(t){return Object.keys(t).map((e=>`${encodeURIComponent(e)}=${encodeURIComponent(t[e])}`)).join("&")}function l(t){if((0,i.VZ)(t))return{message:t.message,name:t.name,stack:t.stack,...d(t)};if((0,i.cO)(t)){const e={type:t.type,target:p(t.target),currentTarget:p(t.currentTarget),...d(t)};return"undefined"!=typeof CustomEvent&&(0,i.V9)(t,CustomEvent)&&(e.detail=t.detail),e}return t}function p(t){try{return(0,i.kK)(t)?(0,r.Rt)(t):Object.prototype.toString.call(t)}catch(t){return""}}function d(t){if("object"==typeof t&&null!==t){const e={};for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}return{}}function h(t,e=40){const n=Object.keys(l(t));if(n.sort(),!n.length)return"[object has no keys]";if(n[0].length>=e)return(0,s.$G)(n[0],e);for(let t=n.length;t>0;t--){const r=n.slice(0,t).join(", ");if(!(r.length>e))return t===n.length?r:(0,s.$G)(r,e)}return""}function f(t){return _(t,new Map)}function _(t,e){if((0,i.PO)(t)){const n=e.get(t);if(void 0!==n)return n;const r={};e.set(t,r);for(const n of Object.keys(t))void 0!==t[n]&&(r[n]=_(t[n],e));return r}if(Array.isArray(t)){const n=e.get(t);if(void 0!==n)return n;const r=[];return e.set(t,r),t.forEach((t=>{r.push(_(t,e))})),r}return t}},442:(t,e,n)=>{"use strict";n.d(e,{dB:()=>i,oA:()=>s});var r=n(6956);function i(t,e,n){t&&(t.metadata.source&&"url"!==t.metadata.source||t.setName(...s(e,{path:!0,method:!0})),t.setData("url",e.originalUrl||e.url),e.baseUrl&&t.setData("baseUrl",e.baseUrl),t.setData("query",function(t,e){let n=t.originalUrl||t.url||"";if(n)return n.startsWith("/")&&(n=`http://dogs.are.great${n}`),t.query||void 0!==typeof URL&&new URL(n).search.replace("?","")||e&&e.url&&e.url.parse(n).query||void 0}(e,n)))}function s(t,e={}){const n=t.method&&t.method.toUpperCase();let i="",s="url";e.customRoute||t.route?(i=e.customRoute||`${t.baseUrl||""}${t.route&&t.route.path}`,s="route"):(t.originalUrl||t.url)&&(i=(0,r.rt)(t.originalUrl||t.url||""));let o="";return e.method&&n&&(o+=n),e.method&&e.path&&(o+=" "),e.path&&i&&(o+=i),[o,s]}},6147:(t,e,n)=>{"use strict";function r(t){const e=/^\s*[-]{4,}$/,n=/at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/;return r=>{const i=r.match(n);if(i){let e,n,r,s,o;if(i[1]){r=i[1];let t=r.lastIndexOf(".");if("."===r[t-1]&&t--,t>0){e=r.slice(0,t),n=r.slice(t+1);const i=e.indexOf(".Module");i>0&&(r=r.slice(i+1),e=e.slice(0,i))}s=void 0}n&&(s=e,o=n),""===n&&(o=void 0,r=void 0),void 0===r&&(o=o||"",r=s?`${s}.${o}`:o);let a=i[2]&&i[2].startsWith("file://")?i[2].slice(7):i[2];const c="native"===i[5];a||!i[5]||c||(a=i[5]);const u=!(c||a&&!a.startsWith("/")&&!a.includes(":\\")&&!a.startsWith(".")&&!a.match(/^[a-zA-Z]([a-zA-Z0-9.\-+])*:\/\//)||void 0===a||a.includes("node_modules/"));return{filename:a,module:t?t(a):void 0,function:r,lineno:parseInt(i[3],10)||void 0,colno:parseInt(i[4],10)||void 0,in_app:u}}if(r.match(e))return{filename:r}}}n.d(e,{pE:()=>o,$P:()=>u,Ep:()=>l,Sq:()=>a});const i=50,s=/\(error: (.*)\)/;function o(...t){const e=t.sort(((t,e)=>t[0]-e[0])).map((t=>t[1]));return(t,n=0)=>{const r=[],o=t.split("\n");for(let t=n;t1024)continue;const a=s.test(n)?n.replace(s,"$1"):n;if(!a.match(/\S*Error: /)){for(const t of e){const e=t(a);if(e){r.push(e);break}}if(r.length>=i)break}}return function(t){if(!t.length)return[];const e=t.slice(0,i),n=e[e.length-1].function;n&&/sentryWrapped/.test(n)&&e.pop(),e.reverse();const r=e[e.length-1].function;return r&&/captureMessage|captureException/.test(r)&&e.pop(),e.map((t=>({...t,filename:t.filename||e[e.length-1].filename,function:t.function||"?"})))}(r)}}function a(t){return Array.isArray(t)?o(...t):t}const c="";function u(t){try{return t&&"function"==typeof t&&t.name||c}catch(t){return c}}function l(t){return[90,r(t)]}},7321:(t,e,n)=>{"use strict";n.d(e,{$G:()=>i,JM:()=>s,U0:()=>o});var r=n(7597);function i(t,e=0){return"string"!=typeof t||0===e||t.length<=e?t:`${t.slice(0,e)}...`}function s(t,e){let n=t;const r=n.length;if(r<=150)return n;e>r&&(e=r);let i=Math.max(e-60,0);i<5&&(i=0);let s=Math.min(i+140,r);return s>r-5&&(s=r),s===r&&(i=Math.max(s-140,0)),n=n.slice(i,s),i>0&&(n=`'{snip} ${n}`),sfunction(t,e,n=!1){return!!(0,r.HD)(t)&&((0,r.Kj)(e)?e.test(t):!!(0,r.HD)(e)&&(n?t===e:t.includes(e)))}(t,e,n)))}},6893:(t,e,n)=>{"use strict";n.d(e,{$2:()=>o,WD:()=>s,cW:()=>a});var r,i=n(7597);function s(t){return new a((e=>{e(t)}))}function o(t){return new a(((e,n)=>{n(t)}))}!function(t){t[t.PENDING=0]="PENDING",t[t.RESOLVED=1]="RESOLVED",t[t.REJECTED=2]="REJECTED"}(r||(r={}));class a{__init(){this._state=r.PENDING}__init2(){this._handlers=[]}constructor(t){a.prototype.__init.call(this),a.prototype.__init2.call(this),a.prototype.__init3.call(this),a.prototype.__init4.call(this),a.prototype.__init5.call(this),a.prototype.__init6.call(this);try{t(this._resolve,this._reject)}catch(t){this._reject(t)}}then(t,e){return new a(((n,r)=>{this._handlers.push([!1,e=>{if(t)try{n(t(e))}catch(t){r(t)}else n(e)},t=>{if(e)try{n(e(t))}catch(t){r(t)}else r(t)}]),this._executeHandlers()}))}catch(t){return this.then((t=>t),t)}finally(t){return new a(((e,n)=>{let r,i;return this.then((e=>{i=!1,r=e,t&&t()}),(e=>{i=!0,r=e,t&&t()})).then((()=>{i?n(r):e(r)}))}))}__init3(){this._resolve=t=>{this._setResult(r.RESOLVED,t)}}__init4(){this._reject=t=>{this._setResult(r.REJECTED,t)}}__init5(){this._setResult=(t,e)=>{this._state===r.PENDING&&((0,i.J8)(e)?e.then(this._resolve,this._reject):(this._state=t,this._value=e,this._executeHandlers()))}}__init6(){this._executeHandlers=()=>{if(this._state===r.PENDING)return;const t=this._handlers.slice();this._handlers=[],t.forEach((t=>{t[0]||(this._state===r.RESOLVED&&t[1](this._value),this._state===r.REJECTED&&t[2](this._value),t[0]=!0)}))}}}},1170:(t,e,n)=>{"use strict";n.d(e,{Z1:()=>d,ph:()=>l,yW:()=>u});var r=n(2176),i=n(1235);t=n.hmd(t);const s=(0,i.Rf)(),o={nowSeconds:()=>Date.now()/1e3},a=(0,r.KV)()?function(){try{return(0,r.l$)(t,"perf_hooks").performance}catch(t){return}}():function(){const{performance:t}=s;if(t&&t.now)return{now:()=>t.now(),timeOrigin:Date.now()-t.now()}}(),c=void 0===a?o:{nowSeconds:()=>(a.timeOrigin+a.now())/1e3},u=o.nowSeconds.bind(o),l=c.nowSeconds.bind(c);let p;const d=(()=>{const{performance:t}=s;if(!t||!t.now)return void(p="none");const e=36e5,n=t.now(),r=Date.now(),i=t.timeOrigin?Math.abs(t.timeOrigin+n-r):e,o=i{"use strict";n.d(e,{K:()=>r,q:()=>i});const r=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function i(t){const e=t.match(r);if(!t||!e)return;let n;return"1"===e[3]?n=!0:"0"===e[3]&&(n=!1),{traceId:e[1],parentSampled:n,parentSpanId:e[2]}}},6956:(t,e,n)=>{"use strict";function r(t){if(!t)return{};const e=t.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!e)return{};const n=e[6]||"",r=e[8]||"";return{host:e[4],path:e[5],protocol:e[2],search:n,hash:r,relative:e[5]+n+r}}function i(t){return t.split(/[\?#]/,1)[0]}function s(t){return t.split(/\\?\//).filter((t=>t.length>0&&","!==t)).length}function o(t){const{protocol:e,host:n,path:r}=t;return`${e?`${e}://`:""}${n&&n.replace(/^.*@/,"[filtered]:[filtered]@").replace(":80","").replace(":443","")||""}${r}`}n.d(e,{$A:()=>s,en:()=>r,rt:()=>i,tF:()=>o})},1235:(t,e,n)=>{"use strict";function r(t){return t&&t.Math==Math?t:void 0}n.d(e,{Rf:()=>s,YO:()=>o,n2:()=>i});const i="object"==typeof globalThis&&r(globalThis)||"object"==typeof window&&r(window)||"object"==typeof self&&r(self)||"object"==typeof global&&r(global)||function(){return this}()||{};function s(){return i}function o(t,e,n){const r=n||i,s=r.__SENTRY__=r.__SENTRY__||{};return s[t]||(s[t]=e())}},8054:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};const i=n(2361),s=r(n(5158)),o=r(n(6304)),a=s.default("agent-base");function c(){const{stack:t}=new Error;return"string"==typeof t&&t.split("\n").some((t=>-1!==t.indexOf("(https.js:")||-1!==t.indexOf("node:https:")))}function u(t,e){return new u.Agent(t,e)}!function(t){class e extends i.EventEmitter{constructor(t,e){super();let n=e;"function"==typeof t?this.callback=t:t&&(n=t),this.timeout=null,n&&"number"==typeof n.timeout&&(this.timeout=n.timeout),this.maxFreeSockets=1,this.maxSockets=1,this.maxTotalSockets=1/0,this.sockets={},this.freeSockets={},this.requests={},this.options={}}get defaultPort(){return"number"==typeof this.explicitDefaultPort?this.explicitDefaultPort:c()?443:80}set defaultPort(t){this.explicitDefaultPort=t}get protocol(){return"string"==typeof this.explicitProtocol?this.explicitProtocol:c()?"https:":"http:"}set protocol(t){this.explicitProtocol=t}callback(t,e,n){throw new Error('"agent-base" has no default implementation, you must subclass and override `callback()`')}addRequest(t,e){const n=Object.assign({},e);"boolean"!=typeof n.secureEndpoint&&(n.secureEndpoint=c()),null==n.host&&(n.host="localhost"),null==n.port&&(n.port=n.secureEndpoint?443:80),null==n.protocol&&(n.protocol=n.secureEndpoint?"https:":"http:"),n.host&&n.path&&delete n.path,delete n.agent,delete n.hostname,delete n._defaultAgent,delete n.defaultPort,delete n.createConnection,t._last=!0,t.shouldKeepAlive=!1;let r=!1,i=null;const s=n.timeout||this.timeout,u=e=>{t._hadError||(t.emit("error",e),t._hadError=!0)},l=()=>{i=null,r=!0;const t=new Error(`A "socket" was not created for HTTP request before ${s}ms`);t.code="ETIMEOUT",u(t)},p=t=>{r||(null!==i&&(clearTimeout(i),i=null),u(t))},d=e=>{if(r)return;if(null!=i&&(clearTimeout(i),i=null),s=e,Boolean(s)&&"function"==typeof s.addRequest)return a("Callback returned another Agent instance %o",e.constructor.name),void e.addRequest(t,n);var s;if(e)return e.once("free",(()=>{this.freeSocket(e,n)})),void t.onSocket(e);const o=new Error(`no Duplex stream was returned to agent-base for \`${t.method} ${t.path}\``);u(o)};if("function"==typeof this.callback){this.promisifiedCallback||(this.callback.length>=3?(a("Converting legacy callback function to promise"),this.promisifiedCallback=o.default(this.callback)):this.promisifiedCallback=this.callback),"number"==typeof s&&s>0&&(i=setTimeout(l,s)),"port"in n&&"number"!=typeof n.port&&(n.port=Number(n.port));try{a("Resolving socket for %o request: %o",n.protocol,`${t.method} ${t.path}`),Promise.resolve(this.promisifiedCallback(t,n)).then(d,p)}catch(t){Promise.reject(t).catch(p)}}else u(new Error("`callback` is not defined"))}freeSocket(t,e){a("Freeing socket %o %o",t.constructor.name,e),t.destroy()}destroy(){a("Destroying agent %o",this.constructor.name)}}t.Agent=e,t.prototype=t.Agent.prototype}(u||(u={})),t.exports=u},6304:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return function(e,n){return new Promise(((r,i)=>{t.call(this,e,n,((t,e)=>{t?i(t):r(e)}))}))}}},6489:(t,e)=>{"use strict";e.Q=function(t,e){if("string"!=typeof t)throw new TypeError("argument str must be a string");for(var i={},s=e||{},o=t.split(";"),a=s.decode||n,c=0;c{"use strict";const r=n(4341);t.exports=(t,e={})=>{if("function"!=typeof t)throw new TypeError(`Expected the first argument to be a function, got \`${typeof t}\``);const{wait:n=0,maxWait:i=0,before:s=!1,after:o=!0}=e;if(!s&&!o)throw new Error("Both `before` and `after` are false, function wouldn't be called.");let a,c,u;const l=function(...e){const r=this,l=s&&!a;return clearTimeout(a),a=setTimeout((()=>{a=void 0,c&&(clearTimeout(c),c=void 0),o&&(u=t.apply(r,e))}),n),i>0&&!c&&o&&(c=setTimeout((()=>{c=void 0,a&&(clearTimeout(a),a=void 0),u=t.apply(r,e)}),i)),l&&(u=t.apply(r,e)),u};return r(l,t),l.cancel=()=>{a&&(clearTimeout(a),a=void 0),c&&(clearTimeout(c),c=void 0)},l}},1227:(t,e,n)=>{e.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;e.splice(1,0,n,"color: inherit");let r=0,i=0;e[0].replace(/%[a-zA-Z%]/g,(t=>{"%%"!==t&&(r++,"%c"===t&&(i=r))})),e.splice(i,0,n)},e.save=function(t){try{t?e.storage.setItem("debug",t):e.storage.removeItem("debug")}catch(t){}},e.load=function(){let t;try{t=e.storage.getItem("debug")}catch(t){}return!t&&"undefined"!=typeof process&&"env"in process&&(t=process.env.DEBUG),t},e.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},e.storage=function(){try{return localStorage}catch(t){}}(),e.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.log=console.debug||console.log||(()=>{}),t.exports=n(2447)(e);const{formatters:r}=t.exports;r.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}},2447:(t,e,n)=>{t.exports=function(t){function e(t){let n,i,s,o=null;function a(...t){if(!a.enabled)return;const r=a,i=Number(new Date),s=i-(n||i);r.diff=s,r.prev=n,r.curr=i,n=i,t[0]=e.coerce(t[0]),"string"!=typeof t[0]&&t.unshift("%O");let o=0;t[0]=t[0].replace(/%([a-zA-Z%])/g,((n,i)=>{if("%%"===n)return"%";o++;const s=e.formatters[i];if("function"==typeof s){const e=t[o];n=s.call(r,e),t.splice(o,1),o--}return n})),e.formatArgs.call(r,t),(r.log||e.log).apply(r,t)}return a.namespace=t,a.useColors=e.useColors(),a.color=e.selectColor(t),a.extend=r,a.destroy=e.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==o?o:(i!==e.namespaces&&(i=e.namespaces,s=e.enabled(t)),s),set:t=>{o=t}}),"function"==typeof e.init&&e.init(a),a}function r(t,n){const r=e(this.namespace+(void 0===n?":":n)+t);return r.log=this.log,r}function i(t){return t.toString().substring(2,t.toString().length-2).replace(/\.\*\?$/,"*")}return e.debug=e,e.default=e,e.coerce=function(t){return t instanceof Error?t.stack||t.message:t},e.disable=function(){const t=[...e.names.map(i),...e.skips.map(i).map((t=>"-"+t))].join(",");return e.enable(""),t},e.enable=function(t){let n;e.save(t),e.namespaces=t,e.names=[],e.skips=[];const r=("string"==typeof t?t:"").split(/[\s,]+/),i=r.length;for(n=0;n{e[n]=t[n]})),e.names=[],e.skips=[],e.formatters={},e.selectColor=function(t){let n=0;for(let e=0;e{"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?t.exports=n(1227):t.exports=n(39)},39:(t,e,n)=>{const r=n(6224),i=n(3837);e.init=function(t){t.inspectOpts={};const n=Object.keys(e.inspectOpts);for(let r=0;r{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),e.colors=[6,2,3,4,5,1];try{const t=n(2130);t&&(t.stderr||t).level>=2&&(e.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(t){}e.inspectOpts=Object.keys(process.env).filter((t=>/^debug_/i.test(t))).reduce(((t,e)=>{const n=e.substring(6).toLowerCase().replace(/_([a-z])/g,((t,e)=>e.toUpperCase()));let r=process.env[e];return r=!!/^(yes|on|true|enabled)$/i.test(r)||!/^(no|off|false|disabled)$/i.test(r)&&("null"===r?null:Number(r)),t[n]=r,t}),{}),t.exports=n(2447)(e);const{formatters:s}=t.exports;s.o=function(t){return this.inspectOpts.colors=this.useColors,i.inspect(t,this.inspectOpts).split("\n").map((t=>t.trim())).join(" ")},s.O=function(t){return this.inspectOpts.colors=this.useColors,i.inspect(t,this.inspectOpts)}},2559:t=>{!function(){"use strict";var e=[,function(t,e){function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n255)throw new Error("Not ascii. Base64.encode can only take ascii strings.");t[n]=i}}for(var o=[],a=null,c=null,u=null,l=null,p=0;p>2&63,c=(3&t[p])<<4;break;case 1:c|=t[p]>>4&15,u=(15&t[p])<<2;break;case 2:u|=t[p]>>6&3,l=63&t[p],o.push(r(a)),o.push(r(c)),o.push(r(u)),o.push(r(l)),a=null,c=null,u=null,l=null}return null!=a&&(o.push(r(a)),o.push(r(c)),null==u?o.push("="):o.push(r(u)),null==l&&o.push("=")),o.join("")},decode:function(t){var e=Math.floor(3*t.length/4);"="==t.charAt(t.length-1)&&(e--,"="==t.charAt(t.length-2)&&e--);for(var r,i=s(e),o=null,a=null,c=null,u=0,l=0;l>4,i[u++]=o,a=(15&p)<<4;break;case 2:p>=0&&(a|=p>>2,i[u++]=a,c=(3&p)<<6);break;case 3:p>=0&&(i[u++]=c|p)}}return i},newBinary:s};e.Base64=o},function(t){t.exports={_noYieldsAllowed:function(t){return t()}}},function(t,e){function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function r(t){return JSON.stringify(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=function t(e,i,s,o,a){var c=i[e];switch(n(c)){case"string":return r(c);case"number":return isFinite(c)?String(c):"null";case"boolean":return String(c);case"object":if(!c)return"null";var u,l=o+s,p=[];if(Array.isArray(c)||{}.hasOwnProperty.call(c,"callee")){for(var d=c.length,h=0;h0&&void 0!==arguments[0]&&arguments[0]?a:(0,s.convertMapToObject)(a)},o._getConverters=function(){return c};var u=function(t){for(var e=0;e=p.length||i!==p[r]||!o.equals(t[i],e[p[r]],n)||(r++,0))}))):(r=0,a=l.every((function(i){return!!(0,s.hasOwn)(e,i)&&!!o.equals(t[i],e[i],n)&&(r++,!0)}))),a&&r===p.length},o.clone=function(t){var e;if(!(0,s.isObject)(t))return t;if(null===t)return null;if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp)return t;if(o.isBinary(t)){e=o.newBinary(t.length);for(var n=0;n{"use strict";var e=Object.prototype.hasOwnProperty,n="~";function r(){}function i(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function s(t,e,r,s,o){if("function"!=typeof r)throw new TypeError("The listener must be a function");var a=new i(r,s||t,o),c=n?n+e:e;return t._events[c]?t._events[c].fn?t._events[c]=[t._events[c],a]:t._events[c].push(a):(t._events[c]=a,t._eventsCount++),t}function o(t,e){0==--t._eventsCount?t._events=new r:delete t._events[e]}function a(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),a.prototype.eventNames=function(){var t,r,i=[];if(0===this._eventsCount)return i;for(r in t=this._events)e.call(t,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},a.prototype.listeners=function(t){var e=n?n+t:t,r=this._events[e];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,s=r.length,o=new Array(s);i{"use strict";t.exports=function t(e,n){if(e===n)return!0;if(e&&n&&"object"==typeof e&&"object"==typeof n){if(e.constructor!==n.constructor)return!1;var r,i,s;if(Array.isArray(e)){if((r=e.length)!=n.length)return!1;for(i=r;0!=i--;)if(!t(e[i],n[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if((r=(s=Object.keys(e)).length)!==Object.keys(n).length)return!1;for(i=r;0!=i--;)if(!Object.prototype.hasOwnProperty.call(n,s[i]))return!1;for(i=r;0!=i--;){var o=s[i];if(!t(e[o],n[o]))return!1}return!0}return e!=e&&n!=n}},2261:(t,e,n)=>{var r;t.exports=function(){if(!r){try{r=n(5158)("follow-redirects")}catch(t){}"function"!=typeof r&&(r=function(){})}r.apply(null,arguments)}},938:(t,e,n)=>{var r=n(7310),i=r.URL,s=n(3685),o=n(5687),a=n(2781).Writable,c=n(9491),u=n(2261),l=["abort","aborted","connect","error","socket","timeout"],p=Object.create(null);l.forEach((function(t){p[t]=function(e,n,r){this._redirectable.emit(t,e,n,r)}}));var d=w("ERR_INVALID_URL","Invalid URL",TypeError),h=w("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),f=w("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded"),_=w("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),m=w("ERR_STREAM_WRITE_AFTER_END","write after end");function g(t,e){a.call(this),this._sanitizeOptions(t),this._options=t,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],e&&this.on("response",e);var n=this;this._onNativeResponse=function(t){n._processResponse(t)},this._performRequest()}function y(t){var e={maxRedirects:21,maxBodyLength:10485760},n={};return Object.keys(t).forEach((function(s){var o=s+":",a=n[o]=t[s],l=e[s]=Object.create(a);Object.defineProperties(l,{request:{value:function(t,s,a){if(S(t)){var l;try{l=v(new i(t))}catch(e){l=r.parse(t)}if(!S(l.protocol))throw new d({input:t});t=l}else i&&t instanceof i?t=v(t):(a=s,s=t,t={protocol:o});return I(s)&&(a=s,s=null),(s=Object.assign({maxRedirects:e.maxRedirects,maxBodyLength:e.maxBodyLength},t,s)).nativeProtocols=n,S(s.host)||S(s.hostname)||(s.hostname="::1"),c.equal(s.protocol,o,"protocol mismatch"),u("options",s),new g(s,a)},configurable:!0,enumerable:!0,writable:!0},get:{value:function(t,e,n){var r=l.request(t,e,n);return r.end(),r},configurable:!0,enumerable:!0,writable:!0}})})),e}function b(){}function v(t){var e={protocol:t.protocol,hostname:t.hostname.startsWith("[")?t.hostname.slice(1,-1):t.hostname,hash:t.hash,search:t.search,pathname:t.pathname,path:t.pathname+t.search,href:t.href};return""!==t.port&&(e.port=Number(t.port)),e}function E(t,e){var n;for(var r in e)t.test(r)&&(n=e[r],delete e[r]);return null==n?void 0:String(n).trim()}function w(t,e,n){function r(n){Error.captureStackTrace(this,this.constructor),Object.assign(this,n||{}),this.code=t,this.message=this.cause?e+": "+this.cause.message:e}return r.prototype=new(n||Error),r.prototype.constructor=r,r.prototype.name="Error ["+t+"]",r}function T(t){for(var e of l)t.removeListener(e,p[e]);t.on("error",b),t.abort()}function S(t){return"string"==typeof t||t instanceof String}function I(t){return"function"==typeof t}g.prototype=Object.create(a.prototype),g.prototype.abort=function(){T(this._currentRequest),this.emit("abort")},g.prototype.write=function(t,e,n){if(this._ending)throw new m;if(!(S(t)||"object"==typeof(r=t)&&"length"in r))throw new TypeError("data should be a string, Buffer or Uint8Array");var r;I(e)&&(n=e,e=null),0!==t.length?this._requestBodyLength+t.length<=this._options.maxBodyLength?(this._requestBodyLength+=t.length,this._requestBodyBuffers.push({data:t,encoding:e}),this._currentRequest.write(t,e,n)):(this.emit("error",new _),this.abort()):n&&n()},g.prototype.end=function(t,e,n){if(I(t)?(n=t,t=e=null):I(e)&&(n=e,e=null),t){var r=this,i=this._currentRequest;this.write(t,e,(function(){r._ended=!0,i.end(null,null,n)})),this._ending=!0}else this._ended=this._ending=!0,this._currentRequest.end(null,null,n)},g.prototype.setHeader=function(t,e){this._options.headers[t]=e,this._currentRequest.setHeader(t,e)},g.prototype.removeHeader=function(t){delete this._options.headers[t],this._currentRequest.removeHeader(t)},g.prototype.setTimeout=function(t,e){var n=this;function r(e){e.setTimeout(t),e.removeListener("timeout",e.destroy),e.addListener("timeout",e.destroy)}function i(e){n._timeout&&clearTimeout(n._timeout),n._timeout=setTimeout((function(){n.emit("timeout"),s()}),t),r(e)}function s(){n._timeout&&(clearTimeout(n._timeout),n._timeout=null),n.removeListener("abort",s),n.removeListener("error",s),n.removeListener("response",s),e&&n.removeListener("timeout",e),n.socket||n._currentRequest.removeListener("socket",i)}return e&&this.on("timeout",e),this.socket?i(this.socket):this._currentRequest.once("socket",i),this.on("socket",r),this.on("abort",s),this.on("error",s),this.on("response",s),this},["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach((function(t){g.prototype[t]=function(e,n){return this._currentRequest[t](e,n)}})),["aborted","connection","socket"].forEach((function(t){Object.defineProperty(g.prototype,t,{get:function(){return this._currentRequest[t]}})})),g.prototype._sanitizeOptions=function(t){if(t.headers||(t.headers={}),t.host&&(t.hostname||(t.hostname=t.host),delete t.host),!t.pathname&&t.path){var e=t.path.indexOf("?");e<0?t.pathname=t.path:(t.pathname=t.path.substring(0,e),t.search=t.path.substring(e))}},g.prototype._performRequest=function(){var t=this._options.protocol,e=this._options.nativeProtocols[t];if(e){if(this._options.agents){var n=t.slice(0,-1);this._options.agent=this._options.agents[n]}var i=this._currentRequest=e.request(this._options,this._onNativeResponse);for(var s of(i._redirectable=this,l))i.on(s,p[s]);if(this._currentUrl=/^\//.test(this._options.path)?r.format(this._options):this._options.path,this._isRedirect){var o=0,a=this,c=this._requestBodyBuffers;!function t(e){if(i===a._currentRequest)if(e)a.emit("error",e);else if(o=400)return t.responseUrl=this._currentUrl,t.redirects=this._redirects,this.emit("response",t),void(this._requestBodyBuffers=[]);if(T(this._currentRequest),t.destroy(),++this._redirectCount>this._options.maxRedirects)this.emit("error",new f);else{var i,s=this._options.beforeRedirect;s&&(i=Object.assign({Host:t.req.getHeader("host")},this._options.headers));var o=this._options.method;((301===e||302===e)&&"POST"===this._options.method||303===e&&!/^(?:GET|HEAD)$/.test(this._options.method))&&(this._options.method="GET",this._requestBodyBuffers=[],E(/^content-/i,this._options.headers));var a,l=E(/^host$/i,this._options.headers),p=r.parse(this._currentUrl),d=l||p.host,_=/^\w+:/.test(n)?this._currentUrl:r.format(Object.assign(p,{host:d}));try{a=r.resolve(_,n)}catch(t){return void this.emit("error",new h({cause:t}))}u("redirecting to",a),this._isRedirect=!0;var m=r.parse(a);if(Object.assign(this._options,m),(m.protocol!==p.protocol&&"https:"!==m.protocol||m.host!==d&&!function(t,e){c(S(t)&&S(e));var n=t.length-e.length-1;return n>0&&"."===t[n]&&t.endsWith(e)}(m.host,d))&&E(/^(?:authorization|cookie)$/i,this._options.headers),I(s)){var g={headers:t.headers,statusCode:e},y={url:_,method:o,headers:i};try{s(this._options,g,y)}catch(t){return void this.emit("error",t)}this._sanitizeOptions(this._options)}try{this._performRequest()}catch(t){this.emit("error",new h({cause:t}))}}},t.exports=y({http:s,https:o}),t.exports.wrap=y},6560:t=>{"use strict";t.exports=(t,e=process.argv)=>{const n=t.startsWith("-")?"":1===t.length?"-":"--",r=e.indexOf(n+t),i=e.indexOf("--");return-1!==r&&(-1===i||r{d("replaying proxy buffer for failed request"),c.default(t.listenerCount("data")>0),t.push(y),t.push(null)})),b}))}}function f(t){t.resume()}e.default=h},6018:function(t,e,n){"use strict";const r=(this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}})(n(9146));function i(t){return new r.default(t)}!function(t){t.HttpsProxyAgent=r.default,t.prototype=r.default.prototype}(i||(i={})),t.exports=i},9829:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const i=r(n(5158)).default("https-proxy-agent:parse-proxy-response");e.default=function(t){return new Promise(((e,n)=>{let r=0;const s=[];function o(){const n=t.read();n?function(t){s.push(t),r+=t.length;const n=Buffer.concat(s,r);if(-1===n.indexOf("\r\n\r\n"))return i("have not received end of HTTP headers yet..."),void o();const a=n.toString("ascii",0,n.indexOf("\r\n")),c=+a.split(" ")[1];i("got proxy server response: %o",a),e({statusCode:c,buffered:n})}(n):t.once("readable",o)}function a(t){i("onclose had error %o",t)}function c(){i("onend")}t.on("error",(function e(r){t.removeListener("end",c),t.removeListener("error",e),t.removeListener("close",a),t.removeListener("readable",o),i("onerror %o",r),n(r)})),t.on("close",a),t.on("end",c),o()}))}},7612:function(t,e,n){var r,i;!function(s,o){const a=e;!function(t){const e=Symbol("newer"),n=Symbol("older");function r(t,e){"number"!=typeof t&&(e=t,t=0),this.size=0,this.limit=t,this.oldest=this.newest=void 0,this._keymap=new Map,e&&(this.assign(e),t<1&&(this.limit=this.size))}function i(t,r){this.key=t,this.value=r,this[e]=void 0,this[n]=void 0}function s(t){this.entry=t}function o(t){this.entry=t}function a(t){this.entry=t}t.LRUMap=r,r.prototype._markEntryAsUsed=function(t){t!==this.newest&&(t[e]&&(t===this.oldest&&(this.oldest=t[e]),t[e][n]=t[n]),t[n]&&(t[n][e]=t[e]),t[e]=void 0,t[n]=this.newest,this.newest&&(this.newest[e]=t),this.newest=t)},r.prototype.assign=function(t){let r,s=this.limit||Number.MAX_VALUE;this._keymap.clear();let o=t[Symbol.iterator]();for(let t=o.next();!t.done;t=o.next()){let o=new i(t.value[0],t.value[1]);if(this._keymap.set(o.key,o),r?(r[e]=o,o[n]=r):this.oldest=o,r=o,0==s--)throw new Error("overflow")}this.newest=r,this.size=this._keymap.size},r.prototype.get=function(t){var e=this._keymap.get(t);if(e)return this._markEntryAsUsed(e),e.value},r.prototype.set=function(t,r){var s=this._keymap.get(t);return s?(s.value=r,this._markEntryAsUsed(s),this):(this._keymap.set(t,s=new i(t,r)),this.newest?(this.newest[e]=s,s[n]=this.newest):this.oldest=s,this.newest=s,++this.size,this.size>this.limit&&this.shift(),this)},r.prototype.shift=function(){var t=this.oldest;if(t)return this.oldest[e]?(this.oldest=this.oldest[e],this.oldest[n]=void 0):(this.oldest=void 0,this.newest=void 0),t[e]=t[n]=void 0,this._keymap.delete(t.key),--this.size,[t.key,t.value]},r.prototype.find=function(t){let e=this._keymap.get(t);return e?e.value:void 0},r.prototype.has=function(t){return this._keymap.has(t)},r.prototype.delete=function(t){var r=this._keymap.get(t);if(r)return this._keymap.delete(r.key),r[e]&&r[n]?(r[n][e]=r[e],r[e][n]=r[n]):r[e]?(r[e][n]=void 0,this.oldest=r[e]):r[n]?(r[n][e]=void 0,this.newest=r[n]):this.oldest=this.newest=void 0,this.size--,r.value},r.prototype.clear=function(){this.oldest=this.newest=void 0,this.size=0,this._keymap.clear()},s.prototype[Symbol.iterator]=function(){return this},s.prototype.next=function(){let t=this.entry;return t?(this.entry=t[e],{done:!1,value:[t.key,t.value]}):{done:!0,value:void 0}},o.prototype[Symbol.iterator]=function(){return this},o.prototype.next=function(){let t=this.entry;return t?(this.entry=t[e],{done:!1,value:t.key}):{done:!0,value:void 0}},a.prototype[Symbol.iterator]=function(){return this},a.prototype.next=function(){let t=this.entry;return t?(this.entry=t[e],{done:!1,value:t.value}):{done:!0,value:void 0}},r.prototype.keys=function(){return new o(this.oldest)},r.prototype.values=function(){return new a(this.oldest)},r.prototype.entries=function(){return this},r.prototype[Symbol.iterator]=function(){return new s(this.oldest)},r.prototype.forEach=function(t,n){"object"!=typeof n&&(n=this);let r=this.oldest;for(;r;)t.call(n,r.value,r.key,this),r=r[e]},r.prototype.toJSON=function(){for(var t=new Array(this.size),n=0,r=this.oldest;r;)t[n++]={key:r.key,value:r.value},r=r[e];return t},r.prototype.toString=function(){for(var t="",n=this.oldest;n;)t+=String(n.key)+":"+n.value,(n=n[e])&&(t+=" < ");return t}}(a),void 0===(i="function"==typeof(r=a)?r.call(e,n,e,t):r)||(t.exports=i)}()},4341:t=>{"use strict";const e=(t,e,r,i)=>{if("length"===r||"prototype"===r)return;if("arguments"===r||"caller"===r)return;const s=Object.getOwnPropertyDescriptor(t,r),o=Object.getOwnPropertyDescriptor(e,r);!n(s,o)&&i||Object.defineProperty(t,r,o)},n=function(t,e){return void 0===t||t.configurable||t.writable===e.writable&&t.enumerable===e.enumerable&&t.configurable===e.configurable&&(t.writable||t.value===e.value)},r=(t,e)=>`/* Wrapped ${t}*/\n${e}`,i=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),s=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name");t.exports=(t,n,{ignoreNonConfigurable:o=!1}={})=>{const{name:a}=t;for(const r of Reflect.ownKeys(n))e(t,n,r,o);return((t,e)=>{const n=Object.getPrototypeOf(e);n!==Object.getPrototypeOf(t)&&Object.setPrototypeOf(t,n)})(t,n),((t,e,n)=>{const o=""===n?"":`with ${n.trim()}() `,a=r.bind(null,o,e.toString());Object.defineProperty(a,"name",s),Object.defineProperty(t,"toString",{...i,value:a})})(t,n,a),t}},7824:t=>{var e=1e3,n=60*e,r=60*n,i=24*r;function s(t,e,n,r){var i=e>=1.5*n;return Math.round(t/n)+" "+r+(i?"s":"")}t.exports=function(t,o){o=o||{};var a,c,u=typeof t;if("string"===u&&t.length>0)return function(t){if(!((t=String(t)).length>100)){var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(s){var o=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*o;case"weeks":case"week":case"w":return 6048e5*o;case"days":case"day":case"d":return o*i;case"hours":case"hour":case"hrs":case"hr":case"h":return o*r;case"minutes":case"minute":case"mins":case"min":case"m":return o*n;case"seconds":case"second":case"secs":case"sec":case"s":return o*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return o;default:return}}}}(t);if("number"===u&&isFinite(t))return o.long?(a=t,(c=Math.abs(a))>=i?s(a,c,i,"day"):c>=r?s(a,c,r,"hour"):c>=n?s(a,c,n,"minute"):c>=e?s(a,c,e,"second"):a+" ms"):function(t){var s=Math.abs(t);return s>=i?Math.round(t/i)+"d":s>=r?Math.round(t/r)+"h":s>=n?Math.round(t/n)+"m":s>=e?Math.round(t/e)+"s":t+"ms"}(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},9646:(t,e,n)=>{var r=n(938).http,i=n(938).https,s=n(7310),o=n(3837),a=n(2361),c=n(9796),u=n(5158)("NRC");e.K=function(t){var e=this,r=n(8180)(),i=n(6310)(),c=new l(this,r),u=function(t,n){var r=function(t){return function(){try{return t.apply(this,arguments)}catch(t){e.emit("error",t)}}},i={parsers:{},serializers:{}};return i.parsers.add=r(t.add),i.parsers.remove=r(t.remove),i.parsers.find=r(t.find),i.parsers.getAll=r(t.getAll),i.parsers.getDefault=r(t.getDefault),i.parsers.clean=r(t.clean),i.serializers.add=r(n.add),i.serializers.remove=r(n.remove),i.serializers.find=r(n.find),i.serializers.getAll=r(n.getAll),i.serializers.getDefault=r(n.getDefault),i.serializers.clean=r(n.clean),i}(r,i),d="Content-Length";e.options=t||{},e.useProxy=!!e.options.proxy,e.useProxyTunnel=!(!e.useProxy||void 0===e.options.proxy.tunnel)&&e.options.proxy.tunnel,e.proxy=e.options.proxy,e.connection=e.options.connection||{},e.mimetypes=e.options.mimetypes||{},e.requestConfig=e.options.requestConfig||{},e.responseConfig=e.options.responseConfig||{},this.methods={},this.parsers={},this.serializers={};var h=function(){a.EventEmitter.call(this)};o.inherits(h,a.EventEmitter),h.prototype.end=function(){this._httpRequest&&this._httpRequest.end()},h.prototype.setHttpRequest=function(t){this._httpRequest=t};var f={createProxyPath:function(t){var e=t.host;return"https:"===t.protocol&&(e=-1==t.host.indexOf(":")?t.hostname+":443":t.host),e},createProxyHeaders:function(t){var n={};return e.proxy.user&&e.proxy.password&&(n["Proxy-Authorization"]="Basic "+new Buffer([e.proxy.user,e.proxy.password].join(":")).toString("base64")),e.useProxyTunnel||(n.host=t.host),n},createConnectOptions:function(t,n){p("connect URL = ",t);var r=s.parse(t),i={},o=-1==r.protocol.indexOf(":")?r.protocol:r.protocol.substring(0,r.protocol.indexOf(":")),a="http"===o?80:443;if(i={host:-1==r.host.indexOf(":")?r.host:r.host.substring(0,r.host.indexOf(":")),port:void 0===r.port?a:r.port,path:r.path,protocol:o,href:r.href},e.useProxy&&(i.agent=!1),e.options.user&&e.options.password?i.auth=[e.options.user,e.options.password].join(":"):e.options.user&&!e.options.password&&(i.auth=e.options.user+":"),e.useProxy&&(i.proxy={host:e.proxy.host,port:e.proxy.port,method:e.useProxyTunnel?"CONNECT":n,path:e.useProxyTunnel?this.createProxyPath(r):t,headers:this.createProxyHeaders(r)}),e.connection&&"object"==typeof e.connection)for(var c in e.connection)i[c]=e.connection[c];if(!e.useProxyTunnel){for(var u in i.proxy)i[u]=i.proxy[u];delete i.proxy}return i.requestConfig=e.requestConfig,i.responseConfig=e.responseConfig,i},decodeQueryFromURL:function(t){for(var e,n=s.parse(t).query.substring(1).split("&"),r={},i=0;i0){var h=u.path.length,_=u.path.indexOf("?");_>=0&&_!==h-1&&e.emit("error","parameters argument cannot be used if parameters are already defined in URL "+u.path),u.path+="?"===u.path.charAt(h-1)?"":"?",u.path=u.path.concat(f.serializeEncodeQueryFromArgs(r.parameters)),p("options.path after request parameters = ",u.path)}this.overrideClientConfig(u,r),void 0===r.data||u.headers.hasOwnProperty(d)?u.headers[d]=0:i.get(u).serialize(r.data,(a=e,function(t,e){a.emit(t,e)}),(function(t){u.data=t,u.headers[d]=Buffer.byteLength(u.data,"utf8")}))}p("options post connect",u),p("FINAL SELF object ====>",e),e.useProxy&&e.useProxyTunnel?c.proxy(u,s):c.normal(u,s)},mergeMimeTypes:function(t){if(t&&"object"==typeof t)try{t.json&&t.json instanceof Array&&t.json.length>0?r.find("JSON").contentTypes=t.json:t.xml&&t.xml instanceof Array&&t.xml.length>0&&(r.find("XML").contentTypes=t.xml)}catch(t){e.emit("error","cannot assign custom content types to parser, cause: "+t)}},createHttpMethod:function(t){return function(e,n,r){var i=new h;return f.connect(t.toUpperCase(),e,n,r,i),i}}},_=function(t,n){var r=e[n.toLowerCase()];return function(e,n){return"function"==typeof e&&(n=e,e={}),r(t,e,n)}};this.get=f.createHttpMethod("get"),this.post=f.createHttpMethod("post"),this.put=f.createHttpMethod("put"),this.delete=f.createHttpMethod("delete"),this.patch=f.createHttpMethod("patch"),this.registerMethod=function(t,e,n){this.methods[t]=new _(e,n)},this.unregisterMethod=function(t){delete this.methods[t]},this.addCustomHttpMethod=function(t){e[t.toLowerCase()]=f.createHttpMethod(t)},this.parsers=u.parsers,this.serializers=u.serializers,f.mergeMimeTypes(e.mimetypes),p("ConnectManager",c)};var l=function(t,e){this.configureRequest=function(t,e,n){e.timeout&&t.setTimeout(e.timeout,(function(){n.emit("requestTimeout",t)})),e.noDelay&&t.setNoDelay(e.noDelay),e.keepAlive&&t.setSocketKeepAlive(e.noDelay,e.keepAliveDelay||0)},this.configureResponse=function(t,e,n){e.timeout&&t.setTimeout(e.timeout,(function(){n.emit("responseTimeout",t),t.close()}))},this.configureOptions=function(t){!function(e,n){for(var r in e)n.hasOwnProperty(e[r])&&(t[e[r]]=n[e[r]])}(["followRedirects","maxRedirects"],t.requestConfig),delete t.protocol,delete t.clientRequest,delete t.requestConfig,delete t.responseConfig,p("options pre connect",t)},this.handleEnd=function(t,e,n){var r=this,i=t.headers["content-type"],s=t.headers["content-encoding"];p("content-type: ",i),p("content-encoding: ",s),void 0!==s&&s.indexOf("gzip")>=0?(p("gunzip"),c.gunzip(Buffer.concat(e),(function(e,i){r.handleResponse(t,i,n)}))):void 0!==s&&s.indexOf("deflate")>=0?(p("inflate"),c.inflate(Buffer.concat(e),(function(e,i){r.handleResponse(t,i,n)}))):(p("not compressed"),r.handleResponse(t,Buffer.concat(e),n))},this.handleResponse=function(n,r,i){e.get(n).parse(r,function(t){return function(e,n){t.emit(e,n)}}(t),(function(t){i(t,n)}))},this.prepareData=function(t){return t instanceof Buffer||"object"!=typeof t?t:JSON.stringify(t)},this.proxy=function(e,n){p("proxy options",e.proxy);var s=r.request(e.proxy),o=this;s.on("connect",(function(s,a,c){p("proxy connected",a),e.socket=a;var u=[],l="http"==e.protocol?r:i,d=e.clientRequest,h=e.requestConfig,f=e.responseConfig;o.configureOptions(e),d.options=e;var _=l.request(e,(function(e){o.configureResponse(e,f,d),e.on("data",(function(t){u.push(Buffer.from(t))})),e.on("end",(function(){o.handleEnd(e,u,n)})),e.on("error",(function(n){void 0!==d&&"object"==typeof d?(n.request=d,n.response=e,d.emit("error",n)):t.emit("error",n)}))}));o.configureRequest(_,h,d),d.setHttpRequest(_),e.data&&_.write(e.data),_.end(),_.on("error",(function(e){void 0!==d&&"object"==typeof d?(e.request=d,d.emit("error",e)):t.emit("error",e)}))})),s.on("error",(function(e){t.emit("error",e)})),s.end()},this.normal=function(e,n){var s=[],o="http"===e.protocol?r:i,a=e.clientRequest,c=e.requestConfig,u=e.responseConfig,l=this;l.configureOptions(e),a.options=e;var d=o.request(e,(function(e){l.configureResponse(e,u,a),e.on("data",(function(t){s.push(Buffer.from(t))})),e.on("end",(function(){l.handleEnd(e,s,n)})),e.on("error",(function(n){void 0!==a&&"object"==typeof a?(n.request=a,n.response=e,a.emit("error",n)):t.emit("error",n)}))}));l.configureRequest(d,c,a),p("clientRequest",a),a.setHttpRequest(d),p("options data",e.data),e.data&&d.write(e.data),d.end(),d.on("error",(function(e){void 0!==a&&"object"==typeof a?(e.request=a,a.emit("error",e)):t.emit("error",e)}))}};o.inherits(e.K,a.EventEmitter);var p=function(){if(process.env.DEBUG){var t=new Date,e=t.getHours()+":"+t.getMinutes()+":"+t.getSeconds()+" [NRC CLIENT]"+arguments.callee.caller.name+" -> ",n=Array.prototype.slice.call(arguments);n.splice(0,0,e),u.apply(console,n)}}},8180:(t,e,n)=>{var r=function(){var t={},e=null;this.add=function(n){if(!function(t){function e(t,e){var n=!0;for(var r in e){var i=e[r].split(":");if(!t.hasOwnProperty([i[0]])||typeof t[i[0]]!==i[1]){n=!1;break}}return n}return result=e(t,["name:string","parse:function","isDefault:boolean"]),result&&!t.isDefault&&(result=e(t,["match:function"])),result}(n))throw"parser cannot be added: invalid parser definition";n.isDefault?e=n:t[n.name]=n},this.remove=function(e){if(!t[e])throw"cannot remove parser: "+e+" doesn't exists";delete t[e]},this.clean=function(){t={}},this.find=function(e){var n=t[e];if(!n)throw"cannot find parser: "+e+" doesn't exists ";return n},this.getDefault=function(){return e},this.get=function(n){var r=null;for(var i in t)if(t[i].match(n)){r=t[i];break}return null===r?e:r},this.getAll=function(){var e=[];for(var n in t)e.push(t[n]);return e}};t.exports=function(){var t=new r,e={isDefault:!1,match:function(t){var e=!1,n=t.headers["content-type"]&&t.headers["content-type"].replace(/ /g,"");if(!n)return e;for(var r=0;r0},parse:function(t,e,n){var r,i=t.toString();try{r=this.isValidData(i)?JSON.parse(i):i}catch(t){e("error","Error parsing response. response: ["+i+"], error: ["+t+"]")}n(r)}},e)),t.add({name:"DEFAULT",isDefault:!0,parse:function(t,e,n){n(t)}}),t}},6310:(t,e,n)=>{var r=n(5055),i=function(){var t={},e=null;this.add=function(n){if(!function(t){function e(t,e){var n=!0;for(var r in e){var i=e[r].split(":");if(!t.hasOwnProperty([i[0]])||typeof t[i[0]]!==i[1]){n=!1;break}}return n}return result=e(t,["name:string","serialize:function","isDefault:boolean"]),result&&!t.isDefault&&(result=e(t,["match:function"])),result}(n))throw"serializer cannot be added: invalid serializer definition";n.isDefault?e=n:t[n.name]=n},this.remove=function(e){if(!t[e])throw"cannot remove serializer: "+e+" doesn't exists";delete t[e]},this.find=function(e){var n=t[e];if(!n)throw"cannot find serializer: "+e+" doesn't exists";return n},this.clean=function(){t={}},this.get=function(n){var r=null;for(var i in t)if(t[i].match(n)){r=t[i];break}return null===r?e:r},this.getAll=function(){var e=[];for(var n in t)e.push(t[n]);return e},this.getDefault=function(){return e}};t.exports=function(){var t=new i,e={isDefault:!1,match:function(t){var e=!1,n=t.headers["Content-Type"]&&t.headers["Content-Type"].replace(/ /g,"");if(!n)return e;for(var r=0;r{"use strict";t.exports=(t,e)=>(e=e||(()=>{}),t.then((t=>new Promise((t=>{t(e())})).then((()=>t))),(t=>new Promise((t=>{t(e())})).then((()=>{throw t})))))},5860:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(6729),i=n(6512),s=n(6506),o=()=>{},a=new i.TimeoutError;e.default=class extends r{constructor(t){var e,n,r,i;if(super(),this._intervalCount=0,this._intervalEnd=0,this._pendingCount=0,this._resolveEmpty=o,this._resolveIdle=o,!("number"==typeof(t=Object.assign({carryoverConcurrencyCount:!1,intervalCap:1/0,interval:0,concurrency:1/0,autoStart:!0,queueClass:s.default},t)).intervalCap&&t.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${null!==(n=null===(e=t.intervalCap)||void 0===e?void 0:e.toString())&&void 0!==n?n:""}\` (${typeof t.intervalCap})`);if(void 0===t.interval||!(Number.isFinite(t.interval)&&t.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${null!==(i=null===(r=t.interval)||void 0===r?void 0:r.toString())&&void 0!==i?i:""}\` (${typeof t.interval})`);this._carryoverConcurrencyCount=t.carryoverConcurrencyCount,this._isIntervalIgnored=t.intervalCap===1/0||0===t.interval,this._intervalCap=t.intervalCap,this._interval=t.interval,this._queue=new t.queueClass,this._queueClass=t.queueClass,this.concurrency=t.concurrency,this._timeout=t.timeout,this._throwOnTimeout=!0===t.throwOnTimeout,this._isPaused=!1===t.autoStart}get _doesIntervalAllowAnother(){return this._isIntervalIgnored||this._intervalCount{this._onResumeInterval()}),e)),!0;this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0}return!1}_tryToStartAnother(){if(0===this._queue.size)return this._intervalId&&clearInterval(this._intervalId),this._intervalId=void 0,this._resolvePromises(),!1;if(!this._isPaused){const t=!this._isIntervalPaused();if(this._doesIntervalAllowAnother&&this._doesConcurrentAllowAnother){const e=this._queue.dequeue();return!!e&&(this.emit("active"),e(),t&&this._initializeIntervalIfNeeded(),!0)}}return!1}_initializeIntervalIfNeeded(){this._isIntervalIgnored||void 0!==this._intervalId||(this._intervalId=setInterval((()=>{this._onInterval()}),this._interval),this._intervalEnd=Date.now()+this._interval)}_onInterval(){0===this._intervalCount&&0===this._pendingCount&&this._intervalId&&(clearInterval(this._intervalId),this._intervalId=void 0),this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0,this._processQueue()}_processQueue(){for(;this._tryToStartAnother(););}get concurrency(){return this._concurrency}set concurrency(t){if(!("number"==typeof t&&t>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${t}\` (${typeof t})`);this._concurrency=t,this._processQueue()}async add(t,e={}){return new Promise(((n,r)=>{this._queue.enqueue((async()=>{this._pendingCount++,this._intervalCount++;try{const s=void 0===this._timeout&&void 0===e.timeout?t():i.default(Promise.resolve(t()),void 0===e.timeout?this._timeout:e.timeout,(()=>{(void 0===e.throwOnTimeout?this._throwOnTimeout:e.throwOnTimeout)&&r(a)}));n(await s)}catch(t){r(t)}this._next()}),e),this._tryToStartAnother(),this.emit("add")}))}async addAll(t,e){return Promise.all(t.map((async t=>this.add(t,e))))}start(){return this._isPaused?(this._isPaused=!1,this._processQueue(),this):this}pause(){this._isPaused=!0}clear(){this._queue=new this._queueClass}async onEmpty(){if(0!==this._queue.size)return new Promise((t=>{const e=this._resolveEmpty;this._resolveEmpty=()=>{e(),t()}}))}async onIdle(){if(0!==this._pendingCount||0!==this._queue.size)return new Promise((t=>{const e=this._resolveIdle;this._resolveIdle=()=>{e(),t()}}))}get size(){return this._queue.size}sizeBy(t){return this._queue.filter(t).length}get pending(){return this._pendingCount}get isPaused(){return this._isPaused}get timeout(){return this._timeout}set timeout(t){this._timeout=t}}},7489:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e,n){let r=0,i=t.length;for(;i>0;){const s=i/2|0;let o=r+s;n(t[o],e)<=0?(r=++o,i-=s+1):i=s}return r}},6506:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(7489);e.default=class{constructor(){this._queue=[]}enqueue(t,e){const n={priority:(e=Object.assign({priority:0},e)).priority,run:t};if(this.size&&this._queue[this.size-1].priority>=e.priority)return void this._queue.push(n);const i=r.default(this._queue,n,((t,e)=>e.priority-t.priority));this._queue.splice(i,0,n)}dequeue(){const t=this._queue.shift();return null==t?void 0:t.run}filter(t){return this._queue.filter((e=>e.priority===t.priority)).map((t=>t.run))}get size(){return this._queue.length}}},6512:(t,e,n)=>{"use strict";const r=n(7345);class i extends Error{constructor(t){super(t),this.name="TimeoutError"}}const s=(t,e,n)=>new Promise(((s,o)=>{if("number"!=typeof e||e<0)throw new TypeError("Expected `milliseconds` to be a positive number");if(e===1/0)return void s(t);const a=setTimeout((()=>{if("function"==typeof n){try{s(n())}catch(t){o(t)}return}const r=n instanceof Error?n:new i("string"==typeof n?n:`Promise timed out after ${e} milliseconds`);"function"==typeof t.cancel&&t.cancel(),o(r)}),e);r(t.then(s,o),(()=>{clearTimeout(a)}))}));t.exports=s,t.exports.default=s,t.exports.TimeoutError=i},6099:(t,e,n)=>{!function(t){t.parser=function(t,e){return new i(t,e)},t.SAXParser=i,t.SAXStream=o,t.createStream=function(t,e){return new o(t,e)},t.MAX_BUFFER_LENGTH=65536;var e,r=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];function i(e,n){if(!(this instanceof i))return new i(e,n);var s=this;!function(t){for(var e=0,n=r.length;e"===s?(O(n,"onsgmldeclaration",n.sgmlDecl),n.sgmlDecl="",n.state=S.TEXT):g(s)?(n.state=S.SGML_DECL_QUOTED,n.sgmlDecl+=s):n.sgmlDecl+=s;continue;case S.SGML_DECL_QUOTED:s===n.q&&(n.state=S.SGML_DECL,n.q=""),n.sgmlDecl+=s;continue;case S.DOCTYPE:">"===s?(n.state=S.TEXT,O(n,"ondoctype",n.doctype),n.doctype=!0):(n.doctype+=s,"["===s?n.state=S.DOCTYPE_DTD:g(s)&&(n.state=S.DOCTYPE_QUOTED,n.q=s));continue;case S.DOCTYPE_QUOTED:n.doctype+=s,s===n.q&&(n.q="",n.state=S.DOCTYPE);continue;case S.DOCTYPE_DTD:n.doctype+=s,"]"===s?n.state=S.DOCTYPE:g(s)&&(n.state=S.DOCTYPE_DTD_QUOTED,n.q=s);continue;case S.DOCTYPE_DTD_QUOTED:n.doctype+=s,s===n.q&&(n.state=S.DOCTYPE_DTD,n.q="");continue;case S.COMMENT:"-"===s?n.state=S.COMMENT_ENDING:n.comment+=s;continue;case S.COMMENT_ENDING:"-"===s?(n.state=S.COMMENT_ENDED,n.comment=N(n.opt,n.comment),n.comment&&O(n,"oncomment",n.comment),n.comment=""):(n.comment+="-"+s,n.state=S.COMMENT);continue;case S.COMMENT_ENDED:">"!==s?(A(n,"Malformed comment"),n.comment+="--"+s,n.state=S.COMMENT):n.state=S.TEXT;continue;case S.CDATA:"]"===s?n.state=S.CDATA_ENDING:n.cdata+=s;continue;case S.CDATA_ENDING:"]"===s?n.state=S.CDATA_ENDING_2:(n.cdata+="]"+s,n.state=S.CDATA);continue;case S.CDATA_ENDING_2:">"===s?(n.cdata&&O(n,"oncdata",n.cdata),O(n,"onclosecdata"),n.cdata="",n.state=S.TEXT):"]"===s?n.cdata+="]":(n.cdata+="]]"+s,n.state=S.CDATA);continue;case S.PROC_INST:"?"===s?n.state=S.PROC_INST_ENDING:m(s)?n.state=S.PROC_INST_BODY:n.procInstName+=s;continue;case S.PROC_INST_BODY:if(!n.procInstBody&&m(s))continue;"?"===s?n.state=S.PROC_INST_ENDING:n.procInstBody+=s;continue;case S.PROC_INST_ENDING:">"===s?(O(n,"onprocessinginstruction",{name:n.procInstName,body:n.procInstBody}),n.procInstName=n.procInstBody="",n.state=S.TEXT):(n.procInstBody+="?"+s,n.state=S.PROC_INST_BODY);continue;case S.OPEN_TAG:b(h,s)?n.tagName+=s:(R(n),">"===s?j(n):"/"===s?n.state=S.OPEN_TAG_SLASH:(m(s)||A(n,"Invalid character in tag name"),n.state=S.ATTRIB));continue;case S.OPEN_TAG_SLASH:">"===s?(j(n,!0),M(n)):(A(n,"Forward-slash in opening tag not followed by >"),n.state=S.ATTRIB);continue;case S.ATTRIB:if(m(s))continue;">"===s?j(n):"/"===s?n.state=S.OPEN_TAG_SLASH:b(d,s)?(n.attribName=s,n.attribValue="",n.state=S.ATTRIB_NAME):A(n,"Invalid attribute name");continue;case S.ATTRIB_NAME:"="===s?n.state=S.ATTRIB_VALUE:">"===s?(A(n,"Attribute without value"),n.attribValue=n.attribName,U(n),j(n)):m(s)?n.state=S.ATTRIB_NAME_SAW_WHITE:b(h,s)?n.attribName+=s:A(n,"Invalid attribute name");continue;case S.ATTRIB_NAME_SAW_WHITE:if("="===s)n.state=S.ATTRIB_VALUE;else{if(m(s))continue;A(n,"Attribute without value"),n.tag.attributes[n.attribName]="",n.attribValue="",O(n,"onattribute",{name:n.attribName,value:""}),n.attribName="",">"===s?j(n):b(d,s)?(n.attribName=s,n.state=S.ATTRIB_NAME):(A(n,"Invalid attribute name"),n.state=S.ATTRIB)}continue;case S.ATTRIB_VALUE:if(m(s))continue;g(s)?(n.q=s,n.state=S.ATTRIB_VALUE_QUOTED):(A(n,"Unquoted attribute value"),n.state=S.ATTRIB_VALUE_UNQUOTED,n.attribValue=s);continue;case S.ATTRIB_VALUE_QUOTED:if(s!==n.q){"&"===s?n.state=S.ATTRIB_VALUE_ENTITY_Q:n.attribValue+=s;continue}U(n),n.q="",n.state=S.ATTRIB_VALUE_CLOSED;continue;case S.ATTRIB_VALUE_CLOSED:m(s)?n.state=S.ATTRIB:">"===s?j(n):"/"===s?n.state=S.OPEN_TAG_SLASH:b(d,s)?(A(n,"No whitespace between attributes"),n.attribName=s,n.attribValue="",n.state=S.ATTRIB_NAME):A(n,"Invalid attribute name");continue;case S.ATTRIB_VALUE_UNQUOTED:if(!y(s)){"&"===s?n.state=S.ATTRIB_VALUE_ENTITY_U:n.attribValue+=s;continue}U(n),">"===s?j(n):n.state=S.ATTRIB;continue;case S.CLOSE_TAG:if(n.tagName)">"===s?M(n):b(h,s)?n.tagName+=s:n.script?(n.script+=""===s?M(n):A(n,"Invalid characters in closing tag");continue;case S.TEXT_ENTITY:case S.ATTRIB_VALUE_ENTITY_Q:case S.ATTRIB_VALUE_ENTITY_U:var l,p;switch(n.state){case S.TEXT_ENTITY:l=S.TEXT,p="textNode";break;case S.ATTRIB_VALUE_ENTITY_Q:l=S.ATTRIB_VALUE_QUOTED,p="attribValue";break;case S.ATTRIB_VALUE_ENTITY_U:l=S.ATTRIB_VALUE_UNQUOTED,p="attribValue"}";"===s?(n[p]+=F(n),n.entity="",n.state=l):b(n.entity.length?_:f,s)?n.entity+=s:(A(n,"Invalid character in entity name"),n[p]+="&"+n.entity+s,n.entity="",n.state=l);continue;default:throw new Error(n,"Unknown state: "+n.state)}return n.position>=n.bufferCheckPosition&&function(e){for(var n=Math.max(t.MAX_BUFFER_LENGTH,10),i=0,s=0,o=r.length;sn)switch(r[s]){case"textNode":D(e);break;case"cdata":O(e,"oncdata",e.cdata),e.cdata="";break;case"script":O(e,"onscript",e.script),e.script="";break;default:C(e,"Max buffer length exceeded: "+r[s])}i=Math.max(i,a)}var c=t.MAX_BUFFER_LENGTH-i;e.bufferCheckPosition=c+e.position}(n),n},resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){var t;D(t=this),""!==t.cdata&&(O(t,"oncdata",t.cdata),t.cdata=""),""!==t.script&&(O(t,"onscript",t.script),t.script="")}};try{e=n(2781).Stream}catch(t){e=function(){}}var s=t.EVENTS.filter((function(t){return"error"!==t&&"end"!==t}));function o(t,n){if(!(this instanceof o))return new o(t,n);e.apply(this),this._parser=new i(t,n),this.writable=!0,this.readable=!0;var r=this;this._parser.onend=function(){r.emit("end")},this._parser.onerror=function(t){r.emit("error",t),r._parser.error=null},this._decoder=null,s.forEach((function(t){Object.defineProperty(r,"on"+t,{get:function(){return r._parser["on"+t]},set:function(e){if(!e)return r.removeAllListeners(t),r._parser["on"+t]=e,e;r.on(t,e)},enumerable:!0,configurable:!1})}))}o.prototype=Object.create(e.prototype,{constructor:{value:o}}),o.prototype.write=function(t){if("function"==typeof Buffer&&"function"==typeof Buffer.isBuffer&&Buffer.isBuffer(t)){if(!this._decoder){var e=n(1576).StringDecoder;this._decoder=new e("utf8")}t=this._decoder.write(t)}return this._parser.write(t.toString()),this.emit("data",t),!0},o.prototype.end=function(t){return t&&t.length&&this.write(t),this._parser.end(),!0},o.prototype.on=function(t,n){var r=this;return r._parser["on"+t]||-1===s.indexOf(t)||(r._parser["on"+t]=function(){var e=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);e.splice(0,0,t),r.emit.apply(r,e)}),e.prototype.on.call(r,t,n)};var a="[CDATA[",c="DOCTYPE",u="http://www.w3.org/XML/1998/namespace",l="http://www.w3.org/2000/xmlns/",p={xml:u,xmlns:l},d=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,h=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,f=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,_=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function m(t){return" "===t||"\n"===t||"\r"===t||"\t"===t}function g(t){return'"'===t||"'"===t}function y(t){return">"===t||m(t)}function b(t,e){return t.test(e)}function v(t,e){return!b(t,e)}var E,w,T,S=0;for(var I in t.STATE={BEGIN:S++,BEGIN_WHITESPACE:S++,TEXT:S++,TEXT_ENTITY:S++,OPEN_WAKA:S++,SGML_DECL:S++,SGML_DECL_QUOTED:S++,DOCTYPE:S++,DOCTYPE_QUOTED:S++,DOCTYPE_DTD:S++,DOCTYPE_DTD_QUOTED:S++,COMMENT_STARTING:S++,COMMENT:S++,COMMENT_ENDING:S++,COMMENT_ENDED:S++,CDATA:S++,CDATA_ENDING:S++,CDATA_ENDING_2:S++,PROC_INST:S++,PROC_INST_BODY:S++,PROC_INST_ENDING:S++,OPEN_TAG:S++,OPEN_TAG_SLASH:S++,ATTRIB:S++,ATTRIB_NAME:S++,ATTRIB_NAME_SAW_WHITE:S++,ATTRIB_VALUE:S++,ATTRIB_VALUE_QUOTED:S++,ATTRIB_VALUE_CLOSED:S++,ATTRIB_VALUE_UNQUOTED:S++,ATTRIB_VALUE_ENTITY_Q:S++,ATTRIB_VALUE_ENTITY_U:S++,CLOSE_TAG:S++,CLOSE_TAG_SAW_WHITE:S++,SCRIPT:S++,SCRIPT_ENDING:S++},t.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},t.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(t.ENTITIES).forEach((function(e){var n=t.ENTITIES[e],r="number"==typeof n?String.fromCharCode(n):n;t.ENTITIES[e]=r})),t.STATE)t.STATE[t.STATE[I]]=I;function x(t,e,n){t[e]&&t[e](n)}function O(t,e,n){t.textNode&&D(t),x(t,e,n)}function D(t){t.textNode=N(t.opt,t.textNode),t.textNode&&x(t,"ontext",t.textNode),t.textNode=""}function N(t,e){return t.trim&&(e=e.trim()),t.normalize&&(e=e.replace(/\s+/g," ")),e}function C(t,e){return D(t),t.trackPosition&&(e+="\nLine: "+t.line+"\nColumn: "+t.column+"\nChar: "+t.c),e=new Error(e),t.error=e,x(t,"onerror",e),t}function k(t){return t.sawRoot&&!t.closedRoot&&A(t,"Unclosed root tag"),t.state!==S.BEGIN&&t.state!==S.BEGIN_WHITESPACE&&t.state!==S.TEXT&&C(t,"Unexpected end"),D(t),t.c="",t.closed=!0,x(t,"onend"),i.call(t,t.strict,t.opt),t}function A(t,e){if("object"!=typeof t||!(t instanceof i))throw new Error("bad call to strictFail");t.strict&&C(t,e)}function R(t){t.strict||(t.tagName=t.tagName[t.looseCase]());var e=t.tags[t.tags.length-1]||t,n=t.tag={name:t.tagName,attributes:{}};t.opt.xmlns&&(n.ns=e.ns),t.attribList.length=0,O(t,"onopentagstart",n)}function P(t,e){var n=t.indexOf(":")<0?["",t]:t.split(":"),r=n[0],i=n[1];return e&&"xmlns"===t&&(r="xmlns",i=""),{prefix:r,local:i}}function U(t){if(t.strict||(t.attribName=t.attribName[t.looseCase]()),-1!==t.attribList.indexOf(t.attribName)||t.tag.attributes.hasOwnProperty(t.attribName))t.attribName=t.attribValue="";else{if(t.opt.xmlns){var e=P(t.attribName,!0),n=e.prefix,r=e.local;if("xmlns"===n)if("xml"===r&&t.attribValue!==u)A(t,"xml: prefix must be bound to "+u+"\nActual: "+t.attribValue);else if("xmlns"===r&&t.attribValue!==l)A(t,"xmlns: prefix must be bound to "+l+"\nActual: "+t.attribValue);else{var i=t.tag,s=t.tags[t.tags.length-1]||t;i.ns===s.ns&&(i.ns=Object.create(s.ns)),i.ns[r]=t.attribValue}t.attribList.push([t.attribName,t.attribValue])}else t.tag.attributes[t.attribName]=t.attribValue,O(t,"onattribute",{name:t.attribName,value:t.attribValue});t.attribName=t.attribValue=""}}function j(t,e){if(t.opt.xmlns){var n=t.tag,r=P(t.tagName);n.prefix=r.prefix,n.local=r.local,n.uri=n.ns[r.prefix]||"",n.prefix&&!n.uri&&(A(t,"Unbound namespace prefix: "+JSON.stringify(t.tagName)),n.uri=r.prefix);var i=t.tags[t.tags.length-1]||t;n.ns&&i.ns!==n.ns&&Object.keys(n.ns).forEach((function(e){O(t,"onopennamespace",{prefix:e,uri:n.ns[e]})}));for(var s=0,o=t.attribList.length;s",t.tagName="",void(t.state=S.SCRIPT);O(t,"onscript",t.script),t.script=""}var e=t.tags.length,n=t.tagName;t.strict||(n=n[t.looseCase]());for(var r=n;e--&&t.tags[e].name!==r;)A(t,"Unexpected close tag");if(e<0)return A(t,"Unmatched closing tag: "+t.tagName),t.textNode+="",void(t.state=S.TEXT);t.tagName=n;for(var i=t.tags.length;i-- >e;){var s=t.tag=t.tags.pop();t.tagName=t.tag.name,O(t,"onclosetag",t.tagName);var o={};for(var a in s.ns)o[a]=s.ns[a];var c=t.tags[t.tags.length-1]||t;t.opt.xmlns&&s.ns!==c.ns&&Object.keys(s.ns).forEach((function(e){var n=s.ns[e];O(t,"onclosenamespace",{prefix:e,uri:n})}))}0===e&&(t.closedRoot=!0),t.tagName=t.attribValue=t.attribName="",t.attribList.length=0,t.state=S.TEXT}function F(t){var e,n=t.entity,r=n.toLowerCase(),i="";return t.ENTITIES[n]?t.ENTITIES[n]:t.ENTITIES[r]?t.ENTITIES[r]:("#"===(n=r).charAt(0)&&("x"===n.charAt(1)?(n=n.slice(2),i=(e=parseInt(n,16)).toString(16)):(n=n.slice(1),i=(e=parseInt(n,10)).toString(10))),n=n.replace(/^0+/,""),isNaN(e)||i.toLowerCase()!==n?(A(t,"Invalid character entity"),"&"+t.entity+";"):String.fromCodePoint(e))}function B(t,e){"<"===e?(t.state=S.OPEN_WAKA,t.startTagPosition=t.position):m(e)||(A(t,"Non-whitespace before first tag."),t.textNode=e,t.state=S.TEXT)}function L(t,e){var n="";return e1114111||w(o)!==o)throw RangeError("Invalid code point: "+o);o<=65535?n.push(o):(t=55296+((o-=65536)>>10),e=o%1024+56320,n.push(t,e)),(r+1===i||n.length>16384)&&(s+=E.apply(null,n),n.length=0)}return s},Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:T,configurable:!0,writable:!0}):String.fromCodePoint=T)}(e)},2130:(t,e,n)=>{"use strict";const r=n(2037),i=n(6224),s=n(6560),{env:o}=process;let a;function c(t){return 0!==t&&{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function u(t,e){if(0===a)return 0;if(s("color=16m")||s("color=full")||s("color=truecolor"))return 3;if(s("color=256"))return 2;if(t&&!e&&void 0===a)return 0;const n=a||0;if("dumb"===o.TERM)return n;if("win32"===process.platform){const t=r.release().split(".");return Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}if("CI"in o)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some((t=>t in o))||"codeship"===o.CI_NAME?1:n;if("TEAMCITY_VERSION"in o)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(o.TEAMCITY_VERSION)?1:0;if("truecolor"===o.COLORTERM)return 3;if("TERM_PROGRAM"in o){const t=parseInt((o.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(o.TERM_PROGRAM){case"iTerm.app":return t>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(o.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(o.TERM)||"COLORTERM"in o?1:n}s("no-color")||s("no-colors")||s("color=false")||s("color=never")?a=0:(s("color")||s("colors")||s("color=true")||s("color=always"))&&(a=1),"FORCE_COLOR"in o&&(a="true"===o.FORCE_COLOR?1:"false"===o.FORCE_COLOR?0:0===o.FORCE_COLOR.length?1:Math.min(parseInt(o.FORCE_COLOR,10),3)),t.exports={supportsColor:function(t){return c(u(t,t&&t.isTTY))},stdout:c(u(!0,i.isatty(1))),stderr:c(u(!0,i.isatty(2)))}},306:function(t,e){(function(){"use strict";e.stripBOM=function(t){return"\ufeff"===t[0]?t.substring(1):t}}).call(this)},4096:function(t,e,n){(function(){"use strict";var t,r,i,s,o,a={}.hasOwnProperty;t=n(5532),r=n(8381).defaults,s=function(t){return"string"==typeof t&&(t.indexOf("&")>=0||t.indexOf(">")>=0||t.indexOf("<")>=0)},o=function(t){return""},i=function(t){return t.replace("]]>","]]]]>")},e.Builder=function(){function e(t){var e,n,i;for(e in this.options={},n=r[.2])a.call(n,e)&&(i=n[e],this.options[e]=i);for(e in t)a.call(t,e)&&(i=t[e],this.options[e]=i)}return e.prototype.buildObject=function(e){var n,i,c,u,l,p;return n=this.options.attrkey,i=this.options.charkey,1===Object.keys(e).length&&this.options.rootName===r[.2].rootName?e=e[l=Object.keys(e)[0]]:l=this.options.rootName,p=this,c=function(t,e){var r,u,l,d,h,f;if("object"!=typeof e)p.options.cdata&&s(e)?t.raw(o(e)):t.txt(e);else if(Array.isArray(e)){for(d in e)if(a.call(e,d))for(h in u=e[d])l=u[h],t=c(t.ele(h),l).up()}else for(h in e)if(a.call(e,h))if(u=e[h],h===n){if("object"==typeof u)for(r in u)f=u[r],t=t.att(r,f)}else if(h===i)t=p.options.cdata&&s(u)?t.raw(o(u)):t.txt(u);else if(Array.isArray(u))for(d in u)a.call(u,d)&&(t="string"==typeof(l=u[d])?p.options.cdata&&s(l)?t.ele(h).raw(o(l)).up():t.ele(h,l).up():c(t.ele(h),l).up());else"object"==typeof u?t=c(t.ele(h),u).up():"string"==typeof u&&p.options.cdata&&s(u)?t=t.ele(h).raw(o(u)).up():(null==u&&(u=""),t=t.ele(h,u.toString()).up());return t},u=t.create(l,this.options.xmldec,this.options.doctype,{headless:this.options.headless,allowSurrogateChars:this.options.allowSurrogateChars}),c(u,e).end(this.options.renderOpts)},e}()}).call(this)},8381:function(t,e){(function(){e.defaults={.1:{explicitCharkey:!1,trim:!0,normalize:!0,normalizeTags:!1,attrkey:"@",charkey:"#",explicitArray:!1,ignoreAttrs:!1,mergeAttrs:!1,explicitRoot:!1,validator:null,xmlns:!1,explicitChildren:!1,childkey:"@@",charsAsChildren:!1,includeWhiteChars:!1,async:!1,strict:!0,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,emptyTag:""},.2:{explicitCharkey:!1,trim:!1,normalize:!1,normalizeTags:!1,attrkey:"$",charkey:"_",explicitArray:!0,ignoreAttrs:!1,mergeAttrs:!1,explicitRoot:!0,validator:null,xmlns:!1,explicitChildren:!1,preserveChildrenOrder:!1,childkey:"$$",charsAsChildren:!1,includeWhiteChars:!1,async:!1,strict:!0,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,rootName:"root",xmldec:{version:"1.0",encoding:"UTF-8",standalone:!0},doctype:null,renderOpts:{pretty:!0,indent:" ",newline:"\n"},headless:!1,chunkSize:1e4,emptyTag:"",cdata:!1}}}).call(this)},9082:function(t,e,n){(function(){"use strict";var t,r,i,s,o,a,c,u,l,p=function(t,e){return function(){return t.apply(e,arguments)}},d={}.hasOwnProperty;u=n(6099),i=n(2361),t=n(306),c=n(7526),l=n(9512).setImmediate,r=n(8381).defaults,s=function(t){return"object"==typeof t&&null!=t&&0===Object.keys(t).length},o=function(t){return"__proto__"!==t&&"constructor"!==t&&"prototype"!==t},a=function(t,e,n){var r,i;for(r=0,i=t.length;r0&&(u[t.options.childkey]=p),p=u;return r.length>0?t.assignOrPush(_,l,p):(t.options.explicitRoot&&(f=p,(p={})[l]=f),t.resultObject=p,t.saxParser.ended=!0,t.emit("end",t.resultObject))}}(this),n=function(t){return function(n){var i,s;if(s=r[r.length-1])return s[e]+=n,t.options.explicitChildren&&t.options.preserveChildrenOrder&&t.options.charsAsChildren&&(t.options.includeWhiteChars||""!==n.replace(/\\n/g,"").trim())&&(s[t.options.childkey]=s[t.options.childkey]||[],(i={"#name":"__text__"})[e]=n,t.options.normalize&&(i[e]=i[e].replace(/\s{2,}/g," ").trim()),s[t.options.childkey].push(i)),s}}(this),this.saxParser.ontext=n,this.saxParser.oncdata=function(t){var e;if(e=n(t))return e.cdata=!0}},i.prototype.parseString=function(e,n){var r;null!=n&&"function"==typeof n&&(this.on("end",(function(t){return this.reset(),n(null,t)})),this.on("error",(function(t){return this.reset(),n(t)})));try{return""===(e=e.toString()).trim()?(this.emit("end",null),!0):(e=t.stripBOM(e),this.options.async?(this.remaining=e,l(this.processAsync),this.saxParser):this.saxParser.write(e).close())}catch(t){if(r=t,!this.saxParser.errThrown&&!this.saxParser.ended)return this.emit("error",r),this.saxParser.errThrown=!0;if(this.saxParser.ended)throw r}},i.prototype.parseStringPromise=function(t){return new Promise((e=this,function(n,r){return e.parseString(t,(function(t,e){return t?r(t):n(e)}))}));var e},i}(i),e.parseString=function(t,n,r){var i,s;return null!=r?("function"==typeof r&&(i=r),"object"==typeof n&&(s=n)):("function"==typeof n&&(i=n),s={}),new e.Parser(s).parseString(t,i)},e.parseStringPromise=function(t,n){var r;return"object"==typeof n&&(r=n),new e.Parser(r).parseStringPromise(t)}}).call(this)},7526:function(t,e){(function(){"use strict";var t;t=new RegExp(/(?!xmlns)^.*:/),e.normalize=function(t){return t.toLowerCase()},e.firstCharLowerCase=function(t){return t.charAt(0).toLowerCase()+t.slice(1)},e.stripPrefix=function(e){return e.replace(t,"")},e.parseNumbers=function(t){return isNaN(t)||(t=t%1==0?parseInt(t,10):parseFloat(t)),t},e.parseBooleans=function(t){return/^(?:true|false)$/i.test(t)&&(t="true"===t.toLowerCase()),t}}).call(this)},5055:function(t,e,n){(function(){"use strict";var t,r,i,s,o={}.hasOwnProperty;r=n(8381),t=n(4096),i=n(9082),s=n(7526),e.defaults=r.defaults,e.processors=s,e.ValidationError=function(t){function e(t){this.message=t}return function(t,e){for(var n in e)o.call(e,n)&&(t[n]=e[n]);function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype}(e,Error),e}(),e.Builder=t.Builder,e.Parser=i.Parser,e.parseString=i.parseString,e.parseStringPromise=i.parseStringPromise}).call(this)},7557:function(t){(function(){t.exports={Disconnected:1,Preceding:2,Following:4,Contains:8,ContainedBy:16,ImplementationSpecific:32}}).call(this)},9335:function(t){(function(){t.exports={Element:1,Attribute:2,Text:3,CData:4,EntityReference:5,EntityDeclaration:6,ProcessingInstruction:7,Comment:8,Document:9,DocType:10,DocumentFragment:11,NotationDeclaration:12,Declaration:201,Raw:202,AttributeDeclaration:203,ElementDeclaration:204,Dummy:205}}).call(this)},8369:function(t){(function(){var e,n,r,i,s,o,a,c=[].slice,u={}.hasOwnProperty;e=function(){var t,e,n,r,i,o;if(o=arguments[0],i=2<=arguments.length?c.call(arguments,1):[],s(Object.assign))Object.assign.apply(null,arguments);else for(t=0,n=i.length;t":"attribute: {"+t+"}, parent: <"+this.parent.name+">"},t.prototype.isEqualNode=function(t){return t.namespaceURI===this.namespaceURI&&t.prefix===this.prefix&&t.localName===this.localName&&t.value===this.value},t}()}).call(this)},6170:function(t,e,n){(function(){var e,r,i={}.hasOwnProperty;e=n(9335),r=n(6488),t.exports=function(t){function n(t,r){if(n.__super__.constructor.call(this,t),null==r)throw new Error("Missing CDATA text. "+this.debugInfo());this.name="#cdata-section",this.type=e.CData,this.value=this.stringify.cdata(r)}return function(t,e){for(var n in e)i.call(e,n)&&(t[n]=e[n]);function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype}(n,t),n.prototype.clone=function(){return Object.create(this)},n.prototype.toString=function(t){return this.options.writer.cdata(this,this.options.writer.filterOptions(t))},n}(r)}).call(this)},6488:function(t,e,n){(function(){var e,r={}.hasOwnProperty;e=n(2026),t.exports=function(t){function e(t){e.__super__.constructor.call(this,t),this.value=""}return function(t,e){for(var n in e)r.call(e,n)&&(t[n]=e[n]);function i(){this.constructor=t}i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype}(e,t),Object.defineProperty(e.prototype,"data",{get:function(){return this.value},set:function(t){return this.value=t||""}}),Object.defineProperty(e.prototype,"length",{get:function(){return this.value.length}}),Object.defineProperty(e.prototype,"textContent",{get:function(){return this.value},set:function(t){return this.value=t||""}}),e.prototype.clone=function(){return Object.create(this)},e.prototype.substringData=function(t,e){throw new Error("This DOM method is not implemented."+this.debugInfo())},e.prototype.appendData=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())},e.prototype.insertData=function(t,e){throw new Error("This DOM method is not implemented."+this.debugInfo())},e.prototype.deleteData=function(t,e){throw new Error("This DOM method is not implemented."+this.debugInfo())},e.prototype.replaceData=function(t,e,n){throw new Error("This DOM method is not implemented."+this.debugInfo())},e.prototype.isEqualNode=function(t){return!!e.__super__.isEqualNode.apply(this,arguments).isEqualNode(t)&&t.data===this.data},e}(e)}).call(this)},2096:function(t,e,n){(function(){var e,r,i={}.hasOwnProperty;e=n(9335),r=n(6488),t.exports=function(t){function n(t,r){if(n.__super__.constructor.call(this,t),null==r)throw new Error("Missing comment text. "+this.debugInfo());this.name="#comment",this.type=e.Comment,this.value=this.stringify.comment(r)}return function(t,e){for(var n in e)i.call(e,n)&&(t[n]=e[n]);function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype}(n,t),n.prototype.clone=function(){return Object.create(this)},n.prototype.toString=function(t){return this.options.writer.comment(this,this.options.writer.filterOptions(t))},n}(r)}).call(this)},383:function(t,e,n){(function(){var e,r;e=n(3933),r=n(6210),t.exports=function(){function t(){this.defaultParams={"canonical-form":!1,"cdata-sections":!1,comments:!1,"datatype-normalization":!1,"element-content-whitespace":!0,entities:!0,"error-handler":new e,infoset:!0,"validate-if-schema":!1,namespaces:!0,"namespace-declarations":!0,"normalize-characters":!1,"schema-location":"","schema-type":"","split-cdata-sections":!0,validate:!1,"well-formed":!0},this.params=Object.create(this.defaultParams)}return Object.defineProperty(t.prototype,"parameterNames",{get:function(){return new r(Object.keys(this.defaultParams))}}),t.prototype.getParameter=function(t){return this.params.hasOwnProperty(t)?this.params[t]:null},t.prototype.canSetParameter=function(t,e){return!0},t.prototype.setParameter=function(t,e){return null!=e?this.params[t]=e:delete this.params[t]},t}()}).call(this)},3933:function(t){(function(){t.exports=function(){function t(){}return t.prototype.handleError=function(t){throw new Error(t)},t}()}).call(this)},1770:function(t){(function(){t.exports=function(){function t(){}return t.prototype.hasFeature=function(t,e){return!0},t.prototype.createDocumentType=function(t,e,n){throw new Error("This DOM method is not implemented.")},t.prototype.createDocument=function(t,e,n){throw new Error("This DOM method is not implemented.")},t.prototype.createHTMLDocument=function(t){throw new Error("This DOM method is not implemented.")},t.prototype.getFeature=function(t,e){throw new Error("This DOM method is not implemented.")},t}()}).call(this)},6210:function(t){(function(){t.exports=function(){function t(t){this.arr=t||[]}return Object.defineProperty(t.prototype,"length",{get:function(){return this.arr.length}}),t.prototype.item=function(t){return this.arr[t]||null},t.prototype.contains=function(t){return-1!==this.arr.indexOf(t)},t}()}).call(this)},1179:function(t,e,n){(function(){var e,r,i={}.hasOwnProperty;r=n(2026),e=n(9335),t.exports=function(t){function n(t,r,i,s,o,a){if(n.__super__.constructor.call(this,t),null==r)throw new Error("Missing DTD element name. "+this.debugInfo());if(null==i)throw new Error("Missing DTD attribute name. "+this.debugInfo(r));if(!s)throw new Error("Missing DTD attribute type. "+this.debugInfo(r));if(!o)throw new Error("Missing DTD attribute default. "+this.debugInfo(r));if(0!==o.indexOf("#")&&(o="#"+o),!o.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/))throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT. "+this.debugInfo(r));if(a&&!o.match(/^(#FIXED|#DEFAULT)$/))throw new Error("Default value only applies to #FIXED or #DEFAULT. "+this.debugInfo(r));this.elementName=this.stringify.name(r),this.type=e.AttributeDeclaration,this.attributeName=this.stringify.name(i),this.attributeType=this.stringify.dtdAttType(s),a&&(this.defaultValue=this.stringify.dtdAttDefault(a)),this.defaultValueType=o}return function(t,e){for(var n in e)i.call(e,n)&&(t[n]=e[n]);function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype}(n,t),n.prototype.toString=function(t){return this.options.writer.dtdAttList(this,this.options.writer.filterOptions(t))},n}(r)}).call(this)},6347:function(t,e,n){(function(){var e,r,i={}.hasOwnProperty;r=n(2026),e=n(9335),t.exports=function(t){function n(t,r,i){if(n.__super__.constructor.call(this,t),null==r)throw new Error("Missing DTD element name. "+this.debugInfo());i||(i="(#PCDATA)"),Array.isArray(i)&&(i="("+i.join(",")+")"),this.name=this.stringify.name(r),this.type=e.ElementDeclaration,this.value=this.stringify.dtdElementValue(i)}return function(t,e){for(var n in e)i.call(e,n)&&(t[n]=e[n]);function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype}(n,t),n.prototype.toString=function(t){return this.options.writer.dtdElement(this,this.options.writer.filterOptions(t))},n}(r)}).call(this)},9078:function(t,e,n){(function(){var e,r,i,s={}.hasOwnProperty;i=n(8369).isObject,r=n(2026),e=n(9335),t.exports=function(t){function n(t,r,s,o){if(n.__super__.constructor.call(this,t),null==s)throw new Error("Missing DTD entity name. "+this.debugInfo(s));if(null==o)throw new Error("Missing DTD entity value. "+this.debugInfo(s));if(this.pe=!!r,this.name=this.stringify.name(s),this.type=e.EntityDeclaration,i(o)){if(!o.pubID&&!o.sysID)throw new Error("Public and/or system identifiers are required for an external entity. "+this.debugInfo(s));if(o.pubID&&!o.sysID)throw new Error("System identifier is required for a public external entity. "+this.debugInfo(s));if(this.internal=!1,null!=o.pubID&&(this.pubID=this.stringify.dtdPubID(o.pubID)),null!=o.sysID&&(this.sysID=this.stringify.dtdSysID(o.sysID)),null!=o.nData&&(this.nData=this.stringify.dtdNData(o.nData)),this.pe&&this.nData)throw new Error("Notation declaration is not allowed in a parameter entity. "+this.debugInfo(s))}else this.value=this.stringify.dtdEntityValue(o),this.internal=!0}return function(t,e){for(var n in e)s.call(e,n)&&(t[n]=e[n]);function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype}(n,t),Object.defineProperty(n.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(n.prototype,"systemId",{get:function(){return this.sysID}}),Object.defineProperty(n.prototype,"notationName",{get:function(){return this.nData||null}}),Object.defineProperty(n.prototype,"inputEncoding",{get:function(){return null}}),Object.defineProperty(n.prototype,"xmlEncoding",{get:function(){return null}}),Object.defineProperty(n.prototype,"xmlVersion",{get:function(){return null}}),n.prototype.toString=function(t){return this.options.writer.dtdEntity(this,this.options.writer.filterOptions(t))},n}(r)}).call(this)},4777:function(t,e,n){(function(){var e,r,i={}.hasOwnProperty;r=n(2026),e=n(9335),t.exports=function(t){function n(t,r,i){if(n.__super__.constructor.call(this,t),null==r)throw new Error("Missing DTD notation name. "+this.debugInfo(r));if(!i.pubID&&!i.sysID)throw new Error("Public or system identifiers are required for an external entity. "+this.debugInfo(r));this.name=this.stringify.name(r),this.type=e.NotationDeclaration,null!=i.pubID&&(this.pubID=this.stringify.dtdPubID(i.pubID)),null!=i.sysID&&(this.sysID=this.stringify.dtdSysID(i.sysID))}return function(t,e){for(var n in e)i.call(e,n)&&(t[n]=e[n]);function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype}(n,t),Object.defineProperty(n.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(n.prototype,"systemId",{get:function(){return this.sysID}}),n.prototype.toString=function(t){return this.options.writer.dtdNotation(this,this.options.writer.filterOptions(t))},n}(r)}).call(this)},9077:function(t,e,n){(function(){var e,r,i,s={}.hasOwnProperty;i=n(8369).isObject,r=n(2026),e=n(9335),t.exports=function(t){function n(t,r,s,o){var a;n.__super__.constructor.call(this,t),i(r)&&(r=(a=r).version,s=a.encoding,o=a.standalone),r||(r="1.0"),this.type=e.Declaration,this.version=this.stringify.xmlVersion(r),null!=s&&(this.encoding=this.stringify.xmlEncoding(s)),null!=o&&(this.standalone=this.stringify.xmlStandalone(o))}return function(t,e){for(var n in e)s.call(e,n)&&(t[n]=e[n]);function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype}(n,t),n.prototype.toString=function(t){return this.options.writer.declaration(this,this.options.writer.filterOptions(t))},n}(r)}).call(this)},6544:function(t,e,n){(function(){var e,r,i,s,o,a,c,u,l={}.hasOwnProperty;u=n(8369).isObject,c=n(2026),e=n(9335),r=n(1179),s=n(9078),i=n(6347),o=n(4777),a=n(663),t.exports=function(t){function n(t,r,i){var s,o,a,c,l,p;if(n.__super__.constructor.call(this,t),this.type=e.DocType,t.children)for(o=0,a=(c=t.children).length;o=0;)this.up();return this.onEnd()},t.prototype.openCurrent=function(){if(this.currentNode)return this.currentNode.children=!0,this.openNode(this.currentNode)},t.prototype.openNode=function(t){var n,i,s,o;if(!t.isOpen){if(this.root||0!==this.currentLevel||t.type!==e.Element||(this.root=t),i="",t.type===e.Element){for(s in this.writerOptions.state=r.OpenTag,i=this.writer.indent(t,this.writerOptions,this.currentLevel)+"<"+t.name,o=t.attribs)I.call(o,s)&&(n=o[s],i+=this.writer.attribute(n,this.writerOptions,this.currentLevel));i+=(t.children?">":"/>")+this.writer.endline(t,this.writerOptions,this.currentLevel),this.writerOptions.state=r.InsideTag}else this.writerOptions.state=r.OpenTag,i=this.writer.indent(t,this.writerOptions,this.currentLevel)+""),i+=this.writer.endline(t,this.writerOptions,this.currentLevel);return this.onData(i,this.currentLevel),t.isOpen=!0}},t.prototype.closeNode=function(t){var n;if(!t.isClosed)return"",this.writerOptions.state=r.CloseTag,n=t.type===e.Element?this.writer.indent(t,this.writerOptions,this.currentLevel)+""+this.writer.endline(t,this.writerOptions,this.currentLevel):this.writer.indent(t,this.writerOptions,this.currentLevel)+"]>"+this.writer.endline(t,this.writerOptions,this.currentLevel),this.writerOptions.state=r.None,this.onData(n,this.currentLevel),t.isClosed=!0},t.prototype.onData=function(t,e){return this.documentStarted=!0,this.onDataCallback(t,e+1)},t.prototype.onEnd=function(){return this.documentCompleted=!0,this.onEndCallback()},t.prototype.debugInfo=function(t){return null==t?"":"node: <"+t+">"},t.prototype.ele=function(){return this.element.apply(this,arguments)},t.prototype.nod=function(t,e,n){return this.node(t,e,n)},t.prototype.txt=function(t){return this.text(t)},t.prototype.dat=function(t){return this.cdata(t)},t.prototype.com=function(t){return this.comment(t)},t.prototype.ins=function(t,e){return this.instruction(t,e)},t.prototype.dec=function(t,e,n){return this.declaration(t,e,n)},t.prototype.dtd=function(t,e,n){return this.doctype(t,e,n)},t.prototype.e=function(t,e,n){return this.element(t,e,n)},t.prototype.n=function(t,e,n){return this.node(t,e,n)},t.prototype.t=function(t){return this.text(t)},t.prototype.d=function(t){return this.cdata(t)},t.prototype.c=function(t){return this.comment(t)},t.prototype.r=function(t){return this.raw(t)},t.prototype.i=function(t,e){return this.instruction(t,e)},t.prototype.att=function(){return this.currentNode&&this.currentNode.type===e.DocType?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},t.prototype.a=function(){return this.currentNode&&this.currentNode.type===e.DocType?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},t.prototype.ent=function(t,e){return this.entity(t,e)},t.prototype.pent=function(t,e){return this.pEntity(t,e)},t.prototype.not=function(t,e){return this.notation(t,e)},t}()}).call(this)},8833:function(t,e,n){(function(){var e,r,i={}.hasOwnProperty;r=n(2026),e=n(9335),t.exports=function(t){function n(t){n.__super__.constructor.call(this,t),this.type=e.Dummy}return function(t,e){for(var n in e)i.call(e,n)&&(t[n]=e[n]);function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype}(n,t),n.prototype.clone=function(){return Object.create(this)},n.prototype.toString=function(t){return""},n}(r)}).call(this)},2161:function(t,e,n){(function(){var e,r,i,s,o,a,c,u,l={}.hasOwnProperty;u=n(8369),c=u.isObject,a=u.isFunction,o=u.getValue,s=n(2026),e=n(9335),r=n(2750),i=n(663),t.exports=function(t){function n(t,r,i){var s,o,a,c;if(n.__super__.constructor.call(this,t),null==r)throw new Error("Missing element name. "+this.debugInfo());if(this.name=this.stringify.name(r),this.type=e.Element,this.attribs={},this.schemaTypeInfo=null,null!=i&&this.attribute(i),t.type===e.Document&&(this.isRoot=!0,this.documentObject=t,t.rootObject=this,t.children))for(o=0,a=(c=t.children).length;o=i;e=0<=i?++r:--r)if(!this.attribs[e].isEqualNode(t.attribs[e]))return!1;return!0},n}(s)}).call(this)},663:function(t){(function(){t.exports=function(){function t(t){this.nodes=t}return Object.defineProperty(t.prototype,"length",{get:function(){return Object.keys(this.nodes).length||0}}),t.prototype.clone=function(){return this.nodes=null},t.prototype.getNamedItem=function(t){return this.nodes[t]},t.prototype.setNamedItem=function(t){var e;return e=this.nodes[t.nodeName],this.nodes[t.nodeName]=t,e||null},t.prototype.removeNamedItem=function(t){var e;return e=this.nodes[t],delete this.nodes[t],e||null},t.prototype.item=function(t){return this.nodes[Object.keys(this.nodes)[t]]||null},t.prototype.getNamedItemNS=function(t,e){throw new Error("This DOM method is not implemented.")},t.prototype.setNamedItemNS=function(t){throw new Error("This DOM method is not implemented.")},t.prototype.removeNamedItemNS=function(t,e){throw new Error("This DOM method is not implemented.")},t}()}).call(this)},2026:function(t,e,n){(function(){var e,r,i,s,o,a,c,u,l,p,d,h,f,_,m,g,y,b={}.hasOwnProperty;y=n(8369),g=y.isObject,m=y.isFunction,_=y.isEmpty,f=y.getValue,u=null,i=null,s=null,o=null,a=null,d=null,h=null,p=null,c=null,r=null,l=null,e=null,t.exports=function(){function t(t){this.parent=t,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),this.value=null,this.children=[],this.baseURI=null,u||(u=n(2161),i=n(6170),s=n(2096),o=n(9077),a=n(6544),d=n(9406),h=n(3595),p=n(4981),c=n(8833),r=n(9335),l=n(2390),n(663),e=n(7557))}return Object.defineProperty(t.prototype,"nodeName",{get:function(){return this.name}}),Object.defineProperty(t.prototype,"nodeType",{get:function(){return this.type}}),Object.defineProperty(t.prototype,"nodeValue",{get:function(){return this.value}}),Object.defineProperty(t.prototype,"parentNode",{get:function(){return this.parent}}),Object.defineProperty(t.prototype,"childNodes",{get:function(){return this.childNodeList&&this.childNodeList.nodes||(this.childNodeList=new l(this.children)),this.childNodeList}}),Object.defineProperty(t.prototype,"firstChild",{get:function(){return this.children[0]||null}}),Object.defineProperty(t.prototype,"lastChild",{get:function(){return this.children[this.children.length-1]||null}}),Object.defineProperty(t.prototype,"previousSibling",{get:function(){var t;return t=this.parent.children.indexOf(this),this.parent.children[t-1]||null}}),Object.defineProperty(t.prototype,"nextSibling",{get:function(){var t;return t=this.parent.children.indexOf(this),this.parent.children[t+1]||null}}),Object.defineProperty(t.prototype,"ownerDocument",{get:function(){return this.document()||null}}),Object.defineProperty(t.prototype,"textContent",{get:function(){var t,e,n,i,s;if(this.nodeType===r.Element||this.nodeType===r.DocumentFragment){for(s="",e=0,n=(i=this.children).length;e":(null!=(n=this.parent)?n.name:void 0)?"node: <"+t+">, parent: <"+this.parent.name+">":"node: <"+t+">":""},t.prototype.ele=function(t,e,n){return this.element(t,e,n)},t.prototype.nod=function(t,e,n){return this.node(t,e,n)},t.prototype.txt=function(t){return this.text(t)},t.prototype.dat=function(t){return this.cdata(t)},t.prototype.com=function(t){return this.comment(t)},t.prototype.ins=function(t,e){return this.instruction(t,e)},t.prototype.doc=function(){return this.document()},t.prototype.dec=function(t,e,n){return this.declaration(t,e,n)},t.prototype.e=function(t,e,n){return this.element(t,e,n)},t.prototype.n=function(t,e,n){return this.node(t,e,n)},t.prototype.t=function(t){return this.text(t)},t.prototype.d=function(t){return this.cdata(t)},t.prototype.c=function(t){return this.comment(t)},t.prototype.r=function(t){return this.raw(t)},t.prototype.i=function(t,e){return this.instruction(t,e)},t.prototype.u=function(){return this.up()},t.prototype.importXMLBuilder=function(t){return this.importDocument(t)},t.prototype.replaceChild=function(t,e){throw new Error("This DOM method is not implemented."+this.debugInfo())},t.prototype.removeChild=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())},t.prototype.appendChild=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())},t.prototype.hasChildNodes=function(){return 0!==this.children.length},t.prototype.cloneNode=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())},t.prototype.normalize=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},t.prototype.isSupported=function(t,e){return!0},t.prototype.hasAttributes=function(){return 0!==this.attribs.length},t.prototype.compareDocumentPosition=function(t){var n,r;return(n=this)===t?0:this.document()!==t.document()?(r=e.Disconnected|e.ImplementationSpecific,Math.random()<.5?r|=e.Preceding:r|=e.Following,r):n.isAncestor(t)?e.Contains|e.Preceding:n.isDescendant(t)?e.Contains|e.Following:n.isPreceding(t)?e.Preceding:e.Following},t.prototype.isSameNode=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())},t.prototype.lookupPrefix=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())},t.prototype.isDefaultNamespace=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())},t.prototype.lookupNamespaceURI=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())},t.prototype.isEqualNode=function(t){var e,n,r;if(t.nodeType!==this.nodeType)return!1;if(t.children.length!==this.children.length)return!1;for(e=n=0,r=this.children.length-1;0<=r?n<=r:n>=r;e=0<=r?++n:--n)if(!this.children[e].isEqualNode(t.children[e]))return!1;return!0},t.prototype.getFeature=function(t,e){throw new Error("This DOM method is not implemented."+this.debugInfo())},t.prototype.setUserData=function(t,e,n){throw new Error("This DOM method is not implemented."+this.debugInfo())},t.prototype.getUserData=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())},t.prototype.contains=function(t){return!!t&&(t===this||this.isDescendant(t))},t.prototype.isDescendant=function(t){var e,n,r,i;for(n=0,r=(i=this.children).length;nn},t.prototype.treePosition=function(t){var e,n;return n=0,e=!1,this.foreachTreeNode(this.document(),(function(r){if(n++,!e&&r===t)return e=!0})),e?n:-1},t.prototype.foreachTreeNode=function(t,e){var n,r,i,s,o;for(t||(t=this.document()),r=0,i=(s=t.children).length;r0){for(this.stream.write(" ["),this.stream.write(this.endline(t,e,n)),e.state=r.InsideTag,s=0,o=(a=t.children).length;s"),this.stream.write(this.endline(t,e,n)),e.state=r.None,this.closeNode(t,e,n)},n.prototype.element=function(t,n,i){var o,a,c,u,l,p,d,h,f;for(d in i||(i=0),this.openNode(t,n,i),n.state=r.OpenTag,this.stream.write(this.indent(t,n,i)+"<"+t.name),h=t.attribs)s.call(h,d)&&(o=h[d],this.attribute(o,n,i));if(u=0===(c=t.children.length)?null:t.children[0],0===c||t.children.every((function(t){return(t.type===e.Text||t.type===e.Raw)&&""===t.value})))n.allowEmpty?(this.stream.write(">"),n.state=r.CloseTag,this.stream.write("")):(n.state=r.CloseTag,this.stream.write(n.spaceBeforeSlash+"/>"));else if(!n.pretty||1!==c||u.type!==e.Text&&u.type!==e.Raw||null==u.value){for(this.stream.write(">"+this.endline(t,n,i)),n.state=r.InsideTag,l=0,p=(f=t.children).length;l")}else this.stream.write(">"),n.state=r.InsideTag,n.suppressPrettyCount++,this.writeChildNode(u,n,i+1),n.suppressPrettyCount--,n.state=r.CloseTag,this.stream.write("");return this.stream.write(this.endline(t,n,i)),n.state=r.None,this.closeNode(t,n,i)},n.prototype.processingInstruction=function(t,e,r){return this.stream.write(n.__super__.processingInstruction.call(this,t,e,r))},n.prototype.raw=function(t,e,r){return this.stream.write(n.__super__.raw.call(this,t,e,r))},n.prototype.text=function(t,e,r){return this.stream.write(n.__super__.text.call(this,t,e,r))},n.prototype.dtdAttList=function(t,e,r){return this.stream.write(n.__super__.dtdAttList.call(this,t,e,r))},n.prototype.dtdElement=function(t,e,r){return this.stream.write(n.__super__.dtdElement.call(this,t,e,r))},n.prototype.dtdEntity=function(t,e,r){return this.stream.write(n.__super__.dtdEntity.call(this,t,e,r))},n.prototype.dtdNotation=function(t,e,r){return this.stream.write(n.__super__.dtdNotation.call(this,t,e,r))},n}(i)}).call(this)},6434:function(t,e,n){(function(){var e,r={}.hasOwnProperty;e=n(751),t.exports=function(t){function e(t){e.__super__.constructor.call(this,t)}return function(t,e){for(var n in e)r.call(e,n)&&(t[n]=e[n]);function i(){this.constructor=t}i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype}(e,t),e.prototype.document=function(t,e){var n,r,i,s,o;for(e=this.filterOptions(e),s="",r=0,i=(o=t.children).length;r","]]]]>"),this.assertLegalChar(t))},t.prototype.comment=function(t){if(this.options.noValidation)return t;if((t=""+t||"").match(/--/))throw new Error("Comment text cannot contain double-hypen: "+t);return this.assertLegalChar(t)},t.prototype.raw=function(t){return this.options.noValidation?t:""+t||""},t.prototype.attValue=function(t){return this.options.noValidation?t:this.assertLegalChar(this.attEscape(t=""+t||""))},t.prototype.insTarget=function(t){return this.options.noValidation?t:this.assertLegalChar(""+t||"")},t.prototype.insValue=function(t){if(this.options.noValidation)return t;if((t=""+t||"").match(/\?>/))throw new Error("Invalid processing instruction value: "+t);return this.assertLegalChar(t)},t.prototype.xmlVersion=function(t){if(this.options.noValidation)return t;if(!(t=""+t||"").match(/1\.[0-9]+/))throw new Error("Invalid version number: "+t);return t},t.prototype.xmlEncoding=function(t){if(this.options.noValidation)return t;if(!(t=""+t||"").match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/))throw new Error("Invalid encoding: "+t);return this.assertLegalChar(t)},t.prototype.xmlStandalone=function(t){return this.options.noValidation?t:t?"yes":"no"},t.prototype.dtdPubID=function(t){return this.options.noValidation?t:this.assertLegalChar(""+t||"")},t.prototype.dtdSysID=function(t){return this.options.noValidation?t:this.assertLegalChar(""+t||"")},t.prototype.dtdElementValue=function(t){return this.options.noValidation?t:this.assertLegalChar(""+t||"")},t.prototype.dtdAttType=function(t){return this.options.noValidation?t:this.assertLegalChar(""+t||"")},t.prototype.dtdAttDefault=function(t){return this.options.noValidation?t:this.assertLegalChar(""+t||"")},t.prototype.dtdEntityValue=function(t){return this.options.noValidation?t:this.assertLegalChar(""+t||"")},t.prototype.dtdNData=function(t){return this.options.noValidation?t:this.assertLegalChar(""+t||"")},t.prototype.convertAttKey="@",t.prototype.convertPIKey="?",t.prototype.convertTextKey="#text",t.prototype.convertCDataKey="#cdata",t.prototype.convertCommentKey="#comment",t.prototype.convertRawKey="#raw",t.prototype.assertLegalChar=function(t){var e,n;if(this.options.noValidation)return t;if(e="","1.0"===this.options.version){if(e=/[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,n=t.match(e))throw new Error("Invalid character in string: "+t+" at index "+n.index)}else if("1.1"===this.options.version&&(e=/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,n=t.match(e)))throw new Error("Invalid character in string: "+t+" at index "+n.index);return t},t.prototype.assertLegalName=function(t){var e;if(this.options.noValidation)return t;if(this.assertLegalChar(t),e=/^([:A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])([\x2D\.0-:A-Z_a-z\xB7\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C\u200D\u203F\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])*$/,!t.match(e))throw new Error("Invalid character in name");return t},t.prototype.textEscape=function(t){var e;return this.options.noValidation?t:(e=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,t.replace(e,"&").replace(//g,">").replace(/\r/g," "))},t.prototype.attEscape=function(t){var e;return this.options.noValidation?t:(e=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,t.replace(e,"&").replace(/0?new Array(r).join(e.indent):""},t.prototype.endline=function(t,e,n){return!e.pretty||e.suppressPrettyCount?"":e.newline},t.prototype.attribute=function(t,e,n){var r;return this.openAttribute(t,e,n),r=" "+t.name+'="'+t.value+'"',this.closeAttribute(t,e,n),r},t.prototype.cdata=function(t,e,n){var i;return this.openNode(t,e,n),e.state=r.OpenTag,i=this.indent(t,e,n)+""+this.endline(t,e,n),e.state=r.None,this.closeNode(t,e,n),i},t.prototype.comment=function(t,e,n){var i;return this.openNode(t,e,n),e.state=r.OpenTag,i=this.indent(t,e,n)+"\x3c!-- ",e.state=r.InsideTag,i+=t.value,e.state=r.CloseTag,i+=" --\x3e"+this.endline(t,e,n),e.state=r.None,this.closeNode(t,e,n),i},t.prototype.declaration=function(t,e,n){var i;return this.openNode(t,e,n),e.state=r.OpenTag,i=this.indent(t,e,n)+"",i+=this.endline(t,e,n),e.state=r.None,this.closeNode(t,e,n),i},t.prototype.docType=function(t,e,n){var i,s,o,a,c;if(n||(n=0),this.openNode(t,e,n),e.state=r.OpenTag,a=this.indent(t,e,n),a+="0){for(a+=" [",a+=this.endline(t,e,n),e.state=r.InsideTag,s=0,o=(c=t.children).length;s",a+=this.endline(t,e,n),e.state=r.None,this.closeNode(t,e,n),a},t.prototype.element=function(t,n,i){var o,a,c,u,l,p,d,h,f,_,m,g,y,b;for(f in i||(i=0),_=!1,m="",this.openNode(t,n,i),n.state=r.OpenTag,m+=this.indent(t,n,i)+"<"+t.name,g=t.attribs)s.call(g,f)&&(o=g[f],m+=this.attribute(o,n,i));if(u=0===(c=t.children.length)?null:t.children[0],0===c||t.children.every((function(t){return(t.type===e.Text||t.type===e.Raw)&&""===t.value})))n.allowEmpty?(m+=">",n.state=r.CloseTag,m+=""+this.endline(t,n,i)):(n.state=r.CloseTag,m+=n.spaceBeforeSlash+"/>"+this.endline(t,n,i));else if(!n.pretty||1!==c||u.type!==e.Text&&u.type!==e.Raw||null==u.value){if(n.dontPrettyTextNodes)for(l=0,d=(y=t.children).length;l"+this.endline(t,n,i),n.state=r.InsideTag,p=0,h=(b=t.children).length;p",_&&n.suppressPrettyCount--,m+=this.endline(t,n,i),n.state=r.None}else m+=">",n.state=r.InsideTag,n.suppressPrettyCount++,_=!0,m+=this.writeChildNode(u,n,i+1),n.suppressPrettyCount--,_=!1,n.state=r.CloseTag,m+=""+this.endline(t,n,i);return this.closeNode(t,n,i),m},t.prototype.writeChildNode=function(t,n,r){switch(t.type){case e.CData:return this.cdata(t,n,r);case e.Comment:return this.comment(t,n,r);case e.Element:return this.element(t,n,r);case e.Raw:return this.raw(t,n,r);case e.Text:return this.text(t,n,r);case e.ProcessingInstruction:return this.processingInstruction(t,n,r);case e.Dummy:return"";case e.Declaration:return this.declaration(t,n,r);case e.DocType:return this.docType(t,n,r);case e.AttributeDeclaration:return this.dtdAttList(t,n,r);case e.ElementDeclaration:return this.dtdElement(t,n,r);case e.EntityDeclaration:return this.dtdEntity(t,n,r);case e.NotationDeclaration:return this.dtdNotation(t,n,r);default:throw new Error("Unknown XML node type: "+t.constructor.name)}},t.prototype.processingInstruction=function(t,e,n){var i;return this.openNode(t,e,n),e.state=r.OpenTag,i=this.indent(t,e,n)+"",i+=this.endline(t,e,n),e.state=r.None,this.closeNode(t,e,n),i},t.prototype.raw=function(t,e,n){var i;return this.openNode(t,e,n),e.state=r.OpenTag,i=this.indent(t,e,n),e.state=r.InsideTag,i+=t.value,e.state=r.CloseTag,i+=this.endline(t,e,n),e.state=r.None,this.closeNode(t,e,n),i},t.prototype.text=function(t,e,n){var i;return this.openNode(t,e,n),e.state=r.OpenTag,i=this.indent(t,e,n),e.state=r.InsideTag,i+=t.value,e.state=r.CloseTag,i+=this.endline(t,e,n),e.state=r.None,this.closeNode(t,e,n),i},t.prototype.dtdAttList=function(t,e,n){var i;return this.openNode(t,e,n),e.state=r.OpenTag,i=this.indent(t,e,n)+""+this.endline(t,e,n),e.state=r.None,this.closeNode(t,e,n),i},t.prototype.dtdElement=function(t,e,n){var i;return this.openNode(t,e,n),e.state=r.OpenTag,i=this.indent(t,e,n)+""+this.endline(t,e,n),e.state=r.None,this.closeNode(t,e,n),i},t.prototype.dtdEntity=function(t,e,n){var i;return this.openNode(t,e,n),e.state=r.OpenTag,i=this.indent(t,e,n)+""+this.endline(t,e,n),e.state=r.None,this.closeNode(t,e,n),i},t.prototype.dtdNotation=function(t,e,n){var i;return this.openNode(t,e,n),e.state=r.OpenTag,i=this.indent(t,e,n)+""+this.endline(t,e,n),e.state=r.None,this.closeNode(t,e,n),i},t.prototype.openNode=function(t,e,n){},t.prototype.closeNode=function(t,e,n){},t.prototype.openAttribute=function(t,e,n){},t.prototype.closeAttribute=function(t,e,n){},t}()}).call(this)},5532:function(t,e,n){(function(){var e,r,i,s,o,a,c,u,l,p;p=n(8369),u=p.assign,l=p.isFunction,i=n(1770),s=n(6934),o=n(9227),c=n(6434),a=n(1996),e=n(9335),r=n(594),t.exports.create=function(t,e,n,r){var i,o;if(null==t)throw new Error("Root element needs a name.");return r=u({},e,n,r),o=(i=new s(r)).element(t),r.headless||(i.declaration(r),null==r.pubID&&null==r.sysID||i.dtd(r)),o},t.exports.begin=function(t,e,n){var r;return l(t)&&(e=(r=[t,e])[0],n=r[1],t={}),e?new o(t,e,n):new s(t)},t.exports.stringWriter=function(t){return new c(t)},t.exports.streamWriter=function(t,e){return new a(t,e)},t.exports.implementation=new i,t.exports.nodeType=e,t.exports.writerState=r}).call(this)},5144:t=>{t.exports={initActions:function(){let t=this,e={};e.power_on={name:"Power On",options:[],callback:async function(e){t.sendCommand("system","setPowerStatus",{status:!0})}},e.power_off={name:"Power Off",options:[],callback:async function(e){t.sendCommand("system","setPowerStatus",{status:!1})}},e.volume_up={name:"Volume Up",options:[],callback:async function(e){t.sendCommand("audio","setAudioVolume",{target:"speaker",volume:"+1"})}},e.volume_down={name:"Volume Down",options:[],callback:async function(e){t.sendCommand("audio","setAudioVolume",{target:"speaker",volume:"-1"})}},e.volume_mute={name:"Volume Mute",options:[],callback:async function(e){t.sendCommand("audio","setAudioMute",{status:!0})}},e.volume_unmute={name:"Volume Unmute",options:[],callback:async function(e){t.sendCommand("audio","setAudioMute",{status:!1})}},e.change_external_input={name:"Change External Input",options:[{type:"dropdown",label:"Kind",id:"kind",choices:[{id:"hdmi",label:"HDMI"},{id:"composite",label:"Composite"},{id:"scart",label:"SCART"}]},{type:"dropdown",label:"Port",id:"port",choices:[{id:"1",label:"1"},{id:"2",label:"2"},{id:"3",label:"3"},{id:"4",label:"4"}]}],callback:async function(e){let n=e.options,r={uri:"extInput:"+n.kind+"?port="+n.port};t.sendCommand("avContent","setPlayContent",r)}},t.setActionDefinitions(e)}}},5965:(t,e,n)=>{const{InstanceStatus:r}=n(8049),i=n(9646).K;t.exports={initConnection:function(){let t=this;t.updateStatus(r.Ok),t.sendCommand("avContent","getCurrentExternalInputsStatus",{},"allinputs"),t.getInformation(),t.setupInterval()},setupInterval:function(){let t=this;t.stopInterval(),t.config.interval>0&&(t.INTERVAL=setInterval(t.getInformation.bind(t),t.config.interval),t.log("info","Starting Update Interval: Every "+t.config.interval+"ms"))},stopInterval:function(){let t=this;null!==t.INTERVAL&&(t.log("info","Stopping Update Interval."),clearInterval(t.INTERVAL),t.INTERVAL=null)},getInformation:async function(){let t=this;t.sendCommand("system","getPowerStatus",{},"power"),t.sendCommand("audio","getVolumeInformation",{},"volume"),t.sendCommand("avContent","getPlayingContentInfo",{},"input")},sendCommand:function(t,e,n,r=void 0){let s=this,o={};if(o.method=e,o.version="1.0",o.id=1,"{}"==JSON.stringify(n)?o.params=[]:o.params=[n],void 0!==s.config.psk&&""!==s.config.psk){let e={data:o,headers:{"Content-Type":"application/json","X-Auth-PSK":s.config.psk}};(new i).post(`http://${s.config.host}/sony/${t}`,e,(function(t,e){try{if(200==e.statusCode){if(r)switch(r){case"allinputs":s.DATA.inputs=t.result[0],s.buildInputList(),s.initFeedbacks();break;case"power":s.DATA.powerState="active"===t.result[0].status;break;case"volume":s.DATA.volumeLevel=t.result[0][0].volume,s.DATA.muteState=t.result[0][0].mute;break;case"input":s.DATA.input=t.result[0].uri}s.checkFeedbacks(),s.checkVariables()}else 403==e.statusCode&&(s.log("error","PSK may be incorrect. Please check your PSK and try again."),s.stopInterval())}catch(t){s.log("error","Error processing response: "+t)}})).on("error",(function(t){s.log("error","Error Sending Command "+t.toString())}))}else s.config.verbose&&s.log("debug","No PSK set. Not sending command.")},buildInputList:function(){let t=this;t.CHOICES_INPUTS=[];for(let e=0;e{const{Regex:r}=n(8049);t.exports={getConfigFields:()=>[{type:"static-text",id:"info",width:12,label:"Information",value:"This module controls Sony Bravia TVs. The TV will need to be configured with a Pre Shared Key (PSK)."},{type:"textinput",id:"host",label:"Target IP",width:6,regex:r.IP},{type:"textinput",id:"psk",label:"Pre Shared Key (PSK)",width:6},{type:"checkbox",id:"polling",label:"Enable Polling",width:12},{type:"static-text",id:"intervalInfo",width:9,label:"Update Interval",value:"Please enter the amount of time in milliseconds to request new information from the device.",isVisible:t=>1==t.polling},{type:"textinput",id:"interval",label:"Update Interval",width:3,default:1e3,isVisible:t=>1==t.polling},{type:"static-text",id:"info2",label:"Verbose Logging",width:12,value:'\n\t\t\t\t\t
\n\t\t\t\t\t\tEnabling this option will put more detail in the log, which can be useful for troubleshooting purposes.\n\t\t\t\t\t
\n\t\t\t\t'},{type:"checkbox",id:"verbose",label:"Enable Verbose Logging",default:!1}]}},7417:(t,e,n)=>{const{combineRgb:r}=n(8049);t.exports={initFeedbacks:function(){let t=this,e={};r(255,255,255),r(255,0,0),e.powerStatus={type:"boolean",name:"TV Power is in X State",description:"Show feedback for Power State",options:[{type:"dropdown",label:"State",id:"state",default:!0,choices:[{id:!0,label:"On"},{id:!1,label:"Off"}]}],defaultStyle:{color:r(0,0,0),bgcolor:r(255,0,0)},callback:e=>{let n=e.options;return t.DATA.powerState==n.state}},e.muteStatus={type:"boolean",name:"TV Mute is in X State",description:"Show feedback for Mute State",options:[{type:"dropdown",label:"State",id:"state",default:!0,choices:[{id:!0,label:"On"},{id:!1,label:"Off"}]}],defaultStyle:{color:r(0,0,0),bgcolor:r(255,0,0)},callback:e=>{let n=e.options;return t.DATA.muteState==n.state}},e.currentInput={type:"boolean",name:"TV Input Matches Selected Input",description:"Show feedback for TV Input",options:[{type:"dropdown",label:"Input",id:"input",default:t.CHOICES_INPUTS[0].id,choices:t.CHOICES_INPUTS}],defaultStyle:{color:r(0,0,0),bgcolor:r(255,0,0)},callback:e=>{let n=e.options;return t.DATA.input==n.input}},t.setFeedbackDefinitions(e)}}},3125:(t,e,n)=>{const{combineRgb:r}=n(8049);t.exports={initPresets:function(){r(255,255,255),r(0,0,0),r(255,0,0),r(0,255,0),this.setPresetDefinitions([])}}},4556:t=>{t.exports=[function(t,e){return{updatedConfig:null,updatedActions:[],updatedFeedbacks:[]}}]},4049:t=>{t.exports={initVariables:function(){let t=[];t.push({variableId:"powerState",name:"Power State"}),t.push({variableId:"muteState",name:"Mute State"}),t.push({variableId:"volumeLevel",name:"Current Volume Level"}),t.push({variableId:"input",name:"Current Input"}),this.setVariableDefinitions(t)},checkVariables:function(){let t=this;try{t.setVariableValues({powerState:t.DATA.powerState,muteState:t.DATA.muteState,volumeLevel:t.DATA.volumeLevel,input:t.DATA.input})}catch(e){t.log("error","Error setting variables: "+e)}}}},9491:t=>{"use strict";t.exports=require("assert")},6113:t=>{"use strict";t.exports=require("crypto")},1891:t=>{"use strict";t.exports=require("dgram")},2361:t=>{"use strict";t.exports=require("events")},3292:t=>{"use strict";t.exports=require("fs/promises")},3685:t=>{"use strict";t.exports=require("http")},5687:t=>{"use strict";t.exports=require("https")},1405:t=>{"use strict";t.exports=require("inspector")},1808:t=>{"use strict";t.exports=require("net")},2037:t=>{"use strict";t.exports=require("os")},1017:t=>{"use strict";t.exports=require("path")},2781:t=>{"use strict";t.exports=require("stream")},1576:t=>{"use strict";t.exports=require("string_decoder")},9512:t=>{"use strict";t.exports=require("timers")},4404:t=>{"use strict";t.exports=require("tls")},6224:t=>{"use strict";t.exports=require("tty")},7310:t=>{"use strict";t.exports=require("url")},3837:t=>{"use strict";t.exports=require("util")},9796:t=>{"use strict";t.exports=require("zlib")},2764:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},7359:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.runEntrypoint=void 0;const r=n(6066),i=n(9913),s=r.__importDefault(n(3292)),o=n(2068),a=n(4776);n(5605);const c=n(8221),u=r.__importDefault(n(1017));let l,p=!1;e.runEntrypoint=function(t,e){Promise.resolve().then((async()=>{if(p)throw new Error("runEntrypoint can only be called once");p=!0;const n=process.env.MODULE_MANIFEST;if(!n)throw new Error("Module initialise is missing MODULE_MANIFEST");const r=await s.default.readFile(n),d=JSON.parse(r.toString());if(d.runtime?.api!==i.HostApiNodeJsIpc)throw new Error("Module manifest 'api' mismatch");if(!d.runtime.apiVersion)throw new Error("Module manifest 'apiVersion' missing");let h=d.runtime.apiVersion;if("0.0.0"===h)try{const t=await s.default.readFile(u.default.join(__dirname,"../package.json")),e=JSON.parse(t.toString());"@companion-module/base"===e.name&&(h=e.version)}catch(t){throw new Error("Failed to determine module api version")}if(!process.send)throw new Error("Module is not being run with ipc");console.log(`Starting up module class: ${t.name}`);const f=process.env.CONNECTION_ID;if("string"!=typeof f||!f)throw new Error("Module initialise is missing CONNECTION_ID");const _=process.env.VERIFICATION_TOKEN;if("string"!=typeof _||!_)throw new Error("Module initialise is missing VERIFICATION_TOKEN");const m=process.env.SENTRY_DSN,g=process.env.SENTRY_USERID,y=process.env.SENTRY_COMPANION_VERSION;m&&g&&"https://"==m.substring(0,8)?(console.log("Sentry enabled"),(0,a.init)({dsn:m,release:`${d.name}@${d.version}`,beforeSend:t=>(t.exception&&console.log("sentry","error",t.exception),t)}),(0,a.configureScope)((t=>{t.setUser({id:g}),t.setTag("companion",y)}))):console.log("Sentry disabled");const b=new c.IpcWrapper({},(t=>{process.send(t)}),5e3);process.once("message",(t=>{b.receivedMessage(t)})),l=new t((0,o.literal)({id:f,upgradeScripts:e,_isInstanceBaseProps:!0})),b.sendWithCb("register",{apiVersion:h,connectionId:f,verificationToken:_}).then((()=>{console.log("Module-host accepted registration")}),(t=>{console.error("Module registration failed",t),process.exit(11)}))})).catch((t=>{console.error("Failed to startup module:"),console.error(t.stack||t.message),process.exit(1)}))}},1972:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UDPHelper=e.TelnetHelper=e.TCPHelper=void 0;var r=n(9159);Object.defineProperty(e,"TCPHelper",{enumerable:!0,get:function(){return r.TCPHelper}});var i=n(6226);Object.defineProperty(e,"TelnetHelper",{enumerable:!0,get:function(){return i.TelnetHelper}});var s=n(8473);Object.defineProperty(e,"UDPHelper",{enumerable:!0,get:function(){return s.UDPHelper}})},9159:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TCPHelper=void 0;const r=n(6066).__importDefault(n(1808)),i=n(6729),s=n(609);class o extends i.EventEmitter{#t;#e;_socket;#n;#r=!1;#i=!1;#s=!1;#o;#a;get isConnected(){return this.#r}get isConnecting(){return this.#i}get isDestroyed(){return this.#s}constructor(t,e,n){super(),this.#t=t,this.#e=e,this.#n={reconnect_interval:2e3,reconnect:!0,...n},this._socket=new r.default.Socket,this._socket.setKeepAlive(!0),this._socket.setNoDelay(!0),this._socket.on("error",(t=>{this.#i=!1,this.#r=!1,this.#n.reconnect&&this.#c(),this.#u(s.InstanceStatus.UnknownError,t.message),this.emit("error",t)})),this._socket.on("ready",(()=>{this.#r=!0,this.#i=!1,this.#u(s.InstanceStatus.Ok),this.emit("connect")})),this._socket.on("end",(()=>{this.#r=!1,this.#u(s.InstanceStatus.Disconnected),!this.#i&&this.#n.reconnect&&this.#c(),this.emit("end")})),this._socket.on("data",(t=>this.emit("data",t))),this._socket.on("drain",(()=>this.emit("drain"))),setImmediate((()=>this.connect())),setTimeout((()=>{this.#s||this.listenerCount("error")||console.error(`Danger: TCP client for ${this.#t}:${this.#e} is missing an error handler!`)}),5e3)}connect(){if(this.#s)throw new Error("Cannot connect destroyed socket");return!this.#i&&(this.#i=!0,this._socket.connect(this.#e,this.#t),!0)}async send(t){if(this.#s||this._socket.destroyed)throw new Error("Cannot write to destroyed socket");if(!t||!t.length)throw new Error("No message to send");if(!this.#r)return!1;try{return new Promise(((e,n)=>{this._socket.write(t,(t=>{t?n(t):e(!0)}))}))}catch(t){this.#r=!1;const e=t instanceof Error?t:new Error(`${t}`);throw this.#u(s.InstanceStatus.UnknownError,e.message),this.emit("error",e),e}}destroy(){this.#s=!0,void 0!==this.#a&&clearTimeout(this.#a),this._socket.removeAllListeners(),this.removeAllListeners(),this._socket.destroy()}#c(){void 0!==this.#a&&clearTimeout(this.#a),this.#a=setTimeout((()=>{this.#a=void 0,this.#u(s.InstanceStatus.Connecting),this.connect()}),this.#n.reconnect_interval)}#u(t,e){this.#o!=t&&(this.#o=t,this.emit("status_change",t,e))}}e.TCPHelper=o},6226:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TelnetHelper=void 0;const r=n(6066).__importDefault(n(6729)),i=n(2781),s=n(9159);class o extends r.default{#l;#p;get isConnected(){return this.#l.isConnected}get isConnecting(){return this.#l.isConnecting}get isDestroyed(){return this.#l.isDestroyed}constructor(t,e,n){super(),this.#l=new s.TCPHelper(t,e,n),this.#p=new a,this.#l._socket.pipe(this.#p),this.#l.on("connect",(()=>this.emit("connect"))),this.#l.on("end",(()=>this.emit("end"))),this.#l.on("error",(t=>this.emit("error",t))),this.#l.on("status_change",((t,e)=>this.emit("status_change",t,e))),this.#p.on("iac",((t,e)=>this.emit("iac",t,e))),this.#p.on("sb",(t=>this.emit("sb",t))),this.#p.on("data",(t=>this.emit("data",t))),this.#p.on("drain",(()=>this.emit("drain"))),setTimeout((()=>{this.isDestroyed||this.listenerCount("error")||console.error(`Danger: Telnet client for ${t}:${e} is missing an error handler!`)}),5e3)}connect(){return this.#l.connect()}async send(t){return this.#l.send(t)}destroy(){this.#l.destroy(),this.#p.removeAllListeners(),this.#p.destroy()}}e.TelnetHelper=o;class a extends i.Transform{#d;#h;#f;constructor(t){super(t),this.#d=Buffer.alloc(0),this.#h=Buffer.alloc(0),this.#f=0}_transform(t,e,n){for(let e=0;e=251&&this.#f<=254){let e;switch(this.#f){case 251:e="WILL";break;case 252:e="WONT";break;case 253:e="DO";break;case 254:e="DONT";break;default:return}return this.emit("iac",e,t),void(this.#f=0)}if(250===this.#f){if(240===t)return this.emit("sb",this.#h),this.#f=0,void(this.#h=Buffer.alloc(0));this.#h=Buffer.concat([this.#h,Buffer.from([t])])}}}#m(){const t=this.#d;return this.#d=Buffer.alloc(0),t}}},8473:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UDPHelper=void 0;const r=n(6066).__importDefault(n(1891)),i=n(6729),s=n(609);class o extends i.EventEmitter{#t;#e;#g;#n;#s=!1;#o;get isDestroyed(){return this.#s}constructor(t,e,n){super(),this.#t=t,this.#e=e,this.#n={...n},this.#g=r.default.createSocket("udp4");try{this.#g.bind(this.#n.bind_port||0,this.#n.bind_ip)}catch(t){throw new Error(`Unable to bind to ip/port: ${this.#n.bind_ip}:${this.#n.bind_port}`)}this.#n.broadcast&&this.#g.setBroadcast(!0),void 0!==this.#n.ttl&&this.#g.setTTL(this.#n.ttl),void 0!==this.#n.multicast_ttl&&this.#g.setMulticastTTL(this.#n.multicast_ttl),this.#g.on("error",(t=>{this.#u(s.InstanceStatus.UnknownError,t.message),this.emit("error",t)})),this.#g.on("listening",(()=>{this.#n.multicast_interface&&this.#g.setMulticastInterface(this.#n.multicast_interface),this.#u(s.InstanceStatus.Ok),this.emit("listening")})),this.#g.on("message",(t=>this.emit("data",t))),setTimeout((()=>{this.#s||this.listenerCount("error")||console.error(`Danger: UDP socket for ${this.#t}:${this.#e} is missing an error handler!`)}),5e3)}async send(t){if(this.#s)throw new Error("Cannot write to destroyed socket");if(!t||!t.length)throw new Error("No message to send");return new Promise(((e,n)=>{this.#g.send(t,this.#e,this.#t,(t=>{t?n(t):e()}))}))}destroy(){this.#s=!0,this.#g.removeAllListeners(),this.#g.close(),this.removeAllListeners()}#u(t,e){this.#o!=t&&(this.#o=t,this.emit("status_change",t,e))}}e.UDPHelper=o},8221:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IpcWrapper=void 0;const r=n(6066),i=n(4300),s=n(2068),o=r.__importDefault(n(2559));e.IpcWrapper=class{#y;#b;#v;#E={};constructor(t,e,n){this.#y=t,this.#b=e,this.#v=n}async sendWithCb(t,e,n,r=0){r<=0&&(r=this.#v);const s={timeout:void 0,resolve:()=>null,reject:()=>null},a=new Promise(((t,e)=>{s.resolve=t,s.reject=e})),c=(0,i.nanoid)();this.#E[c]=s,this.#b({direction:"call",name:String(t),payload:o.default.stringify(e),callbackId:c});const u=new Error("Call timed out");return s.timeout=setTimeout((()=>{s.reject(n?n():u),delete this.#E[c]}),r),a}sendWithNoCb(t,e){this.#b({direction:"call",name:String(t),payload:o.default.stringify(e),callbackId:void 0})}receivedMessage(t){const e=t;switch(t.direction){case"call":{const e=this.#y[t.name];if(!e)return void(t.callbackId&&this.#b({direction:"response",callbackId:t.callbackId,success:!1,payload:o.default.stringify({message:`Unknown command "${t.name}"`})}));e(t.payload?o.default.parse(t.payload):void 0).then((e=>{t.callbackId&&this.#b({direction:"response",callbackId:t.callbackId,success:!0,payload:o.default.stringify(e)})}),(e=>{t.callbackId&&this.#b({direction:"response",callbackId:t.callbackId,success:!1,payload:e instanceof Error?JSON.stringify(e,Object.getOwnPropertyNames(e)):o.default.stringify(e)})}));break}case"response":{if(!t.callbackId)return void console.error("Ipc: Response message has no callbackId");const e=this.#E[t.callbackId];if(delete this.#E[t.callbackId],!e)return;clearTimeout(e.timeout);const n=t.payload?o.default.parse(t.payload):void 0;if(t.success)e.resolve(n);else{let t=n;n&&"message"in n&&(t=new Error(n.message),n.stack&&(t.stack=n.stack)),e.reject(t)}break}default:(0,s.assertNever)(t),console.error(`Ipc: Message of unknown direction "${e.direction}"`)}}}},9913:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.HostApiNodeJsIpc=void 0,e.HostApiNodeJsIpc="nodejs-ipc"},8049:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.runEntrypoint=e.assertNever=e.splitRgb=e.combineRgb=e.literal=void 0;const r=n(6066);r.__exportStar(n(7517),e),r.__exportStar(n(4911),e),r.__exportStar(n(2764),e);var i=n(2068);Object.defineProperty(e,"literal",{enumerable:!0,get:function(){return i.literal}}),Object.defineProperty(e,"combineRgb",{enumerable:!0,get:function(){return i.combineRgb}}),Object.defineProperty(e,"splitRgb",{enumerable:!0,get:function(){return i.splitRgb}}),Object.defineProperty(e,"assertNever",{enumerable:!0,get:function(){return i.assertNever}}),r.__exportStar(n(1972),e);var s=n(7359);Object.defineProperty(e,"runEntrypoint",{enumerable:!0,get:function(){return s.runEntrypoint}})},4391:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ActionManager=void 0;const r=n(2557);function i(t){return{id:t.id,actionId:t.actionId,controlId:t.controlId,options:t.options}}e.ActionManager=class{#w;#T;#S;#I=new Map;#x=new Map;constructor(t,e,n){this.#w=t,this.#T=e,this.#S=n}async handleExecuteAction(t){const e=this.#I.get(t.action.actionId);if(!e)throw new Error(`Unknown action: ${t.action.actionId}`);const n={parseVariablesInString:async e=>(await this.#w({text:e,controlId:t.action.controlId,actionInstanceId:t.action.id,feedbackInstanceId:void 0})).text};await e.callback({id:t.action.id,actionId:t.action.actionId,controlId:t.action.controlId,options:t.action.options,surfaceId:t.surfaceId??t.deviceId,_deviceId:t.surfaceId??t.deviceId,_page:t.action.page,_bank:t.action.bank},n)}handleUpdateActions(t){for(const[e,n]of Object.entries(t)){const t=this.#x.get(e);if(t){const e=this.#I.get(t.actionId);if(e?.unsubscribe){const n={parseVariablesInString:async e=>(await this.#w({text:e,controlId:t.controlId,actionInstanceId:t.id,feedbackInstanceId:void 0})).text};Promise.resolve(e.unsubscribe(i(t),n)).catch((e=>{this.#S("error",`Action unsubscribe failed: ${JSON.stringify(t)} - ${e?.message??e} ${e?.stack}`)}))}}if(!n||n.disabled)this.#x.delete(e);else{this.#x.set(e,n);const t=this.#I.get(n.actionId);if(t?.subscribe){const e={parseVariablesInString:async t=>(await this.#w({text:t,controlId:n.controlId,actionInstanceId:n.id,feedbackInstanceId:void 0})).text};Promise.resolve(t.subscribe(i(n),e)).catch((t=>{this.#S("error",`Action subscribe failed: ${JSON.stringify(n)} - ${t?.message??t} ${t?.stack}`)}))}}}}async handleLearnAction(t){const e=this.#I.get(t.action.actionId);if(e&&e.learn){const n={parseVariablesInString:async e=>(await this.#w({text:e,controlId:t.action.controlId,actionInstanceId:t.action.id,feedbackInstanceId:void 0})).text};return{options:await e.learn({id:t.action.id,actionId:t.action.actionId,controlId:t.action.controlId,options:t.action.options,surfaceId:void 0,_deviceId:void 0,_page:t.action.page,_bank:t.action.bank},n)}}return{options:void 0}}setActionDefinitions(t){const e=[];this.#I.clear();for(const[n,i]of Object.entries(t))i&&(e.push({id:n,name:i.name,description:i.description,options:(0,r.serializeIsVisibleFn)(i.options),hasLearn:!!i.learn}),this.#I.set(n,i));this.#T({actions:e})}_getAllActions(){return Array.from(this.#x.values()).map((t=>({id:t.id,actionId:t.actionId,controlId:t.controlId,options:t.options})))}subscribeActions(t){let e=Array.from(this.#x.values());const n=new Set(t);n.size&&(e=e.filter((t=>n.has(t.actionId))));for(const t of e){const e=this.#I.get(t.actionId);if(e?.subscribe){const n={parseVariablesInString:async e=>(await this.#w({text:e,controlId:t.controlId,actionInstanceId:t.id,feedbackInstanceId:void 0})).text};Promise.resolve(e.subscribe(i(t),n)).catch((e=>{this.#S("error",`Action subscribe failed: ${JSON.stringify(t)} - ${e?.message??e} ${e?.stack}`)}))}}}unsubscribeActions(t){let e=Array.from(this.#x.values());const n=new Set(t);n.size&&(e=e.filter((t=>n.has(t.actionId))));for(const t of e){const e=this.#I.get(t.actionId);if(e&&e.unsubscribe){const n={parseVariablesInString:async e=>(await this.#w({text:e,controlId:t.controlId,actionInstanceId:t.id,feedbackInstanceId:void 0})).text};Promise.resolve(e.unsubscribe(i(t),n)).catch((e=>{this.#S("error",`Action unsubscribe failed: ${JSON.stringify(t)} - ${e?.message??e} ${e?.stack}`)}))}}}}},2557:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isInstanceBaseProps=e.serializeIsVisibleFn=void 0,e.serializeIsVisibleFn=function(t){return t.map((t=>"isVisible"in t&&"function"==typeof t.isVisible?{...t,isVisibleFn:t.isVisible.toString(),isVisible:void 0}:{...t,isVisibleFn:void 0}))},e.isInstanceBaseProps=function(t){const e=t;return"object"==typeof e&&"string"==typeof e.id&&!0===e._isInstanceBaseProps}},7550:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FeedbackManager=void 0;const r=n(6066),i=n(2557),s=r.__importDefault(n(7319));function o(t,e){return{type:t,id:e.id,feedbackId:e.feedbackId,controlId:e.controlId,options:e.options}}e.FeedbackManager=class{#w;#O;#D;#S;#N=new Map;#C=new Map;#k=new Map;#A=new Map;#R;get parseVariablesContext(){return this.#R}constructor(t,e,n,r){this.#w=t,this.#O=e,this.#D=n,this.#S=r}getDefinitionIds(){return Array.from(this.#N.keys())}getInstanceIds(){return Array.from(this.#C.keys())}handleUpdateFeedbacks(t){for(const[e,n]of Object.entries(t)){const t=this.#C.get(e);if(t){const e=this.#N.get(t.feedbackId);if(e?.unsubscribe){const n={parseVariablesInString:async e=>(await this.#w({text:e,controlId:t.controlId,actionInstanceId:void 0,feedbackInstanceId:t.id})).text};Promise.resolve(e.unsubscribe(o(e.type,t),n)).catch((e=>{this.#S("error",`Feedback unsubscribe failed: ${JSON.stringify(t)} - ${e?.message??e} ${e?.stack}`)}))}}if(!n||n.disabled)this.#C.delete(e);else{this.#C.set(e,{...n,referencedVariables:null});const t=this.#N.get(n.feedbackId);if(t?.subscribe){const e={parseVariablesInString:async t=>(await this.#w({text:t,controlId:n.controlId,actionInstanceId:void 0,feedbackInstanceId:n.id})).text};Promise.resolve(t.subscribe(o(t.type,n),e)).catch((t=>{this.#S("error",`Feedback subscribe failed: ${JSON.stringify(n)} - ${t?.message??t} ${t?.stack}`)}))}this.#P(e)}}}async handleLearnFeedback(t){const e=this.#N.get(t.feedback.feedbackId);if(e&&e.learn){const n={parseVariablesInString:async e=>(await this.#w({text:e,controlId:t.feedback.controlId,actionInstanceId:void 0,feedbackInstanceId:t.feedback.id})).text};return{options:await e.learn({id:t.feedback.id,feedbackId:t.feedback.feedbackId,controlId:t.feedback.controlId,options:t.feedback.options,type:e.type},n)}}return{options:void 0}}handleVariablesChanged(t){if(!t.variablesIds.length)return;const e=new Set(t.variablesIds);for(const e of this.#A.values())for(const n of t.variablesIds)e.changedVariables.add(n);const n=new Set;for(const t of this.#C.values())if(!this.#A.has(t.id)&&t.referencedVariables)for(const r of t.referencedVariables)if(e.has(r)){n.add(t.id);break}for(const t of n)setImmediate((()=>{this.#P(t)}))}#P(t){const e=this.#A.get(t);if(e)return void(e.needsRecheck=!0);const n=this.#C.get(t);if(!n)return;const r=n,i={needsRecheck:!1,changedVariables:new Set};this.#A.set(t,i),Promise.resolve().then((async()=>{const e=this.#N.get(r.feedbackId);let n;const i=new Set;if(e){this.#R=`Feedback ${r.feedbackId} (${t})`;const s={parseVariablesInString:async e=>{const n=await this.#w({text:e,controlId:r.controlId,actionInstanceId:void 0,feedbackInstanceId:t});if(n.variableIds&&n.variableIds.length)for(const t of n.variableIds)i.add(t);return n.text}};n="boolean"===e.type?e.callback({...o("boolean",r),type:"boolean",_rawBank:r.rawBank},s):e.callback({...o("advanced",r),type:"advanced",image:r.image,_page:r.page,_bank:r.bank,_rawBank:r.rawBank},s),this.#R=void 0}const s=await n;this.#k.set(t,{id:t,controlId:r.controlId,value:s}),this.#U(),r.referencedVariables=i.size>0?Array.from(i):null})).catch((t=>{console.error(`Feedback check failed: ${JSON.stringify(r)} - ${t?.message??t} ${t?.stack}`)})).finally((()=>{this.#R=void 0,this.#A.delete(t);let e=!1;if(r.referencedVariables)for(const t of r.referencedVariables)if(i.changedVariables.has(t)){e=!0;break}(e||i.needsRecheck)&&setImmediate((()=>{this.#P(t)}))}))}#U=(0,s.default)((()=>{const t=this.#k;this.#k=new Map,t.size>0&&this.#O({values:Array.from(t.values())})}),{wait:5,maxWait:25});setFeedbackDefinitions(t){const e=[];this.#N.clear();for(const[n,r]of Object.entries(t))r&&(e.push({id:n,name:r.name,description:r.description,options:(0,i.serializeIsVisibleFn)(r.options),type:r.type,defaultStyle:"defaultStyle"in r?r.defaultStyle:void 0,hasLearn:!!r.learn}),this.#N.set(n,r));this.#D({feedbacks:e})}checkFeedbacks(t){const e=new Set(t);for(const[t,n]of this.#C.entries())this.#N.get(n.feedbackId)&&(0===e.size||e.has(n.feedbackId))&&this.#P(t)}checkFeedbacksById(t){for(const e of t)this.#P(e)}_getAllFeedbacks(){return Array.from(this.#C.values()).map((t=>({id:t.id,feedbackId:t.feedbackId,controlId:t.controlId,options:t.options})))}subscribeFeedbacks(t){let e=Array.from(this.#C.values());const n=new Set(t);n.size&&(e=e.filter((t=>n.has(t.feedbackId))));for(const t of e){const e=this.#N.get(t.feedbackId);if(e?.subscribe){const n={parseVariablesInString:async e=>(await this.#w({text:e,controlId:t.controlId,actionInstanceId:void 0,feedbackInstanceId:t.id})).text};Promise.resolve(e.subscribe(o(e.type,t),n)).catch((e=>{this.#S("error",`Feedback subscribe failed: ${JSON.stringify(t)} - ${e?.message??e} ${e?.stack}`)}))}}}unsubscribeFeedbacks(t){let e=Array.from(this.#C.values());const n=new Set(t);n.size&&(e=e.filter((t=>n.has(t.feedbackId))));for(const t of e){const e=this.#N.get(t.feedbackId);if(e&&e.unsubscribe){const n={parseVariablesInString:async e=>(await this.#w({text:e,controlId:t.controlId,actionInstanceId:void 0,feedbackInstanceId:t.id})).text};Promise.resolve(e.unsubscribe(o(e.type,t),n)).catch((e=>{this.#S("error",`Feedback unsubscribe failed: ${JSON.stringify(t)} - ${e?.message??e} ${e?.stack}`)}))}}}}},1806:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.runThroughUpgradeScripts=void 0;const r=n(2068);function i(t){return JSON.parse(JSON.stringify(t))}e.runThroughUpgradeScripts=function(t,e,n,s,o,a){const c=new Map,u=t=>{let e=c.get(t);return e||(e={actions:[],feedbacks:[],config:!1},c.set(t,e)),e};for(const e of Object.values(t)){const t=e?.upgradeIndex??n;e&&"number"==typeof t&&u(t).actions.push(e.id)}for(const t of Object.values(e)){const e=t?.upgradeIndex??n;t&&"number"==typeof e&&u(e).feedbacks.push(t.id)}if(!a)for(let t=n??-1;t0){const a=Array.from(c.keys()).sort(),u=Math.min(...a,n??-1)+1,h=[],f=[],_=s.length;for(let n=u;n<_;n++){const a=c.get(n-1);a&&(h.push(...a.actions),f.push(...a.feedbacks));const u=!!a?.config;if(!u&&0===h.length&&0===f.length)continue;const _=d??o,m=(0,s[n])({currentConfig:i(_)},{config:u?_:null,actions:h.map((e=>{const n=t[e];if(n)return(0,r.literal)({id:n.id,controlId:n.controlId,actionId:n.actionId,options:void 0!==n.options?i(n.options):{}})})).filter((t=>!!t)),feedbacks:f.map((t=>{const n=e[t];if(n)return(0,r.literal)({id:n.id,controlId:n.controlId,feedbackId:n.feedbackId,options:void 0!==n.options?i(n.options):{}})})).filter((t=>!!t))});u&&m.updatedConfig&&(d=m.updatedConfig);for(const e of m.updatedActions)if(e){const n=t[e.id];n&&(n.actionId=e.actionId,n.options=e.options,p[e.id]=n)}for(const t of m.updatedFeedbacks)if(t){const n=e[t.id];n&&(n.feedbackId=t.feedbackId,n.options=t.options,l[t.id]={...n,style:l[t.id]?.style??t.style})}}for(const[e,n]of Object.entries(t))p[e]||"number"!=typeof n?.upgradeIndex||(p[e]=n);for(const[t,n]of Object.entries(e))l[t]||"number"!=typeof n?.upgradeIndex||(l[t]=n)}return{updatedActions:p,updatedFeedbacks:l,updatedConfig:d}}},7517:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.validateManifest=void 0;const r=n(6066).__importDefault(n(4618));e.validateManifest=function(t){if(!(0,r.default)(t)){const t=r.default.errors;if(!t)throw new Error("Manifest failed validation with unknown reason");throw new Error(`Manifest validation failed: ${JSON.stringify(t)}`)}}},8322:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},5203:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.InstanceBase=void 0;const r=n(6066),i=n(2068),s=r.__importDefault(n(5860)),o=n(2557),a=n(1806),c=n(7550),u=n(8221),l=n(4391);e.InstanceBase=class{#j;#M;id;#F=new s.default({concurrency:1});#B=!1;#L=!1;#$={};#G;#q;#Y=new Map;#V=new Map;#n;#H;get instanceOptions(){return this.#n}get label(){return this.#H}constructor(t){if(!(0,o.isInstanceBaseProps)(t)||!t._isInstanceBaseProps)throw new Error("Module instance is being constructed incorrectly. Make sure you aren't trying to do this manually");this.#n={disableVariableValidation:!1},this.#j=new u.IpcWrapper({init:this._handleInit.bind(this),destroy:this._handleDestroy.bind(this),updateConfigAndLabel:this._handleConfigUpdateAndLabel.bind(this),updateConfig:async()=>{},executeAction:this._handleExecuteAction.bind(this),updateFeedbacks:this._handleUpdateFeedbacks.bind(this),updateActions:this._handleUpdateActions.bind(this),getConfigFields:this._handleGetConfigFields.bind(this),handleHttpRequest:this._handleHttpRequest.bind(this),learnAction:this._handleLearnAction.bind(this),learnFeedback:this._handleLearnFeedback.bind(this),startStopRecordActions:this._handleStartStopRecordActions.bind(this),variablesChanged:this._handleVariablesChanged.bind(this)},(t=>{process.send(t)}),5e3),process.on("message",(t=>{this.#j.receivedMessage(t)})),this.#G=new l.ActionManager((async t=>this.#j.sendWithCb("parseVariablesInString",t)),(t=>this.#j.sendWithNoCb("setActionDefinitions",t)),this.log.bind(this)),this.#q=new c.FeedbackManager((async t=>this.#j.sendWithCb("parseVariablesInString",t)),(t=>this.#j.sendWithNoCb("updateFeedbackValues",t)),(t=>this.#j.sendWithNoCb("setFeedbackDefinitions",t)),this.log.bind(this)),this.#M=t.upgradeScripts,this.id=t.id,this.#H=t.id,this.log("debug","Initializing")}async _handleInit(t){return this.#F.add((async()=>{if(this.#B)throw new Error("Already initialized");const e=t.actions,n=t.feedbacks;if(this.#$=t.config,this.#H=t.label,t.isFirstInit){const e={},n=this.getConfigFields();for(const t of n)"default"in t&&(e[t.id]=t.default);this.#$=e,this.saveConfig(this.#$),t.lastUpgradeIndex=this.#M.length-1}const{updatedActions:r,updatedFeedbacks:i,updatedConfig:s}=(0,a.runThroughUpgradeScripts)(e,n,t.lastUpgradeIndex,this.#M,this.#$,!1);this.#$=s??this.#$;const o=this.#j.sendWithCb("upgradedItems",{updatedActions:r,updatedFeedbacks:i});try{await this.init(this.#$,!!t.isFirstInit),this.#B=!0}catch(t){throw console.trace(`Init failed: ${t}`),t}finally{await o}return setImmediate((()=>{this._handleUpdateActions({actions:e},!0).catch((t=>{this.log("error",`Receive actions failed: ${t}`)})),this._handleUpdateFeedbacks({feedbacks:n},!0).catch((t=>{this.log("error",`Receive feedbacks failed: ${t}`)}))})),{hasHttpHandler:"function"==typeof this.handleHttpRequest,hasRecordActionsHandler:"function"==typeof this.handleStartStopRecordActions,newUpgradeIndex:this.#M.length-1,updatedConfig:this.#$}}))}async _handleDestroy(){await this.#F.add((async()=>{if(!this.#B)throw new Error("Not initialized");await this.destroy(),this.#B=!1}))}async _handleConfigUpdateAndLabel(t){await this.#F.add((async()=>{if(!this.#B)throw new Error("Not initialized");this.#H=t.label,this.#$=t.config,await this.configUpdated(this.#$)}))}async _handleExecuteAction(t){return this.#G.handleExecuteAction(t)}async _handleUpdateFeedbacks(t,e){if(!e){const e=(0,a.runThroughUpgradeScripts)({},t.feedbacks,null,this.#M,this.#$,!0);this.#j.sendWithCb("upgradedItems",{updatedActions:e.updatedActions,updatedFeedbacks:e.updatedFeedbacks}).catch((t=>{this.log("error",`Failed to save upgraded feedbacks: ${t}`)}))}this.#q.handleUpdateFeedbacks(t.feedbacks)}async _handleUpdateActions(t,e){if(!e){const e=(0,a.runThroughUpgradeScripts)(t.actions,{},null,this.#M,this.#$,!0);this.#j.sendWithCb("upgradedItems",{updatedActions:e.updatedActions,updatedFeedbacks:e.updatedFeedbacks}).catch((t=>{this.log("error",`Failed to save upgraded actions: ${t}`)}))}this.#G.handleUpdateActions(t.actions)}async _handleGetConfigFields(t){return{fields:(0,o.serializeIsVisibleFn)(this.getConfigFields())}}async _handleHttpRequest(t){if(!this.handleHttpRequest)throw new Error("handleHttpRequest is not supported!");return{response:await this.handleHttpRequest(t.request)}}async _handleLearnAction(t){return this.#G.handleLearnAction(t)}async _handleLearnFeedback(t){return this.#q.handleLearnFeedback(t)}async _handleStartStopRecordActions(t){if(t.recording){if(this.#L)return}else if(!this.#L)return;if(!this.handleStartStopRecordActions)throw this.#L=!1,new Error("Recording actions is not supported by this module!");this.#L=t.recording,this.handleStartStopRecordActions(this.#L)}async _handleVariablesChanged(t){this.#q.handleVariablesChanged(t)}saveConfig(t){this.#$=t,this.#j.sendWithNoCb("saveConfig",{config:t})}setActionDefinitions(t){this.#G.setActionDefinitions(t)}setFeedbackDefinitions(t){this.#q.setFeedbackDefinitions(t)}setPresetDefinitions(t){const e=[];for(const[n,r]of Object.entries(t))r&&e.push({...r,id:n});this.#j.sendWithNoCb("setPresetDefinitions",{presets:e})}setVariableDefinitions(t){const e=[];this.#Y.clear();for(const n of t)e.push({id:n.variableId,name:n.name}),this.#Y.set(n.variableId,n),this.#V.has(n.variableId)||this.#V.set(n.variableId,"");if(!this.#n.disableVariableValidation){const t=new Set(this.#Y.keys());for(const e of this.#V.keys())t.has(e)||this.#V.delete(e)}this.#j.sendWithNoCb("setVariableDefinitions",{variables:e})}setVariableValues(t){const e=[];for(const[n,r]of Object.entries(t))this.#n.disableVariableValidation?(void 0===r?this.#V.delete(n):this.#V.set(n,r),e.push({id:n,value:r})):this.#Y.has(n)?(this.#V.set(n,r??""),e.push({id:n,value:r??""})):e.push({id:n,value:void 0});this.#j.sendWithNoCb("setVariableValues",{newValues:e})}getVariableValue(t){return this.#V.get(t)}async parseVariablesInString(t){const e=this.#q.parseVariablesContext;return e&&this.log("debug",`parseVariablesInString called while in: ${e}. You should use the parseVariablesInString provided to the callback instead`),(await this.#j.sendWithCb("parseVariablesInString",{text:t,controlId:void 0,actionInstanceId:void 0,feedbackInstanceId:void 0})).text}checkFeedbacks(...t){this.#q.checkFeedbacks(t)}checkFeedbacksById(...t){this.#q.checkFeedbacksById(t)}_getAllActions(){return this.#G._getAllActions()}subscribeActions(...t){this.#G.subscribeActions(t)}unsubscribeActions(...t){this.#G.unsubscribeActions(t)}_getAllFeedbacks(){return this.#q._getAllFeedbacks()}subscribeFeedbacks(...t){this.#q.subscribeFeedbacks(t)}unsubscribeFeedbacks(...t){this.#q.unsubscribeFeedbacks(t)}recordAction(t,e){if(!this.#L)throw new Error("Not currently recording actions");this.#j.sendWithNoCb("recordAction",{uniquenessId:e??null,actionId:t.actionId,options:t.options})}setCustomVariableValue(t,e){this.#j.sendWithNoCb("setCustomVariable",{customVariableId:t,value:e})}oscSend(t,e,n,r){this.#j.sendWithNoCb("send-osc",(0,i.literal)({host:t,port:e,path:n,args:r}))}updateStatus(t,e){this.#j.sendWithNoCb("set-status",(0,i.literal)({status:t,message:e??null}))}log(t,e){this.#j.sendWithNoCb("log-message",(0,i.literal)({level:t,message:e}))}}},9051:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},609:(t,e)=>{"use strict";var n,r;Object.defineProperty(e,"__esModule",{value:!0}),e.Regex=e.InstanceStatus=void 0,(r=e.InstanceStatus||(e.InstanceStatus={})).Ok="ok",r.Connecting="connecting",r.Disconnected="disconnected",r.ConnectionFailure="connection_failure",r.BadConfig="bad_config",r.UnknownError="unknown_error",r.UnknownWarning="unknown_warning",(n=e.Regex||(e.Regex={})).IP="/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/",n.HOSTNAME="/^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9])$/",n.BOOLEAN="/^(true|false|0|1)$/i",n.PORT="/^([1-9]|[1-8][0-9]|9[0-9]|[1-8][0-9]{2}|9[0-8][0-9]|99[0-9]|[1-8][0-9]{3}|9[0-8][0-9]{2}|99[0-8][0-9]|999[0-9]|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-4])$/",n.PERCENT="/^(100|[0-9]|[0-9][0-9])$/",n.FLOAT="/^([0-9]*\\.)?[0-9]+$/",n.SIGNED_FLOAT="/^[+-]?([0-9]*\\.)?[0-9]+$/",n.FLOAT_OR_INT="/^([0-9]+)(\\.[0-9]+)?$/",n.NUMBER="/^\\d+$/",n.SIGNED_NUMBER="/^[+-]?\\d+$/",n.SOMETHING="/^.+$/",n.TIMECODE="/^(0*[0-9]|1[0-9]|2[0-4]):(0*[0-9]|[1-5][0-9]|60):(0*[0-9]|[1-5][0-9]|60):(0*[0-9]|[12][0-9]|30)$/"},4334:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},2490:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},4911:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(6066);r.__exportStar(n(8322),e),r.__exportStar(n(5203),e),r.__exportStar(n(9051),e),r.__exportStar(n(609),e),r.__exportStar(n(4334),e),r.__exportStar(n(2490),e),r.__exportStar(n(3646),e),r.__exportStar(n(3558),e),r.__exportStar(n(4788),e),r.__exportStar(n(521),e),r.__exportStar(n(6870),e)},3646:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},3558:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},4788:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},521:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CreateConvertToBooleanFeedbackUpgradeScript=e.EmptyUpgradeScript=void 0,e.EmptyUpgradeScript=()=>({updatedConfig:null,updatedActions:[],updatedFeedbacks:[]}),e.CreateConvertToBooleanFeedbackUpgradeScript=function(t){return(e,n)=>{const r=[];for(const e of n.feedbacks){let n=t[e.feedbackId];if(!0===n&&(n={bg:"bgcolor",bgcolor:"bgcolor",fg:"color",color:"color",png64:"png64",png:"png64"}),n){e.style||(e.style={});for(const[t,i]of Object.entries(n))void 0!==e.options[t]&&(e.style[i]=e.options[t],delete e.options[t],r.push(e))}}return{updatedConfig:null,updatedActions:[],updatedFeedbacks:r}}}},6870:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},2068:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.splitRgb=e.combineRgb=e.assertNever=e.literal=void 0,e.literal=function(t){return t},e.assertNever=function(t){},e.combineRgb=function(t,e,n){return(255&t)<<16|(255&e)<<8|255&n},e.splitRgb=function(t){return{r:(16711680&t)>>16,g:(65280&t)>>8,b:255&t}}},4618:(t,e,n)=>{"use strict";t.exports=s,t.exports.default=s;const r={$schema:"http://json-schema.org/draft-07/schema#",type:"object",title:"ModuleManifest",properties:{id:{type:"string",description:"Unique identifier for the module"},name:{type:"string",description:"Name of the module"},shortname:{type:"string"},description:{type:"string",description:"Description of the module "},version:{type:"string",description:"Current version of the module"},license:{type:"string",description:"SPDX identifier for license of the module"},repository:{type:"string",description:"URL to the source repository"},bugs:{type:"string",description:"URL to bug tracker"},maintainers:{type:"array",description:"List of active maintiners",uniqueItems:!0,items:{type:"object",title:"ModuleManifestMaintainer",properties:{name:{type:"string"},email:{type:"string"},github:{type:"string"}},required:["name"]}},legacyIds:{type:"array",description:"If the module had a different unique identifier previously, then specify it here",uniqueItems:!0,items:{type:"string"}},runtime:{type:"object",title:"ModuleManifestRuntime",description:"Information on how to execute the module",properties:{type:{type:"string",description:"Type of the module. Must be: node18"},api:{type:"string",description:"Which host-api does it use. In the future alternate options will be allowed",enum:["nodejs-ipc"]},apiVersion:{type:"string",description:"The version of the host-api used"},entrypoint:{type:"string",description:"Entrypoint to pass to the runtime. eg index.js"}},required:["type","api","apiVersion","entrypoint"]},manufacturer:{type:"string"},products:{type:"array",uniqueItems:!0,items:{type:"string"}},keywords:{type:"array",uniqueItems:!0,items:{type:"string"}}},required:["id","name","shortname","description","version","license","repository","bugs","maintainers","legacyIds","runtime","manufacturer","products","keywords"]},i=n(7056).Z;function s(t,{instancePath:e="",parentData:n,parentDataProperty:o,rootData:a=t}={}){if(!t||"object"!=typeof t||Array.isArray(t))return s.errors=[{instancePath:e,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;{let n;if(void 0===t.id&&(n="id")||void 0===t.name&&(n="name")||void 0===t.shortname&&(n="shortname")||void 0===t.description&&(n="description")||void 0===t.version&&(n="version")||void 0===t.license&&(n="license")||void 0===t.repository&&(n="repository")||void 0===t.bugs&&(n="bugs")||void 0===t.maintainers&&(n="maintainers")||void 0===t.legacyIds&&(n="legacyIds")||void 0===t.runtime&&(n="runtime")||void 0===t.manufacturer&&(n="manufacturer")||void 0===t.products&&(n="products")||void 0===t.keywords&&(n="keywords"))return s.errors=[{instancePath:e,schemaPath:"#/required",keyword:"required",params:{missingProperty:n},message:"must have required property '"+n+"'"}],!1;if(void 0!==t.id){const n=0;if("string"!=typeof t.id)return s.errors=[{instancePath:e+"/id",schemaPath:"#/properties/id/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var c=0===n}else c=!0;if(c){if(void 0!==t.name){const n=0;if("string"!=typeof t.name)return s.errors=[{instancePath:e+"/name",schemaPath:"#/properties/name/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;c=0===n}else c=!0;if(c){if(void 0!==t.shortname){const n=0;if("string"!=typeof t.shortname)return s.errors=[{instancePath:e+"/shortname",schemaPath:"#/properties/shortname/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;c=0===n}else c=!0;if(c){if(void 0!==t.description){const n=0;if("string"!=typeof t.description)return s.errors=[{instancePath:e+"/description",schemaPath:"#/properties/description/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;c=0===n}else c=!0;if(c){if(void 0!==t.version){const n=0;if("string"!=typeof t.version)return s.errors=[{instancePath:e+"/version",schemaPath:"#/properties/version/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;c=0===n}else c=!0;if(c){if(void 0!==t.license){const n=0;if("string"!=typeof t.license)return s.errors=[{instancePath:e+"/license",schemaPath:"#/properties/license/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;c=0===n}else c=!0;if(c){if(void 0!==t.repository){const n=0;if("string"!=typeof t.repository)return s.errors=[{instancePath:e+"/repository",schemaPath:"#/properties/repository/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;c=0===n}else c=!0;if(c){if(void 0!==t.bugs){const n=0;if("string"!=typeof t.bugs)return s.errors=[{instancePath:e+"/bugs",schemaPath:"#/properties/bugs/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;c=0===n}else c=!0;if(c){if(void 0!==t.maintainers){let n=t.maintainers;const r=0;if(0===r){if(!Array.isArray(n))return s.errors=[{instancePath:e+"/maintainers",schemaPath:"#/properties/maintainers/type",keyword:"type",params:{type:"array"},message:"must be array"}],!1;{var u=!0;const t=n.length;for(let r=0;r1)for(;r--;)for(t=r;t--;)if(i(n[r],n[t]))return s.errors=[{instancePath:e+"/maintainers",schemaPath:"#/properties/maintainers/uniqueItems",keyword:"uniqueItems",params:{i:r,j:t},message:"must NOT have duplicate items (items ## "+t+" and "+r+" are identical)"}],!1}}}c=0===r}else c=!0;if(c){if(void 0!==t.legacyIds){let n=t.legacyIds;const r=0;if(0===r){if(!Array.isArray(n))return s.errors=[{instancePath:e+"/legacyIds",schemaPath:"#/properties/legacyIds/type",keyword:"type",params:{type:"array"},message:"must be array"}],!1;{var p=!0;const t=n.length;for(let r=0;r1){const i={};for(;r--;){let o=n[r];if("string"==typeof o){if("number"==typeof i[o])return t=i[o],s.errors=[{instancePath:e+"/legacyIds",schemaPath:"#/properties/legacyIds/uniqueItems",keyword:"uniqueItems",params:{i:r,j:t},message:"must NOT have duplicate items (items ## "+t+" and "+r+" are identical)"}],!1;i[o]=r}}}}}}c=0===r}else c=!0;if(c){if(void 0!==t.runtime){let n=t.runtime;const i=0;if(0===i){if(!n||"object"!=typeof n||Array.isArray(n))return s.errors=[{instancePath:e+"/runtime",schemaPath:"#/properties/runtime/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;{let t;if(void 0===n.type&&(t="type")||void 0===n.api&&(t="api")||void 0===n.apiVersion&&(t="apiVersion")||void 0===n.entrypoint&&(t="entrypoint"))return s.errors=[{instancePath:e+"/runtime",schemaPath:"#/properties/runtime/required",keyword:"required",params:{missingProperty:t},message:"must have required property '"+t+"'"}],!1;if(void 0!==n.type){const t=0;if("string"!=typeof n.type)return s.errors=[{instancePath:e+"/runtime/type",schemaPath:"#/properties/runtime/properties/type/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var d=0===t}else d=!0;if(d){if(void 0!==n.api){let t=n.api;const i=0;if("string"!=typeof t)return s.errors=[{instancePath:e+"/runtime/api",schemaPath:"#/properties/runtime/properties/api/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if("nodejs-ipc"!==t)return s.errors=[{instancePath:e+"/runtime/api",schemaPath:"#/properties/runtime/properties/api/enum",keyword:"enum",params:{allowedValues:r.properties.runtime.properties.api.enum},message:"must be equal to one of the allowed values"}],!1;d=0===i}else d=!0;if(d){if(void 0!==n.apiVersion){const t=0;if("string"!=typeof n.apiVersion)return s.errors=[{instancePath:e+"/runtime/apiVersion",schemaPath:"#/properties/runtime/properties/apiVersion/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;d=0===t}else d=!0;if(d)if(void 0!==n.entrypoint){const t=0;if("string"!=typeof n.entrypoint)return s.errors=[{instancePath:e+"/runtime/entrypoint",schemaPath:"#/properties/runtime/properties/entrypoint/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;d=0===t}else d=!0}}}}c=0===i}else c=!0;if(c){if(void 0!==t.manufacturer){const n=0;if("string"!=typeof t.manufacturer)return s.errors=[{instancePath:e+"/manufacturer",schemaPath:"#/properties/manufacturer/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;c=0===n}else c=!0;if(c){if(void 0!==t.products){let n=t.products;const r=0;if(0===r){if(!Array.isArray(n))return s.errors=[{instancePath:e+"/products",schemaPath:"#/properties/products/type",keyword:"type",params:{type:"array"},message:"must be array"}],!1;{var h=!0;const t=n.length;for(let r=0;r1){const i={};for(;r--;){let o=n[r];if("string"==typeof o){if("number"==typeof i[o])return t=i[o],s.errors=[{instancePath:e+"/products",schemaPath:"#/properties/products/uniqueItems",keyword:"uniqueItems",params:{i:r,j:t},message:"must NOT have duplicate items (items ## "+t+" and "+r+" are identical)"}],!1;i[o]=r}}}}}}c=0===r}else c=!0;if(c)if(void 0!==t.keywords){let n=t.keywords;const r=0;if(0===r){if(!Array.isArray(n))return s.errors=[{instancePath:e+"/keywords",schemaPath:"#/properties/keywords/type",keyword:"type",params:{type:"array"},message:"must be array"}],!1;{var f=!0;const t=n.length;for(let r=0;r1){const i={};for(;r--;){let o=n[r];if("string"==typeof o){if("number"==typeof i[o])return t=i[o],s.errors=[{instancePath:e+"/keywords",schemaPath:"#/properties/keywords/uniqueItems",keyword:"uniqueItems",params:{i:r,j:t},message:"must NOT have duplicate items (items ## "+t+" and "+r+" are identical)"}],!1;i[o]=r}}}}}}c=0===r}else c=!0}}}}}}}}}}}}}return s.errors=null,!0}},4300:(t,e,n)=>{let r,i,s=n(6113),{urlAlphabet:o}=n(3792),a=t=>{!r||r.lengthr.length&&(s.randomFillSync(r),i=0),i+=t},c=t=>(a(t-=0),r.subarray(i-t,i)),u=(t,e,n)=>{let r=(2<<31-Math.clz32(t.length-1|1))-1,i=Math.ceil(1.6*r*e/t.length);return(s=e)=>{let o="";for(;;){let e=n(i),a=i;for(;a--;)if(o+=t[e[a]&r]||"",o.length===s)return o}}};t.exports={nanoid:(t=21)=>{a(t-=0);let e="";for(let n=i-t;nu(t,e,c),customRandom:u,urlAlphabet:o,random:c}},3792:t=>{t.exports={urlAlphabet:"useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"}},6066:(t,e,n)=>{"use strict";n.r(e),n.d(e,{__addDisposableResource:()=>P,__assign:()=>s,__asyncDelegator:()=>I,__asyncGenerator:()=>S,__asyncValues:()=>x,__await:()=>T,__awaiter:()=>f,__classPrivateFieldGet:()=>k,__classPrivateFieldIn:()=>R,__classPrivateFieldSet:()=>A,__createBinding:()=>m,__decorate:()=>a,__disposeResources:()=>j,__esDecorate:()=>u,__exportStar:()=>g,__extends:()=>i,__generator:()=>_,__importDefault:()=>C,__importStar:()=>N,__makeTemplateObject:()=>O,__metadata:()=>h,__param:()=>c,__propKey:()=>p,__read:()=>b,__rest:()=>o,__runInitializers:()=>l,__setFunctionName:()=>d,__spread:()=>v,__spreadArray:()=>w,__spreadArrays:()=>E,__values:()=>y,default:()=>M});var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)};function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var s=function(){return s=Object.assign||function(t){for(var e,n=1,r=arguments.length;n=0;a--)(i=t[a])&&(o=(s<3?i(o):s>3?i(e,n,o):i(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o}function c(t,e){return function(n,r){e(n,r,t)}}function u(t,e,n,r,i,s){function o(t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("Function expected");return t}for(var a,c=r.kind,u="getter"===c?"get":"setter"===c?"set":"value",l=!e&&t?r.static?t:t.prototype:null,p=e||(l?Object.getOwnPropertyDescriptor(l,r.name):{}),d=!1,h=n.length-1;h>=0;h--){var f={};for(var _ in r)f[_]="access"===_?{}:r[_];for(var _ in r.access)f.access[_]=r.access[_];f.addInitializer=function(t){if(d)throw new TypeError("Cannot add initializers after decoration has completed");s.push(o(t||null))};var m=(0,n[h])("accessor"===c?{get:p.get,set:p.set}:p[u],f);if("accessor"===c){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(a=o(m.get))&&(p.get=a),(a=o(m.set))&&(p.set=a),(a=o(m.init))&&i.unshift(a)}else(a=o(m))&&("field"===c?i.unshift(a):p[u]=a)}l&&Object.defineProperty(l,r.name,p),d=!0}function l(t,e,n){for(var r=arguments.length>2,i=0;i0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function b(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,s=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=s.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=s.return)&&n.call(s)}finally{if(i)throw i.error}}return o}function v(){for(var t=[],e=0;e1||a(t,e)}))})}function a(t,e){try{(n=i[t](e)).value instanceof T?Promise.resolve(n.value.v).then(c,u):l(s[0][2],n)}catch(t){l(s[0][3],t)}var n}function c(t){a("next",t)}function u(t){a("throw",t)}function l(t,e){t(e),s.shift(),s.length&&a(s[0][0],s[0][1])}}function I(t){var e,n;return e={},r("next"),r("throw",(function(t){throw t})),r("return"),e[Symbol.iterator]=function(){return this},e;function r(r,i){e[r]=t[r]?function(e){return(n=!n)?{value:T(t[r](e)),done:!1}:i?i(e):e}:i}}function x(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t=y(t),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);function r(n){e[n]=t[n]&&function(e){return new Promise((function(r,i){!function(t,e,n,r){Promise.resolve(r).then((function(e){t({value:e,done:n})}),e)}(r,i,(e=t[n](e)).done,e.value)}))}}}function O(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}var D=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};function N(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&m(e,t,n);return D(e,t),e}function C(t){return t&&t.__esModule?t:{default:t}}function k(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t)}function A(t,e,n,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?i.call(t,n):i?i.value=n:e.set(t,n),n}function R(t,e){if(null===e||"object"!=typeof e&&"function"!=typeof e)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof t?e===t:t.has(e)}function P(t,e,n){if(null!=e){if("object"!=typeof e)throw new TypeError("Object expected.");var r;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");r=e[Symbol.asyncDispose]}if(void 0===r){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");r=e[Symbol.dispose]}if("function"!=typeof r)throw new TypeError("Object not disposable.");t.stack.push({value:e,dispose:r,async:n})}else n&&t.stack.push({async:!0});return e}var U="function"==typeof SuppressedError?SuppressedError:function(t,e,n){var r=new Error(n);return r.name="SuppressedError",r.error=t,r.suppressed=e,r};function j(t){function e(e){t.error=t.hasError?new U(e,t.error,"An error was suppressed during disposal."):e,t.hasError=!0}return function n(){for(;t.stack.length;){var r=t.stack.pop();try{var i=r.dispose&&r.dispose.call(r.value);if(r.async)return Promise.resolve(i).then(n,(function(t){return e(t),n()}))}catch(t){e(t)}}if(t.hasError)throw t.error}()}const M={__extends:i,__assign:s,__rest:o,__decorate:a,__param:c,__metadata:h,__awaiter:f,__generator:_,__createBinding:m,__exportStar:g,__values:y,__read:b,__spread:v,__spreadArrays:E,__spreadArray:w,__await:T,__asyncGenerator:S,__asyncDelegator:I,__asyncValues:x,__makeTemplateObject:O,__importStar:N,__importDefault:C,__classPrivateFieldGet:k,__classPrivateFieldSet:A,__classPrivateFieldIn:R,__addDisposableResource:P,__disposeResources:j}}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={id:r,loaded:!1,exports:{}};return t[r].call(s.exports,s,s.exports,n),s.loaded=!0,s.exports}n.c=e,n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.hmd=t=>((t=Object.create(t)).children||(t.children=[]),Object.defineProperty(t,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+t.id)}}),t),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n(n.s=6010)})(); \ No newline at end of file +(()=>{var t={6010:(t,e,n)=>{const{InstanceBase:r,InstanceStatus:i,runEntrypoint:s}=n(8049),o=n(4556),a=n(9182),c=n(5144),u=n(7417),l=n(4049),p=n(3125),d=n(5965);s(class extends r{constructor(t){super(t),Object.assign(this,{...a,...c,...u,...l,...p,...d}),this.INTERVAL=null,this.DATA={powerState:!1,volumeLevel:0,muteState:!1,input:"",inputs:[]},this.CHOICES_INPUTS=[{id:"extInput:component?port=1",label:"Component 1"},{id:"extInput:component?port=2",label:"Component 2"},{id:"extInput:hdmi?port=1",label:"HDMI 1"},{id:"extInput:hdmi?port=2",label:"HDMI 2"}]}async destroy(){let t=this;t.INTERVAL&&(clearInterval(t.INTERVAL),t.INTERVAL=null)}async init(t){this.configUpdated(t)}async configUpdated(t){this.config=t,this.config.verbose&&this.log("info","Verbose mode enabled. Log entries will contain detailed information."),this.updateStatus(i.Connecting),this.initConnection(),this.initActions(),this.initFeedbacks(),this.initVariables(),this.initPresets(),this.checkFeedbacks(),this.checkVariables()}},o)},7056:(t,e,n)=>{"use strict";const r=n(4063);r.code='require("ajv/dist/runtime/equal").default',e.Z=r},758:(t,e,n)=>{"use strict";n.d(e,{r:()=>o});var r=n(5659),i=n(6890),s=n(2176);function o(){(0,i.T)(),(0,s.KV)()&&function(){const e=(0,r.cu)();if(!e.__SENTRY__)return;const n={mongodb:()=>new((0,s.l$)(t,"./node/integrations/mongo").Mongo),mongoose:()=>new((0,s.l$)(t,"./node/integrations/mongo").Mongo),mysql:()=>new((0,s.l$)(t,"./node/integrations/mysql").Mysql),pg:()=>new((0,s.l$)(t,"./node/integrations/postgres").Postgres)},i=Object.keys(n).filter((t=>!!(0,s.$y)(t))).map((t=>{try{return n[t]()}catch(t){return}})).filter((t=>t));i.length>0&&(e.__SENTRY__.integrations=[...e.__SENTRY__.integrations||[],...i])}()}t=n.hmd(t)},2716:(t,e,n)=>{"use strict";n.d(e,{_:()=>l});var r=n(4307),i=n(2176),s=n(2343),o=n(535),a=n(2844),c=n(7597),u=n(7990);class l{static __initStatic(){this.id="Apollo"}__init(){this.name=l.id}constructor(t={useNestjs:!1}){l.prototype.__init.call(this),this._useNest=!!t.useNestjs}loadDependency(){return this._useNest?this._module=this._module||(0,i.$y)("@nestjs/graphql"):this._module=this._module||(0,i.$y)("apollo-server-core"),this._module}setupOnce(t,e){if((0,u.K)(e))("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&s.kg.log("Apollo Integration is skipped because of instrumenter configuration.");else if(this._useNest){const t=this.loadDependency();if(!t)return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&s.kg.error("Apollo-NestJS Integration was unable to require @nestjs/graphql package."));(0,o.hl)(t.GraphQLFactory.prototype,"mergeWithSchema",(function(t){return function(...n){return(0,o.hl)(this.resolversExplorerService,"explore",(function(t){return function(){return p((0,a.lE)(t.call(this)),e)}})),t.call(this,...n)}}))}else{const t=this.loadDependency();if(!t)return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&s.kg.error("Apollo Integration was unable to require apollo-server-core package."));(0,o.hl)(t.ApolloServerBase.prototype,"constructSchema",(function(t){return function(){if(!this.config.resolvers)return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&(this.config.schema?(s.kg.warn("Apollo integration is not able to trace `ApolloServer` instances constructed via `schema` property.If you are using NestJS with Apollo, please use `Sentry.Integrations.Apollo({ useNestjs: true })` instead."),s.kg.warn()):this.config.modules&&s.kg.warn("Apollo integration is not able to trace `ApolloServer` instances constructed via `modules` property."),s.kg.error("Skipping tracing as no resolvers found on the `ApolloServer` instance.")),t.call(this);const n=(0,a.lE)(this.config.resolvers);return this.config.resolvers=p(n,e),t.call(this)}}))}}}function p(t,e){return t.map((t=>(Object.keys(t).forEach((n=>{Object.keys(t[n]).forEach((i=>{"function"==typeof t[n][i]&&function(t,e,n,i){(0,o.hl)(t[e],n,(function(t){return function(...s){const o=i().getScope(),a=(0,r.x)([o,"optionalAccess",t=>t.getSpan,"call",t=>t()]),u=(0,r.x)([a,"optionalAccess",t=>t.startChild,"call",t=>t({description:`${e}.${n}`,op:"graphql.resolve"})]),l=t.call(this,...s);return(0,c.J8)(l)?l.then((t=>((0,r.x)([u,"optionalAccess",t=>t.finish,"call",t=>t()]),t))):((0,r.x)([u,"optionalAccess",t=>t.finish,"call",t=>t()]),l)}}))}(t,n,i,e)}))})),t)))}l.__initStatic()},8737:(t,e,n)=>{"use strict";n.d(e,{N:()=>u});var r=n(4307),i=n(2343),s=n(6956),o=n(442),a=n(7597),c=n(7990);class u{static __initStatic(){this.id="Express"}__init(){this.name=u.id}constructor(t={}){u.prototype.__init.call(this),this._router=t.router||t.app,this._methods=(Array.isArray(t.methods)?t.methods:[]).concat("use")}setupOnce(t,e){this._router?(0,c.K)(e)?("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&i.kg.log("Express Integration is skipped because of instrumenter configuration."):(function(t,e=[]){e.forEach((e=>function(t,e){const n=t[e];return t[e]=function(...t){return n.call(this,...function(t,e){return t.map((t=>"function"==typeof t?l(t,e):Array.isArray(t)?t.map((t=>"function"==typeof t?l(t,e):t)):t))}(t,e))},t}(t,e)))}(this._router,this._methods),function(t){const e="settings"in t;e&&void 0===t._router&&t.lazyrouter&&t.lazyrouter();const n=e?t._router:t;if(!n)return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&i.kg.debug("Cannot instrument router for URL Parameterization (did not find a valid router)."),void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&i.kg.debug("Routing instrumentation is currently only supported in Express 4."));const c=Object.getPrototypeOf(n),u=c.process_params;c.process_params=function(t,e,n,i,c){n._reconstructedRoute||(n._reconstructedRoute="");const{layerRoutePath:l,isRegex:p,isArray:d,numExtraSegments:h}=function(t){const e=(0,r.x)([t,"access",t=>t.route,"optionalAccess",t=>t.path]),n=(0,a.Kj)(e),i=Array.isArray(e);if(!e)return{isRegex:n,isArray:i,numExtraSegments:0};const o=i?Math.max(e.reduce(((t,e)=>t+(0,s.$A)(e.toString())),0)-(0,s.$A)(t.path||""),0):0,c=function(t,e){return t?e.map((t=>t.toString())).join(","):e&&e.toString()}(i,e);return{layerRoutePath:c,isRegex:n,isArray:i,numExtraSegments:o}}(t);(l||p||d)&&(n._hasParameters=!0);const f=(l||t.path||"").split("/").filter((t=>t.length>0&&(p||d||!t.includes("*")))).join("/");if(f&&f.length>0&&(n._reconstructedRoute+=`/${f}${p?"/":""}`),(0,s.$A)(n.originalUrl||"")+h===(0,s.$A)(n._reconstructedRoute)){n._hasParameters||n._reconstructedRoute!==n.originalUrl&&(n._reconstructedRoute=n.originalUrl?(0,s.rt)(n.originalUrl):n.originalUrl);const t=i.__sentry_transaction;if(t&&"custom"!==t.metadata.source){const e=n._reconstructedRoute||"/";t.setName(...(0,o.oA)(n,{path:!0,method:!0,customRoute:e}))}}return u.call(this,t,e,n,i,c)}}(this._router)):("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&i.kg.error("ExpressIntegration is missing an Express instance")}}function l(t,e){const n=t.length;switch(n){case 2:return function(n,r){const i=r.__sentry_transaction;if(i){const n=i.startChild({description:t.name,op:`middleware.express.${e}`});r.once("finish",(()=>{n.finish()}))}return t.call(this,n,r)};case 3:return function(n,i,s){const o=i.__sentry_transaction,a=(0,r.x)([o,"optionalAccess",t=>t.startChild,"call",n=>n({description:t.name,op:`middleware.express.${e}`})]);t.call(this,n,i,(function(...t){(0,r.x)([a,"optionalAccess",t=>t.finish,"call",t=>t()]),s.call(this,...t)}))};case 4:return function(n,i,s,o){const a=s.__sentry_transaction,c=(0,r.x)([a,"optionalAccess",t=>t.startChild,"call",n=>n({description:t.name,op:`middleware.express.${e}`})]);t.call(this,n,i,s,(function(...t){(0,r.x)([c,"optionalAccess",t=>t.finish,"call",t=>t()]),o.call(this,...t)}))};default:throw new Error(`Express middleware takes 2-4 arguments. Got: ${n}`)}}u.__initStatic()},1791:(t,e,n)=>{"use strict";n.d(e,{k:()=>u});var r=n(4307),i=n(2176),s=n(2343),o=n(535),a=n(7597),c=n(7990);class u{constructor(){u.prototype.__init.call(this)}static __initStatic(){this.id="GraphQL"}__init(){this.name=u.id}loadDependency(){return this._module=this._module||(0,i.$y)("graphql/execution/execute.js")}setupOnce(t,e){if((0,c.K)(e))return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&s.kg.log("GraphQL Integration is skipped because of instrumenter configuration."));const n=this.loadDependency();n?(0,o.hl)(n,"execute",(function(t){return function(...n){const i=e().getScope(),s=(0,r.x)([i,"optionalAccess",t=>t.getSpan,"call",t=>t()]),o=(0,r.x)([s,"optionalAccess",t=>t.startChild,"call",t=>t({description:"execute",op:"graphql.execute"})]);(0,r.x)([i,"optionalAccess",t=>t.setSpan,"call",t=>t(o)]);const c=t.call(this,...n);return(0,a.J8)(c)?c.then((t=>((0,r.x)([o,"optionalAccess",t=>t.finish,"call",t=>t()]),(0,r.x)([i,"optionalAccess",t=>t.setSpan,"call",t=>t(s)]),t))):((0,r.x)([o,"optionalAccess",t=>t.finish,"call",t=>t()]),(0,r.x)([i,"optionalAccess",t=>t.setSpan,"call",t=>t(s)]),c)}})):("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&s.kg.error("GraphQL Integration was unable to require graphql/execution package.")}}u.__initStatic()},6046:(t,e,n)=>{"use strict";n.d(e,{G:()=>i});var r=n(2176);t=n.hmd(t);const i=[()=>new((0,r.l$)(t,"./apollo").Apollo),()=>new((0,r.l$)(t,"./apollo").Apollo)({useNestjs:!0}),()=>new((0,r.l$)(t,"./graphql").GraphQL),()=>new((0,r.l$)(t,"./mongo").Mongo),()=>new((0,r.l$)(t,"./mongo").Mongo)({mongoose:!0}),()=>new((0,r.l$)(t,"./mysql").Mysql),()=>new((0,r.l$)(t,"./postgres").Postgres)]},6169:(t,e,n)=>{"use strict";n.d(e,{_:()=>p});var r=n(4307),i=n(2176),s=n(2343),o=n(535),a=n(7597),c=n(7990);const u=["aggregate","bulkWrite","countDocuments","createIndex","createIndexes","deleteMany","deleteOne","distinct","drop","dropIndex","dropIndexes","estimatedDocumentCount","find","findOne","findOneAndDelete","findOneAndReplace","findOneAndUpdate","indexes","indexExists","indexInformation","initializeOrderedBulkOp","insertMany","insertOne","isCapped","mapReduce","options","parallelCollectionScan","rename","replaceOne","stats","updateMany","updateOne"],l={bulkWrite:["operations"],countDocuments:["query"],createIndex:["fieldOrSpec"],createIndexes:["indexSpecs"],deleteMany:["filter"],deleteOne:["filter"],distinct:["key","query"],dropIndex:["indexName"],find:["query"],findOne:["query"],findOneAndDelete:["filter"],findOneAndReplace:["filter","replacement"],findOneAndUpdate:["filter","update"],indexExists:["indexes"],insertMany:["docs"],insertOne:["doc"],mapReduce:["map","reduce"],rename:["newName"],replaceOne:["filter","doc"],updateMany:["filter","update"],updateOne:["filter","update"]};class p{static __initStatic(){this.id="Mongo"}__init(){this.name=p.id}constructor(t={}){p.prototype.__init.call(this),this._operations=Array.isArray(t.operations)?t.operations:u,this._describeOperations=!("describeOperations"in t)||t.describeOperations,this._useMongoose=!!t.useMongoose}loadDependency(){const t=this._useMongoose?"mongoose":"mongodb";return this._module=this._module||(0,i.$y)(t)}setupOnce(t,e){if((0,c.K)(e))return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&s.kg.log("Mongo Integration is skipped because of instrumenter configuration."));const n=this.loadDependency();if(n)this._instrumentOperations(n.Collection,this._operations,e);else{const t=this._useMongoose?"mongoose":"mongodb";("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&s.kg.error(`Mongo Integration was unable to require \`${t}\` package.`)}}_instrumentOperations(t,e,n){e.forEach((e=>this._patchOperation(t,e,n)))}_patchOperation(t,e,n){if(!(e in t.prototype))return;const i=this._getSpanContextFromOperationArguments.bind(this);(0,o.hl)(t.prototype,e,(function(t){return function(...s){const o=s[s.length-1],c=n().getScope(),u=(0,r.x)([c,"optionalAccess",t=>t.getSpan,"call",t=>t()]);if("function"!=typeof o||"mapReduce"===e&&2===s.length){const n=(0,r.x)([u,"optionalAccess",t=>t.startChild,"call",t=>t(i(this,e,s))]),o=t.call(this,...s);if((0,a.J8)(o))return o.then((t=>((0,r.x)([n,"optionalAccess",t=>t.finish,"call",t=>t()]),t)));if((l=o)&&"object"==typeof l&&l.once&&"function"==typeof l.once){const t=o;try{t.once("close",(()=>{(0,r.x)([n,"optionalAccess",t=>t.finish,"call",t=>t()])}))}catch(t){(0,r.x)([n,"optionalAccess",t=>t.finish,"call",t=>t()])}return t}return(0,r.x)([n,"optionalAccess",t=>t.finish,"call",t=>t()]),o}var l;const p=(0,r.x)([u,"optionalAccess",t=>t.startChild,"call",t=>t(i(this,e,s.slice(0,-1)))]);return t.call(this,...s.slice(0,-1),(function(t,e){(0,r.x)([p,"optionalAccess",t=>t.finish,"call",t=>t()]),o(t,e)}))}}))}_getSpanContextFromOperationArguments(t,e,n){const r={collectionName:t.collectionName,dbName:t.dbName,namespace:t.namespace,"db.system":"mongodb"},i={op:"db",description:e,data:r},s=l[e],o=Array.isArray(this._describeOperations)?this._describeOperations.includes(e):this._describeOperations;if(!s||!o)return i;try{if("mapReduce"===e){const[t,e]=n;r[s[0]]="string"==typeof t?t:t.name||"",r[s[1]]="string"==typeof e?e:e.name||""}else for(let t=0;t{"use strict";n.d(e,{m:()=>c});var r=n(4307),i=n(2176),s=n(2343),o=n(535),a=n(7990);class c{constructor(){c.prototype.__init.call(this)}static __initStatic(){this.id="Mysql"}__init(){this.name=c.id}loadDependency(){return this._module=this._module||(0,i.$y)("mysql/lib/Connection.js")}setupOnce(t,e){if((0,a.K)(e))return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&s.kg.log("Mysql Integration is skipped because of instrumenter configuration."));const n=this.loadDependency();n?(0,o.hl)(n,"createQuery",(function(t){return function(n,i,s){const o=e().getScope(),a=(0,r.x)([o,"optionalAccess",t=>t.getSpan,"call",t=>t()]),c=(0,r.x)([a,"optionalAccess",t=>t.startChild,"call",t=>t({description:"string"==typeof n?n:n.sql,op:"db",data:{"db.system":"mysql"}})]);return"function"==typeof s?t.call(this,n,i,(function(t,e,n){(0,r.x)([c,"optionalAccess",t=>t.finish,"call",t=>t()]),s(t,e,n)})):"function"==typeof i?t.call(this,n,(function(t,e,n){(0,r.x)([c,"optionalAccess",t=>t.finish,"call",t=>t()]),i(t,e,n)})):t.call(this,n,i,s)}})):("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&s.kg.error("Mysql Integration was unable to require `mysql` package.")}}c.__initStatic()},1370:(t,e,n)=>{"use strict";n.d(e,{E:()=>u});var r=n(4307),i=n(2176),s=n(2343),o=n(535),a=n(7597),c=n(7990);class u{static __initStatic(){this.id="Postgres"}__init(){this.name=u.id}constructor(t={}){u.prototype.__init.call(this),this._usePgNative=!!t.usePgNative}loadDependency(){return this._module=this._module||(0,i.$y)("pg")}setupOnce(t,e){if((0,c.K)(e))return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&s.kg.log("Postgres Integration is skipped because of instrumenter configuration."));const n=this.loadDependency();if(!n)return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&s.kg.error("Postgres Integration was unable to require `pg` package."));if(this._usePgNative&&!(0,r.x)([n,"access",t=>t.native,"optionalAccess",t=>t.Client]))return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&s.kg.error("Postgres Integration was unable to access 'pg-native' bindings."));const{Client:i}=this._usePgNative?n.native:n;(0,o.hl)(i.prototype,"query",(function(t){return function(n,i,s){const o=e().getScope(),c=(0,r.x)([o,"optionalAccess",t=>t.getSpan,"call",t=>t()]),u=(0,r.x)([c,"optionalAccess",t=>t.startChild,"call",t=>t({description:"string"==typeof n?n:n.text,op:"db",data:{"db.system":"postgresql"}})]);if("function"==typeof s)return t.call(this,n,i,(function(t,e){(0,r.x)([u,"optionalAccess",t=>t.finish,"call",t=>t()]),s(t,e)}));if("function"==typeof i)return t.call(this,n,(function(t,e){(0,r.x)([u,"optionalAccess",t=>t.finish,"call",t=>t()]),i(t,e)}));const l=void 0!==i?t.call(this,n,i):t.call(this,n);return(0,a.J8)(l)?l.then((t=>((0,r.x)([u,"optionalAccess",t=>t.finish,"call",t=>t()]),t))):((0,r.x)([u,"optionalAccess",t=>t.finish,"call",t=>t()]),l)}}))}}u.__initStatic()},9889:(t,e,n)=>{"use strict";n.d(e,{g:()=>o});var r=n(1250),i=n(2343),s=n(7990);class o{static __initStatic(){this.id="Prisma"}__init(){this.name=o.id}constructor(t={}){var e;o.prototype.__init.call(this),(e=t.client)&&e.$use?this._client=t.client:("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&i.kg.warn(`Unsupported Prisma client provided to PrismaIntegration. Provided client: ${JSON.stringify(t.client)}`)}setupOnce(t,e){this._client?(0,s.K)(e)?("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&i.kg.log("Prisma Integration is skipped because of instrumenter configuration."):this._client.$use(((t,e)=>{const n=t.action,i=t.model;return(0,r.g)({name:i?`${i} ${n}`:n,op:"db.sql.prisma",data:{"db.system":"prisma"}},(()=>e(t)))})):("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&i.kg.error("PrismaIntegration is missing a Prisma Client Instance")}}o.__initStatic()},7990:(t,e,n)=>{"use strict";n.d(e,{K:()=>i});var r=n(4307);function i(t){const e=(0,r.x)([t,"call",t=>t(),"access",t=>t.getClient,"call",t=>t(),"optionalAccess",t=>t.getOptions,"call",t=>t()]);return"sentry"!==((0,r.x)([e,"optionalAccess",t=>t.instrumenter])||"sentry")}},1131:(t,e,n)=>{"use strict";n.d(e,{J:()=>r});const r="production"},5659:(t,e,n)=>{"use strict";n.d(e,{$b:()=>y,Gd:()=>_,Ok:()=>b,Xb:()=>d,cu:()=>h,j0:()=>w,pj:()=>f,uZ:()=>g,vi:()=>E});var r=n(2844),i=n(1170),s=n(2343),o=n(1235),a=n(1131),c=n(350),u=n(9015);const l=4,p=100;class d{constructor(t,e=new c.s,n=l){this._version=n,this._stack=[{scope:e}],t&&this.bindClient(t)}isOlderThan(t){return this._version{r.captureException(t,{originalException:t,syntheticException:i,...e,event_id:n},s)})),n}captureMessage(t,e,n){const i=this._lastEventId=n&&n.event_id?n.event_id:(0,r.DM)(),s=new Error(t);return this._withClient(((r,o)=>{r.captureMessage(t,e,{originalException:t,syntheticException:s,...n,event_id:i},o)})),i}captureEvent(t,e){const n=e&&e.event_id?e.event_id:(0,r.DM)();return t.type||(this._lastEventId=n),this._withClient(((r,i)=>{r.captureEvent(t,{...e,event_id:n},i)})),n}lastEventId(){return this._lastEventId}addBreadcrumb(t,e){const{scope:n,client:r}=this.getStackTop();if(!r)return;const{beforeBreadcrumb:o=null,maxBreadcrumbs:a=p}=r.getOptions&&r.getOptions()||{};if(a<=0)return;const c={timestamp:(0,i.yW)(),...t},u=o?(0,s.Cf)((()=>o(c,e))):c;null!==u&&(r.emit&&r.emit("beforeAddBreadcrumb",u,e),n.addBreadcrumb(u,a))}setUser(t){this.getScope().setUser(t)}setTags(t){this.getScope().setTags(t)}setExtras(t){this.getScope().setExtras(t)}setTag(t,e){this.getScope().setTag(t,e)}setExtra(t,e){this.getScope().setExtra(t,e)}setContext(t,e){this.getScope().setContext(t,e)}configureScope(t){const{scope:e,client:n}=this.getStackTop();n&&t(e)}run(t){const e=f(this);try{t(this)}finally{f(e)}}getIntegration(t){const e=this.getClient();if(!e)return null;try{return e.getIntegration(t)}catch(e){return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&s.kg.warn(`Cannot retrieve integration ${t.id} from the current Hub`),null}}startTransaction(t,e){const n=this._callExtensionMethod("startTransaction",t,e);return"undefined"!=typeof __SENTRY_DEBUG__&&!__SENTRY_DEBUG__||n||console.warn("Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':\nSentry.addTracingExtensions();\nSentry.init({...});\n"),n}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(t=!1){if(t)return this.endSession();this._sendSessionUpdate()}endSession(){const t=this.getStackTop().scope,e=t.getSession();e&&(0,u.RJ)(e),this._sendSessionUpdate(),t.setSession()}startSession(t){const{scope:e,client:n}=this.getStackTop(),{release:r,environment:i=a.J}=n&&n.getOptions()||{},{userAgent:s}=o.n2.navigator||{},c=(0,u.Hv)({release:r,environment:i,user:e.getUser(),...s&&{userAgent:s},...t}),l=e.getSession&&e.getSession();return l&&"ok"===l.status&&(0,u.CT)(l,{status:"exited"}),this.endSession(),e.setSession(c),c}shouldSendDefaultPii(){const t=this.getClient(),e=t&&t.getOptions();return Boolean(e&&e.sendDefaultPii)}_sendSessionUpdate(){const{scope:t,client:e}=this.getStackTop(),n=t.getSession();n&&e&&e.captureSession&&e.captureSession(n)}_withClient(t){const{scope:e,client:n}=this.getStackTop();n&&t(n,e)}_callExtensionMethod(t,...e){const n=h().__SENTRY__;if(n&&n.extensions&&"function"==typeof n.extensions[t])return n.extensions[t].apply(this,e);("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&s.kg.warn(`Extension method ${t} couldn't be found, doing nothing.`)}}function h(){return o.n2.__SENTRY__=o.n2.__SENTRY__||{extensions:{},hub:void 0},o.n2}function f(t){const e=h(),n=E(e);return w(e,t),n}function _(){const t=h();if(t.__SENTRY__&&t.__SENTRY__.acs){const e=t.__SENTRY__.acs.getCurrentHub();if(e)return e}return m(t)}function m(t=h()){return v(t)&&!E(t).isOlderThan(l)||w(t,new d),E(t)}function g(t,e=m()){if(!v(t)||E(t).isOlderThan(l)){const n=e.getStackTop();w(t,new d(n.client,c.s.clone(n.scope)))}}function y(t){const e=h();e.__SENTRY__=e.__SENTRY__||{},e.__SENTRY__.acs=t}function b(t,e={}){const n=h();return n.__SENTRY__&&n.__SENTRY__.acs?n.__SENTRY__.acs.runWithAsyncContext(t,e):t()}function v(t){return!!(t&&t.__SENTRY__&&t.__SENTRY__.hub)}function E(t){return(0,o.YO)("hub",(()=>new d),t)}function w(t,e){return!!t&&((t.__SENTRY__=t.__SENTRY__||{}).hub=e,!0)}},350:(t,e,n)=>{"use strict";n.d(e,{c:()=>d,s:()=>l});var r=n(7597),i=n(1170),s=n(6893),o=n(2343),a=n(2844),c=n(1235),u=n(9015);class l{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={}}static clone(t){const e=new l;return t&&(e._breadcrumbs=[...t._breadcrumbs],e._tags={...t._tags},e._extra={...t._extra},e._contexts={...t._contexts},e._user=t._user,e._level=t._level,e._span=t._span,e._session=t._session,e._transactionName=t._transactionName,e._fingerprint=t._fingerprint,e._eventProcessors=[...t._eventProcessors],e._requestSession=t._requestSession,e._attachments=[...t._attachments],e._sdkProcessingMetadata={...t._sdkProcessingMetadata}),e}addScopeListener(t){this._scopeListeners.push(t)}addEventProcessor(t){return this._eventProcessors.push(t),this}setUser(t){return this._user=t||{},this._session&&(0,u.CT)(this._session,{user:t}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(t){return this._requestSession=t,this}setTags(t){return this._tags={...this._tags,...t},this._notifyScopeListeners(),this}setTag(t,e){return this._tags={...this._tags,[t]:e},this._notifyScopeListeners(),this}setExtras(t){return this._extra={...this._extra,...t},this._notifyScopeListeners(),this}setExtra(t,e){return this._extra={...this._extra,[t]:e},this._notifyScopeListeners(),this}setFingerprint(t){return this._fingerprint=t,this._notifyScopeListeners(),this}setLevel(t){return this._level=t,this._notifyScopeListeners(),this}setTransactionName(t){return this._transactionName=t,this._notifyScopeListeners(),this}setContext(t,e){return null===e?delete this._contexts[t]:this._contexts[t]=e,this._notifyScopeListeners(),this}setSpan(t){return this._span=t,this._notifyScopeListeners(),this}getSpan(){return this._span}getTransaction(){const t=this.getSpan();return t&&t.transaction}setSession(t){return t?this._session=t:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;if("function"==typeof t){const e=t(this);return e instanceof l?e:this}return t instanceof l?(this._tags={...this._tags,...t._tags},this._extra={...this._extra,...t._extra},this._contexts={...this._contexts,...t._contexts},t._user&&Object.keys(t._user).length&&(this._user=t._user),t._level&&(this._level=t._level),t._fingerprint&&(this._fingerprint=t._fingerprint),t._requestSession&&(this._requestSession=t._requestSession)):(0,r.PO)(t)&&(this._tags={...this._tags,...t.tags},this._extra={...this._extra,...t.extra},this._contexts={...this._contexts,...t.contexts},t.user&&(this._user=t.user),t.level&&(this._level=t.level),t.fingerprint&&(this._fingerprint=t.fingerprint),t.requestSession&&(this._requestSession=t.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(t,e){const n="number"==typeof e?e:100;if(n<=0)return this;const r={timestamp:(0,i.yW)(),...t};return this._breadcrumbs=[...this._breadcrumbs,r].slice(-n),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(t){return this._attachments.push(t),this}getAttachments(){return this._attachments}clearAttachments(){return this._attachments=[],this}applyToEvent(t,e={}){if(this._extra&&Object.keys(this._extra).length&&(t.extra={...this._extra,...t.extra}),this._tags&&Object.keys(this._tags).length&&(t.tags={...this._tags,...t.tags}),this._user&&Object.keys(this._user).length&&(t.user={...this._user,...t.user}),this._contexts&&Object.keys(this._contexts).length&&(t.contexts={...this._contexts,...t.contexts}),this._level&&(t.level=this._level),this._transactionName&&(t.transaction=this._transactionName),this._span){t.contexts={trace:this._span.getTraceContext(),...t.contexts};const e=this._span.transaction;if(e){t.sdkProcessingMetadata={dynamicSamplingContext:e.getDynamicSamplingContext(),...t.sdkProcessingMetadata};const n=e.name;n&&(t.tags={transaction:n,...t.tags})}}return this._applyFingerprint(t),t.breadcrumbs=[...t.breadcrumbs||[],...this._breadcrumbs],t.breadcrumbs=t.breadcrumbs.length>0?t.breadcrumbs:void 0,t.sdkProcessingMetadata={...t.sdkProcessingMetadata,...this._sdkProcessingMetadata},this._notifyEventProcessors([...p(),...this._eventProcessors],t,e)}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...t},this}_notifyEventProcessors(t,e,n,i=0){return new s.cW(((s,a)=>{const c=t[i];if(null===e||"function"!=typeof c)s(e);else{const u=c({...e},n);("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&c.id&&null===u&&o.kg.log(`Event processor "${c.id}" dropped event`),(0,r.J8)(u)?u.then((e=>this._notifyEventProcessors(t,e,n,i+1).then(s))).then(null,a):this._notifyEventProcessors(t,u,n,i+1).then(s).then(null,a)}}))}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((t=>{t(this)})),this._notifyingListeners=!1)}_applyFingerprint(t){t.fingerprint=t.fingerprint?(0,a.lE)(t.fingerprint):[],this._fingerprint&&(t.fingerprint=t.fingerprint.concat(this._fingerprint)),t.fingerprint&&!t.fingerprint.length&&delete t.fingerprint}}function p(){return(0,c.YO)("globalEventProcessors",(()=>[]))}function d(t){p().push(t)}},9015:(t,e,n)=>{"use strict";n.d(e,{CT:()=>a,Hv:()=>o,RJ:()=>c});var r=n(1170),i=n(2844),s=n(535);function o(t){const e=(0,r.ph)(),n={sid:(0,i.DM)(),init:!0,timestamp:e,started:e,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(t){return(0,s.Jr)({sid:`${t.sid}`,init:t.init,started:new Date(1e3*t.started).toISOString(),timestamp:new Date(1e3*t.timestamp).toISOString(),status:t.status,errors:t.errors,did:"number"==typeof t.did||"string"==typeof t.did?`${t.did}`:void 0,duration:t.duration,attrs:{release:t.release,environment:t.environment,ip_address:t.ipAddress,user_agent:t.userAgent}})}(n)};return t&&a(n,t),n}function a(t,e={}){if(e.user&&(!t.ipAddress&&e.user.ip_address&&(t.ipAddress=e.user.ip_address),t.did||e.did||(t.did=e.user.id||e.user.email||e.user.username)),t.timestamp=e.timestamp||(0,r.ph)(),e.ignoreDuration&&(t.ignoreDuration=e.ignoreDuration),e.sid&&(t.sid=32===e.sid.length?e.sid:(0,i.DM)()),void 0!==e.init&&(t.init=e.init),!t.did&&e.did&&(t.did=`${e.did}`),"number"==typeof e.started&&(t.started=e.started),t.ignoreDuration)t.duration=void 0;else if("number"==typeof e.duration)t.duration=e.duration;else{const e=t.timestamp-t.started;t.duration=e>=0?e:0}e.release&&(t.release=e.release),e.environment&&(t.environment=e.environment),!t.ipAddress&&e.ipAddress&&(t.ipAddress=e.ipAddress),!t.userAgent&&e.userAgent&&(t.userAgent=e.userAgent),"number"==typeof e.errors&&(t.errors=e.errors),e.status&&(t.status=e.status)}function c(t,e){let n={};e?n={status:e}:"ok"===t.status&&(n={status:"exited"}),a(t,n)}},6890:(t,e,n)=>{"use strict";n.d(e,{T:()=>g,l:()=>m});var r=n(2343),i=n(7597),s=n(5659),o=n(7522),a=n(1688),c=n(9791);let u=!1;function l(){const t=(0,c.x1)();if(t){const e="internal_error";("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&r.kg.log(`[Tracing] Transaction: ${e} -> Global error occured`),t.setStatus(e)}}l.tag="sentry_tracingErrorCallback";var p=n(5544),d=n(8069);function h(){const t=this.getScope().getSpan();return t?{"sentry-trace":t.toTraceparent()}:{}}function f(t,e,n){if(!(0,o.z)(e))return t.sampled=!1,t;if(void 0!==t.sampled)return t.setMetadata({sampleRate:Number(t.sampled)}),t;let s;return"function"==typeof e.tracesSampler?(s=e.tracesSampler(n),t.setMetadata({sampleRate:Number(s)})):void 0!==n.parentSampled?s=n.parentSampled:void 0!==e.tracesSampleRate?(s=e.tracesSampleRate,t.setMetadata({sampleRate:Number(s)})):(s=1,t.setMetadata({sampleRate:s})),a=s,((0,i.i2)(a)||"number"!=typeof a&&"boolean"!=typeof a?(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&r.kg.warn(`[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(a)} of type ${JSON.stringify(typeof a)}.`),0):!(a<0||a>1)||(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&r.kg.warn(`[Tracing] Given sample rate is invalid. Sample rate must be between 0 and 1. Got ${a}.`),0))?s?(t.sampled=Math.random(){"use strict";n.d(e,{AT:()=>a,io:()=>l});var r=n(1170),i=n(2343),s=n(8903),o=n(8069);const a={idleTimeout:1e3,finalTimeout:3e4,heartbeatInterval:5e3},c=["heartbeatFailed","idleTimeout","documentHidden","finalTimeout","externalFinish","cancelled"];class u extends s.gB{constructor(t,e,n,r){super(r),this._pushActivity=t,this._popActivity=e,this.transactionSpanId=n}add(t){t.spanId!==this.transactionSpanId&&(t.finish=e=>{t.endTimestamp="number"==typeof e?e:(0,r.ph)(),this._popActivity(t.spanId)},void 0===t.endTimestamp&&this._pushActivity(t.spanId)),super.add(t)}}class l extends o.Y{__init(){this.activities={}}__init2(){this._heartbeatCounter=0}__init3(){this._finished=!1}__init4(){this._idleTimeoutCanceledPermanently=!1}__init5(){this._beforeFinishCallbacks=[]}__init6(){this._finishReason=c[4]}constructor(t,e,n=a.idleTimeout,r=a.finalTimeout,s=a.heartbeatInterval,o=!1){super(t,e),this._idleHub=e,this._idleTimeout=n,this._finalTimeout=r,this._heartbeatInterval=s,this._onScope=o,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),o&&(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&i.kg.log(`Setting idle transaction on scope. Span ID: ${this.spanId}`),e.configureScope((t=>t.setSpan(this)))),this._restartIdleTimeout(),setTimeout((()=>{this._finished||(this.setStatus("deadline_exceeded"),this._finishReason=c[3],this.finish())}),this._finalTimeout)}finish(t=(0,r.ph)()){if(this._finished=!0,this.activities={},"ui.action.click"===this.op&&this.setTag("finishReason",this._finishReason),this.spanRecorder){("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&i.kg.log("[Tracing] finishing IdleTransaction",new Date(1e3*t).toISOString(),this.op);for(const e of this._beforeFinishCallbacks)e(this,t);this.spanRecorder.spans=this.spanRecorder.spans.filter((e=>{if(e.spanId===this.spanId)return!0;e.endTimestamp||(e.endTimestamp=t,e.setStatus("cancelled"),("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&i.kg.log("[Tracing] cancelling span since transaction ended early",JSON.stringify(e,void 0,2)));const n=e.startTimestamp{this._finished||this._pushActivity(t)},n=t=>{this._finished||this._popActivity(t)};this.spanRecorder=new u(e,n,this.spanId,t),("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&i.kg.log("Starting heartbeat"),this._pingHeartbeat()}this.spanRecorder.add(this)}cancelIdleTimeout(t,{restartOnChildSpanChange:e}={restartOnChildSpanChange:!0}){this._idleTimeoutCanceledPermanently=!1===e,this._idleTimeoutID&&(clearTimeout(this._idleTimeoutID),this._idleTimeoutID=void 0,0===Object.keys(this.activities).length&&this._idleTimeoutCanceledPermanently&&(this._finishReason=c[5],this.finish(t)))}setFinishReason(t){this._finishReason=t}_restartIdleTimeout(t){this.cancelIdleTimeout(),this._idleTimeoutID=setTimeout((()=>{this._finished||0!==Object.keys(this.activities).length||(this._finishReason=c[1],this.finish(t))}),this._idleTimeout)}_pushActivity(t){this.cancelIdleTimeout(void 0,{restartOnChildSpanChange:!this._idleTimeoutCanceledPermanently}),("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&i.kg.log(`[Tracing] pushActivity: ${t}`),this.activities[t]=!0,("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&i.kg.log("[Tracing] new activities count",Object.keys(this.activities).length)}_popActivity(t){if(this.activities[t]&&(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&i.kg.log(`[Tracing] popActivity ${t}`),delete this.activities[t],("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&i.kg.log("[Tracing] new activities count",Object.keys(this.activities).length)),0===Object.keys(this.activities).length){const t=(0,r.ph)();this._idleTimeoutCanceledPermanently?(this._finishReason=c[5],this.finish(t)):this._restartIdleTimeout(t+this._idleTimeout/1e3)}}_beat(){if(this._finished)return;const t=Object.keys(this.activities).join("");t===this._prevHeartbeatString?this._heartbeatCounter++:this._heartbeatCounter=1,this._prevHeartbeatString=t,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._finishReason=c[0],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)}}},8903:(t,e,n)=>{"use strict";n.d(e,{Dr:()=>c,Zd:()=>u,gB:()=>a});var r=n(2844),i=n(1170),s=n(2343),o=n(535);class a{__init(){this.spans=[]}constructor(t=1e3){a.prototype.__init.call(this),this._maxlen=t}add(t){this.spans.length>this._maxlen?t.spanRecorder=void 0:this.spans.push(t)}}class c{__init2(){this.traceId=(0,r.DM)()}__init3(){this.spanId=(0,r.DM)().substring(16)}__init4(){this.startTimestamp=(0,i.ph)()}__init5(){this.tags={}}__init6(){this.data={}}__init7(){this.instrumenter="sentry"}constructor(t){if(c.prototype.__init2.call(this),c.prototype.__init3.call(this),c.prototype.__init4.call(this),c.prototype.__init5.call(this),c.prototype.__init6.call(this),c.prototype.__init7.call(this),!t)return this;t.traceId&&(this.traceId=t.traceId),t.spanId&&(this.spanId=t.spanId),t.parentSpanId&&(this.parentSpanId=t.parentSpanId),"sampled"in t&&(this.sampled=t.sampled),t.op&&(this.op=t.op),t.description&&(this.description=t.description),t.data&&(this.data=t.data),t.tags&&(this.tags=t.tags),t.status&&(this.status=t.status),t.startTimestamp&&(this.startTimestamp=t.startTimestamp),t.endTimestamp&&(this.endTimestamp=t.endTimestamp),t.instrumenter&&(this.instrumenter=t.instrumenter)}startChild(t){const e=new c({...t,parentSpanId:this.spanId,sampled:this.sampled,traceId:this.traceId});if(e.spanRecorder=this.spanRecorder,e.spanRecorder&&e.spanRecorder.add(e),e.transaction=this.transaction,("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&e.transaction){const n=`[Tracing] Starting '${t&&t.op||"< unknown op >"}' span on transaction '${e.transaction.name||"< unknown name >"}' (${e.transaction.spanId}).`;e.transaction.metadata.spanMetadata[e.spanId]={logMessage:n},s.kg.log(n)}return e}setTag(t,e){return this.tags={...this.tags,[t]:e},this}setData(t,e){return this.data={...this.data,[t]:e},this}setStatus(t){return this.status=t,this}setHttpStatus(t){this.setTag("http.status_code",String(t));const e=u(t);return"unknown_error"!==e&&this.setStatus(e),this}isSuccess(){return"ok"===this.status}finish(t){if(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&this.transaction&&this.transaction.spanId!==this.spanId){const{logMessage:t}=this.transaction.metadata.spanMetadata[this.spanId];t&&s.kg.log(t.replace("Starting","Finishing"))}this.endTimestamp="number"==typeof t?t:(0,i.ph)()}toTraceparent(){let t="";return void 0!==this.sampled&&(t=this.sampled?"-1":"-0"),`${this.traceId}-${this.spanId}${t}`}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(t){return this.data=t.data||{},this.description=t.description,this.endTimestamp=t.endTimestamp,this.op=t.op,this.parentSpanId=t.parentSpanId,this.sampled=t.sampled,this.spanId=t.spanId||this.spanId,this.startTimestamp=t.startTimestamp||this.startTimestamp,this.status=t.status,this.tags=t.tags||{},this.traceId=t.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})}}function u(t){if(t<400&&t>=100)return"ok";if(t>=400&&t<500)switch(t){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(t>=500&&t<600)switch(t){case 501:return"unimplemented";case 503:return"unavailable";case 504:return"deadline_exceeded";default:return"internal_error"}return"unknown_error"}},1250:(t,e,n)=>{"use strict";n.d(e,{g:()=>s});var r=n(7597),i=n(5659);function s(t,e,n=(()=>{})){const s={...t};void 0!==s.name&&void 0===s.description&&(s.description=s.name);const o=(0,i.Gd)(),a=o.getScope(),c=a.getSpan(),u=c?c.startChild(s):o.startTransaction(s);function l(){u&&u.finish(),o.getScope().setSpan(c)}let p;a.setSpan(u);try{p=e(u)}catch(t){throw u&&u.setStatus("internal_error"),n(t),l(),t}return(0,r.J8)(p)?Promise.resolve(p).then((()=>{l()}),(t=>{u&&u.setStatus("internal_error"),n(t),l()})):l(),p}},8069:(t,e,n)=>{"use strict";n.d(e,{Y:()=>c});var r=n(2343),i=n(535),s=n(1131),o=n(5659),a=n(8903);class c extends a.Dr{__init(){this._measurements={}}__init2(){this._contexts={}}__init3(){this._frozenDynamicSamplingContext=void 0}constructor(t,e){super(t),c.prototype.__init.call(this),c.prototype.__init2.call(this),c.prototype.__init3.call(this),this._hub=e||(0,o.Gd)(),this._name=t.name||"",this.metadata={source:"custom",...t.metadata,spanMetadata:{}},this._trimEnd=t.trimEnd,this.transaction=this;const n=this.metadata.dynamicSamplingContext;n&&(this._frozenDynamicSamplingContext={...n})}get name(){return this._name}set name(t){this.setName(t)}setName(t,e="custom"){this._name=t,this.metadata.source=e}initSpanRecorder(t=1e3){this.spanRecorder||(this.spanRecorder=new a.gB(t)),this.spanRecorder.add(this)}setContext(t,e){null===e?delete this._contexts[t]:this._contexts[t]=e}setMeasurement(t,e,n=""){this._measurements[t]={value:e,unit:n}}setMetadata(t){this.metadata={...this.metadata,...t}}finish(t){if(void 0!==this.endTimestamp)return;this.name||(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&r.kg.warn("Transaction has no name, falling back to ``."),this.name=""),super.finish(t);const e=this._hub.getClient();if(e&&e.emit&&e.emit("finishTransaction",this),!0!==this.sampled)return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&r.kg.log("[Tracing] Discarding transaction because its trace was not chosen to be sampled."),void(e&&e.recordDroppedEvent("sample_rate","transaction"));const n=this.spanRecorder?this.spanRecorder.spans.filter((t=>t!==this&&t.endTimestamp)):[];this._trimEnd&&n.length>0&&(this.endTimestamp=n.reduce(((t,e)=>t.endTimestamp&&e.endTimestamp?t.endTimestamp>e.endTimestamp?t:e:t)).endTimestamp);const i=this.metadata,s={contexts:{...this._contexts,trace:this.getTraceContext()},spans:n,start_timestamp:this.startTimestamp,tags:this.tags,timestamp:this.endTimestamp,transaction:this.name,type:"transaction",sdkProcessingMetadata:{...i,dynamicSamplingContext:this.getDynamicSamplingContext()},...i.source&&{transaction_info:{source:i.source}}};return Object.keys(this._measurements).length>0&&(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&r.kg.log("[Measurements] Adding measurements to transaction",JSON.stringify(this._measurements,void 0,2)),s.measurements=this._measurements),("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&r.kg.log(`[Tracing] Finishing ${this.op} transaction: ${this.name}.`),this._hub.captureEvent(s)}toContext(){const t=super.toContext();return(0,i.Jr)({...t,name:this.name,trimEnd:this._trimEnd})}updateWithContext(t){return super.updateWithContext(t),this.name=t.name||"",this._trimEnd=t.trimEnd,this}getDynamicSamplingContext(){if(this._frozenDynamicSamplingContext)return this._frozenDynamicSamplingContext;const t=this._hub||(0,o.Gd)(),e=t&&t.getClient();if(!e)return{};const{environment:n,release:r}=e.getOptions()||{},{publicKey:a}=e.getDsn()||{},c=this.metadata.sampleRate,u=void 0!==c?c.toString():void 0,{segment:l}=t.getScope().getUser()||{},p=this.metadata.source,d=p&&"url"!==p?this.name:void 0,h=(0,i.Jr)({environment:n||s.J,release:r,transaction:d,user_segment:l,public_key:a,trace_id:this.traceId,sample_rate:u});return e.emit&&e.emit("createDsc",h),h}setHub(t){this._hub=t}}},9791:(t,e,n)=>{"use strict";n.d(e,{x1:()=>i});var r=n(5659);function i(t){return(t||(0,r.Gd)()).getScope().getTransaction()}},7522:(t,e,n)=>{"use strict";n.d(e,{z:()=>i});var r=n(5659);function i(t){if("boolean"==typeof __SENTRY_TRACING__&&!__SENTRY_TRACING__)return!1;const e=(0,r.Gd)().getClient(),n=t||e&&e.getOptions();return!!n&&(n.enableTracing||"tracesSampleRate"in n||"tracesSampler"in n)}},4776:(t,e,n)=>{"use strict";n.r(e),n.d(e,{DEFAULT_USER_INCLUDES:()=>Ie,Handlers:()=>i,Hub:()=>y.Xb,Integrations:()=>un,NodeClient:()=>Dt,SDK_VERSION:()=>g,Scope:()=>nt.s,addBreadcrumb:()=>T,addGlobalEventProcessor:()=>nt.c,addRequestDataToEvent:()=>De,autoDiscoverNodePerformanceMonitoringIntegrations:()=>ct,captureCheckIn:()=>A,captureEvent:()=>E,captureException:()=>b,captureMessage:()=>v,close:()=>Ge,configureScope:()=>w,createTransport:()=>tt,deepReadDirSync:()=>He,defaultIntegrations:()=>Fe,defaultStackParser:()=>Ve,extractRequestData:()=>Oe,extractTraceparentData:()=>rt.q,flush:()=>$e,getActiveTransaction:()=>it.x1,getCurrentHub:()=>y.Gd,getHubFromCarrier:()=>y.vi,getSentryRelease:()=>Ye,init:()=>Be,lastEventId:()=>Le,makeMain:()=>y.pj,makeNodeTransport:()=>Mt,runWithAsyncContext:()=>y.Ok,setContext:()=>S,setExtra:()=>x,setExtras:()=>I,setTag:()=>D,setTags:()=>O,setUser:()=>N,spanStatusfromHttpCode:()=>st.Zd,startTransaction:()=>k,trace:()=>ot.g,withScope:()=>C});var r={};n.r(r),n.d(r,{FunctionToString:()=>u,InboundFilters:()=>_});var i={};n.r(i),n.d(i,{errorHandler:()=>Qe,extractRequestData:()=>We,parseRequest:()=>Je,requestHandler:()=>Xe,tracingHandler:()=>Ke,trpcMiddleware:()=>tn});var s={};n.r(s),n.d(s,{Console:()=>Ht,Context:()=>fe,ContextLines:()=>se,Http:()=>Xt,LinkedErrors:()=>ae,LocalVariables:()=>Ue,Modules:()=>le,OnUncaughtException:()=>ee,OnUnhandledRejection:()=>ne,RequestData:()=>Ce,Undici:()=>je.Y});var o={};n.r(o),n.d(o,{Apollo:()=>en._,Express:()=>nn.N,GraphQL:()=>rn.k,Mongo:()=>sn._,Mysql:()=>on.m,Postgres:()=>an.E,Prisma:()=>cn.g});var a=n(535);let c;class u{constructor(){u.prototype.__init.call(this)}static __initStatic(){this.id="FunctionToString"}__init(){this.name=u.id}setupOnce(){c=Function.prototype.toString;try{Function.prototype.toString=function(...t){const e=(0,a.HK)(this)||this;return c.apply(e,t)}}catch(t){}}}u.__initStatic();var l=n(2343),p=n(2844),d=n(7321);const h=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/],f=[/^.*healthcheck.*$/,/^.*healthy.*$/,/^.*live.*$/,/^.*ready.*$/,/^.*heartbeat.*$/,/^.*\/health$/,/^.*\/healthz$/];class _{static __initStatic(){this.id="InboundFilters"}__init(){this.name=_.id}constructor(t={}){this._options=t,_.prototype.__init.call(this)}setupOnce(t,e){const n=t=>{const n=e();if(n){const e=n.getIntegration(_);if(e){const r=n.getClient(),i=r?r.getOptions():{},s=function(t={},e={}){return{allowUrls:[...t.allowUrls||[],...e.allowUrls||[]],denyUrls:[...t.denyUrls||[],...e.denyUrls||[]],ignoreErrors:[...t.ignoreErrors||[],...e.ignoreErrors||[],...t.disableErrorDefaults?[]:h],ignoreTransactions:[...t.ignoreTransactions||[],...e.ignoreTransactions||[],...t.disableTransactionDefaults?[]:f],ignoreInternal:void 0===t.ignoreInternal||t.ignoreInternal}}(e._options,i);return function(t,e){return e.ignoreInternal&&function(t){try{return"SentryError"===t.exception.values[0].type}catch(t){}return!1}(t)?(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&l.kg.warn(`Event dropped due to being internal Sentry Error.\nEvent: ${(0,p.jH)(t)}`),!0):function(t,e){return!(t.type||!e||!e.length)&&function(t){if(t.message)return[t.message];if(t.exception){const{values:e}=t.exception;try{const{type:t="",value:n=""}=e&&e[e.length-1]||{};return[`${n}`,`${t}: ${n}`]}catch(e){return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&l.kg.error(`Cannot extract message for event ${(0,p.jH)(t)}`),[]}}return[]}(t).some((t=>(0,d.U0)(t,e)))}(t,e.ignoreErrors)?(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&l.kg.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${(0,p.jH)(t)}`),!0):function(t,e){if("transaction"!==t.type||!e||!e.length)return!1;const n=t.transaction;return!!n&&(0,d.U0)(n,e)}(t,e.ignoreTransactions)?(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&l.kg.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.\nEvent: ${(0,p.jH)(t)}`),!0):function(t,e){if(!e||!e.length)return!1;const n=m(t);return!!n&&(0,d.U0)(n,e)}(t,e.denyUrls)?(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&l.kg.warn(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${(0,p.jH)(t)}.\nUrl: ${m(t)}`),!0):!function(t,e){if(!e||!e.length)return!0;const n=m(t);return!n||(0,d.U0)(n,e)}(t,e.allowUrls)&&(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&l.kg.warn(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${(0,p.jH)(t)}.\nUrl: ${m(t)}`),!0)}(t,s)?null:t}}return t};n.id=this.name,t(n)}}function m(t){try{let e;try{e=t.exception.values[0].stacktrace.frames}catch(t){}return e?function(t=[]){for(let e=t.length-1;e>=0;e--){const n=t[e];if(n&&""!==n.filename&&"[native code]"!==n.filename)return n.filename||null}return null}(e):null}catch(e){return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&l.kg.error(`Cannot extract url for event ${(0,p.jH)(t)}`),null}}_.__initStatic();const g="7.56.0";var y=n(5659);function b(t,e){return(0,y.Gd)().captureException(t,{captureContext:e})}function v(t,e){const n="string"==typeof e?e:void 0,r="string"!=typeof e?{captureContext:e}:void 0;return(0,y.Gd)().captureMessage(t,n,r)}function E(t,e){return(0,y.Gd)().captureEvent(t,e)}function w(t){(0,y.Gd)().configureScope(t)}function T(t){(0,y.Gd)().addBreadcrumb(t)}function S(t,e){(0,y.Gd)().setContext(t,e)}function I(t){(0,y.Gd)().setExtras(t)}function x(t,e){(0,y.Gd)().setExtra(t,e)}function O(t){(0,y.Gd)().setTags(t)}function D(t,e){(0,y.Gd)().setTag(t,e)}function N(t){(0,y.Gd)().setUser(t)}function C(t){(0,y.Gd)().withScope(t)}function k(t,e){return(0,y.Gd)().startTransaction({...t},e)}function A(t,e){const n=(0,y.Gd)().getClient();if(n){if(n.captureCheckIn)return n.captureCheckIn(t,e);("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&l.kg.warn("Cannot capture check-in. Client does not support sending check-ins.")}else("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&l.kg.warn("Cannot capture check-in. No client defined.");return(0,p.DM)()}class R extends Error{constructor(t,e="warn"){super(t),this.message=t,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=e}}var P=n(6893);const U=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function j(t,e=!1){const{host:n,path:r,pass:i,port:s,projectId:o,protocol:a,publicKey:c}=t;return`${a}://${c}${e&&i?`:${i}`:""}@${n}${s?`:${s}`:""}/${r?`${r}/`:r}${o}`}function M(t){return{protocol:t.protocol,publicKey:t.publicKey||"",pass:t.pass||"",host:t.host,port:t.port||"",path:t.path||"",projectId:t.projectId}}var F=n(7597),B=n(6147);function L(t,e=100,n=1/0){try{return G("",t,e,n)}catch(t){return{ERROR:`**non-serializable** (${t})`}}}function $(t,e=3,n=102400){const r=L(t,e);return i=r,function(t){return~-encodeURI(t).split(/%..|./).length}(JSON.stringify(i))>n?$(t,e-1,n):r;var i}function G(t,e,n=1/0,r=1/0,i=function(){const t="function"==typeof WeakSet,e=t?new WeakSet:[];return[function(n){if(t)return!!e.has(n)||(e.add(n),!1);for(let t=0;t=r){p[t]="[MaxProperties ~]";break}const e=h[t];p[t]=G(t,e,u-1,r,i),d++}return o(e),p}function q(t,e=[]){return[t,e]}function Y(t,e){const[n,r]=t;return[n,[...r,e]]}function V(t,e){const n=t[1];for(const t of n)if(e(t,t[0].type))return!0;return!1}function H(t,e){return(e||new TextEncoder).encode(t)}function z(t,e){const[n,r]=t;let i=JSON.stringify(n);function s(t){"string"==typeof i?i="string"==typeof t?i+t:[H(i,e),t]:i.push("string"==typeof t?H(t,e):t)}for(const t of r){const[e,n]=t;if(s(`\n${JSON.stringify(e)}\n`),"string"==typeof n||n instanceof Uint8Array)s(n);else{let t;try{t=JSON.stringify(n)}catch(e){t=JSON.stringify(L(n))}s(t)}}return"string"==typeof i?i:function(t){const e=t.reduce(((t,e)=>t+e.length),0),n=new Uint8Array(e);let r=0;for(const e of t)n.set(e,r),r+=e.length;return n}(i)}function W(t,e){const n="string"==typeof t.data?H(t.data,e):t.data;return[(0,a.Jr)({type:"attachment",length:n.length,filename:t.filename,content_type:t.contentType,attachment_type:t.attachmentType}),n]}const J={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor"};function K(t){return J[t]}function X(t){if(!t||!t.sdk)return;const{name:e,version:n}=t.sdk;return{name:e,version:n}}const Z=6e4;const Q=30;function tt(t,e,n=function(t){const e=[];function n(t){return e.splice(e.indexOf(t),1)[0]}return{$:e,add:function(r){if(!(void 0===t||e.lengthn(i))).then(null,(()=>n(i).then(null,(()=>{})))),i},drain:function(t){return new P.cW(((n,r)=>{let i=e.length;if(!i)return n(!0);const s=setTimeout((()=>{t&&t>0&&n(!1)}),t);e.forEach((t=>{(0,P.WD)(t).then((()=>{--i||(clearTimeout(s),n(!0))}),r)}))}))}}}(t.bufferSize||Q)){let r={};function i(i){const s=[];if(V(i,((e,n)=>{const i=K(n);if(function(t,e,n=Date.now()){return function(t,e){return t[e]||t.all||0}(t,e)>n}(r,i)){const r=et(e,n);t.recordDroppedEvent("ratelimit_backoff",i,r)}else s.push(e)})),0===s.length)return(0,P.WD)();const o=q(i[0],s),a=e=>{V(o,((n,r)=>{const i=et(n,r);t.recordDroppedEvent(e,K(r),i)}))};return n.add((()=>e({body:z(o,t.textEncoder)}).then((t=>(void 0!==t.statusCode&&(t.statusCode<200||t.statusCode>=300)&&("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&l.kg.warn(`Sentry responded with status code ${t.statusCode} to sent event.`),r=function(t,{statusCode:e,headers:n},r=Date.now()){const i={...t},s=n&&n["x-sentry-rate-limits"],o=n&&n["retry-after"];if(s)for(const t of s.trim().split(",")){const[e,n]=t.split(":",2),s=parseInt(e,10),o=1e3*(isNaN(s)?60:s);if(n)for(const t of n.split(";"))i[t]=r+o;else i.all=r+o}else o?i.all=r+function(t,e=Date.now()){const n=parseInt(`${t}`,10);if(!isNaN(n))return 1e3*n;const r=Date.parse(`${t}`);return isNaN(r)?Z:r-e}(o,r):429===e&&(i.all=r+6e4);return i}(r,t),t)),(t=>{throw a("network_error"),t})))).then((t=>t),(t=>{if(t instanceof R)return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&l.kg.error("Skipped sending event because buffer is full."),a("queue_overflow"),(0,P.WD)();throw t}))}return i.__sentry__baseTransport__=!0,{send:i,flush:t=>n.drain(t)}}function et(t,e){if("event"===e||"transaction"===e)return Array.isArray(t)?t[1]:void 0}var nt=n(350),rt=n(7638),it=n(9791),st=n(8903),ot=n(1250),at=n(6046);function ct(){const t=at.G.map((t=>{try{return t()}catch(t){return}})).filter((t=>!!t));return 0===t.length&&l.kg.warn("Performance monitoring integrations could not be automatically loaded."),t.filter((t=>!!t.loadDependency()))}var ut=n(4307);const lt=[];function pt(t){const e=t.defaultIntegrations||[],n=t.integrations;let r;e.forEach((t=>{t.isDefaultInstance=!0})),r=Array.isArray(n)?[...e,...n]:"function"==typeof n?(0,p.lE)(n(e)):e;const i=function(t){const e={};return t.forEach((t=>{const{name:n}=t,r=e[n];r&&!r.isDefaultInstance&&t.isDefaultInstance||(e[n]=t)})),Object.keys(e).map((t=>e[t]))}(r),s=function(t,e){for(let e=0;e1&&(c=l.slice(0,-1).join("/"),u=l.pop()),u){const t=u.match(/^\d+/);t&&(u=t[0])}return M({host:s,pass:i,path:c,projectId:u,port:o,protocol:n,publicKey:r})}(t):M(t);if(e&&function(t){if("undefined"!=typeof __SENTRY_DEBUG__&&!__SENTRY_DEBUG__)return!0;const{port:e,projectId:n,protocol:r}=t;return!(["protocol","publicKey","host","projectId"].find((e=>!t[e]&&(l.kg.error(`Invalid Sentry Dsn: ${e} missing`),!0)))||(n.match(/^\d+$/)?function(t){return"http"===t||"https"===t}(r)?e&&isNaN(parseInt(e,10))&&(l.kg.error(`Invalid Sentry Dsn: Invalid port ${e}`),1):(l.kg.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),1):(l.kg.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),1)))}(e))return e}(t.dsn):("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&l.kg.warn("No DSN provided, client will not do anything."),this._dsn){const e=function(t,e={}){const n="string"==typeof e?e:e.tunnel,r="string"!=typeof e&&e._metadata?e._metadata.sdk:void 0;return n||`${function(t){return`${function(t){const e=t.protocol?`${t.protocol}:`:"",n=t.port?`:${t.port}`:"";return`${e}//${t.host}${n}${t.path?`/${t.path}`:""}/api/`}(t)}${t.projectId}/envelope/`}(t)}?${function(t,e){return(0,a._j)({sentry_key:t.publicKey,sentry_version:"7",...e&&{sentry_client:`${e.name}/${e.version}`}})}(t,r)}`}(this._dsn,t);this._transport=t.transport({recordDroppedEvent:this.recordDroppedEvent.bind(this),...t.transportOptions,url:e})}}captureException(t,e,n){if((0,p.YO)(t))return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&l.kg.log(yt));let r=e&&e.event_id;return this._process(this.eventFromException(t,e).then((t=>this._captureEvent(t,e,n))).then((t=>{r=t}))),r}captureMessage(t,e,n,r){let i=n&&n.event_id;const s=(0,F.pt)(t)?this.eventFromMessage(String(t),e,n):this.eventFromException(t,n);return this._process(s.then((t=>this._captureEvent(t,n,r))).then((t=>{i=t}))),i}captureEvent(t,e,n){if(e&&e.originalException&&(0,p.YO)(e.originalException))return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&l.kg.log(yt));let r=e&&e.event_id;return this._process(this._captureEvent(t,e,n).then((t=>{r=t}))),r}captureSession(t){this._isEnabled()?"string"!=typeof t.release?("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&l.kg.warn("Discarded session because of missing or non-string release"):(this.sendSession(t),(0,ht.CT)(t,{init:!1})):("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&l.kg.warn("SDK not enabled, will not capture session.")}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(t){const e=this._transport;return e?this._isClientDoneProcessing(t).then((n=>e.flush(t).then((t=>n&&t)))):(0,P.WD)(!0)}close(t){return this.flush(t).then((t=>(this.getOptions().enabled=!1,t)))}setupIntegrations(){this._isEnabled()&&!this._integrationsInitialized&&(this._integrations=function(t){const e={};return t.forEach((t=>{t&&dt(t,e)})),e}(this._options.integrations),this._integrationsInitialized=!0)}getIntegrationById(t){return this._integrations[t]}getIntegration(t){try{return this._integrations[t.id]||null}catch(e){return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&l.kg.warn(`Cannot retrieve integration ${t.id} from the current Client`),null}}addIntegration(t){dt(t,this._integrations)}sendEvent(t,e={}){if(this._dsn){let n=function(t,e,n,r){const i=X(n),s=t.type&&"replay_event"!==t.type?t.type:"event";!function(t,e){e&&(t.sdk=t.sdk||{},t.sdk.name=t.sdk.name||e.name,t.sdk.version=t.sdk.version||e.version,t.sdk.integrations=[...t.sdk.integrations||[],...e.integrations||[]],t.sdk.packages=[...t.sdk.packages||[],...e.packages||[]])}(t,n&&n.sdk);const o=function(t,e,n,r){const i=t.sdkProcessingMetadata&&t.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:t.event_id,sent_at:(new Date).toISOString(),...e&&{sdk:e},...!!n&&{dsn:j(r)},...i&&{trace:(0,a.Jr)({...i})}}}(t,i,r,e);return delete t.sdkProcessingMetadata,q(o,[[{type:s},t]])}(t,this._dsn,this._options._metadata,this._options.tunnel);for(const t of e.attachments||[])n=Y(n,W(t,this._options.transportOptions&&this._options.transportOptions.textEncoder));const r=this._sendEnvelope(n);r&&r.then((e=>this.emit("afterSendEvent",t,e)),null)}}sendSession(t){if(this._dsn){const e=function(t,e,n,r){const i=X(n);return q({sent_at:(new Date).toISOString(),...i&&{sdk:i},...!!r&&{dsn:j(e)}},["aggregates"in t?[{type:"sessions"},t]:[{type:"session"},t.toJSON()]])}(t,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(e)}}recordDroppedEvent(t,e,n){if(this._options.sendClientReports){const n=`${t}:${e}`;("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&l.kg.log(`Adding outcome: "${n}"`),this._outcomes[n]=this._outcomes[n]+1||1}}on(t,e){this._hooks[t]||(this._hooks[t]=[]),this._hooks[t].push(e)}emit(t,...e){this._hooks[t]&&this._hooks[t].forEach((t=>t(...e)))}_updateSessionFromEvent(t,e){let n=!1,r=!1;const i=e.exception&&e.exception.values;if(i){r=!0;for(const t of i){const e=t.mechanism;if(e&&!1===e.handled){n=!0;break}}}const s="ok"===t.status;(s&&0===t.errors||s&&n)&&((0,ht.CT)(t,{...n&&{status:"crashed"},errors:t.errors||Number(r||n)}),this.captureSession(t))}_isClientDoneProcessing(t){return new P.cW((e=>{let n=0;const r=setInterval((()=>{0==this._numProcessing?(clearInterval(r),e(!0)):(n+=1,t&&n>=t&&(clearInterval(r),e(!1)))}),1)}))}_isEnabled(){return!1!==this.getOptions().enabled&&void 0!==this._dsn}_prepareEvent(t,e,n){const r=this.getOptions(),i=Object.keys(this._integrations);return!e.integrations&&i.length>0&&(e.integrations=i),function(t,e,n,r){const{normalizeDepth:i=3,normalizeMaxBreadth:s=1e3}=t,o={...e,event_id:e.event_id||n.event_id||(0,p.DM)(),timestamp:e.timestamp||(0,ft.yW)()},a=n.integrations||t.integrations.map((t=>t.name));!function(t,e){const{environment:n,release:r,dist:i,maxValueLength:s=250}=e;"environment"in t||(t.environment="environment"in e?n:mt.J),void 0===t.release&&void 0!==r&&(t.release=r),void 0===t.dist&&void 0!==i&&(t.dist=i),t.message&&(t.message=(0,d.$G)(t.message,s));const o=t.exception&&t.exception.values&&t.exception.values[0];o&&o.value&&(o.value=(0,d.$G)(o.value,s));const a=t.request;a&&a.url&&(a.url=(0,d.$G)(a.url,s))}(o,t),function(t,e){e.length>0&&(t.sdk=t.sdk||{},t.sdk.integrations=[...t.sdk.integrations||[],...e])}(o,a),void 0===e.type&&function(t,e){const n=_t.n2._sentryDebugIds;if(!n)return;let r;const i=gt.get(e);i?r=i:(r=new Map,gt.set(e,r));const s=Object.keys(n).reduce(((t,i)=>{let s;const o=r.get(i);o?s=o:(s=e(i),r.set(i,s));for(let e=s.length-1;e>=0;e--){const r=s[e];if(r.filename){t[r.filename]=n[i];break}}return t}),{});try{t.exception.values.forEach((t=>{t.stacktrace.frames.forEach((t=>{t.filename&&(t.debug_id=s[t.filename])}))}))}catch(t){}}(o,t.stackParser);let c=r;n.captureContext&&(c=nt.s.clone(c).update(n.captureContext));let u=(0,P.WD)(o);if(c){if(c.getAttachments){const t=[...n.attachments||[],...c.getAttachments()];t.length&&(n.attachments=t)}u=c.applyToEvent(o,n)}return u.then((t=>(t&&function(t){const e={};try{t.exception.values.forEach((t=>{t.stacktrace.frames.forEach((t=>{t.debug_id&&(t.abs_path?e[t.abs_path]=t.debug_id:t.filename&&(e[t.filename]=t.debug_id),delete t.debug_id)}))}))}catch(t){}if(0===Object.keys(e).length)return;t.debug_meta=t.debug_meta||{},t.debug_meta.images=t.debug_meta.images||[];const n=t.debug_meta.images;Object.keys(e).forEach((t=>{n.push({type:"sourcemap",code_file:t,debug_id:e[t]})}))}(t),"number"==typeof i&&i>0?function(t,e,n){if(!t)return null;const r={...t,...t.breadcrumbs&&{breadcrumbs:t.breadcrumbs.map((t=>({...t,...t.data&&{data:L(t.data,e,n)}})))},...t.user&&{user:L(t.user,e,n)},...t.contexts&&{contexts:L(t.contexts,e,n)},...t.extra&&{extra:L(t.extra,e,n)}};return t.contexts&&t.contexts.trace&&r.contexts&&(r.contexts.trace=t.contexts.trace,t.contexts.trace.data&&(r.contexts.trace.data=L(t.contexts.trace.data,e,n))),t.spans&&(r.spans=t.spans.map((t=>(t.data&&(t.data=L(t.data,e,n)),t)))),r}(t,i,s):t)))}(r,t,e,n)}_captureEvent(t,e={},n){return this._processEvent(t,e,n).then((t=>t.event_id),(t=>{if("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__){const e=t;"log"===e.logLevel?l.kg.log(e.message):l.kg.warn(e)}}))}_processEvent(t,e,n){const r=this.getOptions(),{sampleRate:i}=r;if(!this._isEnabled())return(0,P.$2)(new R("SDK not enabled, will not capture event.","log"));const s=Et(t),o=vt(t),a=t.type||"error",c=`before send for type \`${a}\``;if(o&&"number"==typeof i&&Math.random()>i)return this.recordDroppedEvent("sample_rate","error",t),(0,P.$2)(new R(`Discarding event because it's not included in the random sample (sampling rate = ${i})`,"log"));const u="replay_event"===a?"replay":a;return this._prepareEvent(t,e,n).then((n=>{if(null===n)throw this.recordDroppedEvent("event_processor",u,t),new R("An event processor returned `null`, will not send event.","log");if(e.data&&!0===e.data.__sentry__)return n;const i=function(t,e,n){const{beforeSend:r,beforeSendTransaction:i}=t;return vt(e)&&r?r(e,n):Et(e)&&i?i(e,n):e}(r,n,e);return function(t,e){const n=`${e} must return \`null\` or a valid event.`;if((0,F.J8)(t))return t.then((t=>{if(!(0,F.PO)(t)&&null!==t)throw new R(n);return t}),(t=>{throw new R(`${e} rejected with ${t}`)}));if(!(0,F.PO)(t)&&null!==t)throw new R(n);return t}(i,c)})).then((r=>{if(null===r)throw this.recordDroppedEvent("before_send",u,t),new R(`${c} returned \`null\`, will not send event.`,"log");const i=n&&n.getSession();!s&&i&&this._updateSessionFromEvent(i,r);const o=r.transaction_info;if(s&&o&&r.transaction!==t.transaction){const t="custom";r.transaction_info={...o,source:t}}return this.sendEvent(r,e),r})).then(null,(t=>{if(t instanceof R)throw t;throw this.captureException(t,{data:{__sentry__:!0},originalException:t}),new R(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${t}`)}))}_process(t){this._numProcessing++,t.then((t=>(this._numProcessing--,t)),(t=>(this._numProcessing--,t)))}_sendEnvelope(t){if(this._transport&&this._dsn)return this.emit("beforeEnvelope",t),this._transport.send(t).then(null,(t=>{("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&l.kg.error("Error while sending event:",t)}));("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&l.kg.error("Transport disabled")}_clearOutcomes(){const t=this._outcomes;return this._outcomes={},Object.keys(t).map((e=>{const[n,r]=e.split(":");return{reason:n,category:r,quantity:t[e]}}))}}function vt(t){return void 0===t.type}function Et(t){return"transaction"===t.type}var wt=n(6890);class Tt{__init(){this.flushTimeout=60}__init2(){this._pendingAggregates={}}__init3(){this._isEnabled=!0}constructor(t,e){Tt.prototype.__init.call(this),Tt.prototype.__init2.call(this),Tt.prototype.__init3.call(this),this._client=t,this._intervalId=setInterval((()=>this.flush()),1e3*this.flushTimeout),this._sessionAttrs=e}flush(){const t=this.getSessionAggregates();0!==t.aggregates.length&&(this._pendingAggregates={},this._client.sendSession(t))}getSessionAggregates(){const t=Object.keys(this._pendingAggregates).map((t=>this._pendingAggregates[parseInt(t)])),e={attrs:this._sessionAttrs,aggregates:t};return(0,a.Jr)(e)}close(){clearInterval(this._intervalId),this._isEnabled=!1,this.flush()}incrementSessionStatusCount(){if(!this._isEnabled)return;const t=(0,y.Gd)().getScope(),e=t.getRequestSession();e&&e.status&&(this._incrementSessionStatusCount(e.status,new Date),t.setRequestSession(void 0))}_incrementSessionStatusCount(t,e){const n=new Date(e).setSeconds(0,0);this._pendingAggregates[n]=this._pendingAggregates[n]||{};const r=this._pendingAggregates[n];switch(r.started||(r.started=new Date(n).toISOString()),t){case"errored":return r.errored=(r.errored||0)+1,r.errored;case"ok":return r.exited=(r.exited||0)+1,r.exited;default:return r.crashed=(r.crashed||0)+1,r.crashed}}}var St=n(2037),It=n(3837);function xt(t,e){return t(e.stack||"",1)}function Ot(t,e){const n={type:e.name||e.constructor.name,value:e.message},r=xt(t,e);return r.length&&(n.stacktrace={frames:r}),n}class Dt extends bt{constructor(t){t._metadata=t._metadata||{},t._metadata.sdk=t._metadata.sdk||{name:"sentry.javascript.node",packages:[{name:"npm:@sentry/node",version:g}],version:g},t.transportOptions={textEncoder:new It.TextEncoder,...t.transportOptions},(0,wt.T)(),super(t)}captureException(t,e,n){if(this._options.autoSessionTracking&&this._sessionFlusher&&n){const t=n.getRequestSession();t&&"ok"===t.status&&(t.status="errored")}return super.captureException(t,e,n)}captureEvent(t,e,n){if(this._options.autoSessionTracking&&this._sessionFlusher&&n&&"exception"===(t.type||"exception")&&t.exception&&t.exception.values&&t.exception.values.length>0){const t=n.getRequestSession();t&&"ok"===t.status&&(t.status="errored")}return super.captureEvent(t,e,n)}close(t){return(0,ut.x)([this,"access",t=>t._sessionFlusher,"optionalAccess",t=>t.close,"call",t=>t()]),super.close(t)}initSessionFlusher(){const{release:t,environment:e}=this._options;t?this._sessionFlusher=new Tt(this,{release:t,environment:e}):("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&l.kg.warn("Cannot initialise an instance of SessionFlusher if no release is provided!")}eventFromException(t,e){return(0,P.WD)(function(t,e,n){let r=e;const i=n&&n.data&&n.data.mechanism||{handled:!0,type:"generic"};if(!(0,F.VZ)(e)){if((0,F.PO)(e)){const t=`Non-Error exception captured with keys: ${(0,a.zf)(e)}`,i=(0,y.Gd)(),s=i.getClient(),o=s&&s.getOptions().normalizeDepth;i.configureScope((t=>{t.setExtra("__serialized__",$(e,o))})),r=n&&n.syntheticException||new Error(t),r.message=t}else r=n&&n.syntheticException||new Error(e),r.message=e;i.synthetic=!0}const s={exception:{values:[Ot(t,r)]}};return(0,p.Db)(s,void 0,void 0),(0,p.EG)(s,i),{...s,event_id:n&&n.event_id}}(this._options.stackParser,t,e))}eventFromMessage(t,e="info",n){return(0,P.WD)(function(t,e,n="info",r,i){const s={event_id:r&&r.event_id,level:n,message:e};if(i&&r&&r.syntheticException){const n=xt(t,r.syntheticException);n.length&&(s.exception={values:[{value:e,stacktrace:{frames:n}}]})}return s}(this._options.stackParser,t,e,n,this._options.attachStacktrace))}captureCheckIn(t,e){const n="in_progress"!==t.status&&t.checkInId?t.checkInId:(0,p.DM)();if(!this._isEnabled())return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&l.kg.warn("SDK not enabled, will not capture checkin."),n;const r=this.getOptions(),{release:i,environment:s,tunnel:o}=r,a={check_in_id:n,monitor_slug:t.monitorSlug,status:t.status,release:i,environment:s};"in_progress"!==t.status&&(a.duration=t.duration),e&&(a.monitor_config={schedule:e.schedule,checkin_margin:e.checkinMargin,max_runtime:e.maxRuntime,timezone:e.timezone});const c=function(t,e,n,r){const i={sent_at:(new Date).toISOString(),...e&&e.sdk&&{sdk:{name:e.sdk.name,version:e.sdk.version}},...!!n&&!!r&&{dsn:j(r)}},s=function(t){return[{type:"check_in"},t]}(t);return q(i,[s])}(a,this.getSdkMetadata(),o,this.getDsn());return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&l.kg.info("Sending checkin:",t.monitorSlug,t.status),this._sendEnvelope(c),n}_prepareEvent(t,e,n){return t.platform=t.platform||"node",t.contexts={...t.contexts,runtime:(0,ut.x)([t,"access",t=>t.contexts,"optionalAccess",t=>t.runtime])||{name:"node",version:global.process.version}},t.server_name=t.server_name||this.getOptions().serverName||global.process.env.SENTRY_NAME||St.hostname(),super._prepareEvent(t,e,n)}_captureRequestSession(){this._sessionFlusher?this._sessionFlusher.incrementSessionStatusCount():("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&l.kg.warn("Discarded request mode session because autoSessionTracking option was disabled")}}function Nt(t,e){return null!=t?t:e()}var Ct=n(3685),kt=n(5687),At=n(6018),Rt=n(2781),Pt=n(7310),Ut=n(9796);const jt=32768;function Mt(t){let e;try{e=new Pt.URL(t.url)}catch(e){return console.warn("[@sentry/node]: Invalid dsn or tunnel option, will not send any events. The tunnel option must be a full URL when used."),tt(t,(()=>Promise.resolve({})))}const n="https:"===e.protocol,r=function(t,e){const{no_proxy:n}=process.env;return n&&n.split(",").some((e=>t.host.endsWith(e)||t.hostname.endsWith(e)))?void 0:e}(e,t.proxy||(n?process.env.https_proxy:void 0)||process.env.http_proxy),i=n?kt:Ct,s=void 0!==t.keepAlive&&t.keepAlive,o=r?new At.HttpsProxyAgent(r):new i.Agent({keepAlive:s,maxSockets:30,timeout:2e3}),a=function(t,e,n){const{hostname:r,pathname:i,port:s,protocol:o,search:a}=new Pt.URL(t.url);return function(c){return new Promise(((u,l)=>{let p=function(t){return new Rt.Readable({read(){this.push(t),this.push(null)}})}(c.body);const d={...t.headers};c.body.length>jt&&(d["content-encoding"]="gzip",p=p.pipe((0,Ut.createGzip)()));const h=e.request({method:"POST",agent:n,headers:d,hostname:r,path:`${i}${a}`,port:s,protocol:o,ca:t.caCerts},(t=>{t.on("data",(()=>{})),t.on("end",(()=>{})),t.setEncoding("utf8");const e=Nt(t.headers["retry-after"],(()=>null)),n=Nt(t.headers["x-sentry-rate-limits"],(()=>null));u({statusCode:t.statusCode,headers:{"retry-after":e,"x-sentry-rate-limits":Array.isArray(n)?n[0]:n}})}));h.on("error",l),p.pipe(h)}))}}(t,Nt(t.httpModule,(()=>i)),o);return tt(t,a)}var Ft=n(9656);const Bt=require("domain");function Lt(){return Bt.active}function $t(){const t=Lt();if(t)return(0,y.uZ)(t),(0,y.vi)(t)}function Gt(t,e){const n=Lt();if(n&&(0,ut.x)([e,"optionalAccess",t=>t.reuseExisting]))return t();const r=Bt.create(),i=function(t){const e={};return(0,y.uZ)(e,t),(0,y.vi)(e)}(n?(0,y.vi)(n):void 0);return(0,y.j0)(r,i),r.bind((()=>t()))()}const qt=require("async_hooks");function Yt(){Ft.V.major&&Ft.V.major>=14?function(){const t=new qt.AsyncLocalStorage;function e(){return t.getStore()}(0,y.$b)({getCurrentHub:e,runWithAsyncContext:function(n,r){const i=e();if(i&&(0,ut.x)([r,"optionalAccess",t=>t.reuseExisting]))return n();const s=function(t){const e={};return(0,y.uZ)(e,t),(0,y.vi)(e)}(i);return t.run(s,(()=>n()))}})}():(0,y.$b)({getCurrentHub:$t,runWithAsyncContext:Gt})}const Vt=["fatal","error","warning","log","info","debug"];class Ht{constructor(){Ht.prototype.__init.call(this)}static __initStatic(){this.id="Console"}__init(){this.name=Ht.id}setupOnce(){for(const t of["debug","info","warn","error","log"])(0,a.hl)(console,t,zt(t))}}function zt(t){return function(e){const n=function(t){return"warn"===t?"warning":Vt.includes(t)?t:"log"}(t);return function(){(0,y.Gd)().getIntegration(Ht)&&(0,y.Gd)().addBreadcrumb({category:"console",level:n,message:It.format.apply(void 0,arguments)},{input:[...arguments],level:t}),e.apply(this,arguments)}}}Ht.__initStatic();var Wt=n(9181),Jt=n(7612),Kt=n(7578);class Xt{static __initStatic(){this.id="Http"}__init(){this.name=Xt.id}constructor(t={}){Xt.prototype.__init.call(this),this._breadcrumbs=void 0===t.breadcrumbs||t.breadcrumbs,this._tracing=t.tracing?!0===t.tracing?{}:t.tracing:void 0}setupOnce(t,e){if(!this._breadcrumbs&&!this._tracing)return;const r=(0,ut.x)([e,"call",t=>t(),"access",t=>t.getClient,"call",t=>t(),"optionalAccess",t=>t.getOptions,"call",t=>t()]);if(r&&"sentry"!==r.instrumenter)return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&l.kg.log("HTTP Integration is skipped because of instrumenter configuration."));const i=this._tracing?{...r,...this._tracing}:void 0,s=n(3685),o=Zt(this._breadcrumbs,i,s);if((0,a.hl)(s,"get",o),(0,a.hl)(s,"request",o),Ft.V.major&&Ft.V.major>8){const t=n(5687),e=Zt(this._breadcrumbs,i,t);(0,a.hl)(t,"get",e),(0,a.hl)(t,"request",e)}}}function Zt(t,e,n){const r=new Jt.LRUMap(100),i=new Jt.LRUMap(100);return function(s){return function(...o){const a=(0,Kt.nY)(n,o),c=a[0],u=(0,Kt.lx)(c),p=(0,Kt.CA)(c);if((0,Kt.ZB)(p))return s.apply(n,a);let h,f;const _=(0,y.Gd)().getScope(),m=c.method||"GET",g={url:p,"http.method":m};if(c.hash&&(g["http.fragment"]=c.hash.substring(1)),c.search&&(g["http.query"]=c.search.substring(1)),_&&e&&(t=>{if(void 0===(0,ut.x)([e,"optionalAccess",t=>t.shouldCreateSpanForRequest]))return!0;const n=r.get(t);if(void 0!==n)return n;const i=e.shouldCreateSpanForRequest(t);return r.set(t,i),i})(u)&&(f=_.getSpan(),f))if(h=f.startChild({description:`${m} ${g.url}`,op:"http.client",data:g}),(t=>{if(void 0===(0,ut.x)([e,"optionalAccess",t=>t.tracePropagationTargets]))return!0;const n=i.get(t);if(void 0!==n)return n;const r=(0,d.U0)(t,e.tracePropagationTargets);return i.set(t,r),r})(u)){const t=h.toTraceparent();if(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&l.kg.log(`[Tracing] Adding sentry-trace header ${t} to outgoing request to "${p}": `),c.headers={...c.headers,"sentry-trace":t},f.transaction){const t=f.transaction.getDynamicSamplingContext(),e=(0,Wt.IQ)(t);let n;n=c.headers&&c.headers.baggage?e?Array.isArray(c.headers.baggage)?[...c.headers.baggage,e]:[c.headers.baggage,e]:c.headers.baggage:e,c.headers={...c.headers,...n&&{baggage:n}}}}else("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&l.kg.log(`[Tracing] Not adding sentry-trace header to outgoing request (${p}) due to mismatching tracePropagationTargets option.`);return s.apply(n,a).once("response",(function(e){t&&Qt("response",g,this,e),h&&(e.statusCode&&h.setHttpStatus(e.statusCode),h.description=(0,Kt.Dt)(h.description,c,this),h.finish())})).once("error",(function(){t&&Qt("error",g,this),h&&(h.setHttpStatus(500),h.description=(0,Kt.Dt)(h.description,c,this),h.finish())}))}}}function Qt(t,e,n,r){(0,y.Gd)().getIntegration(Xt)&&(0,y.Gd)().addBreadcrumb({category:"http",data:{status_code:r&&r.statusCode,...e},type:"http"},{event:t,request:n,response:r})}function te(t){console.error(t&&t.stack?t.stack:t);const e=(0,y.Gd)().getClient();void 0===e&&(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&l.kg.warn("No NodeClient was defined, we are exiting the process now."),global.process.exit(1));const n=e.getOptions(),r=n&&n.shutdownTimeout&&n.shutdownTimeout>0&&n.shutdownTimeout||2e3;e.close(r).then((t=>{t||("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&l.kg.warn("We reached the timeout for emptying the request buffer, still exiting now!"),global.process.exit(1)}),(t=>{("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&l.kg.error(t)}))}Xt.__initStatic();class ee{static __initStatic(){this.id="OnUncaughtException"}__init(){this.name=ee.id}__init2(){this.handler=this._makeErrorHandler()}constructor(t={}){ee.prototype.__init.call(this),ee.prototype.__init2.call(this),this._options={exitEvenIfOtherHandlersAreRegistered:!0,...t}}setupOnce(){global.process.on("uncaughtException",this.handler)}_makeErrorHandler(){let t,e=!1,n=!1,r=!1;return i=>{let s=te;const o=(0,y.Gd)().getClient();this._options.onFatalError?s=this._options.onFatalError:o&&o.getOptions().onFatalError&&(s=o.getOptions().onFatalError);const a=0===global.process.listeners("uncaughtException").reduce(((t,e)=>"domainUncaughtExceptionClear"===e.name||e.tag&&"sentry_tracingErrorCallback"===e.tag||e===this.handler?t:t+1),0),c=this._options.exitEvenIfOtherHandlersAreRegistered||a;if(e)c&&(r?(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&l.kg.warn("uncaught exception after calling fatal error shutdown callback - this is bad! forcing shutdown"),te(i)):n||(n=!0,setTimeout((()=>{r||(r=!0,s(t,i))}),2e3)));else{const n=(0,y.Gd)();t=i,e=!0,n.getIntegration(ee)?n.withScope((t=>{t.setLevel("fatal"),n.captureException(i,{originalException:i,data:{mechanism:{handled:!1,type:"onuncaughtexception"}}}),!r&&c&&(r=!0,s(i))})):!r&&c&&(r=!0,s(i))}}}}ee.__initStatic();class ne{static __initStatic(){this.id="OnUnhandledRejection"}__init(){this.name=ne.id}constructor(t={mode:"warn"}){this._options=t,ne.prototype.__init.call(this)}setupOnce(){global.process.on("unhandledRejection",this.sendUnhandledPromise.bind(this))}sendUnhandledPromise(t,e){const n=(0,y.Gd)();n.getIntegration(ne)&&n.withScope((r=>{r.setExtra("unhandledPromiseRejection",!0),n.captureException(t,{originalException:e,data:{mechanism:{handled:!1,type:"onunhandledrejection"}}})})),this._handleRejection(t)}_handleRejection(t){const e="This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:";"warn"===this._options.mode?(0,l.Cf)((()=>{console.warn(e),console.error(t&&t.stack?t.stack:t)})):"strict"===this._options.mode&&((0,l.Cf)((()=>{console.warn(e)})),te(t))}}ne.__initStatic();const re=require("fs"),ie=new Jt.LRUMap(100);class se{static __initStatic(){this.id="ContextLines"}__init(){this.name=se.id}constructor(t={}){this._options=t,se.prototype.__init.call(this)}get _contextLines(){return void 0!==this._options.frameContextLines?this._options.frameContextLines:7}setupOnce(t){t((t=>this.addSourceContext(t)))}async addSourceContext(t){const e={},n=[];if(this._contextLines>0&&(0,ut.x)([t,"access",t=>t.exception,"optionalAccess",t=>t.values]))for(const r of t.exception.values)if((0,ut.x)([r,"access",t=>t.stacktrace,"optionalAccess",t=>t.frames]))for(let t=r.stacktrace.frames.length-1;t>=0;t--){const i=r.stacktrace.frames[t];!i.filename||e[i.filename]||ie.get(i.filename)||(n.push(oe(i.filename)),e[i.filename]=1)}if(n.length>0&&await Promise.all(n),this._contextLines>0&&(0,ut.x)([t,"access",t=>t.exception,"optionalAccess",t=>t.values]))for(const e of t.exception.values)e.stacktrace&&e.stacktrace.frames&&await this.addSourceContextToFrames(e.stacktrace.frames);return t}addSourceContextToFrames(t){for(const e of t)if(e.filename&&void 0===e.context_line){const t=ie.get(e.filename);if(t)try{(0,p.go)(t,e,this._contextLines)}catch(t){}}}}async function oe(t){const e=ie.get(t);if(null===e)return null;if(void 0!==e)return e;let n=null;try{n=(await(r=t,new Promise(((t,e)=>{(0,re.readFile)(r,"utf8",((n,r)=>{n?e(n):t(r)}))})))).split("\n")}catch(t){}var r;return ie.set(t,n),n}se.__initStatic();class ae{static __initStatic(){this.id="LinkedErrors"}__init(){this.name=ae.id}constructor(t={}){ae.prototype.__init.call(this),this._key=t.key||"cause",this._limit=t.limit||5}setupOnce(){(0,nt.c)((async(t,e)=>{const n=(0,y.Gd)(),r=n.getIntegration(ae),i=n.getClient();return i&&r&&r._handler&&"function"==typeof r._handler&&await r._handler(i.getOptions().stackParser,t,e),t}))}_handler(t,e,n){return e.exception&&e.exception.values&&(0,F.V9)(n.originalException,Error)?new P.cW((r=>{this._walkErrorTree(t,n.originalException,this._key).then((t=>{e&&e.exception&&e.exception.values&&(e.exception.values=[...t,...e.exception.values]),r(e)})).then(null,(()=>{r(e)}))})):(0,P.WD)(e)}async _walkErrorTree(t,e,n,r=[]){if(!(0,F.V9)(e[n],Error)||r.length+1>=this._limit)return Promise.resolve(r);const i=Ot(t,e[n]),s=(0,y.Gd)().getIntegration(se);return s&&(0,ut.x)([i,"access",t=>t.stacktrace,"optionalAccess",t=>t.frames])&&await s.addSourceContextToFrames(i.stacktrace.frames),new Promise(((s,o)=>{this._walkErrorTree(t,e[n],n,[i,...r]).then(s).then(null,(()=>{o()}))}))}}ae.__initStatic();var ce=n(1017);let ue;class le{constructor(){le.prototype.__init.call(this)}static __initStatic(){this.id="Modules"}__init(){this.name=le.id}setupOnce(t,e){t((t=>e().getIntegration(le)?{...t,modules:{...t.modules,...this._getModules()}}:t))}_getModules(){return ue||(ue=function(){const t=n.c[n.s]&&n.c[n.s].paths||[],e=function(){try{return n.c?Object.keys(n.c):[]}catch(t){return[]}}(),r={},i={};return e.forEach((e=>{let n=e;const s=()=>{const e=n;if(n=(0,ce.dirname)(e),!n||e===n||i[e])return;if(t.indexOf(n)<0)return s();const o=(0,ce.join)(e,"package.json");if(i[e]=!0,!(0,re.existsSync)(o))return s();try{const t=JSON.parse((0,re.readFileSync)(o,"utf8"));r[t.name]=t.version}catch(t){}};s()})),r}()),ue}}le.__initStatic();const pe=require("child_process"),de=(0,It.promisify)(re.readFile),he=(0,It.promisify)(re.readdir);class fe{static __initStatic(){this.id="Context"}__init(){this.name=fe.id}constructor(t={app:!0,os:!0,device:!0,culture:!0}){this._options=t,fe.prototype.__init.call(this)}setupOnce(t){t((t=>this.addContext(t)))}async addContext(t){void 0===this._cachedContext&&(this._cachedContext=this._getContexts());const e=this._updateContext(await this._cachedContext);return t.contexts={...t.contexts,app:{...e.app,...(0,ut.x)([t,"access",t=>t.contexts,"optionalAccess",t=>t.app])},os:{...e.os,...(0,ut.x)([t,"access",t=>t.contexts,"optionalAccess",t=>t.os])},device:{...e.device,...(0,ut.x)([t,"access",t=>t.contexts,"optionalAccess",t=>t.device])},culture:{...e.culture,...(0,ut.x)([t,"access",t=>t.contexts,"optionalAccess",t=>t.culture])}},t}_updateContext(t){return(0,ut.x)([t,"optionalAccess",t=>t.app,"optionalAccess",t=>t.app_memory])&&(t.app.app_memory=process.memoryUsage().rss),(0,ut.x)([t,"optionalAccess",t=>t.device,"optionalAccess",t=>t.free_memory])&&(t.device.free_memory=St.freemem()),t}async _getContexts(){const t={};if(this._options.os&&(t.os=await async function(){const t=St.platform();switch(t){case"darwin":return async function(){const t={kernel_version:St.release(),name:"Mac OS X",version:"10."+(Number(St.release().split(".")[0])-4)};try{const e=await new Promise(((t,e)=>{(0,pe.execFile)("/usr/bin/sw_vers",((n,r)=>{n?e(n):t(r)}))}));t.name=ye(/^ProductName:\s+(.*)$/m,e),t.version=ye(/^ProductVersion:\s+(.*)$/m,e),t.build=ye(/^BuildVersion:\s+(.*)$/m,e)}catch(t){}return t}();case"linux":return async function(){const t={kernel_version:St.release(),name:"Linux"};try{const e=await he("/etc"),n=me.find((t=>e.includes(t.name)));if(!n)return t;const r=(0,ce.join)("/etc",n.name),i=(await de(r,{encoding:"utf-8"})).toLowerCase(),{distros:s}=n;t.name=s.find((t=>i.indexOf(be(t))>=0))||s[0];const o=be(t.name);t.version=ge[o](i)}catch(t){}return t}();default:return{name:_e[t]||t,version:St.release()}}}()),this._options.app&&(t.app=function(){const t=process.memoryUsage().rss;return{app_start_time:new Date(Date.now()-1e3*process.uptime()).toISOString(),app_memory:t}}()),this._options.device&&(t.device=function(t){const e={};let n;try{n=St.uptime&&St.uptime()}catch(t){}if("number"==typeof n&&(e.boot_time=new Date(Date.now()-1e3*n).toISOString()),e.arch=St.arch(),(!0===t||t.memory)&&(e.memory_size=St.totalmem(),e.free_memory=St.freemem()),!0===t||t.cpu){const t=St.cpus();if(t&&t.length){const n=t[0];e.processor_count=t.length,e.cpu_description=n.model,e.processor_frequency=n.speed}}return e}(this._options.device)),this._options.culture){const e=function(){try{if("string"!=typeof process.versions.icu)return;const t=new Date(9e8);if("enero"===new Intl.DateTimeFormat("es",{month:"long"}).format(t)){const t=Intl.DateTimeFormat().resolvedOptions();return{locale:t.locale,timezone:t.timeZone}}}catch(t){}}();e&&(t.culture=e)}return t}}fe.__initStatic();const _e={aix:"IBM AIX",freebsd:"FreeBSD",openbsd:"OpenBSD",sunos:"SunOS",win32:"Windows"},me=[{name:"fedora-release",distros:["Fedora"]},{name:"redhat-release",distros:["Red Hat Linux","Centos"]},{name:"redhat_version",distros:["Red Hat Linux"]},{name:"SuSE-release",distros:["SUSE Linux"]},{name:"lsb-release",distros:["Ubuntu Linux","Arch Linux"]},{name:"debian_version",distros:["Debian"]},{name:"debian_release",distros:["Debian"]},{name:"arch-release",distros:["Arch Linux"]},{name:"gentoo-release",distros:["Gentoo Linux"]},{name:"novell-release",distros:["SUSE Linux"]},{name:"alpine-release",distros:["Alpine Linux"]}],ge={alpine:t=>t,arch:t=>ye(/distrib_release=(.*)/,t),centos:t=>ye(/release ([^ ]+)/,t),debian:t=>t,fedora:t=>ye(/release (..)/,t),mint:t=>ye(/distrib_release=(.*)/,t),red:t=>ye(/release ([^ ]+)/,t),suse:t=>ye(/VERSION = (.*)\n/,t),ubuntu:t=>ye(/distrib_release=(.*)/,t)};function ye(t,e){const n=t.exec(e);return n?n[1]:void 0}function be(t){return t.split(" ")[0].toLowerCase()}var ve=n(442),Ee=n(6956),we=n(6489);const Te={ip:!1,request:!0,transaction:!0,user:!0},Se=["cookies","data","headers","method","query_string","url"],Ie=["id","username","email"];function xe(t,e={}){const n=t.method&&t.method.toUpperCase();let r="",i="url";e.customRoute||t.route?(r=e.customRoute||`${t.baseUrl||""}${t.route&&t.route.path}`,i="route"):(t.originalUrl||t.url)&&(r=(0,Ee.rt)(t.originalUrl||t.url||""));let s="";return e.method&&n&&(s+=n),e.method&&e.path&&(s+=" "),e.path&&r&&(s+=r),[s,i]}function Oe(t,e){const{include:n=Se}=e||{},r={},i=t.headers||{},s=t.method,o=t.hostname||t.host||i.host||"",a="https"===t.protocol||t.socket&&t.socket.encrypted?"https":"http",c=t.originalUrl||t.url||"",u=c.startsWith(a)?c:`${a}://${o}${c}`;return n.forEach((e=>{switch(e){case"headers":r.headers=i,n.includes("cookies")||delete r.headers.cookie;break;case"method":r.method=s;break;case"url":r.url=u;break;case"cookies":r.cookies=t.cookies||i.cookie&&we.Q(i.cookie)||{};break;case"query_string":r.query_string=function(t){let e=t.originalUrl||t.url||"";if(e)return e.startsWith("/")&&(e=`http://dogs.are.great${e}`),t.query||void 0!==typeof URL&&new URL(e).search.replace("?","")||Pt.parse(e).query||void 0}(t);break;case"data":if("GET"===s||"HEAD"===s)break;void 0!==t.body&&(r.data=(0,F.HD)(t.body)?t.body:JSON.stringify(L(t.body)));break;default:({}).hasOwnProperty.call(t,e)&&(r[e]=t[e])}})),r}function De(t,e,n){const r={...Te,...(0,ut.x)([n,"optionalAccess",t=>t.include])};if(r.request){const n=Array.isArray(r.request)?Oe(e,{include:r.request}):Oe(e);t.request={...t.request,...n}}if(r.user){const n=e.user&&(0,F.PO)(e.user)?function(t,e){const n={};return(Array.isArray(e)?e:Ie).forEach((e=>{t&&e in t&&(n[e]=t[e])})),n}(e.user,r.user):{};Object.keys(n).length&&(t.user={...t.user,...n})}if(r.ip){const n=e.ip||e.socket&&e.socket.remoteAddress;n&&(t.user={...t.user,ip_address:n})}return r.transaction&&!t.transaction&&(t.transaction=function(t,e){switch(e){case"path":return xe(t,{path:!0})[0];case"handler":return t.route&&t.route.stack&&t.route.stack[0]&&t.route.stack[0].name||"";default:return xe(t,{path:!0,method:!0})[0]}}(e,r.transaction)),t}const Ne={include:{cookies:!0,data:!0,headers:!0,ip:!1,query_string:!0,url:!0,user:{id:!0,username:!0,email:!0}},transactionNamingScheme:"methodPath"};class Ce{static __initStatic(){this.id="RequestData"}__init(){this.name=Ce.id}constructor(t={}){Ce.prototype.__init.call(this),this._addRequestData=De,this._options={...Ne,...t,include:{method:!0,...Ne.include,...t.include,user:t.include&&"boolean"==typeof t.include.user?t.include.user:{...Ne.include.user,...(t.include||{}).user}}}}setupOnce(t,e){const{transactionNamingScheme:n}=this._options;t((t=>{const r=e(),i=r.getIntegration(Ce),{sdkProcessingMetadata:s={}}=t,o=s.request;if(!i||!o)return t;const a=s.requestDataOptionsFromExpressHandler||s.requestDataOptionsFromGCPWrapper||function(t){const{transactionNamingScheme:e,include:{ip:n,user:r,...i}}=t,s=[];for(const[t,e]of Object.entries(i))e&&s.push(t);let o;if(void 0===r)o=!0;else if("boolean"==typeof r)o=r;else{const t=[];for(const[e,n]of Object.entries(r))n&&t.push(e);o=t}return{include:{ip:n,user:o,request:0!==s.length?s:void 0,transaction:e}}}(this._options),c=this._addRequestData(t,o,a);if("transaction"===t.type||"handler"===n)return c;const u=o._sentryTransaction;if(u){const t="sentry.javascript.nextjs"===function(t){try{return t.getClient().getOptions()._metadata.sdk.name}catch(t){return}}(r)?u.name.startsWith("/api"):"path"!==n,[e]=(0,ve.oA)(o,{path:!0,method:t,customRoute:u.name});c.transaction=e}return c}))}}function ke(t){let e=[],n=!1;function r(r){e=[],n||(n=!0,t(r))}return e.push(r),{add:function(t){e.push(t)},next:function(t){const n=e.pop()||r;try{n(t)}catch(e){r(t)}}}}Ce.__initStatic();class Ae{constructor(){const{Session:t}=n(1405);this._session=new t}configureAndConnect(t,e){this._session.connect(),this._session.on("Debugger.paused",(e=>{t(e,(()=>{this._session.post("Debugger.resume")}))})),this._session.post("Debugger.enable"),this._session.post("Debugger.setPauseOnExceptions",{state:e?"all":"uncaught"})}getLocalVariables(t,e){this._getProperties(t,(t=>{const{add:n,next:r}=ke(e);for(const e of t)if((0,ut.x)([e,"optionalAccess",t=>t.value,"optionalAccess",t=>t.objectId])&&"Array"===(0,ut.x)([e,"optionalAccess",t=>t.value,"access",t=>t.className])){const t=e.value.objectId;n((n=>this._unrollArray(t,e.name,n,r)))}else if((0,ut.x)([e,"optionalAccess",t=>t.value,"optionalAccess",t=>t.objectId])&&"Object"===(0,ut.x)([e,"optionalAccess",t=>t.value,"optionalAccess",t=>t.className])){const t=e.value.objectId;n((n=>this._unrollObject(t,e.name,n,r)))}else((0,ut.x)([e,"optionalAccess",t=>t.value,"optionalAccess",t=>t.value])||(0,ut.x)([e,"optionalAccess",t=>t.value,"optionalAccess",t=>t.description]))&&n((t=>this._unrollOther(e,t,r)));r({})}))}_getProperties(t,e){this._session.post("Runtime.getProperties",{objectId:t,ownProperties:!0},((t,n)=>{e(t?[]:n.result)}))}_unrollArray(t,e,n,r){this._getProperties(t,(t=>{n[e]=t.filter((t=>"length"!==t.name&&!isNaN(parseInt(t.name,10)))).sort(((t,e)=>parseInt(t.name,10)-parseInt(e.name,10))).map((t=>(0,ut.x)([t,"optionalAccess",t=>t.value,"optionalAccess",t=>t.value]))),r(n)}))}_unrollObject(t,e,n,r){this._getProperties(t,(t=>{n[e]=t.map((t=>[t.name,(0,ut.x)([t,"optionalAccess",t=>t.value,"optionalAccess",t=>t.value])])).reduce(((t,[e,n])=>(t[e]=n,t)),{}),r(n)}))}_unrollOther(t,e,n){(0,ut.x)([t,"optionalAccess",t=>t.value,"optionalAccess",t=>t.value])?e[t.name]=t.value.value:(0,ut.x)([t,"optionalAccess",t=>t.value,"optionalAccess",t=>t.description])&&"function"!==(0,ut.x)([t,"optionalAccess",t=>t.value,"optionalAccess",t=>t.type])&&(e[t.name]=`<${t.value.description}>`),n(e)}}function Re(t){return void 0!==t&&["","?",""].includes(t)}function Pe(t){if(void 0!==t)return t.slice(-10).reduce(((t,e)=>`${t},${e.function},${e.lineno},${e.colno}`),"")}class Ue{static __initStatic(){this.id="LocalVariables"}__init(){this.name=Ue.id}__init2(){this._cachedFrames=new Jt.LRUMap(20)}constructor(t={},e=function(){try{return new Ae}catch(t){return}}()){this._options=t,this._session=e,Ue.prototype.__init.call(this),Ue.prototype.__init2.call(this)}setupOnce(t,e){this._setup(t,(0,ut.x)([e,"call",t=>t(),"access",t=>t.getClient,"call",t=>t(),"optionalAccess",t=>t.getOptions,"call",t=>t()]))}_setup(t,e){if(this._session&&(0,ut.x)([e,"optionalAccess",t=>t.includeLocalVariables])){if((Ft.V.major||0)<18)return void l.kg.log("The `LocalVariables` integration is only supported on Node >= v18.");this._session.configureAndConnect(((t,n)=>this._handlePaused(e.stackParser,t,n)),!!this._options.captureAllExceptions),t((async t=>this._addLocalVariables(t)))}}_handlePaused(t,{params:{reason:e,data:n,callFrames:r}},i){if("exception"!==e&&"promiseRejection"!==e)return void i();const s=function(t,e){if(void 0!==e)return Pe(t(e,1))}(t,(0,ut.x)([n,"optionalAccess",t=>t.description]));if(null==s)return void i();const{add:o,next:a}=ke((t=>{this._cachedFrames.set(s,t),i()}));for(let t=0;t"local"===t.type)),c="global"!==i.className&&i.className?`${i.className}.${n}`:n;if(void 0===(0,ut.x)([s,"optionalAccess",t=>t.object,"access",t=>t.objectId]))o((e=>{e[t]={function:c},a(e)}));else{const e=s.object.objectId;o((n=>(0,ut.x)([this,"access",t=>t._session,"optionalAccess",t=>t.getLocalVariables,"call",r=>r(e,(e=>{n[t]={function:c,vars:e},a(n)}))])))}}a([])}_addLocalVariables(t){for(const e of(0,ut.x)([t,"optionalAccess",t=>t.exception,"optionalAccess",t=>t.values])||[])this._addLocalVariablesToException(e);return t}_addLocalVariablesToException(t){const e=Pe((0,ut.x)([t,"optionalAccess",t=>t.stacktrace,"optionalAccess",t=>t.frames]));if(void 0===e)return;const n=this._cachedFrames.delete(e);if(void 0===n)return;const r=(0,ut.x)([t,"access",t=>t.stacktrace,"optionalAccess",t=>t.frames,"optionalAccess",t=>t.length])||0;for(let e=0;et.stacktrace,"optionalAccess",t=>t.frames,"optionalAccess",t=>t[o]])||!n[e])break;void 0!==n[e].vars&&!1!==t.stacktrace.frames[o].in_app&&((i=t.stacktrace.frames[o].function)===(s=n[e].function)||Re(i)&&Re(s))&&(t.stacktrace.frames[o].vars=n[e].vars)}var i,s}}Ue.__initStatic();var je=n(1249);const Me="\\"===ce.sep,Fe=[new _,new u,new Ht,new Xt,new je.Y,new ee,new ne,new se,new Ue,new fe,new le,new Ce,new ae];function Be(t={}){const e=(0,y.cu)();Yt();const n=(0,ut.x)([e,"access",t=>t.__SENTRY__,"optionalAccess",t=>t.integrations])||[];if(t.defaultIntegrations=!1===t.defaultIntegrations?[]:[...Array.isArray(t.defaultIntegrations)?t.defaultIntegrations:Fe,...n],void 0===t.dsn&&process.env.SENTRY_DSN&&(t.dsn=process.env.SENTRY_DSN),void 0===t.tracesSampleRate&&process.env.SENTRY_TRACES_SAMPLE_RATE){const e=parseFloat(process.env.SENTRY_TRACES_SAMPLE_RATE);isFinite(e)&&(t.tracesSampleRate=e)}if(void 0===t.release){const e=Ye();void 0!==e?t.release=e:t.autoSessionTracking=!1}void 0===t.environment&&process.env.SENTRY_ENVIRONMENT&&(t.environment=process.env.SENTRY_ENVIRONMENT),void 0===t.autoSessionTracking&&void 0!==t.dsn&&(t.autoSessionTracking=!0),void 0===t.instrumenter&&(t.instrumenter="sentry");const r={...t,stackParser:(0,B.Sq)(t.stackParser||Ve),integrations:pt(t),transport:t.transport||Mt};!function(t,e){!0===e.debug&&("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__?l.kg.enable():console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle."));const n=(0,y.Gd)();n.getScope().update(e.initialScope);const r=new t(e);n.bindClient(r)}(Dt,r),t.autoSessionTracking&&function(){const t=(0,y.Gd)();t.startSession(),process.on("beforeExit",(()=>{const e=(0,ut.x)([t,"access",t=>t.getScope,"call",t=>t(),"optionalAccess",t=>t.getSession,"call",t=>t()]);e&&!["exited","crashed"].includes(e.status)&&t.endSession()}))}()}function Le(){return(0,y.Gd)().lastEventId()}async function $e(t){const e=(0,y.Gd)().getClient();return e?e.flush(t):(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&l.kg.warn("Cannot flush events. No client defined."),Promise.resolve(!1))}async function Ge(t){const e=(0,y.Gd)().getClient();return e?e.close(t):(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&l.kg.warn("Cannot flush events and disable SDK. No client defined."),Promise.resolve(!1))}function qe(t){if(void 0===t)return!1;const e=t&&t.getOptions();return!(!e||void 0===e.autoSessionTracking)&&e.autoSessionTracking}function Ye(t){return process.env.SENTRY_RELEASE?process.env.SENTRY_RELEASE:_t.n2.SENTRY_RELEASE&&_t.n2.SENTRY_RELEASE.id?_t.n2.SENTRY_RELEASE.id:process.env.GITHUB_SHA||process.env.COMMIT_REF||process.env.VERCEL_GIT_COMMIT_SHA||process.env.VERCEL_GITHUB_COMMIT_SHA||process.env.VERCEL_GITLAB_COMMIT_SHA||process.env.VERCEL_BITBUCKET_COMMIT_SHA||process.env.ZEIT_GITHUB_COMMIT_SHA||process.env.ZEIT_GITLAB_COMMIT_SHA||process.env.ZEIT_BITBUCKET_COMMIT_SHA||t}const Ve=(0,B.pE)((0,B.Ep)((function(t,e=Me){if(!t)return;const r=e?t.replace(/^[A-Z]:/,"").replace(/\\/g,"/"):t;let{root:i,dir:s,base:o,ext:a}=ce.posix.parse(r);const c=`${n.c[n.s]&&n.c[n.s].filename&&s||global.process.cwd()}/`;let u=o;".js"===a&&(u=u.slice(0,u.length-3)),i||s||(s=".");let l=s.lastIndexOf("/node_modules/");if(l>-1)return`${s.slice(l+14).replace(/\//g,".")}:${u}`;if(l=`${s}/`.lastIndexOf(c,0),0===l){let t=s.slice(c.length).replace(/\//g,".");return t&&(t+=":"),t+=u,t}return u})));function He(t){const e=ce.resolve(t);if(!re.existsSync(e))throw new Error(`Cannot read contents of ${e}. Directory does not exist.`);if(!re.statSync(e).isDirectory())throw new Error(`Cannot read contents of ${e}, because it is not a directory.`);const n=t=>re.readdirSync(t).reduce(((e,r)=>{const i=ce.join(t,r);return re.statSync(i).isDirectory()?e.concat(n(i)):(e.push(i),e)}),[]);return n(e).map((t=>ce.relative(e,t)))}var ze=n(7522);function We(t,e){return Oe(t,{include:e})}function Je(t,e,n={}){return De(t,e,{include:n})}function Ke(){return function(t,e,n){const r=(0,y.Gd)(),i=(0,ut.x)([r,"access",t=>t.getClient,"call",t=>t(),"optionalAccess",t=>t.getOptions,"call",t=>t()]);if(!i||"sentry"!==i.instrumenter||"OPTIONS"===(0,ut.x)([t,"access",t=>t.method,"optionalAccess",t=>t.toUpperCase,"call",t=>t()])||"HEAD"===(0,ut.x)([t,"access",t=>t.method,"optionalAccess",t=>t.toUpperCase,"call",t=>t()]))return n();if(!(0,ze.z)(i))return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&l.kg.warn("Sentry `tracingHandler` is being used, but tracing is disabled. Please enable tracing by setting either `tracesSampleRate` or `tracesSampler` in your `Sentry.init()` options."),n();const s=t.headers&&(0,F.HD)(t.headers["sentry-trace"])&&(0,rt.q)(t.headers["sentry-trace"]),o=(0,ut.x)([t,"access",t=>t.headers,"optionalAccess",t=>t.baggage]),a=(0,Wt.EN)(o),[c,u]=(0,ve.oA)(t,{path:!0,method:!0}),p=k({name:c,op:"http.server",...s,metadata:{dynamicSamplingContext:s&&!a?{}:a,request:t,source:u}},{request:Oe(t)});r.configureScope((t=>{t.setSpan(p)})),e.__sentry_transaction=p,e.once("finish",(()=>{setImmediate((()=>{(0,ve.dB)(p,t),p.setHttpStatus(e.statusCode),p.finish()}))})),n()}}function Xe(t){const e=function(t={}){let e;if("include"in t)e={include:t.include};else{const{ip:n,request:r,transaction:i,user:s}=t;(n||r||i||s)&&(e={include:(0,a.Jr)({ip:n,request:r,transaction:i,user:s})})}return e}(t),n=(0,y.Gd)(),r=n.getClient();if(r&&qe(r)){r.initSessionFlusher();const t=n.getScope();t&&t.getSession()&&t.setSession()}return function(n,r,i){if(t&&t.flushTimeout&&t.flushTimeout>0){const e=r.end;r.end=function(n,r,i){$e(t.flushTimeout).then((()=>{e.call(this,n,r,i)})).then(null,(t=>{("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&l.kg.error(t),e.call(this,n,r,i)}))}}(0,y.Ok)((()=>{const t=(0,y.Gd)();t.configureScope((r=>{if(r.setSDKProcessingMetadata({request:n,requestDataOptionsFromExpressHandler:e}),qe(t.getClient())){const e=t.getScope();e&&e.setRequestSession({status:"ok"})}})),r.once("finish",(()=>{const e=t.getClient();qe(e)&&setImmediate((()=>{e&&e._captureRequestSession&&e._captureRequestSession()}))})),i()}))}}function Ze(t){const e=function(t){const e=t.status||t.statusCode||t.status_code||t.output&&t.output.statusCode;return e?parseInt(e,10):500}(t);return e>=500}function Qe(t){return function(e,n,r,i){(t&&t.shouldHandleError||Ze)(e)?C((t=>{t.setSDKProcessingMetadata({request:n});const s=r.__sentry_transaction;s&&void 0===t.getSpan()&&t.setSpan(s);const o=(0,y.Gd)().getClient();if(o&&qe(o)&&void 0!==o._sessionFlusher){const e=t.getRequestSession();e&&void 0!==e.status&&(e.status="crashed")}const a=b(e);r.sentry=a,i(e)})):i(e)}}function tn(t={}){return function({path:e,type:n,next:r,rawInput:i}){const s=(0,y.Gd)(),o=(0,ut.x)([s,"access",t=>t.getClient,"call",t=>t(),"optionalAccess",t=>t.getOptions,"call",t=>t()]),a=(0,ut.x)([s,"access",t=>t.getScope,"call",t=>t(),"optionalAccess",t=>t.getTransaction,"call",t=>t()]);if(a){a.setName(`trpc/${e}`,"route"),a.op="rpc.server";const r={procedure_type:n};(void 0!==t.attachRpcInput?t.attachRpcInput:(0,ut.x)([o,"optionalAccess",t=>t.sendDefaultPii]))&&(r.input=L(i)),a.setContext("trpc",r)}return r()}}var en=n(2716),nn=n(8737),rn=n(1791),sn=n(6169),on=n(24),an=n(1370),cn=n(9889);const un={...r,...s,...o}},1249:(t,e,n)=>{"use strict";n.d(e,{Y:()=>p});var r,i=n(2176),s=n(6956),o=n(7321),a=n(9181),c=n(7612),u=n(9656),l=n(7578);t=n.hmd(t),function(t){t.RequestCreate="undici:request:create",t.RequestEnd="undici:request:headers",t.RequestError="undici:request:error"}(r||(r={}));class p{static __initStatic(){this.id="Undici"}__init(){this.name=p.id}__init2(){this._createSpanUrlMap=new c.LRUMap(100)}__init3(){this._headersUrlMap=new c.LRUMap(100)}constructor(t={}){p.prototype.__init.call(this),p.prototype.__init2.call(this),p.prototype.__init3.call(this),this._options={breadcrumbs:void 0===t.breadcrumbs||t.breadcrumbs,shouldCreateSpanForRequest:t.shouldCreateSpanForRequest}}setupOnce(e,n){if(u.V.major&&u.V.major<16)return;let c;try{c=(0,i.l$)(t,"diagnostics_channel")}catch(t){}if(!c||!c.subscribe)return;const d=t=>{if(void 0===this._options.shouldCreateSpanForRequest)return!0;const e=this._createSpanUrlMap.get(t);if(void 0!==e)return e;const n=this._options.shouldCreateSpanForRequest(t);return this._createSpanUrlMap.set(t,n),n};c.subscribe(r.RequestCreate,(t=>{const e=n();if(!e.getIntegration(p))return;const{request:r}=t,i=r.origin?r.origin.toString()+r.path:r.path,c=(0,s.en)(i);if((0,l.ZB)(i)||void 0!==r.__sentry__)return;const u=e.getClient(),h=e.getScope().getSpan();if(h&&u){const t=u.getOptions();if(d(i)){const e=r.method||"GET",n={"http.method":e};c.search&&(n["http.query"]=c.search),c.hash&&(n["http.fragment"]=c.hash);const u=h.startChild({op:"http.client",description:`${e} ${(0,s.tF)(c)}`,data:n});r.__sentry__=u;const l=e=>{if(void 0===t.tracePropagationTargets)return!0;const n=this._headersUrlMap.get(e);if(void 0!==n)return n;const r=(0,o.U0)(e,t.tracePropagationTargets);return this._headersUrlMap.set(e,r),r};if(l(i)&&(r.addHeader("sentry-trace",u.toTraceparent()),u.transaction)){const t=u.transaction.getDynamicSamplingContext(),e=(0,a.IQ)(t);e&&r.addHeader("baggage",e)}}}})),c.subscribe(r.RequestEnd,(t=>{const e=n();if(!e.getIntegration(p))return;const{request:r,response:i}=t,s=r.origin?r.origin.toString()+r.path:r.path;if((0,l.ZB)(s))return;const o=r.__sentry__;o&&(o.setHttpStatus(i.statusCode),o.finish()),this._options.breadcrumbs&&e.addBreadcrumb({category:"http",data:{method:r.method,status_code:i.statusCode,url:s},type:"http"},{event:"response",request:r,response:i})})),c.subscribe(r.RequestError,(t=>{const e=n();if(!e.getIntegration(p))return;const{request:r}=t,i=r.origin?r.origin.toString()+r.path:r.path;if((0,l.ZB)(i))return;const s=r.__sentry__;s&&(s.setStatus("internal_error"),s.finish()),this._options.breadcrumbs&&e.addBreadcrumb({category:"http",data:{method:r.method,url:i},level:"error",type:"http"},{event:"error",request:r})}))}}p.__initStatic()},7578:(t,e,n)=>{"use strict";n.d(e,{CA:()=>u,Dt:()=>l,ZB:()=>a,lx:()=>c,nY:()=>d});var r=n(4307),i=n(5659),s=n(7310),o=n(9656);function a(t){const e=(0,r.x)([i.Gd,"call",t=>t(),"access",t=>t.getClient,"call",t=>t(),"optionalAccess",t=>t.getDsn,"call",t=>t()]);return!!e&&t.includes(e.host)}function c(t){return`${t.protocol||""}//${t.hostname||t.host||""}${t.port&&80!==t.port&&443!==t.port?`:${t.port}`:""}${t.path?t.path:"/"}`}function u(t){const e=t.protocol||"",n=t.hostname||t.host||"",r=t.port&&80!==t.port&&443!==t.port?`:${t.port}`:"",i=t.pathname||"/";return`${e}//${t.auth?function(t){const[e,n]=t.split(":");return`${e?"[Filtered]":""}:${n?"[Filtered]":""}@`}(t.auth):""}${n}${r}${i}`}function l(t,e,n){if(!t)return t;let[i,s]=t.split(" ");return e.host&&!e.protocol&&(e.protocol=(0,r.x)([n,"optionalAccess",t=>t.agent,"optionalAccess",t=>t.protocol]),s=u(e)),(0,r.x)([s,"optionalAccess",t=>t.startsWith,"call",t=>t("///")])&&(s=s.slice(2)),`${i} ${s}`}function p(t){const e={protocol:t.protocol,hostname:"string"==typeof t.hostname&&t.hostname.startsWith("[")?t.hostname.slice(1,-1):t.hostname,hash:t.hash,search:t.search,pathname:t.pathname,path:`${t.pathname||""}${t.search||""}`,href:t.href};return""!==t.port&&(e.port=Number(t.port)),(t.username||t.password)&&(e.auth=`${t.username}:${t.password}`),e}function d(t,e){let n,i;return"function"==typeof e[e.length-1]&&(n=e.pop()),i="string"==typeof e[0]?p(new s.URL(e[0])):e[0]instanceof s.URL?p(e[0]):e[0],2===e.length&&(i={...i,...e[1]}),void 0===i.protocol&&(o.V.major&&o.V.major>8?i.protocol=(0,r.x)([(0,r.x)([t,"optionalAccess",t=>t.globalAgent]),"optionalAccess",t=>t.protocol])||(0,r.x)([i.agent,"optionalAccess",t=>t.protocol])||(0,r.x)([i._defaultAgent,"optionalAccess",t=>t.protocol]):i.protocol=(0,r.x)([i.agent,"optionalAccess",t=>t.protocol])||(0,r.x)([i._defaultAgent,"optionalAccess",t=>t.protocol])||(0,r.x)([(0,r.x)([t,"optionalAccess",t=>t.globalAgent]),"optionalAccess",t=>t.protocol])),n?[i,n]:[i]}},9656:(t,e,n)=>{"use strict";n.d(e,{V:()=>r});const r=(0,n(2844).J4)(process.versions.node)},5605:(t,e,n)=>{"use strict";n.r(e),n.d(e,{BROWSER_TRACING_INTEGRATION_ID:()=>ct,BrowserTracing:()=>et,IdleTransaction:()=>ht,Integrations:()=>gt,Span:()=>at,SpanStatus:()=>mt,TRACEPARENT_REGEXP:()=>dt,Transaction:()=>ot,addExtensionMethods:()=>nt,defaultRequestInstrumentationOptions:()=>ut,extractTraceparentData:()=>it,getActiveTransaction:()=>rt,hasTracingEnabled:()=>lt,instrumentOutgoingRequests:()=>ft,spanStatusfromHttpCode:()=>st,startIdleTransaction:()=>_t,stripUrlQueryAndFragment:()=>pt});var r=n(5544),i=n(6890),s=n(7638),o=n(9791),a=n(2343),c=n(9181),u=n(8464);const l=n(1235).n2;var p=n(1170);const d=(t,e,n)=>{let r,i;return s=>{e.value>=0&&(s||n)&&(i=e.value-(r||0),(i||void 0===r)&&(r=e.value,e.delta=i,t(e)))}},h=()=>l.__WEB_VITALS_POLYFILL__?l.performance&&(performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]||(()=>{const t=l.performance.timing,e=l.performance.navigation.type,n={entryType:"navigation",startTime:0,type:2==e?"back_forward":1===e?"reload":"navigate"};for(const e in t)"navigationStart"!==e&&"toJSON"!==e&&(n[e]=Math.max(t[e]-t.navigationStart,0));return n})()):l.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0],f=()=>{const t=h();return t&&t.activationStart||0},_=(t,e)=>{const n=h();let r="navigate";return n&&(r=l.document.prerendering||f()>0?"prerender":n.type.replace(/_/g,"-")),{name:t,value:void 0===e?-1:e,rating:"good",delta:0,entries:[],id:`v3-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:r}},m=(t,e,n)=>{try{if(PerformanceObserver.supportedEntryTypes.includes(t)){const r=new PerformanceObserver((t=>{e(t.getEntries())}));return r.observe(Object.assign({type:t,buffered:!0},n||{})),r}}catch(t){}},g=(t,e)=>{const n=r=>{"pagehide"!==r.type&&"hidden"!==l.document.visibilityState||(t(r),e&&(removeEventListener("visibilitychange",n,!0),removeEventListener("pagehide",n,!0)))};addEventListener("visibilitychange",n,!0),addEventListener("pagehide",n,!0)};let y=-1;const b=()=>(y<0&&(y="hidden"!==l.document.visibilityState||l.document.prerendering?1/0:0,g((({timeStamp:t})=>{y=t}),!0)),{get firstHiddenTime(){return y}}),v={};function E(t){return"number"==typeof t&&isFinite(t)}function w(t,{startTimestamp:e,...n}){return e&&t.startTimestamp>e&&(t.startTimestamp=e),t.startChild({startTimestamp:e,...n})}function T(t){return t/1e3}function S(){return l&&l.addEventListener&&l.performance}let I,x,O=0,D={};function N(){const t=S();if(t&&p.Z1){t.mark&&l.performance.mark("sentry-tracing-init"),(t=>{const e=b(),n=_("FID");let r;const i=t=>{t.startTime{t.forEach(i)},o=m("first-input",s);r=d(t,n),o&&g((()=>{s(o.takeRecords()),o.disconnect()}),!0)})((t=>{const e=t.entries.pop();if(!e)return;const n=T(p.Z1),r=T(e.startTime);("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&a.kg.log("[Measurements] Adding FID"),D.fid={value:t.value,unit:"millisecond"},D["mark.fid"]={value:n+r,unit:"second"}}));const e=(t=>{const e=_("CLS",0);let n,r=0,i=[];const s=t=>{t.forEach((t=>{if(!t.hadRecentInput){const s=i[0],o=i[i.length-1];r&&0!==i.length&&t.startTime-o.startTime<1e3&&t.startTime-s.startTime<5e3?(r+=t.value,i.push(t)):(r=t.value,i=[t]),r>e.value&&(e.value=r,e.entries=i,n&&n())}}))},o=m("layout-shift",s);if(o){n=d(t,e);const r=()=>{s(o.takeRecords()),n(!0)};return g(r),r}})((t=>{const e=t.entries.pop();e&&(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&a.kg.log("[Measurements] Adding CLS"),D.cls={value:t.value,unit:""},x=e)})),n=(t=>{const e=b(),n=_("LCP");let r;const i=t=>{const i=t[t.length-1];if(i){const t=Math.max(i.startTime-f(),0);t{v[n.id]||(i(s.takeRecords()),s.disconnect(),v[n.id]=!0,r(!0))};return["keydown","click"].forEach((t=>{addEventListener(t,e,{once:!0,capture:!0})})),g(e,!0),e}})((t=>{const e=t.entries.pop();e&&(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&a.kg.log("[Measurements] Adding LCP"),D.lcp={value:t.value,unit:"millisecond"},I=e)}));return()=>{e&&e(),n&&n()}}return()=>{}}function C(t,e,n,r,i,s){const o=s?e[s]:e[`${n}End`],a=e[`${n}Start`];a&&o&&w(t,{op:"browser",description:i||n,startTimestamp:r+T(a),endTimestamp:r+T(o)})}var k=n(7522),A=n(5659),R=n(1688),P=n(7321),U=n(7597);const j=["localhost",/^\/(?!\/)/],M={traceFetch:!0,traceXHR:!0,tracingOrigins:j,tracePropagationTargets:j};function F(t){const{traceFetch:e,traceXHR:n,tracePropagationTargets:r,tracingOrigins:i,shouldCreateSpanForRequest:s}={traceFetch:M.traceFetch,traceXHR:M.traceXHR,...t},o="function"==typeof s?s:t=>!0,a=t=>function(t,e){return(0,P.U0)(t,e||j)}(t,r||i),u={};e&&(0,R.oq)("fetch",(t=>{!function(t,e,n,r){if(!(0,k.z)()||!t.fetchData||!e(t.fetchData.url))return;if(t.endTimestamp){const e=t.fetchData.__span;if(!e)return;const n=r[e];if(n){if(t.response){n.setHttpStatus(t.response.status);const e=t.response&&t.response.headers&&t.response.headers.get("content-length"),r=parseInt(e);r>0&&n.setData("http.response_content_length",r)}else t.error&&n.setStatus("internal_error");n.finish(),delete r[e]}return}const i=(0,A.Gd)().getScope(),s=i&&i.getSpan(),o=s&&s.transaction;if(s&&o){const{method:e,url:i}=t.fetchData,a=s.startChild({data:{url:i,type:"fetch","http.method":e},description:`${e} ${i}`,op:"http.client"});t.fetchData.__span=a.spanId,r[a.spanId]=a;const u=t.args[0];t.args[1]=t.args[1]||{};const l=t.args[1];n(t.fetchData.url)&&(l.headers=function(t,e,n,r){const i=(0,c.IQ)(e),s=n.toTraceparent(),o="undefined"!=typeof Request&&(0,U.V9)(t,Request)?t.headers:r.headers;if(o){if("undefined"!=typeof Headers&&(0,U.V9)(o,Headers)){const t=new Headers(o);return t.append("sentry-trace",s),i&&t.append(c.bU,i),t}if(Array.isArray(o)){const t=[...o,["sentry-trace",s]];return i&&t.push([c.bU,i]),t}{const t="baggage"in o?o.baggage:void 0,e=[];return Array.isArray(t)?e.push(...t):t&&e.push(t),i&&e.push(i),{...o,"sentry-trace":s,baggage:e.length>0?e.join(","):void 0}}}return{"sentry-trace":s,baggage:i}}(u,o.getDynamicSamplingContext(),a,l))}}(t,o,a,u)})),n&&(0,R.oq)("xhr",(t=>{!function(t,e,n,r){const i=t.xhr,s=i&&i[R.xU];if(!(0,k.z)()||i&&i.__sentry_own_request__||!(i&&s&&e(s.url)))return;if(t.endTimestamp){const t=i.__sentry_xhr_span_id__;if(!t)return;const e=r[t];return void(e&&(e.setHttpStatus(s.status_code),e.finish(),delete r[t]))}const o=(0,A.Gd)().getScope(),a=o&&o.getSpan(),u=a&&a.transaction;if(a&&u){const t=a.startChild({data:{...s.data,type:"xhr","http.method":s.method,url:s.url},description:`${s.method} ${s.url}`,op:"http.client"});if(i.__sentry_xhr_span_id__=t.spanId,r[i.__sentry_xhr_span_id__]=t,i.setRequestHeader&&n(s.url))try{i.setRequestHeader("sentry-trace",t.toTraceparent());const e=u.getDynamicSamplingContext(),n=(0,c.IQ)(e);n&&i.setRequestHeader(c.bU,n)}catch(t){}}}(t,o,a,u)}))}const B="BrowserTracing",L={...r.AT,markBackgroundTransactions:!0,routingInstrumentation:function(t,e=!0,n=!0){if(!l||!l.location)return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&a.kg.warn("Could not initialize routing instrumentation due to invalid location"));let r,i=l.location.href;e&&(r=t({name:l.location.pathname,startTimestamp:p.Z1?p.Z1/1e3:void 0,op:"pageload",metadata:{source:"url"}})),n&&(0,R.oq)("history",(({to:e,from:n})=>{void 0===n&&i&&-1!==i.indexOf(e)?i=void 0:n!==e&&(i=void 0,r&&(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&a.kg.log(`[Tracing] Finishing current transaction with op: ${r.op}`),r.finish()),r=t({name:l.location.pathname,op:"navigation",metadata:{source:"url"}}))}))},startTransactionOnLocationChange:!0,startTransactionOnPageLoad:!0,enableLongTask:!0,_experiments:{},...M};class ${__init(){this.name=B}constructor(t){$.prototype.__init.call(this),(0,i.T)(),this.options={...L,...t},void 0!==this.options._experiments.enableLongTask&&(this.options.enableLongTask=this.options._experiments.enableLongTask),t&&!t.tracePropagationTargets&&t.tracingOrigins&&(this.options.tracePropagationTargets=t.tracingOrigins),this._collectWebVitals=N(),this.options.enableLongTask&&m("longtask",(t=>{for(const e of t){const t=(0,o.x1)();if(!t)return;const n=T(p.Z1+e.startTime),r=T(e.duration);t.startChild({description:"Main UI thread blocked",op:"ui.long-task",startTimestamp:n,endTimestamp:n+r})}})),this.options._experiments.enableInteractions&&m("event",(t=>{for(const e of t){const t=(0,o.x1)();if(!t)return;if("click"===e.name){const n=T(p.Z1+e.startTime),r=T(e.duration);t.startChild({description:(0,u.Rt)(e.target),op:`ui.interaction.${e.name}`,startTimestamp:n,endTimestamp:n+r})}}}),{durationThreshold:0})}setupOnce(t,e){this._getCurrentHub=e;const{routingInstrumentation:n,startTransactionOnLocationChange:r,startTransactionOnPageLoad:i,markBackgroundTransactions:s,traceFetch:c,traceXHR:u,tracePropagationTargets:p,shouldCreateSpanForRequest:d,_experiments:h}=this.options;n((t=>{const n=this._createRouteTransaction(t);return this.options._experiments.onStartRouteTransaction&&this.options._experiments.onStartRouteTransaction(n,t,e),n}),i,r),s&&(l&&l.document?l.document.addEventListener("visibilitychange",(()=>{const t=(0,o.x1)();if(l.document.hidden&&t){const e="cancelled";("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&a.kg.log(`[Tracing] Transaction: ${e} -> since tab moved to the background, op: ${t.op}`),t.status||t.setStatus(e),t.setTag("visibilitychange","document.hidden"),t.finish()}})):("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&a.kg.warn("[Tracing] Could not set up background tab detection due to lack of global document")),h.enableInteractions&&this._registerInteractionListener(),F({traceFetch:c,traceXHR:u,tracePropagationTargets:p,shouldCreateSpanForRequest:d})}_createRouteTransaction(t){if(!this._getCurrentHub)return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&a.kg.warn(`[Tracing] Did not create ${t.op} transaction because _getCurrentHub is invalid.`));const{beforeNavigate:e,idleTimeout:n,finalTimeout:r,heartbeatInterval:o}=this.options,d="pageload"===t.op,h=d?G("sentry-trace"):null,f=d?G("baggage"):null,_=h?(0,s.q)(h):void 0,m=f?(0,c.EN)(f):void 0,g={...t,..._,metadata:{...t.metadata,dynamicSamplingContext:_&&!m?{}:m},trimEnd:!0},y="function"==typeof e?e(g):g,v=void 0===y?{...g,sampled:!1}:y;v.metadata=v.name!==g.name?{...v.metadata,source:"custom"}:v.metadata,this._latestRouteName=v.name,this._latestRouteSource=v.metadata&&v.metadata.source,!1===v.sampled&&("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&a.kg.log(`[Tracing] Will not send ${v.op} transaction because of beforeNavigate.`),("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&a.kg.log(`[Tracing] Starting ${v.op} transaction on scope`);const N=this._getCurrentHub(),{location:k}=l,A=(0,i.l)(N,v,n,r,!0,{location:k},o);return A.registerBeforeFinishCallback((t=>{this._collectWebVitals(),function(t){const e=S();if(!e||!l.performance.getEntries||!p.Z1)return;("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&a.kg.log("[Tracing] Adding & adjusting spans using Performance API");const n=T(p.Z1),r=e.getEntries();let i,s;if(r.slice(O).forEach((e=>{const r=T(e.startTime),o=T(e.duration);if(!("navigation"===t.op&&n+r{C(t,e,r,n)})),C(t,e,"secureConnection",n,"TLS/SSL","connectEnd"),C(t,e,"fetch",n,"cache","domainLookupStart"),C(t,e,"domainLookup",n,"DNS"),function(t,e,n){w(t,{op:"browser",description:"request",startTimestamp:n+T(e.requestStart),endTimestamp:n+T(e.responseEnd)}),w(t,{op:"browser",description:"response",startTimestamp:n+T(e.responseStart),endTimestamp:n+T(e.responseEnd)})}(t,e,n)}(t,e,n),i=n+T(e.responseStart),s=n+T(e.requestStart);break;case"mark":case"paint":case"measure":{!function(t,e,n,r,i){const s=i+n,o=s+r;w(t,{description:e.name,endTimestamp:o,op:e.entryType,startTimestamp:s})}(t,e,r,o,n);const i=b(),s=e.startTime{if(!D[e]||n>=t.startTimestamp)return;const r=D[e].value,i=n+T(r),s=Math.abs(1e3*(i-t.startTimestamp)),o=s-r;("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&a.kg.log(`[Measurements] Normalized ${e} from ${r} to ${s} (${o})`),D[e].value=s}));const e=D["mark.fid"];e&&D.fid&&(w(t,{description:"first input delay",endTimestamp:e.value+T(D.fid.value),op:"ui.action",startTimestamp:e.value}),delete D["mark.fid"]),"fcp"in D||delete D.cls,Object.keys(D).forEach((e=>{t.setMeasurement(e,D[e].value,D[e].unit)})),function(t){I&&(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&a.kg.log("[Measurements] Adding LCP Data"),I.element&&t.setTag("lcp.element",(0,u.Rt)(I.element)),I.id&&t.setTag("lcp.id",I.id),I.url&&t.setTag("lcp.url",I.url.trim().slice(0,200)),t.setTag("lcp.size",I.size)),x&&x.sources&&(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&a.kg.log("[Measurements] Adding CLS Data"),x.sources.forEach(((e,n)=>t.setTag(`cls.source.${n+1}`,(0,u.Rt)(e.node)))))}(t)}I=void 0,x=void 0,D={}}(t)})),A}_registerInteractionListener(){let t;const e=()=>{const{idleTimeout:e,finalTimeout:n,heartbeatInterval:r}=this.options,s="ui.action.click",c=(0,o.x1)();if(c&&c.op&&["navigation","pageload"].includes(c.op))return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&a.kg.warn(`[Tracing] Did not create ${s} transaction because a pageload or navigation transaction is in progress.`));if(t&&(t.setFinishReason("interactionInterrupted"),t.finish(),t=void 0),!this._getCurrentHub)return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&a.kg.warn(`[Tracing] Did not create ${s} transaction because _getCurrentHub is invalid.`));if(!this._latestRouteName)return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&a.kg.warn(`[Tracing] Did not create ${s} transaction because _latestRouteName is missing.`));const u=this._getCurrentHub(),{location:p}=l,d={name:this._latestRouteName,op:s,trimEnd:!0,metadata:{source:this._latestRouteSource||"url"}};t=(0,i.l)(u,d,e,n,!0,{location:p},r)};["click"].forEach((t=>{addEventListener(t,e,{once:!1,capture:!0})}))}}function G(t){const e=(0,u.qT)(`meta[name=${t}]`);return e?e.getAttribute("content"):null}var q,Y=n(758),V=n(8903),H=n(8069),z=n(6956);!function(t){t.Ok="ok",t.DeadlineExceeded="deadline_exceeded",t.Unauthenticated="unauthenticated",t.PermissionDenied="permission_denied",t.NotFound="not_found",t.ResourceExhausted="resource_exhausted",t.InvalidArgument="invalid_argument",t.Unimplemented="unimplemented",t.Unavailable="unavailable",t.InternalError="internal_error",t.UnknownError="unknown_error",t.Cancelled="cancelled",t.AlreadyExists="already_exists",t.FailedPrecondition="failed_precondition",t.Aborted="aborted",t.OutOfRange="out_of_range",t.DataLoss="data_loss"}(q||(q={}));var W=n(2716),J=n(8737),K=n(1791),X=n(6169),Z=n(24),Q=n(1370),tt=n(9889);const et=$,nt=Y.r,rt=o.x1,it=s.q,st=V.Zd,ot=H.Y,at=V.Dr,ct=B,ut=M,lt=k.z,pt=z.rt,dt=s.K,ht=r.io,ft=F,_t=i.l,mt=q,gt={BrowserTracing:et,Apollo:W._,Express:J.N,GraphQL:K.k,Mongo:X._,Mysql:Z.m,Postgres:Q.E,Prisma:tt.g};("undefined"==typeof __SENTRY_TRACING__||__SENTRY_TRACING__)&&(0,Y.r)()},9181:(t,e,n)=>{"use strict";n.d(e,{EN:()=>u,IQ:()=>l,bU:()=>s});var r=n(7597),i=n(2343);const s="baggage",o="sentry-",a=/^sentry-/,c=8192;function u(t){if(!(0,r.HD)(t)&&!Array.isArray(t))return;let e={};if(Array.isArray(t))e=t.reduce(((t,e)=>({...t,...p(e)})),{});else{if(!t)return;e=p(t)}const n=Object.entries(e).reduce(((t,[e,n])=>(e.match(a)&&(t[e.slice(o.length)]=n),t)),{});return Object.keys(n).length>0?n:void 0}function l(t){return function(t){if(0!==Object.keys(t).length)return Object.entries(t).reduce(((t,[e,n],r)=>{const s=`${encodeURIComponent(e)}=${encodeURIComponent(n)}`,o=0===r?s:`${t},${s}`;return o.length>c?(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&i.kg.warn(`Not adding key: ${e} with val: ${n} to baggage header due to exceeding baggage size limits.`),t):o}),"")}(Object.entries(t).reduce(((t,[e,n])=>(n&&(t[`${o}${e}`]=n),t)),{}))}function p(t){return t.split(",").map((t=>t.split("=").map((t=>decodeURIComponent(t.trim()))))).reduce(((t,[e,n])=>(t[e]=n,t)),{})}},8464:(t,e,n)=>{"use strict";n.d(e,{Rt:()=>o,qT:()=>c});var r=n(7597);const i=(0,n(1235).Rf)(),s=80;function o(t,e={}){try{let n=t;const r=5,i=[];let o=0,c=0;const u=" > ",l=u.length;let p;const d=Array.isArray(e)?e:e.keyAttrs,h=!Array.isArray(e)&&e.maxStringLength||s;for(;n&&o++1&&c+i.length*l+p.length>=h));)i.push(p),c+=p.length,n=n.parentNode;return i.reverse().join(u)}catch(t){return""}}function a(t,e){const n=t,i=[];let s,o,a,c,u;if(!n||!n.tagName)return"";i.push(n.tagName.toLowerCase());const l=e&&e.length?e.filter((t=>n.getAttribute(t))).map((t=>[t,n.getAttribute(t)])):null;if(l&&l.length)l.forEach((t=>{i.push(`[${t[0]}="${t[1]}"]`)}));else if(n.id&&i.push(`#${n.id}`),s=n.className,s&&(0,r.HD)(s))for(o=s.split(/\s+/),u=0;u{"use strict";function r(t){let e,n=t[0],r=1;for(;rn.call(e,...t))),e=void 0)}return n}n.d(e,{x:()=>r})},1688:(t,e,n)=>{"use strict";n.d(e,{xU:()=>d,oq:()=>m});var r=n(7597),i=n(2343),s=n(535),o=n(6147),a=n(1235);const c=(0,a.Rf)();function u(t){return t&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(t.toString())}const l=(0,a.Rf)(),p=(0,a.Rf)(),d="__sentry_xhr_v2__",h={},f={};function _(t){if(!f[t])switch(f[t]=!0,t){case"console":"console"in p&&i.RU.forEach((function(t){t in p.console&&(0,s.hl)(p.console,t,(function(e){return function(...n){g("console",{args:n,level:t}),e&&e.apply(p.console,n)}}))}));break;case"dom":!function(){if(!("document"in p))return;const t=g.bind(null,"dom"),e=S(t,!0);p.document.addEventListener("click",e,!1),p.document.addEventListener("keypress",e,!1),["EventTarget","Node"].forEach((e=>{const n=p[e]&&p[e].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&((0,s.hl)(n,"addEventListener",(function(e){return function(n,r,i){if("click"===n||"keypress"==n)try{const r=this,s=r.__sentry_instrumentation_handlers__=r.__sentry_instrumentation_handlers__||{},o=s[n]=s[n]||{refCount:0};if(!o.handler){const r=S(t);o.handler=r,e.call(this,n,r,i)}o.refCount++}catch(t){}return e.call(this,n,r,i)}})),(0,s.hl)(n,"removeEventListener",(function(t){return function(e,n,r){if("click"===e||"keypress"==e)try{const n=this,i=n.__sentry_instrumentation_handlers__||{},s=i[e];s&&(s.refCount--,s.refCount<=0&&(t.call(this,e,s.handler,r),s.handler=void 0,delete i[e]),0===Object.keys(i).length&&delete n.__sentry_instrumentation_handlers__)}catch(t){}return t.call(this,e,n,r)}})))}))}();break;case"xhr":!function(){if(!("XMLHttpRequest"in p))return;const t=XMLHttpRequest.prototype;(0,s.hl)(t,"open",(function(t){return function(...e){const n=e[1],i=this[d]={method:(0,r.HD)(e[0])?e[0].toUpperCase():e[0],url:e[1],request_headers:{}};(0,r.HD)(n)&&"POST"===i.method&&n.match(/sentry_key/)&&(this.__sentry_own_request__=!0);const o=()=>{const t=this[d];if(t&&4===this.readyState){try{t.status_code=this.status}catch(t){}g("xhr",{args:e,endTimestamp:Date.now(),startTimestamp:Date.now(),xhr:this})}};return"onreadystatechange"in this&&"function"==typeof this.onreadystatechange?(0,s.hl)(this,"onreadystatechange",(function(t){return function(...e){return o(),t.apply(this,e)}})):this.addEventListener("readystatechange",o),(0,s.hl)(this,"setRequestHeader",(function(t){return function(...e){const[n,r]=e,i=this[d];return i&&(i.request_headers[n.toLowerCase()]=r),t.apply(this,e)}})),t.apply(this,e)}})),(0,s.hl)(t,"send",(function(t){return function(...e){const n=this[d];return n&&void 0!==e[0]&&(n.body=e[0]),g("xhr",{args:e,startTimestamp:Date.now(),xhr:this}),t.apply(this,e)}}))}();break;case"fetch":(function(){if(!function(){if(!("fetch"in c))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch(t){return!1}}())return!1;if(u(c.fetch))return!0;let t=!1;const e=c.document;if(e&&"function"==typeof e.createElement)try{const n=e.createElement("iframe");n.hidden=!0,e.head.appendChild(n),n.contentWindow&&n.contentWindow.fetch&&(t=u(n.contentWindow.fetch)),e.head.removeChild(n)}catch(t){("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&i.kg.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",t)}return t})()&&(0,s.hl)(p,"fetch",(function(t){return function(...e){const{method:n,url:r}=function(t){if(0===t.length)return{method:"GET",url:""};if(2===t.length){const[e,n]=t;return{url:b(e),method:y(n,"method")?String(n.method).toUpperCase():"GET"}}const e=t[0];return{url:b(e),method:y(e,"method")?String(e.method).toUpperCase():"GET"}}(e),i={args:e,fetchData:{method:n,url:r},startTimestamp:Date.now()};return g("fetch",{...i}),t.apply(p,e).then((t=>(g("fetch",{...i,endTimestamp:Date.now(),response:t}),t)),(t=>{throw g("fetch",{...i,endTimestamp:Date.now(),error:t}),t}))}}));break;case"history":!function(){if(!function(){const t=l.chrome,e=t&&t.app&&t.app.runtime,n="history"in l&&!!l.history.pushState&&!!l.history.replaceState;return!e&&n}())return;const t=p.onpopstate;function e(t){return function(...e){const n=e.length>2?e[2]:void 0;if(n){const t=v,e=String(n);v=e,g("history",{from:t,to:e})}return t.apply(this,e)}}p.onpopstate=function(...e){const n=p.location.href,r=v;if(v=n,g("history",{from:r,to:n}),t)try{return t.apply(this,e)}catch(t){}},(0,s.hl)(p.history,"pushState",e),(0,s.hl)(p.history,"replaceState",e)}();break;case"error":I=p.onerror,p.onerror=function(t,e,n,r,i){return g("error",{column:r,error:i,line:n,msg:t,url:e}),!(!I||I.__SENTRY_LOADER__)&&I.apply(this,arguments)},p.onerror.__SENTRY_INSTRUMENTED__=!0;break;case"unhandledrejection":x=p.onunhandledrejection,p.onunhandledrejection=function(t){return g("unhandledrejection",t),!(x&&!x.__SENTRY_LOADER__)||x.apply(this,arguments)},p.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0;break;default:return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&i.kg.warn("unknown instrumentation type:",t))}}function m(t,e){h[t]=h[t]||[],h[t].push(e),_(t)}function g(t,e){if(t&&h[t])for(const n of h[t]||[])try{n(e)}catch(e){("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&i.kg.error(`Error while triggering instrumentation handler.\nType: ${t}\nName: ${(0,o.$P)(n)}\nError:`,e)}}function y(t,e){return!!t&&"object"==typeof t&&!!t[e]}function b(t){return"string"==typeof t?t:t?y(t,"url")?t.url:t.toString?t.toString():"":""}let v;const E=1e3;let w,T;function S(t,e=!1){return n=>{if(!n||T===n)return;if(function(t){if("keypress"!==t.type)return!1;try{const e=t.target;if(!e||!e.tagName)return!0;if("INPUT"===e.tagName||"TEXTAREA"===e.tagName||e.isContentEditable)return!1}catch(t){}return!0}(n))return;const r="keypress"===n.type?"input":n.type;(void 0===w||function(t,e){if(!t)return!0;if(t.type!==e.type)return!0;try{if(t.target!==e.target)return!0}catch(t){}return!1}(T,n))&&(t({event:n,name:r,global:e}),T=n),clearTimeout(w),w=p.setTimeout((()=>{w=void 0}),E)}}let I=null,x=null},7597:(t,e,n)=>{"use strict";n.d(e,{Cy:()=>h,HD:()=>o,J8:()=>d,Kj:()=>p,PO:()=>c,V9:()=>_,VZ:()=>i,cO:()=>u,i2:()=>f,kK:()=>l,pt:()=>a});const r=Object.prototype.toString;function i(t){switch(r.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return _(t,Error)}}function s(t,e){return r.call(t)===`[object ${e}]`}function o(t){return s(t,"String")}function a(t){return null===t||"object"!=typeof t&&"function"!=typeof t}function c(t){return s(t,"Object")}function u(t){return"undefined"!=typeof Event&&_(t,Event)}function l(t){return"undefined"!=typeof Element&&_(t,Element)}function p(t){return s(t,"RegExp")}function d(t){return Boolean(t&&t.then&&"function"==typeof t.then)}function h(t){return c(t)&&"nativeEvent"in t&&"preventDefault"in t&&"stopPropagation"in t}function f(t){return"number"==typeof t&&t!=t}function _(t,e){try{return t instanceof e}catch(t){return!1}}},2343:(t,e,n)=>{"use strict";n.d(e,{Cf:()=>s,RU:()=>i,kg:()=>a});var r=n(1235);const i=["debug","info","warn","error","log","assert","trace"];function s(t){if(!("console"in r.n2))return t();const e=r.n2.console,n={};i.forEach((t=>{const r=e[t]&&e[t].__sentry_original__;t in e&&r&&(n[t]=e[t],e[t]=r)}));try{return t()}finally{Object.keys(n).forEach((t=>{e[t]=n[t]}))}}function o(){let t=!1;const e={enable:()=>{t=!0},disable:()=>{t=!1}};return"undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__?i.forEach((n=>{e[n]=(...e)=>{t&&s((()=>{r.n2.console[n](`Sentry Logger [${n}]:`,...e)}))}})):i.forEach((t=>{e[t]=()=>{}})),e}let a;a="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__?(0,r.YO)("logger",o):o()},2844:(t,e,n)=>{"use strict";n.d(e,{DM:()=>o,Db:()=>u,EG:()=>l,J4:()=>d,YO:()=>f,go:()=>h,jH:()=>c,lE:()=>_});var r=n(535),i=n(7321),s=n(1235);function o(){const t=s.n2,e=t.crypto||t.msCrypto;if(e&&e.randomUUID)return e.randomUUID().replace(/-/g,"");const n=e&&e.getRandomValues?()=>e.getRandomValues(new Uint8Array(1))[0]:()=>16*Math.random();return([1e7]+1e3+4e3+8e3+1e11).replace(/[018]/g,(t=>(t^(15&n())>>t/4).toString(16)))}function a(t){return t.exception&&t.exception.values?t.exception.values[0]:void 0}function c(t){const{message:e,event_id:n}=t;if(e)return e;const r=a(t);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"":n||""}function u(t,e,n){const r=t.exception=t.exception||{},i=r.values=r.values||[],s=i[0]=i[0]||{};s.value||(s.value=e||""),s.type||(s.type=n||"Error")}function l(t,e){const n=a(t);if(!n)return;const r=n.mechanism;if(n.mechanism={type:"generic",handled:!0,...r,...e},e&&"data"in e){const t={...r&&r.data,...e.data};n.mechanism.data=t}}const p=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/;function d(t){const e=t.match(p)||[],n=parseInt(e[1],10),r=parseInt(e[2],10),i=parseInt(e[3],10);return{buildmetadata:e[5],major:isNaN(n)?void 0:n,minor:isNaN(r)?void 0:r,patch:isNaN(i)?void 0:i,prerelease:e[4]}}function h(t,e,n=5){if(void 0===e.lineno)return;const r=t.length,s=Math.max(Math.min(r,e.lineno-1),0);e.pre_context=t.slice(Math.max(0,s-n),s).map((t=>(0,i.JM)(t,0))),e.context_line=(0,i.JM)(t[Math.min(r-1,s)],e.colno||0),e.post_context=t.slice(Math.min(s+1,r),s+1+n).map((t=>(0,i.JM)(t,0)))}function f(t){if(t&&t.__sentry_captured__)return!0;try{(0,r.xp)(t,"__sentry_captured__",!0)}catch(t){}return!1}function _(t){return Array.isArray(t)?t:[t]}},2176:(t,e,n)=>{"use strict";function r(){return!("undefined"!=typeof __SENTRY_BROWSER_BUNDLE__&&__SENTRY_BROWSER_BUNDLE__)&&"[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0)}function i(t,e){return t.require(e)}function s(e){let n;try{n=i(t,e)}catch(t){}try{const{cwd:r}=i(t,"process");n=i(t,`${r()}/node_modules/${e}`)}catch(t){}return n}n.d(e,{l$:()=>i,KV:()=>r,$y:()=>s}),t=n.hmd(t)},535:(t,e,n)=>{"use strict";n.d(e,{HK:()=>c,Jr:()=>f,Sh:()=>l,_j:()=>u,hl:()=>o,xp:()=>a,zf:()=>h});var r=n(8464),i=n(7597),s=n(7321);function o(t,e,n){if(!(e in t))return;const r=t[e],i=n(r);if("function"==typeof i)try{!function(t,e){const n=e.prototype||{};t.prototype=e.prototype=n,a(t,"__sentry_original__",e)}(i,r)}catch(t){}t[e]=i}function a(t,e,n){Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0})}function c(t){return t.__sentry_original__}function u(t){return Object.keys(t).map((e=>`${encodeURIComponent(e)}=${encodeURIComponent(t[e])}`)).join("&")}function l(t){if((0,i.VZ)(t))return{message:t.message,name:t.name,stack:t.stack,...d(t)};if((0,i.cO)(t)){const e={type:t.type,target:p(t.target),currentTarget:p(t.currentTarget),...d(t)};return"undefined"!=typeof CustomEvent&&(0,i.V9)(t,CustomEvent)&&(e.detail=t.detail),e}return t}function p(t){try{return(0,i.kK)(t)?(0,r.Rt)(t):Object.prototype.toString.call(t)}catch(t){return""}}function d(t){if("object"==typeof t&&null!==t){const e={};for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}return{}}function h(t,e=40){const n=Object.keys(l(t));if(n.sort(),!n.length)return"[object has no keys]";if(n[0].length>=e)return(0,s.$G)(n[0],e);for(let t=n.length;t>0;t--){const r=n.slice(0,t).join(", ");if(!(r.length>e))return t===n.length?r:(0,s.$G)(r,e)}return""}function f(t){return _(t,new Map)}function _(t,e){if((0,i.PO)(t)){const n=e.get(t);if(void 0!==n)return n;const r={};e.set(t,r);for(const n of Object.keys(t))void 0!==t[n]&&(r[n]=_(t[n],e));return r}if(Array.isArray(t)){const n=e.get(t);if(void 0!==n)return n;const r=[];return e.set(t,r),t.forEach((t=>{r.push(_(t,e))})),r}return t}},442:(t,e,n)=>{"use strict";n.d(e,{dB:()=>i,oA:()=>s});var r=n(6956);function i(t,e,n){t&&(t.metadata.source&&"url"!==t.metadata.source||t.setName(...s(e,{path:!0,method:!0})),t.setData("url",e.originalUrl||e.url),e.baseUrl&&t.setData("baseUrl",e.baseUrl),t.setData("query",function(t,e){let n=t.originalUrl||t.url||"";if(n)return n.startsWith("/")&&(n=`http://dogs.are.great${n}`),t.query||void 0!==typeof URL&&new URL(n).search.replace("?","")||e&&e.url&&e.url.parse(n).query||void 0}(e,n)))}function s(t,e={}){const n=t.method&&t.method.toUpperCase();let i="",s="url";e.customRoute||t.route?(i=e.customRoute||`${t.baseUrl||""}${t.route&&t.route.path}`,s="route"):(t.originalUrl||t.url)&&(i=(0,r.rt)(t.originalUrl||t.url||""));let o="";return e.method&&n&&(o+=n),e.method&&e.path&&(o+=" "),e.path&&i&&(o+=i),[o,s]}},6147:(t,e,n)=>{"use strict";function r(t){const e=/^\s*[-]{4,}$/,n=/at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/;return r=>{const i=r.match(n);if(i){let e,n,r,s,o;if(i[1]){r=i[1];let t=r.lastIndexOf(".");if("."===r[t-1]&&t--,t>0){e=r.slice(0,t),n=r.slice(t+1);const i=e.indexOf(".Module");i>0&&(r=r.slice(i+1),e=e.slice(0,i))}s=void 0}n&&(s=e,o=n),""===n&&(o=void 0,r=void 0),void 0===r&&(o=o||"",r=s?`${s}.${o}`:o);let a=i[2]&&i[2].startsWith("file://")?i[2].slice(7):i[2];const c="native"===i[5];a||!i[5]||c||(a=i[5]);const u=!(c||a&&!a.startsWith("/")&&!a.includes(":\\")&&!a.startsWith(".")&&!a.match(/^[a-zA-Z]([a-zA-Z0-9.\-+])*:\/\//)||void 0===a||a.includes("node_modules/"));return{filename:a,module:t?t(a):void 0,function:r,lineno:parseInt(i[3],10)||void 0,colno:parseInt(i[4],10)||void 0,in_app:u}}if(r.match(e))return{filename:r}}}n.d(e,{pE:()=>o,$P:()=>u,Ep:()=>l,Sq:()=>a});const i=50,s=/\(error: (.*)\)/;function o(...t){const e=t.sort(((t,e)=>t[0]-e[0])).map((t=>t[1]));return(t,n=0)=>{const r=[],o=t.split("\n");for(let t=n;t1024)continue;const a=s.test(n)?n.replace(s,"$1"):n;if(!a.match(/\S*Error: /)){for(const t of e){const e=t(a);if(e){r.push(e);break}}if(r.length>=i)break}}return function(t){if(!t.length)return[];const e=t.slice(0,i),n=e[e.length-1].function;n&&/sentryWrapped/.test(n)&&e.pop(),e.reverse();const r=e[e.length-1].function;return r&&/captureMessage|captureException/.test(r)&&e.pop(),e.map((t=>({...t,filename:t.filename||e[e.length-1].filename,function:t.function||"?"})))}(r)}}function a(t){return Array.isArray(t)?o(...t):t}const c="";function u(t){try{return t&&"function"==typeof t&&t.name||c}catch(t){return c}}function l(t){return[90,r(t)]}},7321:(t,e,n)=>{"use strict";n.d(e,{$G:()=>i,JM:()=>s,U0:()=>o});var r=n(7597);function i(t,e=0){return"string"!=typeof t||0===e||t.length<=e?t:`${t.slice(0,e)}...`}function s(t,e){let n=t;const r=n.length;if(r<=150)return n;e>r&&(e=r);let i=Math.max(e-60,0);i<5&&(i=0);let s=Math.min(i+140,r);return s>r-5&&(s=r),s===r&&(i=Math.max(s-140,0)),n=n.slice(i,s),i>0&&(n=`'{snip} ${n}`),sfunction(t,e,n=!1){return!!(0,r.HD)(t)&&((0,r.Kj)(e)?e.test(t):!!(0,r.HD)(e)&&(n?t===e:t.includes(e)))}(t,e,n)))}},6893:(t,e,n)=>{"use strict";n.d(e,{$2:()=>o,WD:()=>s,cW:()=>a});var r,i=n(7597);function s(t){return new a((e=>{e(t)}))}function o(t){return new a(((e,n)=>{n(t)}))}!function(t){t[t.PENDING=0]="PENDING",t[t.RESOLVED=1]="RESOLVED",t[t.REJECTED=2]="REJECTED"}(r||(r={}));class a{__init(){this._state=r.PENDING}__init2(){this._handlers=[]}constructor(t){a.prototype.__init.call(this),a.prototype.__init2.call(this),a.prototype.__init3.call(this),a.prototype.__init4.call(this),a.prototype.__init5.call(this),a.prototype.__init6.call(this);try{t(this._resolve,this._reject)}catch(t){this._reject(t)}}then(t,e){return new a(((n,r)=>{this._handlers.push([!1,e=>{if(t)try{n(t(e))}catch(t){r(t)}else n(e)},t=>{if(e)try{n(e(t))}catch(t){r(t)}else r(t)}]),this._executeHandlers()}))}catch(t){return this.then((t=>t),t)}finally(t){return new a(((e,n)=>{let r,i;return this.then((e=>{i=!1,r=e,t&&t()}),(e=>{i=!0,r=e,t&&t()})).then((()=>{i?n(r):e(r)}))}))}__init3(){this._resolve=t=>{this._setResult(r.RESOLVED,t)}}__init4(){this._reject=t=>{this._setResult(r.REJECTED,t)}}__init5(){this._setResult=(t,e)=>{this._state===r.PENDING&&((0,i.J8)(e)?e.then(this._resolve,this._reject):(this._state=t,this._value=e,this._executeHandlers()))}}__init6(){this._executeHandlers=()=>{if(this._state===r.PENDING)return;const t=this._handlers.slice();this._handlers=[],t.forEach((t=>{t[0]||(this._state===r.RESOLVED&&t[1](this._value),this._state===r.REJECTED&&t[2](this._value),t[0]=!0)}))}}}},1170:(t,e,n)=>{"use strict";n.d(e,{Z1:()=>d,ph:()=>l,yW:()=>u});var r=n(2176),i=n(1235);t=n.hmd(t);const s=(0,i.Rf)(),o={nowSeconds:()=>Date.now()/1e3},a=(0,r.KV)()?function(){try{return(0,r.l$)(t,"perf_hooks").performance}catch(t){return}}():function(){const{performance:t}=s;if(t&&t.now)return{now:()=>t.now(),timeOrigin:Date.now()-t.now()}}(),c=void 0===a?o:{nowSeconds:()=>(a.timeOrigin+a.now())/1e3},u=o.nowSeconds.bind(o),l=c.nowSeconds.bind(c);let p;const d=(()=>{const{performance:t}=s;if(!t||!t.now)return void(p="none");const e=36e5,n=t.now(),r=Date.now(),i=t.timeOrigin?Math.abs(t.timeOrigin+n-r):e,o=i{"use strict";n.d(e,{K:()=>r,q:()=>i});const r=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function i(t){const e=t.match(r);if(!t||!e)return;let n;return"1"===e[3]?n=!0:"0"===e[3]&&(n=!1),{traceId:e[1],parentSampled:n,parentSpanId:e[2]}}},6956:(t,e,n)=>{"use strict";function r(t){if(!t)return{};const e=t.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!e)return{};const n=e[6]||"",r=e[8]||"";return{host:e[4],path:e[5],protocol:e[2],search:n,hash:r,relative:e[5]+n+r}}function i(t){return t.split(/[\?#]/,1)[0]}function s(t){return t.split(/\\?\//).filter((t=>t.length>0&&","!==t)).length}function o(t){const{protocol:e,host:n,path:r}=t;return`${e?`${e}://`:""}${n&&n.replace(/^.*@/,"[filtered]:[filtered]@").replace(":80","").replace(":443","")||""}${r}`}n.d(e,{$A:()=>s,en:()=>r,rt:()=>i,tF:()=>o})},1235:(t,e,n)=>{"use strict";function r(t){return t&&t.Math==Math?t:void 0}n.d(e,{Rf:()=>s,YO:()=>o,n2:()=>i});const i="object"==typeof globalThis&&r(globalThis)||"object"==typeof window&&r(window)||"object"==typeof self&&r(self)||"object"==typeof global&&r(global)||function(){return this}()||{};function s(){return i}function o(t,e,n){const r=n||i,s=r.__SENTRY__=r.__SENTRY__||{};return s[t]||(s[t]=e())}},8054:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};const i=n(2361),s=r(n(5158)),o=r(n(6304)),a=s.default("agent-base");function c(){const{stack:t}=new Error;return"string"==typeof t&&t.split("\n").some((t=>-1!==t.indexOf("(https.js:")||-1!==t.indexOf("node:https:")))}function u(t,e){return new u.Agent(t,e)}!function(t){class e extends i.EventEmitter{constructor(t,e){super();let n=e;"function"==typeof t?this.callback=t:t&&(n=t),this.timeout=null,n&&"number"==typeof n.timeout&&(this.timeout=n.timeout),this.maxFreeSockets=1,this.maxSockets=1,this.maxTotalSockets=1/0,this.sockets={},this.freeSockets={},this.requests={},this.options={}}get defaultPort(){return"number"==typeof this.explicitDefaultPort?this.explicitDefaultPort:c()?443:80}set defaultPort(t){this.explicitDefaultPort=t}get protocol(){return"string"==typeof this.explicitProtocol?this.explicitProtocol:c()?"https:":"http:"}set protocol(t){this.explicitProtocol=t}callback(t,e,n){throw new Error('"agent-base" has no default implementation, you must subclass and override `callback()`')}addRequest(t,e){const n=Object.assign({},e);"boolean"!=typeof n.secureEndpoint&&(n.secureEndpoint=c()),null==n.host&&(n.host="localhost"),null==n.port&&(n.port=n.secureEndpoint?443:80),null==n.protocol&&(n.protocol=n.secureEndpoint?"https:":"http:"),n.host&&n.path&&delete n.path,delete n.agent,delete n.hostname,delete n._defaultAgent,delete n.defaultPort,delete n.createConnection,t._last=!0,t.shouldKeepAlive=!1;let r=!1,i=null;const s=n.timeout||this.timeout,u=e=>{t._hadError||(t.emit("error",e),t._hadError=!0)},l=()=>{i=null,r=!0;const t=new Error(`A "socket" was not created for HTTP request before ${s}ms`);t.code="ETIMEOUT",u(t)},p=t=>{r||(null!==i&&(clearTimeout(i),i=null),u(t))},d=e=>{if(r)return;if(null!=i&&(clearTimeout(i),i=null),s=e,Boolean(s)&&"function"==typeof s.addRequest)return a("Callback returned another Agent instance %o",e.constructor.name),void e.addRequest(t,n);var s;if(e)return e.once("free",(()=>{this.freeSocket(e,n)})),void t.onSocket(e);const o=new Error(`no Duplex stream was returned to agent-base for \`${t.method} ${t.path}\``);u(o)};if("function"==typeof this.callback){this.promisifiedCallback||(this.callback.length>=3?(a("Converting legacy callback function to promise"),this.promisifiedCallback=o.default(this.callback)):this.promisifiedCallback=this.callback),"number"==typeof s&&s>0&&(i=setTimeout(l,s)),"port"in n&&"number"!=typeof n.port&&(n.port=Number(n.port));try{a("Resolving socket for %o request: %o",n.protocol,`${t.method} ${t.path}`),Promise.resolve(this.promisifiedCallback(t,n)).then(d,p)}catch(t){Promise.reject(t).catch(p)}}else u(new Error("`callback` is not defined"))}freeSocket(t,e){a("Freeing socket %o %o",t.constructor.name,e),t.destroy()}destroy(){a("Destroying agent %o",this.constructor.name)}}t.Agent=e,t.prototype=t.Agent.prototype}(u||(u={})),t.exports=u},6304:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return function(e,n){return new Promise(((r,i)=>{t.call(this,e,n,((t,e)=>{t?i(t):r(e)}))}))}}},6489:(t,e)=>{"use strict";e.Q=function(t,e){if("string"!=typeof t)throw new TypeError("argument str must be a string");for(var i={},s=e||{},o=t.split(";"),a=s.decode||n,c=0;c{"use strict";const r=n(4341);t.exports=(t,e={})=>{if("function"!=typeof t)throw new TypeError(`Expected the first argument to be a function, got \`${typeof t}\``);const{wait:n=0,maxWait:i=0,before:s=!1,after:o=!0}=e;if(!s&&!o)throw new Error("Both `before` and `after` are false, function wouldn't be called.");let a,c,u;const l=function(...e){const r=this,l=s&&!a;return clearTimeout(a),a=setTimeout((()=>{a=void 0,c&&(clearTimeout(c),c=void 0),o&&(u=t.apply(r,e))}),n),i>0&&!c&&o&&(c=setTimeout((()=>{c=void 0,a&&(clearTimeout(a),a=void 0),u=t.apply(r,e)}),i)),l&&(u=t.apply(r,e)),u};return r(l,t),l.cancel=()=>{a&&(clearTimeout(a),a=void 0),c&&(clearTimeout(c),c=void 0)},l}},1227:(t,e,n)=>{e.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;e.splice(1,0,n,"color: inherit");let r=0,i=0;e[0].replace(/%[a-zA-Z%]/g,(t=>{"%%"!==t&&(r++,"%c"===t&&(i=r))})),e.splice(i,0,n)},e.save=function(t){try{t?e.storage.setItem("debug",t):e.storage.removeItem("debug")}catch(t){}},e.load=function(){let t;try{t=e.storage.getItem("debug")}catch(t){}return!t&&"undefined"!=typeof process&&"env"in process&&(t=process.env.DEBUG),t},e.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},e.storage=function(){try{return localStorage}catch(t){}}(),e.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.log=console.debug||console.log||(()=>{}),t.exports=n(2447)(e);const{formatters:r}=t.exports;r.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}},2447:(t,e,n)=>{t.exports=function(t){function e(t){let n,i,s,o=null;function a(...t){if(!a.enabled)return;const r=a,i=Number(new Date),s=i-(n||i);r.diff=s,r.prev=n,r.curr=i,n=i,t[0]=e.coerce(t[0]),"string"!=typeof t[0]&&t.unshift("%O");let o=0;t[0]=t[0].replace(/%([a-zA-Z%])/g,((n,i)=>{if("%%"===n)return"%";o++;const s=e.formatters[i];if("function"==typeof s){const e=t[o];n=s.call(r,e),t.splice(o,1),o--}return n})),e.formatArgs.call(r,t),(r.log||e.log).apply(r,t)}return a.namespace=t,a.useColors=e.useColors(),a.color=e.selectColor(t),a.extend=r,a.destroy=e.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==o?o:(i!==e.namespaces&&(i=e.namespaces,s=e.enabled(t)),s),set:t=>{o=t}}),"function"==typeof e.init&&e.init(a),a}function r(t,n){const r=e(this.namespace+(void 0===n?":":n)+t);return r.log=this.log,r}function i(t){return t.toString().substring(2,t.toString().length-2).replace(/\.\*\?$/,"*")}return e.debug=e,e.default=e,e.coerce=function(t){return t instanceof Error?t.stack||t.message:t},e.disable=function(){const t=[...e.names.map(i),...e.skips.map(i).map((t=>"-"+t))].join(",");return e.enable(""),t},e.enable=function(t){let n;e.save(t),e.namespaces=t,e.names=[],e.skips=[];const r=("string"==typeof t?t:"").split(/[\s,]+/),i=r.length;for(n=0;n{e[n]=t[n]})),e.names=[],e.skips=[],e.formatters={},e.selectColor=function(t){let n=0;for(let e=0;e{"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?t.exports=n(1227):t.exports=n(39)},39:(t,e,n)=>{const r=n(6224),i=n(3837);e.init=function(t){t.inspectOpts={};const n=Object.keys(e.inspectOpts);for(let r=0;r{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),e.colors=[6,2,3,4,5,1];try{const t=n(2130);t&&(t.stderr||t).level>=2&&(e.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(t){}e.inspectOpts=Object.keys(process.env).filter((t=>/^debug_/i.test(t))).reduce(((t,e)=>{const n=e.substring(6).toLowerCase().replace(/_([a-z])/g,((t,e)=>e.toUpperCase()));let r=process.env[e];return r=!!/^(yes|on|true|enabled)$/i.test(r)||!/^(no|off|false|disabled)$/i.test(r)&&("null"===r?null:Number(r)),t[n]=r,t}),{}),t.exports=n(2447)(e);const{formatters:s}=t.exports;s.o=function(t){return this.inspectOpts.colors=this.useColors,i.inspect(t,this.inspectOpts).split("\n").map((t=>t.trim())).join(" ")},s.O=function(t){return this.inspectOpts.colors=this.useColors,i.inspect(t,this.inspectOpts)}},2559:t=>{!function(){"use strict";var e=[,function(t,e){function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n255)throw new Error("Not ascii. Base64.encode can only take ascii strings.");t[n]=i}}for(var o=[],a=null,c=null,u=null,l=null,p=0;p>2&63,c=(3&t[p])<<4;break;case 1:c|=t[p]>>4&15,u=(15&t[p])<<2;break;case 2:u|=t[p]>>6&3,l=63&t[p],o.push(r(a)),o.push(r(c)),o.push(r(u)),o.push(r(l)),a=null,c=null,u=null,l=null}return null!=a&&(o.push(r(a)),o.push(r(c)),null==u?o.push("="):o.push(r(u)),null==l&&o.push("=")),o.join("")},decode:function(t){var e=Math.floor(3*t.length/4);"="==t.charAt(t.length-1)&&(e--,"="==t.charAt(t.length-2)&&e--);for(var r,i=s(e),o=null,a=null,c=null,u=0,l=0;l>4,i[u++]=o,a=(15&p)<<4;break;case 2:p>=0&&(a|=p>>2,i[u++]=a,c=(3&p)<<6);break;case 3:p>=0&&(i[u++]=c|p)}}return i},newBinary:s};e.Base64=o},function(t){t.exports={_noYieldsAllowed:function(t){return t()}}},function(t,e){function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function r(t){return JSON.stringify(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=function t(e,i,s,o,a){var c=i[e];switch(n(c)){case"string":return r(c);case"number":return isFinite(c)?String(c):"null";case"boolean":return String(c);case"object":if(!c)return"null";var u,l=o+s,p=[];if(Array.isArray(c)||{}.hasOwnProperty.call(c,"callee")){for(var d=c.length,h=0;h0&&void 0!==arguments[0]&&arguments[0]?a:(0,s.convertMapToObject)(a)},o._getConverters=function(){return c};var u=function(t){for(var e=0;e=p.length||i!==p[r]||!o.equals(t[i],e[p[r]],n)||(r++,0))}))):(r=0,a=l.every((function(i){return!!(0,s.hasOwn)(e,i)&&!!o.equals(t[i],e[i],n)&&(r++,!0)}))),a&&r===p.length},o.clone=function(t){var e;if(!(0,s.isObject)(t))return t;if(null===t)return null;if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp)return t;if(o.isBinary(t)){e=o.newBinary(t.length);for(var n=0;n{"use strict";var e=Object.prototype.hasOwnProperty,n="~";function r(){}function i(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function s(t,e,r,s,o){if("function"!=typeof r)throw new TypeError("The listener must be a function");var a=new i(r,s||t,o),c=n?n+e:e;return t._events[c]?t._events[c].fn?t._events[c]=[t._events[c],a]:t._events[c].push(a):(t._events[c]=a,t._eventsCount++),t}function o(t,e){0==--t._eventsCount?t._events=new r:delete t._events[e]}function a(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),a.prototype.eventNames=function(){var t,r,i=[];if(0===this._eventsCount)return i;for(r in t=this._events)e.call(t,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},a.prototype.listeners=function(t){var e=n?n+t:t,r=this._events[e];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,s=r.length,o=new Array(s);i{"use strict";t.exports=function t(e,n){if(e===n)return!0;if(e&&n&&"object"==typeof e&&"object"==typeof n){if(e.constructor!==n.constructor)return!1;var r,i,s;if(Array.isArray(e)){if((r=e.length)!=n.length)return!1;for(i=r;0!=i--;)if(!t(e[i],n[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if((r=(s=Object.keys(e)).length)!==Object.keys(n).length)return!1;for(i=r;0!=i--;)if(!Object.prototype.hasOwnProperty.call(n,s[i]))return!1;for(i=r;0!=i--;){var o=s[i];if(!t(e[o],n[o]))return!1}return!0}return e!=e&&n!=n}},2261:(t,e,n)=>{var r;t.exports=function(){if(!r){try{r=n(5158)("follow-redirects")}catch(t){}"function"!=typeof r&&(r=function(){})}r.apply(null,arguments)}},938:(t,e,n)=>{var r=n(7310),i=r.URL,s=n(3685),o=n(5687),a=n(2781).Writable,c=n(9491),u=n(2261),l=["abort","aborted","connect","error","socket","timeout"],p=Object.create(null);l.forEach((function(t){p[t]=function(e,n,r){this._redirectable.emit(t,e,n,r)}}));var d=w("ERR_INVALID_URL","Invalid URL",TypeError),h=w("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),f=w("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded"),_=w("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),m=w("ERR_STREAM_WRITE_AFTER_END","write after end");function g(t,e){a.call(this),this._sanitizeOptions(t),this._options=t,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],e&&this.on("response",e);var n=this;this._onNativeResponse=function(t){n._processResponse(t)},this._performRequest()}function y(t){var e={maxRedirects:21,maxBodyLength:10485760},n={};return Object.keys(t).forEach((function(s){var o=s+":",a=n[o]=t[s],l=e[s]=Object.create(a);Object.defineProperties(l,{request:{value:function(t,s,a){if(S(t)){var l;try{l=v(new i(t))}catch(e){l=r.parse(t)}if(!S(l.protocol))throw new d({input:t});t=l}else i&&t instanceof i?t=v(t):(a=s,s=t,t={protocol:o});return I(s)&&(a=s,s=null),(s=Object.assign({maxRedirects:e.maxRedirects,maxBodyLength:e.maxBodyLength},t,s)).nativeProtocols=n,S(s.host)||S(s.hostname)||(s.hostname="::1"),c.equal(s.protocol,o,"protocol mismatch"),u("options",s),new g(s,a)},configurable:!0,enumerable:!0,writable:!0},get:{value:function(t,e,n){var r=l.request(t,e,n);return r.end(),r},configurable:!0,enumerable:!0,writable:!0}})})),e}function b(){}function v(t){var e={protocol:t.protocol,hostname:t.hostname.startsWith("[")?t.hostname.slice(1,-1):t.hostname,hash:t.hash,search:t.search,pathname:t.pathname,path:t.pathname+t.search,href:t.href};return""!==t.port&&(e.port=Number(t.port)),e}function E(t,e){var n;for(var r in e)t.test(r)&&(n=e[r],delete e[r]);return null==n?void 0:String(n).trim()}function w(t,e,n){function r(n){Error.captureStackTrace(this,this.constructor),Object.assign(this,n||{}),this.code=t,this.message=this.cause?e+": "+this.cause.message:e}return r.prototype=new(n||Error),r.prototype.constructor=r,r.prototype.name="Error ["+t+"]",r}function T(t){for(var e of l)t.removeListener(e,p[e]);t.on("error",b),t.abort()}function S(t){return"string"==typeof t||t instanceof String}function I(t){return"function"==typeof t}g.prototype=Object.create(a.prototype),g.prototype.abort=function(){T(this._currentRequest),this.emit("abort")},g.prototype.write=function(t,e,n){if(this._ending)throw new m;if(!(S(t)||"object"==typeof(r=t)&&"length"in r))throw new TypeError("data should be a string, Buffer or Uint8Array");var r;I(e)&&(n=e,e=null),0!==t.length?this._requestBodyLength+t.length<=this._options.maxBodyLength?(this._requestBodyLength+=t.length,this._requestBodyBuffers.push({data:t,encoding:e}),this._currentRequest.write(t,e,n)):(this.emit("error",new _),this.abort()):n&&n()},g.prototype.end=function(t,e,n){if(I(t)?(n=t,t=e=null):I(e)&&(n=e,e=null),t){var r=this,i=this._currentRequest;this.write(t,e,(function(){r._ended=!0,i.end(null,null,n)})),this._ending=!0}else this._ended=this._ending=!0,this._currentRequest.end(null,null,n)},g.prototype.setHeader=function(t,e){this._options.headers[t]=e,this._currentRequest.setHeader(t,e)},g.prototype.removeHeader=function(t){delete this._options.headers[t],this._currentRequest.removeHeader(t)},g.prototype.setTimeout=function(t,e){var n=this;function r(e){e.setTimeout(t),e.removeListener("timeout",e.destroy),e.addListener("timeout",e.destroy)}function i(e){n._timeout&&clearTimeout(n._timeout),n._timeout=setTimeout((function(){n.emit("timeout"),s()}),t),r(e)}function s(){n._timeout&&(clearTimeout(n._timeout),n._timeout=null),n.removeListener("abort",s),n.removeListener("error",s),n.removeListener("response",s),e&&n.removeListener("timeout",e),n.socket||n._currentRequest.removeListener("socket",i)}return e&&this.on("timeout",e),this.socket?i(this.socket):this._currentRequest.once("socket",i),this.on("socket",r),this.on("abort",s),this.on("error",s),this.on("response",s),this},["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach((function(t){g.prototype[t]=function(e,n){return this._currentRequest[t](e,n)}})),["aborted","connection","socket"].forEach((function(t){Object.defineProperty(g.prototype,t,{get:function(){return this._currentRequest[t]}})})),g.prototype._sanitizeOptions=function(t){if(t.headers||(t.headers={}),t.host&&(t.hostname||(t.hostname=t.host),delete t.host),!t.pathname&&t.path){var e=t.path.indexOf("?");e<0?t.pathname=t.path:(t.pathname=t.path.substring(0,e),t.search=t.path.substring(e))}},g.prototype._performRequest=function(){var t=this._options.protocol,e=this._options.nativeProtocols[t];if(e){if(this._options.agents){var n=t.slice(0,-1);this._options.agent=this._options.agents[n]}var i=this._currentRequest=e.request(this._options,this._onNativeResponse);for(var s of(i._redirectable=this,l))i.on(s,p[s]);if(this._currentUrl=/^\//.test(this._options.path)?r.format(this._options):this._options.path,this._isRedirect){var o=0,a=this,c=this._requestBodyBuffers;!function t(e){if(i===a._currentRequest)if(e)a.emit("error",e);else if(o=400)return t.responseUrl=this._currentUrl,t.redirects=this._redirects,this.emit("response",t),void(this._requestBodyBuffers=[]);if(T(this._currentRequest),t.destroy(),++this._redirectCount>this._options.maxRedirects)this.emit("error",new f);else{var i,s=this._options.beforeRedirect;s&&(i=Object.assign({Host:t.req.getHeader("host")},this._options.headers));var o=this._options.method;((301===e||302===e)&&"POST"===this._options.method||303===e&&!/^(?:GET|HEAD)$/.test(this._options.method))&&(this._options.method="GET",this._requestBodyBuffers=[],E(/^content-/i,this._options.headers));var a,l=E(/^host$/i,this._options.headers),p=r.parse(this._currentUrl),d=l||p.host,_=/^\w+:/.test(n)?this._currentUrl:r.format(Object.assign(p,{host:d}));try{a=r.resolve(_,n)}catch(t){return void this.emit("error",new h({cause:t}))}u("redirecting to",a),this._isRedirect=!0;var m=r.parse(a);if(Object.assign(this._options,m),(m.protocol!==p.protocol&&"https:"!==m.protocol||m.host!==d&&!function(t,e){c(S(t)&&S(e));var n=t.length-e.length-1;return n>0&&"."===t[n]&&t.endsWith(e)}(m.host,d))&&E(/^(?:authorization|cookie)$/i,this._options.headers),I(s)){var g={headers:t.headers,statusCode:e},y={url:_,method:o,headers:i};try{s(this._options,g,y)}catch(t){return void this.emit("error",t)}this._sanitizeOptions(this._options)}try{this._performRequest()}catch(t){this.emit("error",new h({cause:t}))}}},t.exports=y({http:s,https:o}),t.exports.wrap=y},6560:t=>{"use strict";t.exports=(t,e=process.argv)=>{const n=t.startsWith("-")?"":1===t.length?"-":"--",r=e.indexOf(n+t),i=e.indexOf("--");return-1!==r&&(-1===i||r{d("replaying proxy buffer for failed request"),c.default(t.listenerCount("data")>0),t.push(y),t.push(null)})),b}))}}function f(t){t.resume()}e.default=h},6018:function(t,e,n){"use strict";const r=(this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}})(n(9146));function i(t){return new r.default(t)}!function(t){t.HttpsProxyAgent=r.default,t.prototype=r.default.prototype}(i||(i={})),t.exports=i},9829:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const i=r(n(5158)).default("https-proxy-agent:parse-proxy-response");e.default=function(t){return new Promise(((e,n)=>{let r=0;const s=[];function o(){const n=t.read();n?function(t){s.push(t),r+=t.length;const n=Buffer.concat(s,r);if(-1===n.indexOf("\r\n\r\n"))return i("have not received end of HTTP headers yet..."),void o();const a=n.toString("ascii",0,n.indexOf("\r\n")),c=+a.split(" ")[1];i("got proxy server response: %o",a),e({statusCode:c,buffered:n})}(n):t.once("readable",o)}function a(t){i("onclose had error %o",t)}function c(){i("onend")}t.on("error",(function e(r){t.removeListener("end",c),t.removeListener("error",e),t.removeListener("close",a),t.removeListener("readable",o),i("onerror %o",r),n(r)})),t.on("close",a),t.on("end",c),o()}))}},7612:function(t,e,n){var r,i;!function(s,o){const a=e;!function(t){const e=Symbol("newer"),n=Symbol("older");function r(t,e){"number"!=typeof t&&(e=t,t=0),this.size=0,this.limit=t,this.oldest=this.newest=void 0,this._keymap=new Map,e&&(this.assign(e),t<1&&(this.limit=this.size))}function i(t,r){this.key=t,this.value=r,this[e]=void 0,this[n]=void 0}function s(t){this.entry=t}function o(t){this.entry=t}function a(t){this.entry=t}t.LRUMap=r,r.prototype._markEntryAsUsed=function(t){t!==this.newest&&(t[e]&&(t===this.oldest&&(this.oldest=t[e]),t[e][n]=t[n]),t[n]&&(t[n][e]=t[e]),t[e]=void 0,t[n]=this.newest,this.newest&&(this.newest[e]=t),this.newest=t)},r.prototype.assign=function(t){let r,s=this.limit||Number.MAX_VALUE;this._keymap.clear();let o=t[Symbol.iterator]();for(let t=o.next();!t.done;t=o.next()){let o=new i(t.value[0],t.value[1]);if(this._keymap.set(o.key,o),r?(r[e]=o,o[n]=r):this.oldest=o,r=o,0==s--)throw new Error("overflow")}this.newest=r,this.size=this._keymap.size},r.prototype.get=function(t){var e=this._keymap.get(t);if(e)return this._markEntryAsUsed(e),e.value},r.prototype.set=function(t,r){var s=this._keymap.get(t);return s?(s.value=r,this._markEntryAsUsed(s),this):(this._keymap.set(t,s=new i(t,r)),this.newest?(this.newest[e]=s,s[n]=this.newest):this.oldest=s,this.newest=s,++this.size,this.size>this.limit&&this.shift(),this)},r.prototype.shift=function(){var t=this.oldest;if(t)return this.oldest[e]?(this.oldest=this.oldest[e],this.oldest[n]=void 0):(this.oldest=void 0,this.newest=void 0),t[e]=t[n]=void 0,this._keymap.delete(t.key),--this.size,[t.key,t.value]},r.prototype.find=function(t){let e=this._keymap.get(t);return e?e.value:void 0},r.prototype.has=function(t){return this._keymap.has(t)},r.prototype.delete=function(t){var r=this._keymap.get(t);if(r)return this._keymap.delete(r.key),r[e]&&r[n]?(r[n][e]=r[e],r[e][n]=r[n]):r[e]?(r[e][n]=void 0,this.oldest=r[e]):r[n]?(r[n][e]=void 0,this.newest=r[n]):this.oldest=this.newest=void 0,this.size--,r.value},r.prototype.clear=function(){this.oldest=this.newest=void 0,this.size=0,this._keymap.clear()},s.prototype[Symbol.iterator]=function(){return this},s.prototype.next=function(){let t=this.entry;return t?(this.entry=t[e],{done:!1,value:[t.key,t.value]}):{done:!0,value:void 0}},o.prototype[Symbol.iterator]=function(){return this},o.prototype.next=function(){let t=this.entry;return t?(this.entry=t[e],{done:!1,value:t.key}):{done:!0,value:void 0}},a.prototype[Symbol.iterator]=function(){return this},a.prototype.next=function(){let t=this.entry;return t?(this.entry=t[e],{done:!1,value:t.value}):{done:!0,value:void 0}},r.prototype.keys=function(){return new o(this.oldest)},r.prototype.values=function(){return new a(this.oldest)},r.prototype.entries=function(){return this},r.prototype[Symbol.iterator]=function(){return new s(this.oldest)},r.prototype.forEach=function(t,n){"object"!=typeof n&&(n=this);let r=this.oldest;for(;r;)t.call(n,r.value,r.key,this),r=r[e]},r.prototype.toJSON=function(){for(var t=new Array(this.size),n=0,r=this.oldest;r;)t[n++]={key:r.key,value:r.value},r=r[e];return t},r.prototype.toString=function(){for(var t="",n=this.oldest;n;)t+=String(n.key)+":"+n.value,(n=n[e])&&(t+=" < ");return t}}(a),void 0===(i="function"==typeof(r=a)?r.call(e,n,e,t):r)||(t.exports=i)}()},4341:t=>{"use strict";const e=(t,e,r,i)=>{if("length"===r||"prototype"===r)return;if("arguments"===r||"caller"===r)return;const s=Object.getOwnPropertyDescriptor(t,r),o=Object.getOwnPropertyDescriptor(e,r);!n(s,o)&&i||Object.defineProperty(t,r,o)},n=function(t,e){return void 0===t||t.configurable||t.writable===e.writable&&t.enumerable===e.enumerable&&t.configurable===e.configurable&&(t.writable||t.value===e.value)},r=(t,e)=>`/* Wrapped ${t}*/\n${e}`,i=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),s=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name");t.exports=(t,n,{ignoreNonConfigurable:o=!1}={})=>{const{name:a}=t;for(const r of Reflect.ownKeys(n))e(t,n,r,o);return((t,e)=>{const n=Object.getPrototypeOf(e);n!==Object.getPrototypeOf(t)&&Object.setPrototypeOf(t,n)})(t,n),((t,e,n)=>{const o=""===n?"":`with ${n.trim()}() `,a=r.bind(null,o,e.toString());Object.defineProperty(a,"name",s),Object.defineProperty(t,"toString",{...i,value:a})})(t,n,a),t}},7824:t=>{var e=1e3,n=60*e,r=60*n,i=24*r;function s(t,e,n,r){var i=e>=1.5*n;return Math.round(t/n)+" "+r+(i?"s":"")}t.exports=function(t,o){o=o||{};var a,c,u=typeof t;if("string"===u&&t.length>0)return function(t){if(!((t=String(t)).length>100)){var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(s){var o=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*o;case"weeks":case"week":case"w":return 6048e5*o;case"days":case"day":case"d":return o*i;case"hours":case"hour":case"hrs":case"hr":case"h":return o*r;case"minutes":case"minute":case"mins":case"min":case"m":return o*n;case"seconds":case"second":case"secs":case"sec":case"s":return o*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return o;default:return}}}}(t);if("number"===u&&isFinite(t))return o.long?(a=t,(c=Math.abs(a))>=i?s(a,c,i,"day"):c>=r?s(a,c,r,"hour"):c>=n?s(a,c,n,"minute"):c>=e?s(a,c,e,"second"):a+" ms"):function(t){var s=Math.abs(t);return s>=i?Math.round(t/i)+"d":s>=r?Math.round(t/r)+"h":s>=n?Math.round(t/n)+"m":s>=e?Math.round(t/e)+"s":t+"ms"}(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},9646:(t,e,n)=>{var r=n(938).http,i=n(938).https,s=n(7310),o=n(3837),a=n(2361),c=n(9796),u=n(5158)("NRC");e.K=function(t){var e=this,r=n(8180)(),i=n(6310)(),c=new l(this,r),u=function(t,n){var r=function(t){return function(){try{return t.apply(this,arguments)}catch(t){e.emit("error",t)}}},i={parsers:{},serializers:{}};return i.parsers.add=r(t.add),i.parsers.remove=r(t.remove),i.parsers.find=r(t.find),i.parsers.getAll=r(t.getAll),i.parsers.getDefault=r(t.getDefault),i.parsers.clean=r(t.clean),i.serializers.add=r(n.add),i.serializers.remove=r(n.remove),i.serializers.find=r(n.find),i.serializers.getAll=r(n.getAll),i.serializers.getDefault=r(n.getDefault),i.serializers.clean=r(n.clean),i}(r,i),d="Content-Length";e.options=t||{},e.useProxy=!!e.options.proxy,e.useProxyTunnel=!(!e.useProxy||void 0===e.options.proxy.tunnel)&&e.options.proxy.tunnel,e.proxy=e.options.proxy,e.connection=e.options.connection||{},e.mimetypes=e.options.mimetypes||{},e.requestConfig=e.options.requestConfig||{},e.responseConfig=e.options.responseConfig||{},this.methods={},this.parsers={},this.serializers={};var h=function(){a.EventEmitter.call(this)};o.inherits(h,a.EventEmitter),h.prototype.end=function(){this._httpRequest&&this._httpRequest.end()},h.prototype.setHttpRequest=function(t){this._httpRequest=t};var f={createProxyPath:function(t){var e=t.host;return"https:"===t.protocol&&(e=-1==t.host.indexOf(":")?t.hostname+":443":t.host),e},createProxyHeaders:function(t){var n={};return e.proxy.user&&e.proxy.password&&(n["Proxy-Authorization"]="Basic "+new Buffer([e.proxy.user,e.proxy.password].join(":")).toString("base64")),e.useProxyTunnel||(n.host=t.host),n},createConnectOptions:function(t,n){p("connect URL = ",t);var r=s.parse(t),i={},o=-1==r.protocol.indexOf(":")?r.protocol:r.protocol.substring(0,r.protocol.indexOf(":")),a="http"===o?80:443;if(i={host:-1==r.host.indexOf(":")?r.host:r.host.substring(0,r.host.indexOf(":")),port:void 0===r.port?a:r.port,path:r.path,protocol:o,href:r.href},e.useProxy&&(i.agent=!1),e.options.user&&e.options.password?i.auth=[e.options.user,e.options.password].join(":"):e.options.user&&!e.options.password&&(i.auth=e.options.user+":"),e.useProxy&&(i.proxy={host:e.proxy.host,port:e.proxy.port,method:e.useProxyTunnel?"CONNECT":n,path:e.useProxyTunnel?this.createProxyPath(r):t,headers:this.createProxyHeaders(r)}),e.connection&&"object"==typeof e.connection)for(var c in e.connection)i[c]=e.connection[c];if(!e.useProxyTunnel){for(var u in i.proxy)i[u]=i.proxy[u];delete i.proxy}return i.requestConfig=e.requestConfig,i.responseConfig=e.responseConfig,i},decodeQueryFromURL:function(t){for(var e,n=s.parse(t).query.substring(1).split("&"),r={},i=0;i0){var h=u.path.length,_=u.path.indexOf("?");_>=0&&_!==h-1&&e.emit("error","parameters argument cannot be used if parameters are already defined in URL "+u.path),u.path+="?"===u.path.charAt(h-1)?"":"?",u.path=u.path.concat(f.serializeEncodeQueryFromArgs(r.parameters)),p("options.path after request parameters = ",u.path)}this.overrideClientConfig(u,r),void 0===r.data||u.headers.hasOwnProperty(d)?u.headers[d]=0:i.get(u).serialize(r.data,(a=e,function(t,e){a.emit(t,e)}),(function(t){u.data=t,u.headers[d]=Buffer.byteLength(u.data,"utf8")}))}p("options post connect",u),p("FINAL SELF object ====>",e),e.useProxy&&e.useProxyTunnel?c.proxy(u,s):c.normal(u,s)},mergeMimeTypes:function(t){if(t&&"object"==typeof t)try{t.json&&t.json instanceof Array&&t.json.length>0?r.find("JSON").contentTypes=t.json:t.xml&&t.xml instanceof Array&&t.xml.length>0&&(r.find("XML").contentTypes=t.xml)}catch(t){e.emit("error","cannot assign custom content types to parser, cause: "+t)}},createHttpMethod:function(t){return function(e,n,r){var i=new h;return f.connect(t.toUpperCase(),e,n,r,i),i}}},_=function(t,n){var r=e[n.toLowerCase()];return function(e,n){return"function"==typeof e&&(n=e,e={}),r(t,e,n)}};this.get=f.createHttpMethod("get"),this.post=f.createHttpMethod("post"),this.put=f.createHttpMethod("put"),this.delete=f.createHttpMethod("delete"),this.patch=f.createHttpMethod("patch"),this.registerMethod=function(t,e,n){this.methods[t]=new _(e,n)},this.unregisterMethod=function(t){delete this.methods[t]},this.addCustomHttpMethod=function(t){e[t.toLowerCase()]=f.createHttpMethod(t)},this.parsers=u.parsers,this.serializers=u.serializers,f.mergeMimeTypes(e.mimetypes),p("ConnectManager",c)};var l=function(t,e){this.configureRequest=function(t,e,n){e.timeout&&t.setTimeout(e.timeout,(function(){n.emit("requestTimeout",t)})),e.noDelay&&t.setNoDelay(e.noDelay),e.keepAlive&&t.setSocketKeepAlive(e.noDelay,e.keepAliveDelay||0)},this.configureResponse=function(t,e,n){e.timeout&&t.setTimeout(e.timeout,(function(){n.emit("responseTimeout",t),t.close()}))},this.configureOptions=function(t){!function(e,n){for(var r in e)n.hasOwnProperty(e[r])&&(t[e[r]]=n[e[r]])}(["followRedirects","maxRedirects"],t.requestConfig),delete t.protocol,delete t.clientRequest,delete t.requestConfig,delete t.responseConfig,p("options pre connect",t)},this.handleEnd=function(t,e,n){var r=this,i=t.headers["content-type"],s=t.headers["content-encoding"];p("content-type: ",i),p("content-encoding: ",s),void 0!==s&&s.indexOf("gzip")>=0?(p("gunzip"),c.gunzip(Buffer.concat(e),(function(e,i){r.handleResponse(t,i,n)}))):void 0!==s&&s.indexOf("deflate")>=0?(p("inflate"),c.inflate(Buffer.concat(e),(function(e,i){r.handleResponse(t,i,n)}))):(p("not compressed"),r.handleResponse(t,Buffer.concat(e),n))},this.handleResponse=function(n,r,i){e.get(n).parse(r,function(t){return function(e,n){t.emit(e,n)}}(t),(function(t){i(t,n)}))},this.prepareData=function(t){return t instanceof Buffer||"object"!=typeof t?t:JSON.stringify(t)},this.proxy=function(e,n){p("proxy options",e.proxy);var s=r.request(e.proxy),o=this;s.on("connect",(function(s,a,c){p("proxy connected",a),e.socket=a;var u=[],l="http"==e.protocol?r:i,d=e.clientRequest,h=e.requestConfig,f=e.responseConfig;o.configureOptions(e),d.options=e;var _=l.request(e,(function(e){o.configureResponse(e,f,d),e.on("data",(function(t){u.push(Buffer.from(t))})),e.on("end",(function(){o.handleEnd(e,u,n)})),e.on("error",(function(n){void 0!==d&&"object"==typeof d?(n.request=d,n.response=e,d.emit("error",n)):t.emit("error",n)}))}));o.configureRequest(_,h,d),d.setHttpRequest(_),e.data&&_.write(e.data),_.end(),_.on("error",(function(e){void 0!==d&&"object"==typeof d?(e.request=d,d.emit("error",e)):t.emit("error",e)}))})),s.on("error",(function(e){t.emit("error",e)})),s.end()},this.normal=function(e,n){var s=[],o="http"===e.protocol?r:i,a=e.clientRequest,c=e.requestConfig,u=e.responseConfig,l=this;l.configureOptions(e),a.options=e;var d=o.request(e,(function(e){l.configureResponse(e,u,a),e.on("data",(function(t){s.push(Buffer.from(t))})),e.on("end",(function(){l.handleEnd(e,s,n)})),e.on("error",(function(n){void 0!==a&&"object"==typeof a?(n.request=a,n.response=e,a.emit("error",n)):t.emit("error",n)}))}));l.configureRequest(d,c,a),p("clientRequest",a),a.setHttpRequest(d),p("options data",e.data),e.data&&d.write(e.data),d.end(),d.on("error",(function(e){void 0!==a&&"object"==typeof a?(e.request=a,a.emit("error",e)):t.emit("error",e)}))}};o.inherits(e.K,a.EventEmitter);var p=function(){if(process.env.DEBUG){var t=new Date,e=t.getHours()+":"+t.getMinutes()+":"+t.getSeconds()+" [NRC CLIENT]"+arguments.callee.caller.name+" -> ",n=Array.prototype.slice.call(arguments);n.splice(0,0,e),u.apply(console,n)}}},8180:(t,e,n)=>{var r=function(){var t={},e=null;this.add=function(n){if(!function(t){function e(t,e){var n=!0;for(var r in e){var i=e[r].split(":");if(!t.hasOwnProperty([i[0]])||typeof t[i[0]]!==i[1]){n=!1;break}}return n}return result=e(t,["name:string","parse:function","isDefault:boolean"]),result&&!t.isDefault&&(result=e(t,["match:function"])),result}(n))throw"parser cannot be added: invalid parser definition";n.isDefault?e=n:t[n.name]=n},this.remove=function(e){if(!t[e])throw"cannot remove parser: "+e+" doesn't exists";delete t[e]},this.clean=function(){t={}},this.find=function(e){var n=t[e];if(!n)throw"cannot find parser: "+e+" doesn't exists ";return n},this.getDefault=function(){return e},this.get=function(n){var r=null;for(var i in t)if(t[i].match(n)){r=t[i];break}return null===r?e:r},this.getAll=function(){var e=[];for(var n in t)e.push(t[n]);return e}};t.exports=function(){var t=new r,e={isDefault:!1,match:function(t){var e=!1,n=t.headers["content-type"]&&t.headers["content-type"].replace(/ /g,"");if(!n)return e;for(var r=0;r0},parse:function(t,e,n){var r,i=t.toString();try{r=this.isValidData(i)?JSON.parse(i):i}catch(t){e("error","Error parsing response. response: ["+i+"], error: ["+t+"]")}n(r)}},e)),t.add({name:"DEFAULT",isDefault:!0,parse:function(t,e,n){n(t)}}),t}},6310:(t,e,n)=>{var r=n(5055),i=function(){var t={},e=null;this.add=function(n){if(!function(t){function e(t,e){var n=!0;for(var r in e){var i=e[r].split(":");if(!t.hasOwnProperty([i[0]])||typeof t[i[0]]!==i[1]){n=!1;break}}return n}return result=e(t,["name:string","serialize:function","isDefault:boolean"]),result&&!t.isDefault&&(result=e(t,["match:function"])),result}(n))throw"serializer cannot be added: invalid serializer definition";n.isDefault?e=n:t[n.name]=n},this.remove=function(e){if(!t[e])throw"cannot remove serializer: "+e+" doesn't exists";delete t[e]},this.find=function(e){var n=t[e];if(!n)throw"cannot find serializer: "+e+" doesn't exists";return n},this.clean=function(){t={}},this.get=function(n){var r=null;for(var i in t)if(t[i].match(n)){r=t[i];break}return null===r?e:r},this.getAll=function(){var e=[];for(var n in t)e.push(t[n]);return e},this.getDefault=function(){return e}};t.exports=function(){var t=new i,e={isDefault:!1,match:function(t){var e=!1,n=t.headers["Content-Type"]&&t.headers["Content-Type"].replace(/ /g,"");if(!n)return e;for(var r=0;r{"use strict";t.exports=(t,e)=>(e=e||(()=>{}),t.then((t=>new Promise((t=>{t(e())})).then((()=>t))),(t=>new Promise((t=>{t(e())})).then((()=>{throw t})))))},5860:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(6729),i=n(6512),s=n(6506),o=()=>{},a=new i.TimeoutError;e.default=class extends r{constructor(t){var e,n,r,i;if(super(),this._intervalCount=0,this._intervalEnd=0,this._pendingCount=0,this._resolveEmpty=o,this._resolveIdle=o,!("number"==typeof(t=Object.assign({carryoverConcurrencyCount:!1,intervalCap:1/0,interval:0,concurrency:1/0,autoStart:!0,queueClass:s.default},t)).intervalCap&&t.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${null!==(n=null===(e=t.intervalCap)||void 0===e?void 0:e.toString())&&void 0!==n?n:""}\` (${typeof t.intervalCap})`);if(void 0===t.interval||!(Number.isFinite(t.interval)&&t.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${null!==(i=null===(r=t.interval)||void 0===r?void 0:r.toString())&&void 0!==i?i:""}\` (${typeof t.interval})`);this._carryoverConcurrencyCount=t.carryoverConcurrencyCount,this._isIntervalIgnored=t.intervalCap===1/0||0===t.interval,this._intervalCap=t.intervalCap,this._interval=t.interval,this._queue=new t.queueClass,this._queueClass=t.queueClass,this.concurrency=t.concurrency,this._timeout=t.timeout,this._throwOnTimeout=!0===t.throwOnTimeout,this._isPaused=!1===t.autoStart}get _doesIntervalAllowAnother(){return this._isIntervalIgnored||this._intervalCount{this._onResumeInterval()}),e)),!0;this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0}return!1}_tryToStartAnother(){if(0===this._queue.size)return this._intervalId&&clearInterval(this._intervalId),this._intervalId=void 0,this._resolvePromises(),!1;if(!this._isPaused){const t=!this._isIntervalPaused();if(this._doesIntervalAllowAnother&&this._doesConcurrentAllowAnother){const e=this._queue.dequeue();return!!e&&(this.emit("active"),e(),t&&this._initializeIntervalIfNeeded(),!0)}}return!1}_initializeIntervalIfNeeded(){this._isIntervalIgnored||void 0!==this._intervalId||(this._intervalId=setInterval((()=>{this._onInterval()}),this._interval),this._intervalEnd=Date.now()+this._interval)}_onInterval(){0===this._intervalCount&&0===this._pendingCount&&this._intervalId&&(clearInterval(this._intervalId),this._intervalId=void 0),this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0,this._processQueue()}_processQueue(){for(;this._tryToStartAnother(););}get concurrency(){return this._concurrency}set concurrency(t){if(!("number"==typeof t&&t>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${t}\` (${typeof t})`);this._concurrency=t,this._processQueue()}async add(t,e={}){return new Promise(((n,r)=>{this._queue.enqueue((async()=>{this._pendingCount++,this._intervalCount++;try{const s=void 0===this._timeout&&void 0===e.timeout?t():i.default(Promise.resolve(t()),void 0===e.timeout?this._timeout:e.timeout,(()=>{(void 0===e.throwOnTimeout?this._throwOnTimeout:e.throwOnTimeout)&&r(a)}));n(await s)}catch(t){r(t)}this._next()}),e),this._tryToStartAnother(),this.emit("add")}))}async addAll(t,e){return Promise.all(t.map((async t=>this.add(t,e))))}start(){return this._isPaused?(this._isPaused=!1,this._processQueue(),this):this}pause(){this._isPaused=!0}clear(){this._queue=new this._queueClass}async onEmpty(){if(0!==this._queue.size)return new Promise((t=>{const e=this._resolveEmpty;this._resolveEmpty=()=>{e(),t()}}))}async onIdle(){if(0!==this._pendingCount||0!==this._queue.size)return new Promise((t=>{const e=this._resolveIdle;this._resolveIdle=()=>{e(),t()}}))}get size(){return this._queue.size}sizeBy(t){return this._queue.filter(t).length}get pending(){return this._pendingCount}get isPaused(){return this._isPaused}get timeout(){return this._timeout}set timeout(t){this._timeout=t}}},7489:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e,n){let r=0,i=t.length;for(;i>0;){const s=i/2|0;let o=r+s;n(t[o],e)<=0?(r=++o,i-=s+1):i=s}return r}},6506:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(7489);e.default=class{constructor(){this._queue=[]}enqueue(t,e){const n={priority:(e=Object.assign({priority:0},e)).priority,run:t};if(this.size&&this._queue[this.size-1].priority>=e.priority)return void this._queue.push(n);const i=r.default(this._queue,n,((t,e)=>e.priority-t.priority));this._queue.splice(i,0,n)}dequeue(){const t=this._queue.shift();return null==t?void 0:t.run}filter(t){return this._queue.filter((e=>e.priority===t.priority)).map((t=>t.run))}get size(){return this._queue.length}}},6512:(t,e,n)=>{"use strict";const r=n(7345);class i extends Error{constructor(t){super(t),this.name="TimeoutError"}}const s=(t,e,n)=>new Promise(((s,o)=>{if("number"!=typeof e||e<0)throw new TypeError("Expected `milliseconds` to be a positive number");if(e===1/0)return void s(t);const a=setTimeout((()=>{if("function"==typeof n){try{s(n())}catch(t){o(t)}return}const r=n instanceof Error?n:new i("string"==typeof n?n:`Promise timed out after ${e} milliseconds`);"function"==typeof t.cancel&&t.cancel(),o(r)}),e);r(t.then(s,o),(()=>{clearTimeout(a)}))}));t.exports=s,t.exports.default=s,t.exports.TimeoutError=i},6099:(t,e,n)=>{!function(t){t.parser=function(t,e){return new i(t,e)},t.SAXParser=i,t.SAXStream=o,t.createStream=function(t,e){return new o(t,e)},t.MAX_BUFFER_LENGTH=65536;var e,r=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];function i(e,n){if(!(this instanceof i))return new i(e,n);var s=this;!function(t){for(var e=0,n=r.length;e"===s?(O(n,"onsgmldeclaration",n.sgmlDecl),n.sgmlDecl="",n.state=S.TEXT):g(s)?(n.state=S.SGML_DECL_QUOTED,n.sgmlDecl+=s):n.sgmlDecl+=s;continue;case S.SGML_DECL_QUOTED:s===n.q&&(n.state=S.SGML_DECL,n.q=""),n.sgmlDecl+=s;continue;case S.DOCTYPE:">"===s?(n.state=S.TEXT,O(n,"ondoctype",n.doctype),n.doctype=!0):(n.doctype+=s,"["===s?n.state=S.DOCTYPE_DTD:g(s)&&(n.state=S.DOCTYPE_QUOTED,n.q=s));continue;case S.DOCTYPE_QUOTED:n.doctype+=s,s===n.q&&(n.q="",n.state=S.DOCTYPE);continue;case S.DOCTYPE_DTD:n.doctype+=s,"]"===s?n.state=S.DOCTYPE:g(s)&&(n.state=S.DOCTYPE_DTD_QUOTED,n.q=s);continue;case S.DOCTYPE_DTD_QUOTED:n.doctype+=s,s===n.q&&(n.state=S.DOCTYPE_DTD,n.q="");continue;case S.COMMENT:"-"===s?n.state=S.COMMENT_ENDING:n.comment+=s;continue;case S.COMMENT_ENDING:"-"===s?(n.state=S.COMMENT_ENDED,n.comment=N(n.opt,n.comment),n.comment&&O(n,"oncomment",n.comment),n.comment=""):(n.comment+="-"+s,n.state=S.COMMENT);continue;case S.COMMENT_ENDED:">"!==s?(A(n,"Malformed comment"),n.comment+="--"+s,n.state=S.COMMENT):n.state=S.TEXT;continue;case S.CDATA:"]"===s?n.state=S.CDATA_ENDING:n.cdata+=s;continue;case S.CDATA_ENDING:"]"===s?n.state=S.CDATA_ENDING_2:(n.cdata+="]"+s,n.state=S.CDATA);continue;case S.CDATA_ENDING_2:">"===s?(n.cdata&&O(n,"oncdata",n.cdata),O(n,"onclosecdata"),n.cdata="",n.state=S.TEXT):"]"===s?n.cdata+="]":(n.cdata+="]]"+s,n.state=S.CDATA);continue;case S.PROC_INST:"?"===s?n.state=S.PROC_INST_ENDING:m(s)?n.state=S.PROC_INST_BODY:n.procInstName+=s;continue;case S.PROC_INST_BODY:if(!n.procInstBody&&m(s))continue;"?"===s?n.state=S.PROC_INST_ENDING:n.procInstBody+=s;continue;case S.PROC_INST_ENDING:">"===s?(O(n,"onprocessinginstruction",{name:n.procInstName,body:n.procInstBody}),n.procInstName=n.procInstBody="",n.state=S.TEXT):(n.procInstBody+="?"+s,n.state=S.PROC_INST_BODY);continue;case S.OPEN_TAG:b(h,s)?n.tagName+=s:(R(n),">"===s?j(n):"/"===s?n.state=S.OPEN_TAG_SLASH:(m(s)||A(n,"Invalid character in tag name"),n.state=S.ATTRIB));continue;case S.OPEN_TAG_SLASH:">"===s?(j(n,!0),M(n)):(A(n,"Forward-slash in opening tag not followed by >"),n.state=S.ATTRIB);continue;case S.ATTRIB:if(m(s))continue;">"===s?j(n):"/"===s?n.state=S.OPEN_TAG_SLASH:b(d,s)?(n.attribName=s,n.attribValue="",n.state=S.ATTRIB_NAME):A(n,"Invalid attribute name");continue;case S.ATTRIB_NAME:"="===s?n.state=S.ATTRIB_VALUE:">"===s?(A(n,"Attribute without value"),n.attribValue=n.attribName,U(n),j(n)):m(s)?n.state=S.ATTRIB_NAME_SAW_WHITE:b(h,s)?n.attribName+=s:A(n,"Invalid attribute name");continue;case S.ATTRIB_NAME_SAW_WHITE:if("="===s)n.state=S.ATTRIB_VALUE;else{if(m(s))continue;A(n,"Attribute without value"),n.tag.attributes[n.attribName]="",n.attribValue="",O(n,"onattribute",{name:n.attribName,value:""}),n.attribName="",">"===s?j(n):b(d,s)?(n.attribName=s,n.state=S.ATTRIB_NAME):(A(n,"Invalid attribute name"),n.state=S.ATTRIB)}continue;case S.ATTRIB_VALUE:if(m(s))continue;g(s)?(n.q=s,n.state=S.ATTRIB_VALUE_QUOTED):(A(n,"Unquoted attribute value"),n.state=S.ATTRIB_VALUE_UNQUOTED,n.attribValue=s);continue;case S.ATTRIB_VALUE_QUOTED:if(s!==n.q){"&"===s?n.state=S.ATTRIB_VALUE_ENTITY_Q:n.attribValue+=s;continue}U(n),n.q="",n.state=S.ATTRIB_VALUE_CLOSED;continue;case S.ATTRIB_VALUE_CLOSED:m(s)?n.state=S.ATTRIB:">"===s?j(n):"/"===s?n.state=S.OPEN_TAG_SLASH:b(d,s)?(A(n,"No whitespace between attributes"),n.attribName=s,n.attribValue="",n.state=S.ATTRIB_NAME):A(n,"Invalid attribute name");continue;case S.ATTRIB_VALUE_UNQUOTED:if(!y(s)){"&"===s?n.state=S.ATTRIB_VALUE_ENTITY_U:n.attribValue+=s;continue}U(n),">"===s?j(n):n.state=S.ATTRIB;continue;case S.CLOSE_TAG:if(n.tagName)">"===s?M(n):b(h,s)?n.tagName+=s:n.script?(n.script+=""===s?M(n):A(n,"Invalid characters in closing tag");continue;case S.TEXT_ENTITY:case S.ATTRIB_VALUE_ENTITY_Q:case S.ATTRIB_VALUE_ENTITY_U:var l,p;switch(n.state){case S.TEXT_ENTITY:l=S.TEXT,p="textNode";break;case S.ATTRIB_VALUE_ENTITY_Q:l=S.ATTRIB_VALUE_QUOTED,p="attribValue";break;case S.ATTRIB_VALUE_ENTITY_U:l=S.ATTRIB_VALUE_UNQUOTED,p="attribValue"}";"===s?(n[p]+=F(n),n.entity="",n.state=l):b(n.entity.length?_:f,s)?n.entity+=s:(A(n,"Invalid character in entity name"),n[p]+="&"+n.entity+s,n.entity="",n.state=l);continue;default:throw new Error(n,"Unknown state: "+n.state)}return n.position>=n.bufferCheckPosition&&function(e){for(var n=Math.max(t.MAX_BUFFER_LENGTH,10),i=0,s=0,o=r.length;sn)switch(r[s]){case"textNode":D(e);break;case"cdata":O(e,"oncdata",e.cdata),e.cdata="";break;case"script":O(e,"onscript",e.script),e.script="";break;default:C(e,"Max buffer length exceeded: "+r[s])}i=Math.max(i,a)}var c=t.MAX_BUFFER_LENGTH-i;e.bufferCheckPosition=c+e.position}(n),n},resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){var t;D(t=this),""!==t.cdata&&(O(t,"oncdata",t.cdata),t.cdata=""),""!==t.script&&(O(t,"onscript",t.script),t.script="")}};try{e=n(2781).Stream}catch(t){e=function(){}}var s=t.EVENTS.filter((function(t){return"error"!==t&&"end"!==t}));function o(t,n){if(!(this instanceof o))return new o(t,n);e.apply(this),this._parser=new i(t,n),this.writable=!0,this.readable=!0;var r=this;this._parser.onend=function(){r.emit("end")},this._parser.onerror=function(t){r.emit("error",t),r._parser.error=null},this._decoder=null,s.forEach((function(t){Object.defineProperty(r,"on"+t,{get:function(){return r._parser["on"+t]},set:function(e){if(!e)return r.removeAllListeners(t),r._parser["on"+t]=e,e;r.on(t,e)},enumerable:!0,configurable:!1})}))}o.prototype=Object.create(e.prototype,{constructor:{value:o}}),o.prototype.write=function(t){if("function"==typeof Buffer&&"function"==typeof Buffer.isBuffer&&Buffer.isBuffer(t)){if(!this._decoder){var e=n(1576).StringDecoder;this._decoder=new e("utf8")}t=this._decoder.write(t)}return this._parser.write(t.toString()),this.emit("data",t),!0},o.prototype.end=function(t){return t&&t.length&&this.write(t),this._parser.end(),!0},o.prototype.on=function(t,n){var r=this;return r._parser["on"+t]||-1===s.indexOf(t)||(r._parser["on"+t]=function(){var e=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);e.splice(0,0,t),r.emit.apply(r,e)}),e.prototype.on.call(r,t,n)};var a="[CDATA[",c="DOCTYPE",u="http://www.w3.org/XML/1998/namespace",l="http://www.w3.org/2000/xmlns/",p={xml:u,xmlns:l},d=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,h=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,f=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,_=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function m(t){return" "===t||"\n"===t||"\r"===t||"\t"===t}function g(t){return'"'===t||"'"===t}function y(t){return">"===t||m(t)}function b(t,e){return t.test(e)}function v(t,e){return!b(t,e)}var E,w,T,S=0;for(var I in t.STATE={BEGIN:S++,BEGIN_WHITESPACE:S++,TEXT:S++,TEXT_ENTITY:S++,OPEN_WAKA:S++,SGML_DECL:S++,SGML_DECL_QUOTED:S++,DOCTYPE:S++,DOCTYPE_QUOTED:S++,DOCTYPE_DTD:S++,DOCTYPE_DTD_QUOTED:S++,COMMENT_STARTING:S++,COMMENT:S++,COMMENT_ENDING:S++,COMMENT_ENDED:S++,CDATA:S++,CDATA_ENDING:S++,CDATA_ENDING_2:S++,PROC_INST:S++,PROC_INST_BODY:S++,PROC_INST_ENDING:S++,OPEN_TAG:S++,OPEN_TAG_SLASH:S++,ATTRIB:S++,ATTRIB_NAME:S++,ATTRIB_NAME_SAW_WHITE:S++,ATTRIB_VALUE:S++,ATTRIB_VALUE_QUOTED:S++,ATTRIB_VALUE_CLOSED:S++,ATTRIB_VALUE_UNQUOTED:S++,ATTRIB_VALUE_ENTITY_Q:S++,ATTRIB_VALUE_ENTITY_U:S++,CLOSE_TAG:S++,CLOSE_TAG_SAW_WHITE:S++,SCRIPT:S++,SCRIPT_ENDING:S++},t.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},t.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(t.ENTITIES).forEach((function(e){var n=t.ENTITIES[e],r="number"==typeof n?String.fromCharCode(n):n;t.ENTITIES[e]=r})),t.STATE)t.STATE[t.STATE[I]]=I;function x(t,e,n){t[e]&&t[e](n)}function O(t,e,n){t.textNode&&D(t),x(t,e,n)}function D(t){t.textNode=N(t.opt,t.textNode),t.textNode&&x(t,"ontext",t.textNode),t.textNode=""}function N(t,e){return t.trim&&(e=e.trim()),t.normalize&&(e=e.replace(/\s+/g," ")),e}function C(t,e){return D(t),t.trackPosition&&(e+="\nLine: "+t.line+"\nColumn: "+t.column+"\nChar: "+t.c),e=new Error(e),t.error=e,x(t,"onerror",e),t}function k(t){return t.sawRoot&&!t.closedRoot&&A(t,"Unclosed root tag"),t.state!==S.BEGIN&&t.state!==S.BEGIN_WHITESPACE&&t.state!==S.TEXT&&C(t,"Unexpected end"),D(t),t.c="",t.closed=!0,x(t,"onend"),i.call(t,t.strict,t.opt),t}function A(t,e){if("object"!=typeof t||!(t instanceof i))throw new Error("bad call to strictFail");t.strict&&C(t,e)}function R(t){t.strict||(t.tagName=t.tagName[t.looseCase]());var e=t.tags[t.tags.length-1]||t,n=t.tag={name:t.tagName,attributes:{}};t.opt.xmlns&&(n.ns=e.ns),t.attribList.length=0,O(t,"onopentagstart",n)}function P(t,e){var n=t.indexOf(":")<0?["",t]:t.split(":"),r=n[0],i=n[1];return e&&"xmlns"===t&&(r="xmlns",i=""),{prefix:r,local:i}}function U(t){if(t.strict||(t.attribName=t.attribName[t.looseCase]()),-1!==t.attribList.indexOf(t.attribName)||t.tag.attributes.hasOwnProperty(t.attribName))t.attribName=t.attribValue="";else{if(t.opt.xmlns){var e=P(t.attribName,!0),n=e.prefix,r=e.local;if("xmlns"===n)if("xml"===r&&t.attribValue!==u)A(t,"xml: prefix must be bound to "+u+"\nActual: "+t.attribValue);else if("xmlns"===r&&t.attribValue!==l)A(t,"xmlns: prefix must be bound to "+l+"\nActual: "+t.attribValue);else{var i=t.tag,s=t.tags[t.tags.length-1]||t;i.ns===s.ns&&(i.ns=Object.create(s.ns)),i.ns[r]=t.attribValue}t.attribList.push([t.attribName,t.attribValue])}else t.tag.attributes[t.attribName]=t.attribValue,O(t,"onattribute",{name:t.attribName,value:t.attribValue});t.attribName=t.attribValue=""}}function j(t,e){if(t.opt.xmlns){var n=t.tag,r=P(t.tagName);n.prefix=r.prefix,n.local=r.local,n.uri=n.ns[r.prefix]||"",n.prefix&&!n.uri&&(A(t,"Unbound namespace prefix: "+JSON.stringify(t.tagName)),n.uri=r.prefix);var i=t.tags[t.tags.length-1]||t;n.ns&&i.ns!==n.ns&&Object.keys(n.ns).forEach((function(e){O(t,"onopennamespace",{prefix:e,uri:n.ns[e]})}));for(var s=0,o=t.attribList.length;s",t.tagName="",void(t.state=S.SCRIPT);O(t,"onscript",t.script),t.script=""}var e=t.tags.length,n=t.tagName;t.strict||(n=n[t.looseCase]());for(var r=n;e--&&t.tags[e].name!==r;)A(t,"Unexpected close tag");if(e<0)return A(t,"Unmatched closing tag: "+t.tagName),t.textNode+="",void(t.state=S.TEXT);t.tagName=n;for(var i=t.tags.length;i-- >e;){var s=t.tag=t.tags.pop();t.tagName=t.tag.name,O(t,"onclosetag",t.tagName);var o={};for(var a in s.ns)o[a]=s.ns[a];var c=t.tags[t.tags.length-1]||t;t.opt.xmlns&&s.ns!==c.ns&&Object.keys(s.ns).forEach((function(e){var n=s.ns[e];O(t,"onclosenamespace",{prefix:e,uri:n})}))}0===e&&(t.closedRoot=!0),t.tagName=t.attribValue=t.attribName="",t.attribList.length=0,t.state=S.TEXT}function F(t){var e,n=t.entity,r=n.toLowerCase(),i="";return t.ENTITIES[n]?t.ENTITIES[n]:t.ENTITIES[r]?t.ENTITIES[r]:("#"===(n=r).charAt(0)&&("x"===n.charAt(1)?(n=n.slice(2),i=(e=parseInt(n,16)).toString(16)):(n=n.slice(1),i=(e=parseInt(n,10)).toString(10))),n=n.replace(/^0+/,""),isNaN(e)||i.toLowerCase()!==n?(A(t,"Invalid character entity"),"&"+t.entity+";"):String.fromCodePoint(e))}function B(t,e){"<"===e?(t.state=S.OPEN_WAKA,t.startTagPosition=t.position):m(e)||(A(t,"Non-whitespace before first tag."),t.textNode=e,t.state=S.TEXT)}function L(t,e){var n="";return e1114111||w(o)!==o)throw RangeError("Invalid code point: "+o);o<=65535?n.push(o):(t=55296+((o-=65536)>>10),e=o%1024+56320,n.push(t,e)),(r+1===i||n.length>16384)&&(s+=E.apply(null,n),n.length=0)}return s},Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:T,configurable:!0,writable:!0}):String.fromCodePoint=T)}(e)},2130:(t,e,n)=>{"use strict";const r=n(2037),i=n(6224),s=n(6560),{env:o}=process;let a;function c(t){return 0!==t&&{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function u(t,e){if(0===a)return 0;if(s("color=16m")||s("color=full")||s("color=truecolor"))return 3;if(s("color=256"))return 2;if(t&&!e&&void 0===a)return 0;const n=a||0;if("dumb"===o.TERM)return n;if("win32"===process.platform){const t=r.release().split(".");return Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}if("CI"in o)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some((t=>t in o))||"codeship"===o.CI_NAME?1:n;if("TEAMCITY_VERSION"in o)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(o.TEAMCITY_VERSION)?1:0;if("truecolor"===o.COLORTERM)return 3;if("TERM_PROGRAM"in o){const t=parseInt((o.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(o.TERM_PROGRAM){case"iTerm.app":return t>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(o.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(o.TERM)||"COLORTERM"in o?1:n}s("no-color")||s("no-colors")||s("color=false")||s("color=never")?a=0:(s("color")||s("colors")||s("color=true")||s("color=always"))&&(a=1),"FORCE_COLOR"in o&&(a="true"===o.FORCE_COLOR?1:"false"===o.FORCE_COLOR?0:0===o.FORCE_COLOR.length?1:Math.min(parseInt(o.FORCE_COLOR,10),3)),t.exports={supportsColor:function(t){return c(u(t,t&&t.isTTY))},stdout:c(u(!0,i.isatty(1))),stderr:c(u(!0,i.isatty(2)))}},306:function(t,e){(function(){"use strict";e.stripBOM=function(t){return"\ufeff"===t[0]?t.substring(1):t}}).call(this)},4096:function(t,e,n){(function(){"use strict";var t,r,i,s,o,a={}.hasOwnProperty;t=n(5532),r=n(8381).defaults,s=function(t){return"string"==typeof t&&(t.indexOf("&")>=0||t.indexOf(">")>=0||t.indexOf("<")>=0)},o=function(t){return""},i=function(t){return t.replace("]]>","]]]]>")},e.Builder=function(){function e(t){var e,n,i;for(e in this.options={},n=r[.2])a.call(n,e)&&(i=n[e],this.options[e]=i);for(e in t)a.call(t,e)&&(i=t[e],this.options[e]=i)}return e.prototype.buildObject=function(e){var n,i,c,u,l,p;return n=this.options.attrkey,i=this.options.charkey,1===Object.keys(e).length&&this.options.rootName===r[.2].rootName?e=e[l=Object.keys(e)[0]]:l=this.options.rootName,p=this,c=function(t,e){var r,u,l,d,h,f;if("object"!=typeof e)p.options.cdata&&s(e)?t.raw(o(e)):t.txt(e);else if(Array.isArray(e)){for(d in e)if(a.call(e,d))for(h in u=e[d])l=u[h],t=c(t.ele(h),l).up()}else for(h in e)if(a.call(e,h))if(u=e[h],h===n){if("object"==typeof u)for(r in u)f=u[r],t=t.att(r,f)}else if(h===i)t=p.options.cdata&&s(u)?t.raw(o(u)):t.txt(u);else if(Array.isArray(u))for(d in u)a.call(u,d)&&(t="string"==typeof(l=u[d])?p.options.cdata&&s(l)?t.ele(h).raw(o(l)).up():t.ele(h,l).up():c(t.ele(h),l).up());else"object"==typeof u?t=c(t.ele(h),u).up():"string"==typeof u&&p.options.cdata&&s(u)?t=t.ele(h).raw(o(u)).up():(null==u&&(u=""),t=t.ele(h,u.toString()).up());return t},u=t.create(l,this.options.xmldec,this.options.doctype,{headless:this.options.headless,allowSurrogateChars:this.options.allowSurrogateChars}),c(u,e).end(this.options.renderOpts)},e}()}).call(this)},8381:function(t,e){(function(){e.defaults={.1:{explicitCharkey:!1,trim:!0,normalize:!0,normalizeTags:!1,attrkey:"@",charkey:"#",explicitArray:!1,ignoreAttrs:!1,mergeAttrs:!1,explicitRoot:!1,validator:null,xmlns:!1,explicitChildren:!1,childkey:"@@",charsAsChildren:!1,includeWhiteChars:!1,async:!1,strict:!0,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,emptyTag:""},.2:{explicitCharkey:!1,trim:!1,normalize:!1,normalizeTags:!1,attrkey:"$",charkey:"_",explicitArray:!0,ignoreAttrs:!1,mergeAttrs:!1,explicitRoot:!0,validator:null,xmlns:!1,explicitChildren:!1,preserveChildrenOrder:!1,childkey:"$$",charsAsChildren:!1,includeWhiteChars:!1,async:!1,strict:!0,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,rootName:"root",xmldec:{version:"1.0",encoding:"UTF-8",standalone:!0},doctype:null,renderOpts:{pretty:!0,indent:" ",newline:"\n"},headless:!1,chunkSize:1e4,emptyTag:"",cdata:!1}}}).call(this)},9082:function(t,e,n){(function(){"use strict";var t,r,i,s,o,a,c,u,l,p=function(t,e){return function(){return t.apply(e,arguments)}},d={}.hasOwnProperty;u=n(6099),i=n(2361),t=n(306),c=n(7526),l=n(9512).setImmediate,r=n(8381).defaults,s=function(t){return"object"==typeof t&&null!=t&&0===Object.keys(t).length},o=function(t){return"__proto__"!==t&&"constructor"!==t&&"prototype"!==t},a=function(t,e,n){var r,i;for(r=0,i=t.length;r0&&(u[t.options.childkey]=p),p=u;return r.length>0?t.assignOrPush(_,l,p):(t.options.explicitRoot&&(f=p,(p={})[l]=f),t.resultObject=p,t.saxParser.ended=!0,t.emit("end",t.resultObject))}}(this),n=function(t){return function(n){var i,s;if(s=r[r.length-1])return s[e]+=n,t.options.explicitChildren&&t.options.preserveChildrenOrder&&t.options.charsAsChildren&&(t.options.includeWhiteChars||""!==n.replace(/\\n/g,"").trim())&&(s[t.options.childkey]=s[t.options.childkey]||[],(i={"#name":"__text__"})[e]=n,t.options.normalize&&(i[e]=i[e].replace(/\s{2,}/g," ").trim()),s[t.options.childkey].push(i)),s}}(this),this.saxParser.ontext=n,this.saxParser.oncdata=function(t){var e;if(e=n(t))return e.cdata=!0}},i.prototype.parseString=function(e,n){var r;null!=n&&"function"==typeof n&&(this.on("end",(function(t){return this.reset(),n(null,t)})),this.on("error",(function(t){return this.reset(),n(t)})));try{return""===(e=e.toString()).trim()?(this.emit("end",null),!0):(e=t.stripBOM(e),this.options.async?(this.remaining=e,l(this.processAsync),this.saxParser):this.saxParser.write(e).close())}catch(t){if(r=t,!this.saxParser.errThrown&&!this.saxParser.ended)return this.emit("error",r),this.saxParser.errThrown=!0;if(this.saxParser.ended)throw r}},i.prototype.parseStringPromise=function(t){return new Promise((e=this,function(n,r){return e.parseString(t,(function(t,e){return t?r(t):n(e)}))}));var e},i}(i),e.parseString=function(t,n,r){var i,s;return null!=r?("function"==typeof r&&(i=r),"object"==typeof n&&(s=n)):("function"==typeof n&&(i=n),s={}),new e.Parser(s).parseString(t,i)},e.parseStringPromise=function(t,n){var r;return"object"==typeof n&&(r=n),new e.Parser(r).parseStringPromise(t)}}).call(this)},7526:function(t,e){(function(){"use strict";var t;t=new RegExp(/(?!xmlns)^.*:/),e.normalize=function(t){return t.toLowerCase()},e.firstCharLowerCase=function(t){return t.charAt(0).toLowerCase()+t.slice(1)},e.stripPrefix=function(e){return e.replace(t,"")},e.parseNumbers=function(t){return isNaN(t)||(t=t%1==0?parseInt(t,10):parseFloat(t)),t},e.parseBooleans=function(t){return/^(?:true|false)$/i.test(t)&&(t="true"===t.toLowerCase()),t}}).call(this)},5055:function(t,e,n){(function(){"use strict";var t,r,i,s,o={}.hasOwnProperty;r=n(8381),t=n(4096),i=n(9082),s=n(7526),e.defaults=r.defaults,e.processors=s,e.ValidationError=function(t){function e(t){this.message=t}return function(t,e){for(var n in e)o.call(e,n)&&(t[n]=e[n]);function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype}(e,Error),e}(),e.Builder=t.Builder,e.Parser=i.Parser,e.parseString=i.parseString,e.parseStringPromise=i.parseStringPromise}).call(this)},7557:function(t){(function(){t.exports={Disconnected:1,Preceding:2,Following:4,Contains:8,ContainedBy:16,ImplementationSpecific:32}}).call(this)},9335:function(t){(function(){t.exports={Element:1,Attribute:2,Text:3,CData:4,EntityReference:5,EntityDeclaration:6,ProcessingInstruction:7,Comment:8,Document:9,DocType:10,DocumentFragment:11,NotationDeclaration:12,Declaration:201,Raw:202,AttributeDeclaration:203,ElementDeclaration:204,Dummy:205}}).call(this)},8369:function(t){(function(){var e,n,r,i,s,o,a,c=[].slice,u={}.hasOwnProperty;e=function(){var t,e,n,r,i,o;if(o=arguments[0],i=2<=arguments.length?c.call(arguments,1):[],s(Object.assign))Object.assign.apply(null,arguments);else for(t=0,n=i.length;t":"attribute: {"+t+"}, parent: <"+this.parent.name+">"},t.prototype.isEqualNode=function(t){return t.namespaceURI===this.namespaceURI&&t.prefix===this.prefix&&t.localName===this.localName&&t.value===this.value},t}()}).call(this)},6170:function(t,e,n){(function(){var e,r,i={}.hasOwnProperty;e=n(9335),r=n(6488),t.exports=function(t){function n(t,r){if(n.__super__.constructor.call(this,t),null==r)throw new Error("Missing CDATA text. "+this.debugInfo());this.name="#cdata-section",this.type=e.CData,this.value=this.stringify.cdata(r)}return function(t,e){for(var n in e)i.call(e,n)&&(t[n]=e[n]);function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype}(n,t),n.prototype.clone=function(){return Object.create(this)},n.prototype.toString=function(t){return this.options.writer.cdata(this,this.options.writer.filterOptions(t))},n}(r)}).call(this)},6488:function(t,e,n){(function(){var e,r={}.hasOwnProperty;e=n(2026),t.exports=function(t){function e(t){e.__super__.constructor.call(this,t),this.value=""}return function(t,e){for(var n in e)r.call(e,n)&&(t[n]=e[n]);function i(){this.constructor=t}i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype}(e,t),Object.defineProperty(e.prototype,"data",{get:function(){return this.value},set:function(t){return this.value=t||""}}),Object.defineProperty(e.prototype,"length",{get:function(){return this.value.length}}),Object.defineProperty(e.prototype,"textContent",{get:function(){return this.value},set:function(t){return this.value=t||""}}),e.prototype.clone=function(){return Object.create(this)},e.prototype.substringData=function(t,e){throw new Error("This DOM method is not implemented."+this.debugInfo())},e.prototype.appendData=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())},e.prototype.insertData=function(t,e){throw new Error("This DOM method is not implemented."+this.debugInfo())},e.prototype.deleteData=function(t,e){throw new Error("This DOM method is not implemented."+this.debugInfo())},e.prototype.replaceData=function(t,e,n){throw new Error("This DOM method is not implemented."+this.debugInfo())},e.prototype.isEqualNode=function(t){return!!e.__super__.isEqualNode.apply(this,arguments).isEqualNode(t)&&t.data===this.data},e}(e)}).call(this)},2096:function(t,e,n){(function(){var e,r,i={}.hasOwnProperty;e=n(9335),r=n(6488),t.exports=function(t){function n(t,r){if(n.__super__.constructor.call(this,t),null==r)throw new Error("Missing comment text. "+this.debugInfo());this.name="#comment",this.type=e.Comment,this.value=this.stringify.comment(r)}return function(t,e){for(var n in e)i.call(e,n)&&(t[n]=e[n]);function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype}(n,t),n.prototype.clone=function(){return Object.create(this)},n.prototype.toString=function(t){return this.options.writer.comment(this,this.options.writer.filterOptions(t))},n}(r)}).call(this)},383:function(t,e,n){(function(){var e,r;e=n(3933),r=n(6210),t.exports=function(){function t(){this.defaultParams={"canonical-form":!1,"cdata-sections":!1,comments:!1,"datatype-normalization":!1,"element-content-whitespace":!0,entities:!0,"error-handler":new e,infoset:!0,"validate-if-schema":!1,namespaces:!0,"namespace-declarations":!0,"normalize-characters":!1,"schema-location":"","schema-type":"","split-cdata-sections":!0,validate:!1,"well-formed":!0},this.params=Object.create(this.defaultParams)}return Object.defineProperty(t.prototype,"parameterNames",{get:function(){return new r(Object.keys(this.defaultParams))}}),t.prototype.getParameter=function(t){return this.params.hasOwnProperty(t)?this.params[t]:null},t.prototype.canSetParameter=function(t,e){return!0},t.prototype.setParameter=function(t,e){return null!=e?this.params[t]=e:delete this.params[t]},t}()}).call(this)},3933:function(t){(function(){t.exports=function(){function t(){}return t.prototype.handleError=function(t){throw new Error(t)},t}()}).call(this)},1770:function(t){(function(){t.exports=function(){function t(){}return t.prototype.hasFeature=function(t,e){return!0},t.prototype.createDocumentType=function(t,e,n){throw new Error("This DOM method is not implemented.")},t.prototype.createDocument=function(t,e,n){throw new Error("This DOM method is not implemented.")},t.prototype.createHTMLDocument=function(t){throw new Error("This DOM method is not implemented.")},t.prototype.getFeature=function(t,e){throw new Error("This DOM method is not implemented.")},t}()}).call(this)},6210:function(t){(function(){t.exports=function(){function t(t){this.arr=t||[]}return Object.defineProperty(t.prototype,"length",{get:function(){return this.arr.length}}),t.prototype.item=function(t){return this.arr[t]||null},t.prototype.contains=function(t){return-1!==this.arr.indexOf(t)},t}()}).call(this)},1179:function(t,e,n){(function(){var e,r,i={}.hasOwnProperty;r=n(2026),e=n(9335),t.exports=function(t){function n(t,r,i,s,o,a){if(n.__super__.constructor.call(this,t),null==r)throw new Error("Missing DTD element name. "+this.debugInfo());if(null==i)throw new Error("Missing DTD attribute name. "+this.debugInfo(r));if(!s)throw new Error("Missing DTD attribute type. "+this.debugInfo(r));if(!o)throw new Error("Missing DTD attribute default. "+this.debugInfo(r));if(0!==o.indexOf("#")&&(o="#"+o),!o.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/))throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT. "+this.debugInfo(r));if(a&&!o.match(/^(#FIXED|#DEFAULT)$/))throw new Error("Default value only applies to #FIXED or #DEFAULT. "+this.debugInfo(r));this.elementName=this.stringify.name(r),this.type=e.AttributeDeclaration,this.attributeName=this.stringify.name(i),this.attributeType=this.stringify.dtdAttType(s),a&&(this.defaultValue=this.stringify.dtdAttDefault(a)),this.defaultValueType=o}return function(t,e){for(var n in e)i.call(e,n)&&(t[n]=e[n]);function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype}(n,t),n.prototype.toString=function(t){return this.options.writer.dtdAttList(this,this.options.writer.filterOptions(t))},n}(r)}).call(this)},6347:function(t,e,n){(function(){var e,r,i={}.hasOwnProperty;r=n(2026),e=n(9335),t.exports=function(t){function n(t,r,i){if(n.__super__.constructor.call(this,t),null==r)throw new Error("Missing DTD element name. "+this.debugInfo());i||(i="(#PCDATA)"),Array.isArray(i)&&(i="("+i.join(",")+")"),this.name=this.stringify.name(r),this.type=e.ElementDeclaration,this.value=this.stringify.dtdElementValue(i)}return function(t,e){for(var n in e)i.call(e,n)&&(t[n]=e[n]);function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype}(n,t),n.prototype.toString=function(t){return this.options.writer.dtdElement(this,this.options.writer.filterOptions(t))},n}(r)}).call(this)},9078:function(t,e,n){(function(){var e,r,i,s={}.hasOwnProperty;i=n(8369).isObject,r=n(2026),e=n(9335),t.exports=function(t){function n(t,r,s,o){if(n.__super__.constructor.call(this,t),null==s)throw new Error("Missing DTD entity name. "+this.debugInfo(s));if(null==o)throw new Error("Missing DTD entity value. "+this.debugInfo(s));if(this.pe=!!r,this.name=this.stringify.name(s),this.type=e.EntityDeclaration,i(o)){if(!o.pubID&&!o.sysID)throw new Error("Public and/or system identifiers are required for an external entity. "+this.debugInfo(s));if(o.pubID&&!o.sysID)throw new Error("System identifier is required for a public external entity. "+this.debugInfo(s));if(this.internal=!1,null!=o.pubID&&(this.pubID=this.stringify.dtdPubID(o.pubID)),null!=o.sysID&&(this.sysID=this.stringify.dtdSysID(o.sysID)),null!=o.nData&&(this.nData=this.stringify.dtdNData(o.nData)),this.pe&&this.nData)throw new Error("Notation declaration is not allowed in a parameter entity. "+this.debugInfo(s))}else this.value=this.stringify.dtdEntityValue(o),this.internal=!0}return function(t,e){for(var n in e)s.call(e,n)&&(t[n]=e[n]);function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype}(n,t),Object.defineProperty(n.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(n.prototype,"systemId",{get:function(){return this.sysID}}),Object.defineProperty(n.prototype,"notationName",{get:function(){return this.nData||null}}),Object.defineProperty(n.prototype,"inputEncoding",{get:function(){return null}}),Object.defineProperty(n.prototype,"xmlEncoding",{get:function(){return null}}),Object.defineProperty(n.prototype,"xmlVersion",{get:function(){return null}}),n.prototype.toString=function(t){return this.options.writer.dtdEntity(this,this.options.writer.filterOptions(t))},n}(r)}).call(this)},4777:function(t,e,n){(function(){var e,r,i={}.hasOwnProperty;r=n(2026),e=n(9335),t.exports=function(t){function n(t,r,i){if(n.__super__.constructor.call(this,t),null==r)throw new Error("Missing DTD notation name. "+this.debugInfo(r));if(!i.pubID&&!i.sysID)throw new Error("Public or system identifiers are required for an external entity. "+this.debugInfo(r));this.name=this.stringify.name(r),this.type=e.NotationDeclaration,null!=i.pubID&&(this.pubID=this.stringify.dtdPubID(i.pubID)),null!=i.sysID&&(this.sysID=this.stringify.dtdSysID(i.sysID))}return function(t,e){for(var n in e)i.call(e,n)&&(t[n]=e[n]);function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype}(n,t),Object.defineProperty(n.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(n.prototype,"systemId",{get:function(){return this.sysID}}),n.prototype.toString=function(t){return this.options.writer.dtdNotation(this,this.options.writer.filterOptions(t))},n}(r)}).call(this)},9077:function(t,e,n){(function(){var e,r,i,s={}.hasOwnProperty;i=n(8369).isObject,r=n(2026),e=n(9335),t.exports=function(t){function n(t,r,s,o){var a;n.__super__.constructor.call(this,t),i(r)&&(r=(a=r).version,s=a.encoding,o=a.standalone),r||(r="1.0"),this.type=e.Declaration,this.version=this.stringify.xmlVersion(r),null!=s&&(this.encoding=this.stringify.xmlEncoding(s)),null!=o&&(this.standalone=this.stringify.xmlStandalone(o))}return function(t,e){for(var n in e)s.call(e,n)&&(t[n]=e[n]);function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype}(n,t),n.prototype.toString=function(t){return this.options.writer.declaration(this,this.options.writer.filterOptions(t))},n}(r)}).call(this)},6544:function(t,e,n){(function(){var e,r,i,s,o,a,c,u,l={}.hasOwnProperty;u=n(8369).isObject,c=n(2026),e=n(9335),r=n(1179),s=n(9078),i=n(6347),o=n(4777),a=n(663),t.exports=function(t){function n(t,r,i){var s,o,a,c,l,p;if(n.__super__.constructor.call(this,t),this.type=e.DocType,t.children)for(o=0,a=(c=t.children).length;o=0;)this.up();return this.onEnd()},t.prototype.openCurrent=function(){if(this.currentNode)return this.currentNode.children=!0,this.openNode(this.currentNode)},t.prototype.openNode=function(t){var n,i,s,o;if(!t.isOpen){if(this.root||0!==this.currentLevel||t.type!==e.Element||(this.root=t),i="",t.type===e.Element){for(s in this.writerOptions.state=r.OpenTag,i=this.writer.indent(t,this.writerOptions,this.currentLevel)+"<"+t.name,o=t.attribs)I.call(o,s)&&(n=o[s],i+=this.writer.attribute(n,this.writerOptions,this.currentLevel));i+=(t.children?">":"/>")+this.writer.endline(t,this.writerOptions,this.currentLevel),this.writerOptions.state=r.InsideTag}else this.writerOptions.state=r.OpenTag,i=this.writer.indent(t,this.writerOptions,this.currentLevel)+""),i+=this.writer.endline(t,this.writerOptions,this.currentLevel);return this.onData(i,this.currentLevel),t.isOpen=!0}},t.prototype.closeNode=function(t){var n;if(!t.isClosed)return"",this.writerOptions.state=r.CloseTag,n=t.type===e.Element?this.writer.indent(t,this.writerOptions,this.currentLevel)+""+this.writer.endline(t,this.writerOptions,this.currentLevel):this.writer.indent(t,this.writerOptions,this.currentLevel)+"]>"+this.writer.endline(t,this.writerOptions,this.currentLevel),this.writerOptions.state=r.None,this.onData(n,this.currentLevel),t.isClosed=!0},t.prototype.onData=function(t,e){return this.documentStarted=!0,this.onDataCallback(t,e+1)},t.prototype.onEnd=function(){return this.documentCompleted=!0,this.onEndCallback()},t.prototype.debugInfo=function(t){return null==t?"":"node: <"+t+">"},t.prototype.ele=function(){return this.element.apply(this,arguments)},t.prototype.nod=function(t,e,n){return this.node(t,e,n)},t.prototype.txt=function(t){return this.text(t)},t.prototype.dat=function(t){return this.cdata(t)},t.prototype.com=function(t){return this.comment(t)},t.prototype.ins=function(t,e){return this.instruction(t,e)},t.prototype.dec=function(t,e,n){return this.declaration(t,e,n)},t.prototype.dtd=function(t,e,n){return this.doctype(t,e,n)},t.prototype.e=function(t,e,n){return this.element(t,e,n)},t.prototype.n=function(t,e,n){return this.node(t,e,n)},t.prototype.t=function(t){return this.text(t)},t.prototype.d=function(t){return this.cdata(t)},t.prototype.c=function(t){return this.comment(t)},t.prototype.r=function(t){return this.raw(t)},t.prototype.i=function(t,e){return this.instruction(t,e)},t.prototype.att=function(){return this.currentNode&&this.currentNode.type===e.DocType?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},t.prototype.a=function(){return this.currentNode&&this.currentNode.type===e.DocType?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},t.prototype.ent=function(t,e){return this.entity(t,e)},t.prototype.pent=function(t,e){return this.pEntity(t,e)},t.prototype.not=function(t,e){return this.notation(t,e)},t}()}).call(this)},8833:function(t,e,n){(function(){var e,r,i={}.hasOwnProperty;r=n(2026),e=n(9335),t.exports=function(t){function n(t){n.__super__.constructor.call(this,t),this.type=e.Dummy}return function(t,e){for(var n in e)i.call(e,n)&&(t[n]=e[n]);function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype}(n,t),n.prototype.clone=function(){return Object.create(this)},n.prototype.toString=function(t){return""},n}(r)}).call(this)},2161:function(t,e,n){(function(){var e,r,i,s,o,a,c,u,l={}.hasOwnProperty;u=n(8369),c=u.isObject,a=u.isFunction,o=u.getValue,s=n(2026),e=n(9335),r=n(2750),i=n(663),t.exports=function(t){function n(t,r,i){var s,o,a,c;if(n.__super__.constructor.call(this,t),null==r)throw new Error("Missing element name. "+this.debugInfo());if(this.name=this.stringify.name(r),this.type=e.Element,this.attribs={},this.schemaTypeInfo=null,null!=i&&this.attribute(i),t.type===e.Document&&(this.isRoot=!0,this.documentObject=t,t.rootObject=this,t.children))for(o=0,a=(c=t.children).length;o=i;e=0<=i?++r:--r)if(!this.attribs[e].isEqualNode(t.attribs[e]))return!1;return!0},n}(s)}).call(this)},663:function(t){(function(){t.exports=function(){function t(t){this.nodes=t}return Object.defineProperty(t.prototype,"length",{get:function(){return Object.keys(this.nodes).length||0}}),t.prototype.clone=function(){return this.nodes=null},t.prototype.getNamedItem=function(t){return this.nodes[t]},t.prototype.setNamedItem=function(t){var e;return e=this.nodes[t.nodeName],this.nodes[t.nodeName]=t,e||null},t.prototype.removeNamedItem=function(t){var e;return e=this.nodes[t],delete this.nodes[t],e||null},t.prototype.item=function(t){return this.nodes[Object.keys(this.nodes)[t]]||null},t.prototype.getNamedItemNS=function(t,e){throw new Error("This DOM method is not implemented.")},t.prototype.setNamedItemNS=function(t){throw new Error("This DOM method is not implemented.")},t.prototype.removeNamedItemNS=function(t,e){throw new Error("This DOM method is not implemented.")},t}()}).call(this)},2026:function(t,e,n){(function(){var e,r,i,s,o,a,c,u,l,p,d,h,f,_,m,g,y,b={}.hasOwnProperty;y=n(8369),g=y.isObject,m=y.isFunction,_=y.isEmpty,f=y.getValue,u=null,i=null,s=null,o=null,a=null,d=null,h=null,p=null,c=null,r=null,l=null,e=null,t.exports=function(){function t(t){this.parent=t,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),this.value=null,this.children=[],this.baseURI=null,u||(u=n(2161),i=n(6170),s=n(2096),o=n(9077),a=n(6544),d=n(9406),h=n(3595),p=n(4981),c=n(8833),r=n(9335),l=n(2390),n(663),e=n(7557))}return Object.defineProperty(t.prototype,"nodeName",{get:function(){return this.name}}),Object.defineProperty(t.prototype,"nodeType",{get:function(){return this.type}}),Object.defineProperty(t.prototype,"nodeValue",{get:function(){return this.value}}),Object.defineProperty(t.prototype,"parentNode",{get:function(){return this.parent}}),Object.defineProperty(t.prototype,"childNodes",{get:function(){return this.childNodeList&&this.childNodeList.nodes||(this.childNodeList=new l(this.children)),this.childNodeList}}),Object.defineProperty(t.prototype,"firstChild",{get:function(){return this.children[0]||null}}),Object.defineProperty(t.prototype,"lastChild",{get:function(){return this.children[this.children.length-1]||null}}),Object.defineProperty(t.prototype,"previousSibling",{get:function(){var t;return t=this.parent.children.indexOf(this),this.parent.children[t-1]||null}}),Object.defineProperty(t.prototype,"nextSibling",{get:function(){var t;return t=this.parent.children.indexOf(this),this.parent.children[t+1]||null}}),Object.defineProperty(t.prototype,"ownerDocument",{get:function(){return this.document()||null}}),Object.defineProperty(t.prototype,"textContent",{get:function(){var t,e,n,i,s;if(this.nodeType===r.Element||this.nodeType===r.DocumentFragment){for(s="",e=0,n=(i=this.children).length;e":(null!=(n=this.parent)?n.name:void 0)?"node: <"+t+">, parent: <"+this.parent.name+">":"node: <"+t+">":""},t.prototype.ele=function(t,e,n){return this.element(t,e,n)},t.prototype.nod=function(t,e,n){return this.node(t,e,n)},t.prototype.txt=function(t){return this.text(t)},t.prototype.dat=function(t){return this.cdata(t)},t.prototype.com=function(t){return this.comment(t)},t.prototype.ins=function(t,e){return this.instruction(t,e)},t.prototype.doc=function(){return this.document()},t.prototype.dec=function(t,e,n){return this.declaration(t,e,n)},t.prototype.e=function(t,e,n){return this.element(t,e,n)},t.prototype.n=function(t,e,n){return this.node(t,e,n)},t.prototype.t=function(t){return this.text(t)},t.prototype.d=function(t){return this.cdata(t)},t.prototype.c=function(t){return this.comment(t)},t.prototype.r=function(t){return this.raw(t)},t.prototype.i=function(t,e){return this.instruction(t,e)},t.prototype.u=function(){return this.up()},t.prototype.importXMLBuilder=function(t){return this.importDocument(t)},t.prototype.replaceChild=function(t,e){throw new Error("This DOM method is not implemented."+this.debugInfo())},t.prototype.removeChild=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())},t.prototype.appendChild=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())},t.prototype.hasChildNodes=function(){return 0!==this.children.length},t.prototype.cloneNode=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())},t.prototype.normalize=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},t.prototype.isSupported=function(t,e){return!0},t.prototype.hasAttributes=function(){return 0!==this.attribs.length},t.prototype.compareDocumentPosition=function(t){var n,r;return(n=this)===t?0:this.document()!==t.document()?(r=e.Disconnected|e.ImplementationSpecific,Math.random()<.5?r|=e.Preceding:r|=e.Following,r):n.isAncestor(t)?e.Contains|e.Preceding:n.isDescendant(t)?e.Contains|e.Following:n.isPreceding(t)?e.Preceding:e.Following},t.prototype.isSameNode=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())},t.prototype.lookupPrefix=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())},t.prototype.isDefaultNamespace=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())},t.prototype.lookupNamespaceURI=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())},t.prototype.isEqualNode=function(t){var e,n,r;if(t.nodeType!==this.nodeType)return!1;if(t.children.length!==this.children.length)return!1;for(e=n=0,r=this.children.length-1;0<=r?n<=r:n>=r;e=0<=r?++n:--n)if(!this.children[e].isEqualNode(t.children[e]))return!1;return!0},t.prototype.getFeature=function(t,e){throw new Error("This DOM method is not implemented."+this.debugInfo())},t.prototype.setUserData=function(t,e,n){throw new Error("This DOM method is not implemented."+this.debugInfo())},t.prototype.getUserData=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())},t.prototype.contains=function(t){return!!t&&(t===this||this.isDescendant(t))},t.prototype.isDescendant=function(t){var e,n,r,i;for(n=0,r=(i=this.children).length;nn},t.prototype.treePosition=function(t){var e,n;return n=0,e=!1,this.foreachTreeNode(this.document(),(function(r){if(n++,!e&&r===t)return e=!0})),e?n:-1},t.prototype.foreachTreeNode=function(t,e){var n,r,i,s,o;for(t||(t=this.document()),r=0,i=(s=t.children).length;r0){for(this.stream.write(" ["),this.stream.write(this.endline(t,e,n)),e.state=r.InsideTag,s=0,o=(a=t.children).length;s"),this.stream.write(this.endline(t,e,n)),e.state=r.None,this.closeNode(t,e,n)},n.prototype.element=function(t,n,i){var o,a,c,u,l,p,d,h,f;for(d in i||(i=0),this.openNode(t,n,i),n.state=r.OpenTag,this.stream.write(this.indent(t,n,i)+"<"+t.name),h=t.attribs)s.call(h,d)&&(o=h[d],this.attribute(o,n,i));if(u=0===(c=t.children.length)?null:t.children[0],0===c||t.children.every((function(t){return(t.type===e.Text||t.type===e.Raw)&&""===t.value})))n.allowEmpty?(this.stream.write(">"),n.state=r.CloseTag,this.stream.write("")):(n.state=r.CloseTag,this.stream.write(n.spaceBeforeSlash+"/>"));else if(!n.pretty||1!==c||u.type!==e.Text&&u.type!==e.Raw||null==u.value){for(this.stream.write(">"+this.endline(t,n,i)),n.state=r.InsideTag,l=0,p=(f=t.children).length;l")}else this.stream.write(">"),n.state=r.InsideTag,n.suppressPrettyCount++,this.writeChildNode(u,n,i+1),n.suppressPrettyCount--,n.state=r.CloseTag,this.stream.write("");return this.stream.write(this.endline(t,n,i)),n.state=r.None,this.closeNode(t,n,i)},n.prototype.processingInstruction=function(t,e,r){return this.stream.write(n.__super__.processingInstruction.call(this,t,e,r))},n.prototype.raw=function(t,e,r){return this.stream.write(n.__super__.raw.call(this,t,e,r))},n.prototype.text=function(t,e,r){return this.stream.write(n.__super__.text.call(this,t,e,r))},n.prototype.dtdAttList=function(t,e,r){return this.stream.write(n.__super__.dtdAttList.call(this,t,e,r))},n.prototype.dtdElement=function(t,e,r){return this.stream.write(n.__super__.dtdElement.call(this,t,e,r))},n.prototype.dtdEntity=function(t,e,r){return this.stream.write(n.__super__.dtdEntity.call(this,t,e,r))},n.prototype.dtdNotation=function(t,e,r){return this.stream.write(n.__super__.dtdNotation.call(this,t,e,r))},n}(i)}).call(this)},6434:function(t,e,n){(function(){var e,r={}.hasOwnProperty;e=n(751),t.exports=function(t){function e(t){e.__super__.constructor.call(this,t)}return function(t,e){for(var n in e)r.call(e,n)&&(t[n]=e[n]);function i(){this.constructor=t}i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype}(e,t),e.prototype.document=function(t,e){var n,r,i,s,o;for(e=this.filterOptions(e),s="",r=0,i=(o=t.children).length;r","]]]]>"),this.assertLegalChar(t))},t.prototype.comment=function(t){if(this.options.noValidation)return t;if((t=""+t||"").match(/--/))throw new Error("Comment text cannot contain double-hypen: "+t);return this.assertLegalChar(t)},t.prototype.raw=function(t){return this.options.noValidation?t:""+t||""},t.prototype.attValue=function(t){return this.options.noValidation?t:this.assertLegalChar(this.attEscape(t=""+t||""))},t.prototype.insTarget=function(t){return this.options.noValidation?t:this.assertLegalChar(""+t||"")},t.prototype.insValue=function(t){if(this.options.noValidation)return t;if((t=""+t||"").match(/\?>/))throw new Error("Invalid processing instruction value: "+t);return this.assertLegalChar(t)},t.prototype.xmlVersion=function(t){if(this.options.noValidation)return t;if(!(t=""+t||"").match(/1\.[0-9]+/))throw new Error("Invalid version number: "+t);return t},t.prototype.xmlEncoding=function(t){if(this.options.noValidation)return t;if(!(t=""+t||"").match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/))throw new Error("Invalid encoding: "+t);return this.assertLegalChar(t)},t.prototype.xmlStandalone=function(t){return this.options.noValidation?t:t?"yes":"no"},t.prototype.dtdPubID=function(t){return this.options.noValidation?t:this.assertLegalChar(""+t||"")},t.prototype.dtdSysID=function(t){return this.options.noValidation?t:this.assertLegalChar(""+t||"")},t.prototype.dtdElementValue=function(t){return this.options.noValidation?t:this.assertLegalChar(""+t||"")},t.prototype.dtdAttType=function(t){return this.options.noValidation?t:this.assertLegalChar(""+t||"")},t.prototype.dtdAttDefault=function(t){return this.options.noValidation?t:this.assertLegalChar(""+t||"")},t.prototype.dtdEntityValue=function(t){return this.options.noValidation?t:this.assertLegalChar(""+t||"")},t.prototype.dtdNData=function(t){return this.options.noValidation?t:this.assertLegalChar(""+t||"")},t.prototype.convertAttKey="@",t.prototype.convertPIKey="?",t.prototype.convertTextKey="#text",t.prototype.convertCDataKey="#cdata",t.prototype.convertCommentKey="#comment",t.prototype.convertRawKey="#raw",t.prototype.assertLegalChar=function(t){var e,n;if(this.options.noValidation)return t;if(e="","1.0"===this.options.version){if(e=/[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,n=t.match(e))throw new Error("Invalid character in string: "+t+" at index "+n.index)}else if("1.1"===this.options.version&&(e=/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,n=t.match(e)))throw new Error("Invalid character in string: "+t+" at index "+n.index);return t},t.prototype.assertLegalName=function(t){var e;if(this.options.noValidation)return t;if(this.assertLegalChar(t),e=/^([:A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])([\x2D\.0-:A-Z_a-z\xB7\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C\u200D\u203F\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])*$/,!t.match(e))throw new Error("Invalid character in name");return t},t.prototype.textEscape=function(t){var e;return this.options.noValidation?t:(e=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,t.replace(e,"&").replace(//g,">").replace(/\r/g," "))},t.prototype.attEscape=function(t){var e;return this.options.noValidation?t:(e=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,t.replace(e,"&").replace(/0?new Array(r).join(e.indent):""},t.prototype.endline=function(t,e,n){return!e.pretty||e.suppressPrettyCount?"":e.newline},t.prototype.attribute=function(t,e,n){var r;return this.openAttribute(t,e,n),r=" "+t.name+'="'+t.value+'"',this.closeAttribute(t,e,n),r},t.prototype.cdata=function(t,e,n){var i;return this.openNode(t,e,n),e.state=r.OpenTag,i=this.indent(t,e,n)+""+this.endline(t,e,n),e.state=r.None,this.closeNode(t,e,n),i},t.prototype.comment=function(t,e,n){var i;return this.openNode(t,e,n),e.state=r.OpenTag,i=this.indent(t,e,n)+"\x3c!-- ",e.state=r.InsideTag,i+=t.value,e.state=r.CloseTag,i+=" --\x3e"+this.endline(t,e,n),e.state=r.None,this.closeNode(t,e,n),i},t.prototype.declaration=function(t,e,n){var i;return this.openNode(t,e,n),e.state=r.OpenTag,i=this.indent(t,e,n)+"",i+=this.endline(t,e,n),e.state=r.None,this.closeNode(t,e,n),i},t.prototype.docType=function(t,e,n){var i,s,o,a,c;if(n||(n=0),this.openNode(t,e,n),e.state=r.OpenTag,a=this.indent(t,e,n),a+="0){for(a+=" [",a+=this.endline(t,e,n),e.state=r.InsideTag,s=0,o=(c=t.children).length;s",a+=this.endline(t,e,n),e.state=r.None,this.closeNode(t,e,n),a},t.prototype.element=function(t,n,i){var o,a,c,u,l,p,d,h,f,_,m,g,y,b;for(f in i||(i=0),_=!1,m="",this.openNode(t,n,i),n.state=r.OpenTag,m+=this.indent(t,n,i)+"<"+t.name,g=t.attribs)s.call(g,f)&&(o=g[f],m+=this.attribute(o,n,i));if(u=0===(c=t.children.length)?null:t.children[0],0===c||t.children.every((function(t){return(t.type===e.Text||t.type===e.Raw)&&""===t.value})))n.allowEmpty?(m+=">",n.state=r.CloseTag,m+=""+this.endline(t,n,i)):(n.state=r.CloseTag,m+=n.spaceBeforeSlash+"/>"+this.endline(t,n,i));else if(!n.pretty||1!==c||u.type!==e.Text&&u.type!==e.Raw||null==u.value){if(n.dontPrettyTextNodes)for(l=0,d=(y=t.children).length;l"+this.endline(t,n,i),n.state=r.InsideTag,p=0,h=(b=t.children).length;p",_&&n.suppressPrettyCount--,m+=this.endline(t,n,i),n.state=r.None}else m+=">",n.state=r.InsideTag,n.suppressPrettyCount++,_=!0,m+=this.writeChildNode(u,n,i+1),n.suppressPrettyCount--,_=!1,n.state=r.CloseTag,m+=""+this.endline(t,n,i);return this.closeNode(t,n,i),m},t.prototype.writeChildNode=function(t,n,r){switch(t.type){case e.CData:return this.cdata(t,n,r);case e.Comment:return this.comment(t,n,r);case e.Element:return this.element(t,n,r);case e.Raw:return this.raw(t,n,r);case e.Text:return this.text(t,n,r);case e.ProcessingInstruction:return this.processingInstruction(t,n,r);case e.Dummy:return"";case e.Declaration:return this.declaration(t,n,r);case e.DocType:return this.docType(t,n,r);case e.AttributeDeclaration:return this.dtdAttList(t,n,r);case e.ElementDeclaration:return this.dtdElement(t,n,r);case e.EntityDeclaration:return this.dtdEntity(t,n,r);case e.NotationDeclaration:return this.dtdNotation(t,n,r);default:throw new Error("Unknown XML node type: "+t.constructor.name)}},t.prototype.processingInstruction=function(t,e,n){var i;return this.openNode(t,e,n),e.state=r.OpenTag,i=this.indent(t,e,n)+"",i+=this.endline(t,e,n),e.state=r.None,this.closeNode(t,e,n),i},t.prototype.raw=function(t,e,n){var i;return this.openNode(t,e,n),e.state=r.OpenTag,i=this.indent(t,e,n),e.state=r.InsideTag,i+=t.value,e.state=r.CloseTag,i+=this.endline(t,e,n),e.state=r.None,this.closeNode(t,e,n),i},t.prototype.text=function(t,e,n){var i;return this.openNode(t,e,n),e.state=r.OpenTag,i=this.indent(t,e,n),e.state=r.InsideTag,i+=t.value,e.state=r.CloseTag,i+=this.endline(t,e,n),e.state=r.None,this.closeNode(t,e,n),i},t.prototype.dtdAttList=function(t,e,n){var i;return this.openNode(t,e,n),e.state=r.OpenTag,i=this.indent(t,e,n)+""+this.endline(t,e,n),e.state=r.None,this.closeNode(t,e,n),i},t.prototype.dtdElement=function(t,e,n){var i;return this.openNode(t,e,n),e.state=r.OpenTag,i=this.indent(t,e,n)+""+this.endline(t,e,n),e.state=r.None,this.closeNode(t,e,n),i},t.prototype.dtdEntity=function(t,e,n){var i;return this.openNode(t,e,n),e.state=r.OpenTag,i=this.indent(t,e,n)+""+this.endline(t,e,n),e.state=r.None,this.closeNode(t,e,n),i},t.prototype.dtdNotation=function(t,e,n){var i;return this.openNode(t,e,n),e.state=r.OpenTag,i=this.indent(t,e,n)+""+this.endline(t,e,n),e.state=r.None,this.closeNode(t,e,n),i},t.prototype.openNode=function(t,e,n){},t.prototype.closeNode=function(t,e,n){},t.prototype.openAttribute=function(t,e,n){},t.prototype.closeAttribute=function(t,e,n){},t}()}).call(this)},5532:function(t,e,n){(function(){var e,r,i,s,o,a,c,u,l,p;p=n(8369),u=p.assign,l=p.isFunction,i=n(1770),s=n(6934),o=n(9227),c=n(6434),a=n(1996),e=n(9335),r=n(594),t.exports.create=function(t,e,n,r){var i,o;if(null==t)throw new Error("Root element needs a name.");return r=u({},e,n,r),o=(i=new s(r)).element(t),r.headless||(i.declaration(r),null==r.pubID&&null==r.sysID||i.dtd(r)),o},t.exports.begin=function(t,e,n){var r;return l(t)&&(e=(r=[t,e])[0],n=r[1],t={}),e?new o(t,e,n):new s(t)},t.exports.stringWriter=function(t){return new c(t)},t.exports.streamWriter=function(t,e){return new a(t,e)},t.exports.implementation=new i,t.exports.nodeType=e,t.exports.writerState=r}).call(this)},5144:t=>{t.exports={initActions:function(){let t=this,e={};e.power_on={name:"Power On",options:[],callback:async function(e){t.sendCommand("system","setPowerStatus",{status:!0})}},e.power_off={name:"Power Off",options:[],callback:async function(e){t.sendCommand("system","setPowerStatus",{status:!1})}},e.volume_up={name:"Volume Up",options:[],callback:async function(e){t.sendCommand("audio","setAudioVolume",{target:"speaker",volume:"+1"})}},e.volume_down={name:"Volume Down",options:[],callback:async function(e){t.sendCommand("audio","setAudioVolume",{target:"speaker",volume:"-1"})}},e.volume_mute={name:"Volume Mute",options:[],callback:async function(e){t.sendCommand("audio","setAudioMute",{status:!0})}},e.volume_unmute={name:"Volume Unmute",options:[],callback:async function(e){t.sendCommand("audio","setAudioMute",{status:!1})}},e.change_external_input={name:"Change External Input",options:[{type:"dropdown",label:"Kind",id:"kind",choices:[{id:"hdmi",label:"HDMI"},{id:"composite",label:"Composite"},{id:"scart",label:"SCART"}]},{type:"dropdown",label:"Port",id:"port",choices:[{id:"1",label:"1"},{id:"2",label:"2"},{id:"3",label:"3"},{id:"4",label:"4"}]}],callback:async function(e){let n=e.options,r={uri:"extInput:"+n.kind+"?port="+n.port};t.sendCommand("avContent","setPlayContent",r)}},t.setActionDefinitions(e)}}},5965:(t,e,n)=>{const{InstanceStatus:r}=n(8049),i=n(9646).K;t.exports={initConnection:function(){let t=this;t.updateStatus(r.Ok),t.sendCommand("avContent","getCurrentExternalInputsStatus",{},"allinputs"),t.getInformation(),t.setupInterval()},setupInterval:function(){let t=this;t.stopInterval(),t.config.interval>0&&(t.INTERVAL=setInterval(t.getInformation.bind(t),t.config.interval),t.log("info","Starting Update Interval: Every "+t.config.interval+"ms"))},stopInterval:function(){let t=this;null!==t.INTERVAL&&(t.log("info","Stopping Update Interval."),clearInterval(t.INTERVAL),t.INTERVAL=null)},getInformation:async function(){let t=this;t.sendCommand("system","getPowerStatus",{},"power"),t.sendCommand("audio","getVolumeInformation",{},"volume"),t.sendCommand("avContent","getPlayingContentInfo",{},"input")},sendCommand:function(t,e,n,r=void 0){let s=this,o={};if(o.method=e,o.version="1.0",o.id=1,"{}"==JSON.stringify(n)?o.params=[]:o.params=[n],void 0!==s.config.psk&&""!==s.config.psk){let e={data:o,headers:{"Content-Type":"application/json","X-Auth-PSK":s.config.psk}};(new i).post(`http://${s.config.host}/sony/${t}`,e,(function(t,e){try{if(200==e.statusCode){if(r)if(t.result)switch(r){case"allinputs":s.DATA.inputs=t.result[0],s.buildInputList(),s.initFeedbacks();break;case"power":s.DATA.powerState="active"===t.result[0].status;break;case"volume":s.DATA.volumeLevel=t.result[0][0].volume,s.DATA.muteState=t.result[0][0].mute;break;case"input":s.DATA.input=t.result[0].uri}else t.error;s.checkFeedbacks(),s.checkVariables()}else 403==e.statusCode&&(s.log("error","PSK may be incorrect. Please check your PSK and try again."),s.stopInterval())}catch(e){s.log("error","Error processing response: "+e),console.log(e),console.log(t)}})).on("error",(function(t){s.log("error","Error Sending Command "+t.toString())}))}else s.config.verbose&&s.log("debug","No PSK set. Not sending command.")},buildInputList:function(){let t=this;t.CHOICES_INPUTS=[];for(let e=0;e{const{Regex:r}=n(8049);t.exports={getConfigFields:()=>[{type:"static-text",id:"info",width:12,label:"Information",value:"This module controls Sony Bravia TVs. The TV will need to be configured with a Pre Shared Key (PSK)."},{type:"textinput",id:"host",label:"Target IP",width:6,regex:r.IP},{type:"textinput",id:"psk",label:"Pre Shared Key (PSK)",width:6},{type:"checkbox",id:"polling",label:"Enable Polling",width:12},{type:"static-text",id:"intervalInfo",width:9,label:"Update Interval",value:"Please enter the amount of time in milliseconds to request new information from the device.",isVisible:t=>1==t.polling},{type:"textinput",id:"interval",label:"Update Interval",width:3,default:1e3,isVisible:t=>1==t.polling},{type:"static-text",id:"info2",label:"Verbose Logging",width:12,value:'\n\t\t\t\t\t
\n\t\t\t\t\t\tEnabling this option will put more detail in the log, which can be useful for troubleshooting purposes.\n\t\t\t\t\t
\n\t\t\t\t'},{type:"checkbox",id:"verbose",label:"Enable Verbose Logging",default:!1}]}},7417:(t,e,n)=>{const{combineRgb:r}=n(8049);t.exports={initFeedbacks:function(){let t=this,e={};r(255,255,255),r(255,0,0),e.powerStatus={type:"boolean",name:"TV Power is in X State",description:"Show feedback for Power State",options:[{type:"dropdown",label:"State",id:"state",default:!0,choices:[{id:!0,label:"On"},{id:!1,label:"Off"}]}],defaultStyle:{color:r(0,0,0),bgcolor:r(255,0,0)},callback:e=>{let n=e.options;return t.DATA.powerState==n.state}},e.muteStatus={type:"boolean",name:"TV Mute is in X State",description:"Show feedback for Mute State",options:[{type:"dropdown",label:"State",id:"state",default:!0,choices:[{id:!0,label:"On"},{id:!1,label:"Off"}]}],defaultStyle:{color:r(0,0,0),bgcolor:r(255,0,0)},callback:e=>{let n=e.options;return t.DATA.muteState==n.state}},e.currentInput={type:"boolean",name:"TV Input Matches Selected Input",description:"Show feedback for TV Input",options:[{type:"dropdown",label:"Input",id:"input",default:t.CHOICES_INPUTS[0].id,choices:t.CHOICES_INPUTS}],defaultStyle:{color:r(0,0,0),bgcolor:r(255,0,0)},callback:e=>{let n=e.options;return t.DATA.input==n.input}},t.setFeedbackDefinitions(e)}}},3125:(t,e,n)=>{const{combineRgb:r}=n(8049);t.exports={initPresets:function(){r(255,255,255),r(0,0,0),r(255,0,0),r(0,255,0),this.setPresetDefinitions([])}}},4556:t=>{t.exports=[function(t,e){return{updatedConfig:null,updatedActions:[],updatedFeedbacks:[]}}]},4049:t=>{t.exports={initVariables:function(){let t=[];t.push({variableId:"powerState",name:"Power State"}),t.push({variableId:"muteState",name:"Mute State"}),t.push({variableId:"volumeLevel",name:"Current Volume Level"}),t.push({variableId:"input",name:"Current Input"}),this.setVariableDefinitions(t)},checkVariables:function(){let t=this;try{t.setVariableValues({powerState:t.DATA.powerState?"On":"Off",muteState:t.DATA.muteState?"Muted":"Unmuted",volumeLevel:t.DATA.volumeLevel,input:t.DATA.input})}catch(e){t.log("error","Error setting variables: "+e)}}}},9491:t=>{"use strict";t.exports=require("assert")},6113:t=>{"use strict";t.exports=require("crypto")},1891:t=>{"use strict";t.exports=require("dgram")},2361:t=>{"use strict";t.exports=require("events")},3292:t=>{"use strict";t.exports=require("fs/promises")},3685:t=>{"use strict";t.exports=require("http")},5687:t=>{"use strict";t.exports=require("https")},1405:t=>{"use strict";t.exports=require("inspector")},1808:t=>{"use strict";t.exports=require("net")},2037:t=>{"use strict";t.exports=require("os")},1017:t=>{"use strict";t.exports=require("path")},2781:t=>{"use strict";t.exports=require("stream")},1576:t=>{"use strict";t.exports=require("string_decoder")},9512:t=>{"use strict";t.exports=require("timers")},4404:t=>{"use strict";t.exports=require("tls")},6224:t=>{"use strict";t.exports=require("tty")},7310:t=>{"use strict";t.exports=require("url")},3837:t=>{"use strict";t.exports=require("util")},9796:t=>{"use strict";t.exports=require("zlib")},2764:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},7359:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.runEntrypoint=void 0;const r=n(6066),i=n(9913),s=r.__importDefault(n(3292)),o=n(2068),a=n(4776);n(5605);const c=n(8221),u=r.__importDefault(n(1017));let l,p=!1;e.runEntrypoint=function(t,e){Promise.resolve().then((async()=>{if(p)throw new Error("runEntrypoint can only be called once");p=!0;const n=process.env.MODULE_MANIFEST;if(!n)throw new Error("Module initialise is missing MODULE_MANIFEST");const r=await s.default.readFile(n),d=JSON.parse(r.toString());if(d.runtime?.api!==i.HostApiNodeJsIpc)throw new Error("Module manifest 'api' mismatch");if(!d.runtime.apiVersion)throw new Error("Module manifest 'apiVersion' missing");let h=d.runtime.apiVersion;if("0.0.0"===h)try{const t=await s.default.readFile(u.default.join(__dirname,"../package.json")),e=JSON.parse(t.toString());"@companion-module/base"===e.name&&(h=e.version)}catch(t){throw new Error("Failed to determine module api version")}if(!process.send)throw new Error("Module is not being run with ipc");console.log(`Starting up module class: ${t.name}`);const f=process.env.CONNECTION_ID;if("string"!=typeof f||!f)throw new Error("Module initialise is missing CONNECTION_ID");const _=process.env.VERIFICATION_TOKEN;if("string"!=typeof _||!_)throw new Error("Module initialise is missing VERIFICATION_TOKEN");const m=process.env.SENTRY_DSN,g=process.env.SENTRY_USERID,y=process.env.SENTRY_COMPANION_VERSION;m&&g&&"https://"==m.substring(0,8)?(console.log("Sentry enabled"),(0,a.init)({dsn:m,release:`${d.name}@${d.version}`,beforeSend:t=>(t.exception&&console.log("sentry","error",t.exception),t)}),(0,a.configureScope)((t=>{t.setUser({id:g}),t.setTag("companion",y)}))):console.log("Sentry disabled");const b=new c.IpcWrapper({},(t=>{process.send(t)}),5e3);process.once("message",(t=>{b.receivedMessage(t)})),l=new t((0,o.literal)({id:f,upgradeScripts:e,_isInstanceBaseProps:!0})),b.sendWithCb("register",{apiVersion:h,connectionId:f,verificationToken:_}).then((()=>{console.log("Module-host accepted registration")}),(t=>{console.error("Module registration failed",t),process.exit(11)}))})).catch((t=>{console.error("Failed to startup module:"),console.error(t.stack||t.message),process.exit(1)}))}},1972:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UDPHelper=e.TelnetHelper=e.TCPHelper=void 0;var r=n(9159);Object.defineProperty(e,"TCPHelper",{enumerable:!0,get:function(){return r.TCPHelper}});var i=n(6226);Object.defineProperty(e,"TelnetHelper",{enumerable:!0,get:function(){return i.TelnetHelper}});var s=n(8473);Object.defineProperty(e,"UDPHelper",{enumerable:!0,get:function(){return s.UDPHelper}})},9159:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TCPHelper=void 0;const r=n(6066).__importDefault(n(1808)),i=n(6729),s=n(609);class o extends i.EventEmitter{#t;#e;_socket;#n;#r=!1;#i=!1;#s=!1;#o;#a;get isConnected(){return this.#r}get isConnecting(){return this.#i}get isDestroyed(){return this.#s}constructor(t,e,n){super(),this.#t=t,this.#e=e,this.#n={reconnect_interval:2e3,reconnect:!0,...n},this._socket=new r.default.Socket,this._socket.setKeepAlive(!0),this._socket.setNoDelay(!0),this._socket.on("error",(t=>{this.#i=!1,this.#r=!1,this.#n.reconnect&&this.#c(),this.#u(s.InstanceStatus.UnknownError,t.message),this.emit("error",t)})),this._socket.on("ready",(()=>{this.#r=!0,this.#i=!1,this.#u(s.InstanceStatus.Ok),this.emit("connect")})),this._socket.on("end",(()=>{this.#r=!1,this.#u(s.InstanceStatus.Disconnected),!this.#i&&this.#n.reconnect&&this.#c(),this.emit("end")})),this._socket.on("data",(t=>this.emit("data",t))),this._socket.on("drain",(()=>this.emit("drain"))),setImmediate((()=>this.connect())),setTimeout((()=>{this.#s||this.listenerCount("error")||console.error(`Danger: TCP client for ${this.#t}:${this.#e} is missing an error handler!`)}),5e3)}connect(){if(this.#s)throw new Error("Cannot connect destroyed socket");return!this.#i&&(this.#i=!0,this._socket.connect(this.#e,this.#t),!0)}async send(t){if(this.#s||this._socket.destroyed)throw new Error("Cannot write to destroyed socket");if(!t||!t.length)throw new Error("No message to send");if(!this.#r)return!1;try{return new Promise(((e,n)=>{this._socket.write(t,(t=>{t?n(t):e(!0)}))}))}catch(t){this.#r=!1;const e=t instanceof Error?t:new Error(`${t}`);throw this.#u(s.InstanceStatus.UnknownError,e.message),this.emit("error",e),e}}destroy(){this.#s=!0,void 0!==this.#a&&clearTimeout(this.#a),this._socket.removeAllListeners(),this.removeAllListeners(),this._socket.destroy()}#c(){void 0!==this.#a&&clearTimeout(this.#a),this.#a=setTimeout((()=>{this.#a=void 0,this.#u(s.InstanceStatus.Connecting),this.connect()}),this.#n.reconnect_interval)}#u(t,e){this.#o!=t&&(this.#o=t,this.emit("status_change",t,e))}}e.TCPHelper=o},6226:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TelnetHelper=void 0;const r=n(6066).__importDefault(n(6729)),i=n(2781),s=n(9159);class o extends r.default{#l;#p;get isConnected(){return this.#l.isConnected}get isConnecting(){return this.#l.isConnecting}get isDestroyed(){return this.#l.isDestroyed}constructor(t,e,n){super(),this.#l=new s.TCPHelper(t,e,n),this.#p=new a,this.#l._socket.pipe(this.#p),this.#l.on("connect",(()=>this.emit("connect"))),this.#l.on("end",(()=>this.emit("end"))),this.#l.on("error",(t=>this.emit("error",t))),this.#l.on("status_change",((t,e)=>this.emit("status_change",t,e))),this.#p.on("iac",((t,e)=>this.emit("iac",t,e))),this.#p.on("sb",(t=>this.emit("sb",t))),this.#p.on("data",(t=>this.emit("data",t))),this.#p.on("drain",(()=>this.emit("drain"))),setTimeout((()=>{this.isDestroyed||this.listenerCount("error")||console.error(`Danger: Telnet client for ${t}:${e} is missing an error handler!`)}),5e3)}connect(){return this.#l.connect()}async send(t){return this.#l.send(t)}destroy(){this.#l.destroy(),this.#p.removeAllListeners(),this.#p.destroy()}}e.TelnetHelper=o;class a extends i.Transform{#d;#h;#f;constructor(t){super(t),this.#d=Buffer.alloc(0),this.#h=Buffer.alloc(0),this.#f=0}_transform(t,e,n){for(let e=0;e=251&&this.#f<=254){let e;switch(this.#f){case 251:e="WILL";break;case 252:e="WONT";break;case 253:e="DO";break;case 254:e="DONT";break;default:return}return this.emit("iac",e,t),void(this.#f=0)}if(250===this.#f){if(240===t)return this.emit("sb",this.#h),this.#f=0,void(this.#h=Buffer.alloc(0));this.#h=Buffer.concat([this.#h,Buffer.from([t])])}}}#m(){const t=this.#d;return this.#d=Buffer.alloc(0),t}}},8473:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UDPHelper=void 0;const r=n(6066).__importDefault(n(1891)),i=n(6729),s=n(609);class o extends i.EventEmitter{#t;#e;#g;#n;#s=!1;#o;get isDestroyed(){return this.#s}constructor(t,e,n){super(),this.#t=t,this.#e=e,this.#n={...n},this.#g=r.default.createSocket("udp4");try{this.#g.bind(this.#n.bind_port||0,this.#n.bind_ip)}catch(t){throw new Error(`Unable to bind to ip/port: ${this.#n.bind_ip}:${this.#n.bind_port}`)}this.#n.broadcast&&this.#g.setBroadcast(!0),void 0!==this.#n.ttl&&this.#g.setTTL(this.#n.ttl),void 0!==this.#n.multicast_ttl&&this.#g.setMulticastTTL(this.#n.multicast_ttl),this.#g.on("error",(t=>{this.#u(s.InstanceStatus.UnknownError,t.message),this.emit("error",t)})),this.#g.on("listening",(()=>{this.#n.multicast_interface&&this.#g.setMulticastInterface(this.#n.multicast_interface),this.#u(s.InstanceStatus.Ok),this.emit("listening")})),this.#g.on("message",(t=>this.emit("data",t))),setTimeout((()=>{this.#s||this.listenerCount("error")||console.error(`Danger: UDP socket for ${this.#t}:${this.#e} is missing an error handler!`)}),5e3)}async send(t){if(this.#s)throw new Error("Cannot write to destroyed socket");if(!t||!t.length)throw new Error("No message to send");return new Promise(((e,n)=>{this.#g.send(t,this.#e,this.#t,(t=>{t?n(t):e()}))}))}destroy(){this.#s=!0,this.#g.removeAllListeners(),this.#g.close(),this.removeAllListeners()}#u(t,e){this.#o!=t&&(this.#o=t,this.emit("status_change",t,e))}}e.UDPHelper=o},8221:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IpcWrapper=void 0;const r=n(6066),i=n(4300),s=n(2068),o=r.__importDefault(n(2559));e.IpcWrapper=class{#y;#b;#v;#E={};constructor(t,e,n){this.#y=t,this.#b=e,this.#v=n}async sendWithCb(t,e,n,r=0){r<=0&&(r=this.#v);const s={timeout:void 0,resolve:()=>null,reject:()=>null},a=new Promise(((t,e)=>{s.resolve=t,s.reject=e})),c=(0,i.nanoid)();this.#E[c]=s,this.#b({direction:"call",name:String(t),payload:o.default.stringify(e),callbackId:c});const u=new Error("Call timed out");return s.timeout=setTimeout((()=>{s.reject(n?n():u),delete this.#E[c]}),r),a}sendWithNoCb(t,e){this.#b({direction:"call",name:String(t),payload:o.default.stringify(e),callbackId:void 0})}receivedMessage(t){const e=t;switch(t.direction){case"call":{const e=this.#y[t.name];if(!e)return void(t.callbackId&&this.#b({direction:"response",callbackId:t.callbackId,success:!1,payload:o.default.stringify({message:`Unknown command "${t.name}"`})}));e(t.payload?o.default.parse(t.payload):void 0).then((e=>{t.callbackId&&this.#b({direction:"response",callbackId:t.callbackId,success:!0,payload:o.default.stringify(e)})}),(e=>{t.callbackId&&this.#b({direction:"response",callbackId:t.callbackId,success:!1,payload:e instanceof Error?JSON.stringify(e,Object.getOwnPropertyNames(e)):o.default.stringify(e)})}));break}case"response":{if(!t.callbackId)return void console.error("Ipc: Response message has no callbackId");const e=this.#E[t.callbackId];if(delete this.#E[t.callbackId],!e)return;clearTimeout(e.timeout);const n=t.payload?o.default.parse(t.payload):void 0;if(t.success)e.resolve(n);else{let t=n;n&&"message"in n&&(t=new Error(n.message),n.stack&&(t.stack=n.stack)),e.reject(t)}break}default:(0,s.assertNever)(t),console.error(`Ipc: Message of unknown direction "${e.direction}"`)}}}},9913:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.HostApiNodeJsIpc=void 0,e.HostApiNodeJsIpc="nodejs-ipc"},8049:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.runEntrypoint=e.assertNever=e.splitRgb=e.combineRgb=e.literal=void 0;const r=n(6066);r.__exportStar(n(7517),e),r.__exportStar(n(4911),e),r.__exportStar(n(2764),e);var i=n(2068);Object.defineProperty(e,"literal",{enumerable:!0,get:function(){return i.literal}}),Object.defineProperty(e,"combineRgb",{enumerable:!0,get:function(){return i.combineRgb}}),Object.defineProperty(e,"splitRgb",{enumerable:!0,get:function(){return i.splitRgb}}),Object.defineProperty(e,"assertNever",{enumerable:!0,get:function(){return i.assertNever}}),r.__exportStar(n(1972),e);var s=n(7359);Object.defineProperty(e,"runEntrypoint",{enumerable:!0,get:function(){return s.runEntrypoint}})},4391:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ActionManager=void 0;const r=n(2557);function i(t){return{id:t.id,actionId:t.actionId,controlId:t.controlId,options:t.options}}e.ActionManager=class{#w;#T;#S;#I=new Map;#x=new Map;constructor(t,e,n){this.#w=t,this.#T=e,this.#S=n}async handleExecuteAction(t){const e=this.#I.get(t.action.actionId);if(!e)throw new Error(`Unknown action: ${t.action.actionId}`);const n={parseVariablesInString:async e=>(await this.#w({text:e,controlId:t.action.controlId,actionInstanceId:t.action.id,feedbackInstanceId:void 0})).text};await e.callback({id:t.action.id,actionId:t.action.actionId,controlId:t.action.controlId,options:t.action.options,surfaceId:t.surfaceId??t.deviceId,_deviceId:t.surfaceId??t.deviceId,_page:t.action.page,_bank:t.action.bank},n)}handleUpdateActions(t){for(const[e,n]of Object.entries(t)){const t=this.#x.get(e);if(t){const e=this.#I.get(t.actionId);if(e?.unsubscribe){const n={parseVariablesInString:async e=>(await this.#w({text:e,controlId:t.controlId,actionInstanceId:t.id,feedbackInstanceId:void 0})).text};Promise.resolve(e.unsubscribe(i(t),n)).catch((e=>{this.#S("error",`Action unsubscribe failed: ${JSON.stringify(t)} - ${e?.message??e} ${e?.stack}`)}))}}if(!n||n.disabled)this.#x.delete(e);else{this.#x.set(e,n);const t=this.#I.get(n.actionId);if(t?.subscribe){const e={parseVariablesInString:async t=>(await this.#w({text:t,controlId:n.controlId,actionInstanceId:n.id,feedbackInstanceId:void 0})).text};Promise.resolve(t.subscribe(i(n),e)).catch((t=>{this.#S("error",`Action subscribe failed: ${JSON.stringify(n)} - ${t?.message??t} ${t?.stack}`)}))}}}}async handleLearnAction(t){const e=this.#I.get(t.action.actionId);if(e&&e.learn){const n={parseVariablesInString:async e=>(await this.#w({text:e,controlId:t.action.controlId,actionInstanceId:t.action.id,feedbackInstanceId:void 0})).text};return{options:await e.learn({id:t.action.id,actionId:t.action.actionId,controlId:t.action.controlId,options:t.action.options,surfaceId:void 0,_deviceId:void 0,_page:t.action.page,_bank:t.action.bank},n)}}return{options:void 0}}setActionDefinitions(t){const e=[];this.#I.clear();for(const[n,i]of Object.entries(t))i&&(e.push({id:n,name:i.name,description:i.description,options:(0,r.serializeIsVisibleFn)(i.options),hasLearn:!!i.learn}),this.#I.set(n,i));this.#T({actions:e})}_getAllActions(){return Array.from(this.#x.values()).map((t=>({id:t.id,actionId:t.actionId,controlId:t.controlId,options:t.options})))}subscribeActions(t){let e=Array.from(this.#x.values());const n=new Set(t);n.size&&(e=e.filter((t=>n.has(t.actionId))));for(const t of e){const e=this.#I.get(t.actionId);if(e?.subscribe){const n={parseVariablesInString:async e=>(await this.#w({text:e,controlId:t.controlId,actionInstanceId:t.id,feedbackInstanceId:void 0})).text};Promise.resolve(e.subscribe(i(t),n)).catch((e=>{this.#S("error",`Action subscribe failed: ${JSON.stringify(t)} - ${e?.message??e} ${e?.stack}`)}))}}}unsubscribeActions(t){let e=Array.from(this.#x.values());const n=new Set(t);n.size&&(e=e.filter((t=>n.has(t.actionId))));for(const t of e){const e=this.#I.get(t.actionId);if(e&&e.unsubscribe){const n={parseVariablesInString:async e=>(await this.#w({text:e,controlId:t.controlId,actionInstanceId:t.id,feedbackInstanceId:void 0})).text};Promise.resolve(e.unsubscribe(i(t),n)).catch((e=>{this.#S("error",`Action unsubscribe failed: ${JSON.stringify(t)} - ${e?.message??e} ${e?.stack}`)}))}}}}},2557:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isInstanceBaseProps=e.serializeIsVisibleFn=void 0,e.serializeIsVisibleFn=function(t){return t.map((t=>"isVisible"in t&&"function"==typeof t.isVisible?{...t,isVisibleFn:t.isVisible.toString(),isVisible:void 0}:{...t,isVisibleFn:void 0}))},e.isInstanceBaseProps=function(t){const e=t;return"object"==typeof e&&"string"==typeof e.id&&!0===e._isInstanceBaseProps}},7550:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FeedbackManager=void 0;const r=n(6066),i=n(2557),s=r.__importDefault(n(7319));function o(t,e){return{type:t,id:e.id,feedbackId:e.feedbackId,controlId:e.controlId,options:e.options}}e.FeedbackManager=class{#w;#O;#D;#S;#N=new Map;#C=new Map;#k=new Map;#A=new Map;#R;get parseVariablesContext(){return this.#R}constructor(t,e,n,r){this.#w=t,this.#O=e,this.#D=n,this.#S=r}getDefinitionIds(){return Array.from(this.#N.keys())}getInstanceIds(){return Array.from(this.#C.keys())}handleUpdateFeedbacks(t){for(const[e,n]of Object.entries(t)){const t=this.#C.get(e);if(t){const e=this.#N.get(t.feedbackId);if(e?.unsubscribe){const n={parseVariablesInString:async e=>(await this.#w({text:e,controlId:t.controlId,actionInstanceId:void 0,feedbackInstanceId:t.id})).text};Promise.resolve(e.unsubscribe(o(e.type,t),n)).catch((e=>{this.#S("error",`Feedback unsubscribe failed: ${JSON.stringify(t)} - ${e?.message??e} ${e?.stack}`)}))}}if(!n||n.disabled)this.#C.delete(e);else{this.#C.set(e,{...n,referencedVariables:null});const t=this.#N.get(n.feedbackId);if(t?.subscribe){const e={parseVariablesInString:async t=>(await this.#w({text:t,controlId:n.controlId,actionInstanceId:void 0,feedbackInstanceId:n.id})).text};Promise.resolve(t.subscribe(o(t.type,n),e)).catch((t=>{this.#S("error",`Feedback subscribe failed: ${JSON.stringify(n)} - ${t?.message??t} ${t?.stack}`)}))}this.#P(e)}}}async handleLearnFeedback(t){const e=this.#N.get(t.feedback.feedbackId);if(e&&e.learn){const n={parseVariablesInString:async e=>(await this.#w({text:e,controlId:t.feedback.controlId,actionInstanceId:void 0,feedbackInstanceId:t.feedback.id})).text};return{options:await e.learn({id:t.feedback.id,feedbackId:t.feedback.feedbackId,controlId:t.feedback.controlId,options:t.feedback.options,type:e.type},n)}}return{options:void 0}}handleVariablesChanged(t){if(!t.variablesIds.length)return;const e=new Set(t.variablesIds);for(const e of this.#A.values())for(const n of t.variablesIds)e.changedVariables.add(n);const n=new Set;for(const t of this.#C.values())if(!this.#A.has(t.id)&&t.referencedVariables)for(const r of t.referencedVariables)if(e.has(r)){n.add(t.id);break}for(const t of n)setImmediate((()=>{this.#P(t)}))}#P(t){const e=this.#A.get(t);if(e)return void(e.needsRecheck=!0);const n=this.#C.get(t);if(!n)return;const r=n,i={needsRecheck:!1,changedVariables:new Set};this.#A.set(t,i),Promise.resolve().then((async()=>{const e=this.#N.get(r.feedbackId);let n;const i=new Set;if(e){this.#R=`Feedback ${r.feedbackId} (${t})`;const s={parseVariablesInString:async e=>{const n=await this.#w({text:e,controlId:r.controlId,actionInstanceId:void 0,feedbackInstanceId:t});if(n.variableIds&&n.variableIds.length)for(const t of n.variableIds)i.add(t);return n.text}};n="boolean"===e.type?e.callback({...o("boolean",r),type:"boolean",_rawBank:r.rawBank},s):e.callback({...o("advanced",r),type:"advanced",image:r.image,_page:r.page,_bank:r.bank,_rawBank:r.rawBank},s),this.#R=void 0}const s=await n;this.#k.set(t,{id:t,controlId:r.controlId,value:s}),this.#U(),r.referencedVariables=i.size>0?Array.from(i):null})).catch((t=>{console.error(`Feedback check failed: ${JSON.stringify(r)} - ${t?.message??t} ${t?.stack}`)})).finally((()=>{this.#R=void 0,this.#A.delete(t);let e=!1;if(r.referencedVariables)for(const t of r.referencedVariables)if(i.changedVariables.has(t)){e=!0;break}(e||i.needsRecheck)&&setImmediate((()=>{this.#P(t)}))}))}#U=(0,s.default)((()=>{const t=this.#k;this.#k=new Map,t.size>0&&this.#O({values:Array.from(t.values())})}),{wait:5,maxWait:25});setFeedbackDefinitions(t){const e=[];this.#N.clear();for(const[n,r]of Object.entries(t))r&&(e.push({id:n,name:r.name,description:r.description,options:(0,i.serializeIsVisibleFn)(r.options),type:r.type,defaultStyle:"defaultStyle"in r?r.defaultStyle:void 0,hasLearn:!!r.learn}),this.#N.set(n,r));this.#D({feedbacks:e})}checkFeedbacks(t){const e=new Set(t);for(const[t,n]of this.#C.entries())this.#N.get(n.feedbackId)&&(0===e.size||e.has(n.feedbackId))&&this.#P(t)}checkFeedbacksById(t){for(const e of t)this.#P(e)}_getAllFeedbacks(){return Array.from(this.#C.values()).map((t=>({id:t.id,feedbackId:t.feedbackId,controlId:t.controlId,options:t.options})))}subscribeFeedbacks(t){let e=Array.from(this.#C.values());const n=new Set(t);n.size&&(e=e.filter((t=>n.has(t.feedbackId))));for(const t of e){const e=this.#N.get(t.feedbackId);if(e?.subscribe){const n={parseVariablesInString:async e=>(await this.#w({text:e,controlId:t.controlId,actionInstanceId:void 0,feedbackInstanceId:t.id})).text};Promise.resolve(e.subscribe(o(e.type,t),n)).catch((e=>{this.#S("error",`Feedback subscribe failed: ${JSON.stringify(t)} - ${e?.message??e} ${e?.stack}`)}))}}}unsubscribeFeedbacks(t){let e=Array.from(this.#C.values());const n=new Set(t);n.size&&(e=e.filter((t=>n.has(t.feedbackId))));for(const t of e){const e=this.#N.get(t.feedbackId);if(e&&e.unsubscribe){const n={parseVariablesInString:async e=>(await this.#w({text:e,controlId:t.controlId,actionInstanceId:void 0,feedbackInstanceId:t.id})).text};Promise.resolve(e.unsubscribe(o(e.type,t),n)).catch((e=>{this.#S("error",`Feedback unsubscribe failed: ${JSON.stringify(t)} - ${e?.message??e} ${e?.stack}`)}))}}}}},1806:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.runThroughUpgradeScripts=void 0;const r=n(2068);function i(t){return JSON.parse(JSON.stringify(t))}e.runThroughUpgradeScripts=function(t,e,n,s,o,a){const c=new Map,u=t=>{let e=c.get(t);return e||(e={actions:[],feedbacks:[],config:!1},c.set(t,e)),e};for(const e of Object.values(t)){const t=e?.upgradeIndex??n;e&&"number"==typeof t&&u(t).actions.push(e.id)}for(const t of Object.values(e)){const e=t?.upgradeIndex??n;t&&"number"==typeof e&&u(e).feedbacks.push(t.id)}if(!a)for(let t=n??-1;t0){const a=Array.from(c.keys()).sort(),u=Math.min(...a,n??-1)+1,h=[],f=[],_=s.length;for(let n=u;n<_;n++){const a=c.get(n-1);a&&(h.push(...a.actions),f.push(...a.feedbacks));const u=!!a?.config;if(!u&&0===h.length&&0===f.length)continue;const _=d??o,m=(0,s[n])({currentConfig:i(_)},{config:u?_:null,actions:h.map((e=>{const n=t[e];if(n)return(0,r.literal)({id:n.id,controlId:n.controlId,actionId:n.actionId,options:void 0!==n.options?i(n.options):{}})})).filter((t=>!!t)),feedbacks:f.map((t=>{const n=e[t];if(n)return(0,r.literal)({id:n.id,controlId:n.controlId,feedbackId:n.feedbackId,options:void 0!==n.options?i(n.options):{}})})).filter((t=>!!t))});u&&m.updatedConfig&&(d=m.updatedConfig);for(const e of m.updatedActions)if(e){const n=t[e.id];n&&(n.actionId=e.actionId,n.options=e.options,p[e.id]=n)}for(const t of m.updatedFeedbacks)if(t){const n=e[t.id];n&&(n.feedbackId=t.feedbackId,n.options=t.options,l[t.id]={...n,style:l[t.id]?.style??t.style})}}for(const[e,n]of Object.entries(t))p[e]||"number"!=typeof n?.upgradeIndex||(p[e]=n);for(const[t,n]of Object.entries(e))l[t]||"number"!=typeof n?.upgradeIndex||(l[t]=n)}return{updatedActions:p,updatedFeedbacks:l,updatedConfig:d}}},7517:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.validateManifest=void 0;const r=n(6066).__importDefault(n(4618));e.validateManifest=function(t){if(!(0,r.default)(t)){const t=r.default.errors;if(!t)throw new Error("Manifest failed validation with unknown reason");throw new Error(`Manifest validation failed: ${JSON.stringify(t)}`)}}},8322:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},5203:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.InstanceBase=void 0;const r=n(6066),i=n(2068),s=r.__importDefault(n(5860)),o=n(2557),a=n(1806),c=n(7550),u=n(8221),l=n(4391);e.InstanceBase=class{#j;#M;id;#F=new s.default({concurrency:1});#B=!1;#L=!1;#$={};#G;#q;#Y=new Map;#V=new Map;#n;#H;get instanceOptions(){return this.#n}get label(){return this.#H}constructor(t){if(!(0,o.isInstanceBaseProps)(t)||!t._isInstanceBaseProps)throw new Error("Module instance is being constructed incorrectly. Make sure you aren't trying to do this manually");this.#n={disableVariableValidation:!1},this.#j=new u.IpcWrapper({init:this._handleInit.bind(this),destroy:this._handleDestroy.bind(this),updateConfigAndLabel:this._handleConfigUpdateAndLabel.bind(this),updateConfig:async()=>{},executeAction:this._handleExecuteAction.bind(this),updateFeedbacks:this._handleUpdateFeedbacks.bind(this),updateActions:this._handleUpdateActions.bind(this),getConfigFields:this._handleGetConfigFields.bind(this),handleHttpRequest:this._handleHttpRequest.bind(this),learnAction:this._handleLearnAction.bind(this),learnFeedback:this._handleLearnFeedback.bind(this),startStopRecordActions:this._handleStartStopRecordActions.bind(this),variablesChanged:this._handleVariablesChanged.bind(this)},(t=>{process.send(t)}),5e3),process.on("message",(t=>{this.#j.receivedMessage(t)})),this.#G=new l.ActionManager((async t=>this.#j.sendWithCb("parseVariablesInString",t)),(t=>this.#j.sendWithNoCb("setActionDefinitions",t)),this.log.bind(this)),this.#q=new c.FeedbackManager((async t=>this.#j.sendWithCb("parseVariablesInString",t)),(t=>this.#j.sendWithNoCb("updateFeedbackValues",t)),(t=>this.#j.sendWithNoCb("setFeedbackDefinitions",t)),this.log.bind(this)),this.#M=t.upgradeScripts,this.id=t.id,this.#H=t.id,this.log("debug","Initializing")}async _handleInit(t){return this.#F.add((async()=>{if(this.#B)throw new Error("Already initialized");const e=t.actions,n=t.feedbacks;if(this.#$=t.config,this.#H=t.label,t.isFirstInit){const e={},n=this.getConfigFields();for(const t of n)"default"in t&&(e[t.id]=t.default);this.#$=e,this.saveConfig(this.#$),t.lastUpgradeIndex=this.#M.length-1}const{updatedActions:r,updatedFeedbacks:i,updatedConfig:s}=(0,a.runThroughUpgradeScripts)(e,n,t.lastUpgradeIndex,this.#M,this.#$,!1);this.#$=s??this.#$;const o=this.#j.sendWithCb("upgradedItems",{updatedActions:r,updatedFeedbacks:i});try{await this.init(this.#$,!!t.isFirstInit),this.#B=!0}catch(t){throw console.trace(`Init failed: ${t}`),t}finally{await o}return setImmediate((()=>{this._handleUpdateActions({actions:e},!0).catch((t=>{this.log("error",`Receive actions failed: ${t}`)})),this._handleUpdateFeedbacks({feedbacks:n},!0).catch((t=>{this.log("error",`Receive feedbacks failed: ${t}`)}))})),{hasHttpHandler:"function"==typeof this.handleHttpRequest,hasRecordActionsHandler:"function"==typeof this.handleStartStopRecordActions,newUpgradeIndex:this.#M.length-1,updatedConfig:this.#$}}))}async _handleDestroy(){await this.#F.add((async()=>{if(!this.#B)throw new Error("Not initialized");await this.destroy(),this.#B=!1}))}async _handleConfigUpdateAndLabel(t){await this.#F.add((async()=>{if(!this.#B)throw new Error("Not initialized");this.#H=t.label,this.#$=t.config,await this.configUpdated(this.#$)}))}async _handleExecuteAction(t){return this.#G.handleExecuteAction(t)}async _handleUpdateFeedbacks(t,e){if(!e){const e=(0,a.runThroughUpgradeScripts)({},t.feedbacks,null,this.#M,this.#$,!0);this.#j.sendWithCb("upgradedItems",{updatedActions:e.updatedActions,updatedFeedbacks:e.updatedFeedbacks}).catch((t=>{this.log("error",`Failed to save upgraded feedbacks: ${t}`)}))}this.#q.handleUpdateFeedbacks(t.feedbacks)}async _handleUpdateActions(t,e){if(!e){const e=(0,a.runThroughUpgradeScripts)(t.actions,{},null,this.#M,this.#$,!0);this.#j.sendWithCb("upgradedItems",{updatedActions:e.updatedActions,updatedFeedbacks:e.updatedFeedbacks}).catch((t=>{this.log("error",`Failed to save upgraded actions: ${t}`)}))}this.#G.handleUpdateActions(t.actions)}async _handleGetConfigFields(t){return{fields:(0,o.serializeIsVisibleFn)(this.getConfigFields())}}async _handleHttpRequest(t){if(!this.handleHttpRequest)throw new Error("handleHttpRequest is not supported!");return{response:await this.handleHttpRequest(t.request)}}async _handleLearnAction(t){return this.#G.handleLearnAction(t)}async _handleLearnFeedback(t){return this.#q.handleLearnFeedback(t)}async _handleStartStopRecordActions(t){if(t.recording){if(this.#L)return}else if(!this.#L)return;if(!this.handleStartStopRecordActions)throw this.#L=!1,new Error("Recording actions is not supported by this module!");this.#L=t.recording,this.handleStartStopRecordActions(this.#L)}async _handleVariablesChanged(t){this.#q.handleVariablesChanged(t)}saveConfig(t){this.#$=t,this.#j.sendWithNoCb("saveConfig",{config:t})}setActionDefinitions(t){this.#G.setActionDefinitions(t)}setFeedbackDefinitions(t){this.#q.setFeedbackDefinitions(t)}setPresetDefinitions(t){const e=[];for(const[n,r]of Object.entries(t))r&&e.push({...r,id:n});this.#j.sendWithNoCb("setPresetDefinitions",{presets:e})}setVariableDefinitions(t){const e=[];this.#Y.clear();for(const n of t)e.push({id:n.variableId,name:n.name}),this.#Y.set(n.variableId,n),this.#V.has(n.variableId)||this.#V.set(n.variableId,"");if(!this.#n.disableVariableValidation){const t=new Set(this.#Y.keys());for(const e of this.#V.keys())t.has(e)||this.#V.delete(e)}this.#j.sendWithNoCb("setVariableDefinitions",{variables:e})}setVariableValues(t){const e=[];for(const[n,r]of Object.entries(t))this.#n.disableVariableValidation?(void 0===r?this.#V.delete(n):this.#V.set(n,r),e.push({id:n,value:r})):this.#Y.has(n)?(this.#V.set(n,r??""),e.push({id:n,value:r??""})):e.push({id:n,value:void 0});this.#j.sendWithNoCb("setVariableValues",{newValues:e})}getVariableValue(t){return this.#V.get(t)}async parseVariablesInString(t){const e=this.#q.parseVariablesContext;return e&&this.log("debug",`parseVariablesInString called while in: ${e}. You should use the parseVariablesInString provided to the callback instead`),(await this.#j.sendWithCb("parseVariablesInString",{text:t,controlId:void 0,actionInstanceId:void 0,feedbackInstanceId:void 0})).text}checkFeedbacks(...t){this.#q.checkFeedbacks(t)}checkFeedbacksById(...t){this.#q.checkFeedbacksById(t)}_getAllActions(){return this.#G._getAllActions()}subscribeActions(...t){this.#G.subscribeActions(t)}unsubscribeActions(...t){this.#G.unsubscribeActions(t)}_getAllFeedbacks(){return this.#q._getAllFeedbacks()}subscribeFeedbacks(...t){this.#q.subscribeFeedbacks(t)}unsubscribeFeedbacks(...t){this.#q.unsubscribeFeedbacks(t)}recordAction(t,e){if(!this.#L)throw new Error("Not currently recording actions");this.#j.sendWithNoCb("recordAction",{uniquenessId:e??null,actionId:t.actionId,options:t.options})}setCustomVariableValue(t,e){this.#j.sendWithNoCb("setCustomVariable",{customVariableId:t,value:e})}oscSend(t,e,n,r){this.#j.sendWithNoCb("send-osc",(0,i.literal)({host:t,port:e,path:n,args:r}))}updateStatus(t,e){this.#j.sendWithNoCb("set-status",(0,i.literal)({status:t,message:e??null}))}log(t,e){this.#j.sendWithNoCb("log-message",(0,i.literal)({level:t,message:e}))}}},9051:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},609:(t,e)=>{"use strict";var n,r;Object.defineProperty(e,"__esModule",{value:!0}),e.Regex=e.InstanceStatus=void 0,(r=e.InstanceStatus||(e.InstanceStatus={})).Ok="ok",r.Connecting="connecting",r.Disconnected="disconnected",r.ConnectionFailure="connection_failure",r.BadConfig="bad_config",r.UnknownError="unknown_error",r.UnknownWarning="unknown_warning",(n=e.Regex||(e.Regex={})).IP="/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/",n.HOSTNAME="/^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9])$/",n.BOOLEAN="/^(true|false|0|1)$/i",n.PORT="/^([1-9]|[1-8][0-9]|9[0-9]|[1-8][0-9]{2}|9[0-8][0-9]|99[0-9]|[1-8][0-9]{3}|9[0-8][0-9]{2}|99[0-8][0-9]|999[0-9]|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-4])$/",n.PERCENT="/^(100|[0-9]|[0-9][0-9])$/",n.FLOAT="/^([0-9]*\\.)?[0-9]+$/",n.SIGNED_FLOAT="/^[+-]?([0-9]*\\.)?[0-9]+$/",n.FLOAT_OR_INT="/^([0-9]+)(\\.[0-9]+)?$/",n.NUMBER="/^\\d+$/",n.SIGNED_NUMBER="/^[+-]?\\d+$/",n.SOMETHING="/^.+$/",n.TIMECODE="/^(0*[0-9]|1[0-9]|2[0-4]):(0*[0-9]|[1-5][0-9]|60):(0*[0-9]|[1-5][0-9]|60):(0*[0-9]|[12][0-9]|30)$/"},4334:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},2490:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},4911:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(6066);r.__exportStar(n(8322),e),r.__exportStar(n(5203),e),r.__exportStar(n(9051),e),r.__exportStar(n(609),e),r.__exportStar(n(4334),e),r.__exportStar(n(2490),e),r.__exportStar(n(3646),e),r.__exportStar(n(3558),e),r.__exportStar(n(4788),e),r.__exportStar(n(521),e),r.__exportStar(n(6870),e)},3646:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},3558:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},4788:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},521:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CreateConvertToBooleanFeedbackUpgradeScript=e.EmptyUpgradeScript=void 0,e.EmptyUpgradeScript=()=>({updatedConfig:null,updatedActions:[],updatedFeedbacks:[]}),e.CreateConvertToBooleanFeedbackUpgradeScript=function(t){return(e,n)=>{const r=[];for(const e of n.feedbacks){let n=t[e.feedbackId];if(!0===n&&(n={bg:"bgcolor",bgcolor:"bgcolor",fg:"color",color:"color",png64:"png64",png:"png64"}),n){e.style||(e.style={});for(const[t,i]of Object.entries(n))void 0!==e.options[t]&&(e.style[i]=e.options[t],delete e.options[t],r.push(e))}}return{updatedConfig:null,updatedActions:[],updatedFeedbacks:r}}}},6870:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},2068:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.splitRgb=e.combineRgb=e.assertNever=e.literal=void 0,e.literal=function(t){return t},e.assertNever=function(t){},e.combineRgb=function(t,e,n){return(255&t)<<16|(255&e)<<8|255&n},e.splitRgb=function(t){return{r:(16711680&t)>>16,g:(65280&t)>>8,b:255&t}}},4618:(t,e,n)=>{"use strict";t.exports=s,t.exports.default=s;const r={$schema:"http://json-schema.org/draft-07/schema#",type:"object",title:"ModuleManifest",properties:{id:{type:"string",description:"Unique identifier for the module"},name:{type:"string",description:"Name of the module"},shortname:{type:"string"},description:{type:"string",description:"Description of the module "},version:{type:"string",description:"Current version of the module"},license:{type:"string",description:"SPDX identifier for license of the module"},repository:{type:"string",description:"URL to the source repository"},bugs:{type:"string",description:"URL to bug tracker"},maintainers:{type:"array",description:"List of active maintiners",uniqueItems:!0,items:{type:"object",title:"ModuleManifestMaintainer",properties:{name:{type:"string"},email:{type:"string"},github:{type:"string"}},required:["name"]}},legacyIds:{type:"array",description:"If the module had a different unique identifier previously, then specify it here",uniqueItems:!0,items:{type:"string"}},runtime:{type:"object",title:"ModuleManifestRuntime",description:"Information on how to execute the module",properties:{type:{type:"string",description:"Type of the module. Must be: node18"},api:{type:"string",description:"Which host-api does it use. In the future alternate options will be allowed",enum:["nodejs-ipc"]},apiVersion:{type:"string",description:"The version of the host-api used"},entrypoint:{type:"string",description:"Entrypoint to pass to the runtime. eg index.js"}},required:["type","api","apiVersion","entrypoint"]},manufacturer:{type:"string"},products:{type:"array",uniqueItems:!0,items:{type:"string"}},keywords:{type:"array",uniqueItems:!0,items:{type:"string"}}},required:["id","name","shortname","description","version","license","repository","bugs","maintainers","legacyIds","runtime","manufacturer","products","keywords"]},i=n(7056).Z;function s(t,{instancePath:e="",parentData:n,parentDataProperty:o,rootData:a=t}={}){if(!t||"object"!=typeof t||Array.isArray(t))return s.errors=[{instancePath:e,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;{let n;if(void 0===t.id&&(n="id")||void 0===t.name&&(n="name")||void 0===t.shortname&&(n="shortname")||void 0===t.description&&(n="description")||void 0===t.version&&(n="version")||void 0===t.license&&(n="license")||void 0===t.repository&&(n="repository")||void 0===t.bugs&&(n="bugs")||void 0===t.maintainers&&(n="maintainers")||void 0===t.legacyIds&&(n="legacyIds")||void 0===t.runtime&&(n="runtime")||void 0===t.manufacturer&&(n="manufacturer")||void 0===t.products&&(n="products")||void 0===t.keywords&&(n="keywords"))return s.errors=[{instancePath:e,schemaPath:"#/required",keyword:"required",params:{missingProperty:n},message:"must have required property '"+n+"'"}],!1;if(void 0!==t.id){const n=0;if("string"!=typeof t.id)return s.errors=[{instancePath:e+"/id",schemaPath:"#/properties/id/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var c=0===n}else c=!0;if(c){if(void 0!==t.name){const n=0;if("string"!=typeof t.name)return s.errors=[{instancePath:e+"/name",schemaPath:"#/properties/name/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;c=0===n}else c=!0;if(c){if(void 0!==t.shortname){const n=0;if("string"!=typeof t.shortname)return s.errors=[{instancePath:e+"/shortname",schemaPath:"#/properties/shortname/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;c=0===n}else c=!0;if(c){if(void 0!==t.description){const n=0;if("string"!=typeof t.description)return s.errors=[{instancePath:e+"/description",schemaPath:"#/properties/description/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;c=0===n}else c=!0;if(c){if(void 0!==t.version){const n=0;if("string"!=typeof t.version)return s.errors=[{instancePath:e+"/version",schemaPath:"#/properties/version/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;c=0===n}else c=!0;if(c){if(void 0!==t.license){const n=0;if("string"!=typeof t.license)return s.errors=[{instancePath:e+"/license",schemaPath:"#/properties/license/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;c=0===n}else c=!0;if(c){if(void 0!==t.repository){const n=0;if("string"!=typeof t.repository)return s.errors=[{instancePath:e+"/repository",schemaPath:"#/properties/repository/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;c=0===n}else c=!0;if(c){if(void 0!==t.bugs){const n=0;if("string"!=typeof t.bugs)return s.errors=[{instancePath:e+"/bugs",schemaPath:"#/properties/bugs/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;c=0===n}else c=!0;if(c){if(void 0!==t.maintainers){let n=t.maintainers;const r=0;if(0===r){if(!Array.isArray(n))return s.errors=[{instancePath:e+"/maintainers",schemaPath:"#/properties/maintainers/type",keyword:"type",params:{type:"array"},message:"must be array"}],!1;{var u=!0;const t=n.length;for(let r=0;r1)for(;r--;)for(t=r;t--;)if(i(n[r],n[t]))return s.errors=[{instancePath:e+"/maintainers",schemaPath:"#/properties/maintainers/uniqueItems",keyword:"uniqueItems",params:{i:r,j:t},message:"must NOT have duplicate items (items ## "+t+" and "+r+" are identical)"}],!1}}}c=0===r}else c=!0;if(c){if(void 0!==t.legacyIds){let n=t.legacyIds;const r=0;if(0===r){if(!Array.isArray(n))return s.errors=[{instancePath:e+"/legacyIds",schemaPath:"#/properties/legacyIds/type",keyword:"type",params:{type:"array"},message:"must be array"}],!1;{var p=!0;const t=n.length;for(let r=0;r1){const i={};for(;r--;){let o=n[r];if("string"==typeof o){if("number"==typeof i[o])return t=i[o],s.errors=[{instancePath:e+"/legacyIds",schemaPath:"#/properties/legacyIds/uniqueItems",keyword:"uniqueItems",params:{i:r,j:t},message:"must NOT have duplicate items (items ## "+t+" and "+r+" are identical)"}],!1;i[o]=r}}}}}}c=0===r}else c=!0;if(c){if(void 0!==t.runtime){let n=t.runtime;const i=0;if(0===i){if(!n||"object"!=typeof n||Array.isArray(n))return s.errors=[{instancePath:e+"/runtime",schemaPath:"#/properties/runtime/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;{let t;if(void 0===n.type&&(t="type")||void 0===n.api&&(t="api")||void 0===n.apiVersion&&(t="apiVersion")||void 0===n.entrypoint&&(t="entrypoint"))return s.errors=[{instancePath:e+"/runtime",schemaPath:"#/properties/runtime/required",keyword:"required",params:{missingProperty:t},message:"must have required property '"+t+"'"}],!1;if(void 0!==n.type){const t=0;if("string"!=typeof n.type)return s.errors=[{instancePath:e+"/runtime/type",schemaPath:"#/properties/runtime/properties/type/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var d=0===t}else d=!0;if(d){if(void 0!==n.api){let t=n.api;const i=0;if("string"!=typeof t)return s.errors=[{instancePath:e+"/runtime/api",schemaPath:"#/properties/runtime/properties/api/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if("nodejs-ipc"!==t)return s.errors=[{instancePath:e+"/runtime/api",schemaPath:"#/properties/runtime/properties/api/enum",keyword:"enum",params:{allowedValues:r.properties.runtime.properties.api.enum},message:"must be equal to one of the allowed values"}],!1;d=0===i}else d=!0;if(d){if(void 0!==n.apiVersion){const t=0;if("string"!=typeof n.apiVersion)return s.errors=[{instancePath:e+"/runtime/apiVersion",schemaPath:"#/properties/runtime/properties/apiVersion/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;d=0===t}else d=!0;if(d)if(void 0!==n.entrypoint){const t=0;if("string"!=typeof n.entrypoint)return s.errors=[{instancePath:e+"/runtime/entrypoint",schemaPath:"#/properties/runtime/properties/entrypoint/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;d=0===t}else d=!0}}}}c=0===i}else c=!0;if(c){if(void 0!==t.manufacturer){const n=0;if("string"!=typeof t.manufacturer)return s.errors=[{instancePath:e+"/manufacturer",schemaPath:"#/properties/manufacturer/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;c=0===n}else c=!0;if(c){if(void 0!==t.products){let n=t.products;const r=0;if(0===r){if(!Array.isArray(n))return s.errors=[{instancePath:e+"/products",schemaPath:"#/properties/products/type",keyword:"type",params:{type:"array"},message:"must be array"}],!1;{var h=!0;const t=n.length;for(let r=0;r1){const i={};for(;r--;){let o=n[r];if("string"==typeof o){if("number"==typeof i[o])return t=i[o],s.errors=[{instancePath:e+"/products",schemaPath:"#/properties/products/uniqueItems",keyword:"uniqueItems",params:{i:r,j:t},message:"must NOT have duplicate items (items ## "+t+" and "+r+" are identical)"}],!1;i[o]=r}}}}}}c=0===r}else c=!0;if(c)if(void 0!==t.keywords){let n=t.keywords;const r=0;if(0===r){if(!Array.isArray(n))return s.errors=[{instancePath:e+"/keywords",schemaPath:"#/properties/keywords/type",keyword:"type",params:{type:"array"},message:"must be array"}],!1;{var f=!0;const t=n.length;for(let r=0;r1){const i={};for(;r--;){let o=n[r];if("string"==typeof o){if("number"==typeof i[o])return t=i[o],s.errors=[{instancePath:e+"/keywords",schemaPath:"#/properties/keywords/uniqueItems",keyword:"uniqueItems",params:{i:r,j:t},message:"must NOT have duplicate items (items ## "+t+" and "+r+" are identical)"}],!1;i[o]=r}}}}}}c=0===r}else c=!0}}}}}}}}}}}}}return s.errors=null,!0}},4300:(t,e,n)=>{let r,i,s=n(6113),{urlAlphabet:o}=n(3792),a=t=>{!r||r.lengthr.length&&(s.randomFillSync(r),i=0),i+=t},c=t=>(a(t-=0),r.subarray(i-t,i)),u=(t,e,n)=>{let r=(2<<31-Math.clz32(t.length-1|1))-1,i=Math.ceil(1.6*r*e/t.length);return(s=e)=>{let o="";for(;;){let e=n(i),a=i;for(;a--;)if(o+=t[e[a]&r]||"",o.length===s)return o}}};t.exports={nanoid:(t=21)=>{a(t-=0);let e="";for(let n=i-t;nu(t,e,c),customRandom:u,urlAlphabet:o,random:c}},3792:t=>{t.exports={urlAlphabet:"useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"}},6066:(t,e,n)=>{"use strict";n.r(e),n.d(e,{__addDisposableResource:()=>P,__assign:()=>s,__asyncDelegator:()=>I,__asyncGenerator:()=>S,__asyncValues:()=>x,__await:()=>T,__awaiter:()=>f,__classPrivateFieldGet:()=>k,__classPrivateFieldIn:()=>R,__classPrivateFieldSet:()=>A,__createBinding:()=>m,__decorate:()=>a,__disposeResources:()=>j,__esDecorate:()=>u,__exportStar:()=>g,__extends:()=>i,__generator:()=>_,__importDefault:()=>C,__importStar:()=>N,__makeTemplateObject:()=>O,__metadata:()=>h,__param:()=>c,__propKey:()=>p,__read:()=>b,__rest:()=>o,__runInitializers:()=>l,__setFunctionName:()=>d,__spread:()=>v,__spreadArray:()=>w,__spreadArrays:()=>E,__values:()=>y,default:()=>M});var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)};function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var s=function(){return s=Object.assign||function(t){for(var e,n=1,r=arguments.length;n=0;a--)(i=t[a])&&(o=(s<3?i(o):s>3?i(e,n,o):i(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o}function c(t,e){return function(n,r){e(n,r,t)}}function u(t,e,n,r,i,s){function o(t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("Function expected");return t}for(var a,c=r.kind,u="getter"===c?"get":"setter"===c?"set":"value",l=!e&&t?r.static?t:t.prototype:null,p=e||(l?Object.getOwnPropertyDescriptor(l,r.name):{}),d=!1,h=n.length-1;h>=0;h--){var f={};for(var _ in r)f[_]="access"===_?{}:r[_];for(var _ in r.access)f.access[_]=r.access[_];f.addInitializer=function(t){if(d)throw new TypeError("Cannot add initializers after decoration has completed");s.push(o(t||null))};var m=(0,n[h])("accessor"===c?{get:p.get,set:p.set}:p[u],f);if("accessor"===c){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(a=o(m.get))&&(p.get=a),(a=o(m.set))&&(p.set=a),(a=o(m.init))&&i.unshift(a)}else(a=o(m))&&("field"===c?i.unshift(a):p[u]=a)}l&&Object.defineProperty(l,r.name,p),d=!0}function l(t,e,n){for(var r=arguments.length>2,i=0;i0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function b(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,s=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=s.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=s.return)&&n.call(s)}finally{if(i)throw i.error}}return o}function v(){for(var t=[],e=0;e1||a(t,e)}))})}function a(t,e){try{(n=i[t](e)).value instanceof T?Promise.resolve(n.value.v).then(c,u):l(s[0][2],n)}catch(t){l(s[0][3],t)}var n}function c(t){a("next",t)}function u(t){a("throw",t)}function l(t,e){t(e),s.shift(),s.length&&a(s[0][0],s[0][1])}}function I(t){var e,n;return e={},r("next"),r("throw",(function(t){throw t})),r("return"),e[Symbol.iterator]=function(){return this},e;function r(r,i){e[r]=t[r]?function(e){return(n=!n)?{value:T(t[r](e)),done:!1}:i?i(e):e}:i}}function x(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t=y(t),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);function r(n){e[n]=t[n]&&function(e){return new Promise((function(r,i){!function(t,e,n,r){Promise.resolve(r).then((function(e){t({value:e,done:n})}),e)}(r,i,(e=t[n](e)).done,e.value)}))}}}function O(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}var D=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};function N(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&m(e,t,n);return D(e,t),e}function C(t){return t&&t.__esModule?t:{default:t}}function k(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t)}function A(t,e,n,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?i.call(t,n):i?i.value=n:e.set(t,n),n}function R(t,e){if(null===e||"object"!=typeof e&&"function"!=typeof e)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof t?e===t:t.has(e)}function P(t,e,n){if(null!=e){if("object"!=typeof e)throw new TypeError("Object expected.");var r;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");r=e[Symbol.asyncDispose]}if(void 0===r){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");r=e[Symbol.dispose]}if("function"!=typeof r)throw new TypeError("Object not disposable.");t.stack.push({value:e,dispose:r,async:n})}else n&&t.stack.push({async:!0});return e}var U="function"==typeof SuppressedError?SuppressedError:function(t,e,n){var r=new Error(n);return r.name="SuppressedError",r.error=t,r.suppressed=e,r};function j(t){function e(e){t.error=t.hasError?new U(e,t.error,"An error was suppressed during disposal."):e,t.hasError=!0}return function n(){for(;t.stack.length;){var r=t.stack.pop();try{var i=r.dispose&&r.dispose.call(r.value);if(r.async)return Promise.resolve(i).then(n,(function(t){return e(t),n()}))}catch(t){e(t)}}if(t.hasError)throw t.error}()}const M={__extends:i,__assign:s,__rest:o,__decorate:a,__param:c,__metadata:h,__awaiter:f,__generator:_,__createBinding:m,__exportStar:g,__values:y,__read:b,__spread:v,__spreadArrays:E,__spreadArray:w,__await:T,__asyncGenerator:S,__asyncDelegator:I,__asyncValues:x,__makeTemplateObject:O,__importStar:N,__importDefault:C,__classPrivateFieldGet:k,__classPrivateFieldSet:A,__classPrivateFieldIn:R,__addDisposableResource:P,__disposeResources:j}}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={id:r,loaded:!1,exports:{}};return t[r].call(s.exports,s,s.exports,n),s.loaded=!0,s.exports}n.c=e,n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.hmd=t=>((t=Object.create(t)).children||(t.children=[]),Object.defineProperty(t,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+t.id)}}),t),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n(n.s=6010)})(); \ No newline at end of file diff --git a/sony-bravia/package.json b/sony-bravia/package.json index 2234901a..a091173a 100644 --- a/sony-bravia/package.json +++ b/sony-bravia/package.json @@ -1 +1 @@ -{"name":"sony-bravia","version":"2.0.1","license":"MIT","type":"commonjs","dependencies":{}} \ No newline at end of file +{"name":"sony-bravia","version":"2.0.2","license":"MIT","type":"commonjs","dependencies":{}} \ No newline at end of file