@forge/util 4.0.0-next.2 → 4.0.1-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @forge/util
|
|
2
2
|
|
|
3
|
+
## 4.0.1-next.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 68fb732: Export `@forge/util` modules so that ES modules can import them by name.
|
|
8
|
+
|
|
9
|
+
## 4.0.0
|
|
10
|
+
|
|
11
|
+
### Major Changes
|
|
12
|
+
|
|
13
|
+
- 3b8f390: Bundle both ARI and analytics with webpack and expose only the names used by the
|
|
14
|
+
Forge CLI, CLI-shared, and tunnel packages. Preserve the existing import subpaths
|
|
15
|
+
and keep ARI declarations for workspace development only; exclude declarations
|
|
16
|
+
from publication and remove unused upstream exports.
|
|
17
|
+
|
|
18
|
+
### Minor Changes
|
|
19
|
+
|
|
20
|
+
- e865360: Bump @forge/util with latest aris and dependencies
|
|
21
|
+
- aabae59: Preparation for the new `forge deploy status` command, which shows the placement deployment status of an app version in an environment
|
|
22
|
+
|
|
3
23
|
## 4.0.0-next.2
|
|
4
24
|
|
|
5
25
|
### Minor Changes
|
package/package.json
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see index.js.LICENSE.txt */
|
|
2
|
-
(()=>{var t={543(t,n,e){"use strict";const{FetchHTTPClient:r}=e(721);class i{constructor(t,n,e,r){this.success=t,this.statusCode=n,this.message=e,this.eventResponseList=r}}class o{constructor(t,n,e){this.messageId=t,this.results=n,this.segmentEvent=e}}class u{static toAnalyticsResponse(t,n,e){const r=JSON.parse(JSON.stringify(t.batch)),u=[],[s,a,c]=[e.success,n.status,n.statusText];if(a>=200&&a<=299){const t=JSON.parse(JSON.stringify(e));return"validationReports"in t&&t.validationReports.forEach(t=>{const n=r.find(n=>n.messageId===t.messageId);n&&u.push(new o(n.messageId,t.results,n))}),new i(s,a,c,u)}if(a>=400&&a<=499){const t=JSON.parse(JSON.stringify(e)).message,n="error"in t?t.error:c;return r.forEach(t=>{u.push(new o(t.messageId,[],t))}),new i(s,a,n,u)}return r.forEach(t=>{u.push(new o(t.messageId,[],t))}),new i(s,a,c,u)}}t.exports={AnalyticsFetchHTTPClient:class extends r{constructor(t,n){super(),this.httpClient="function"==typeof t?new r(t):null!=t?t:new r,this.analyticsClient=n}async makeRequest(t){const n=this.httpClient.makeRequest(t),e=await n;if(429===e.status)return n;const r=this.analyticsClient.getResponseCallback();if(null!==r){const n=await e.clone().json();r(u.toAnalyticsResponse(t.data,e,n))}return n}}}},776(t,n,e){"use strict";const r=e(250),{Analytics:i}=e(721),{AnalyticsFetchHTTPClient:o}=e(543),{requireValue:u,validateTrackEvent:s,validateTraitEvent:a,validateUIEvent:c,validateScreenEvent:l,validateOperationalEvent:f,validateAliasType:p,validateGroupType:h}=e(644),d="prod";function v(t,n,e){if(e)throw Error("baseUrl must be specified when interacting with IC environments.");return function(t){return t&&"fedramp-moderate"===t}(n)?t===d?"https://as.atlassian-us-gov-mod.com/api":"https://as.staging.atl-paas-us-gov-mod.net/api":t===d?"https://as.atlassian.com/api":"https://as.staging.atl-paas.net/api"}function g(t,n){return void 0===t?n:t}class y{static callback(t){const n=t.statusCode;n>=200&&n<=299?0===t.eventResponseList.length?console.debug("Event(s) submitted to GASv3"):t.eventResponseList.forEach(t=>{console.warn("Validation report for event with message ID %s:\n",t.messageId,JSON.stringify(t,null,2))}):400===n||404===n?(console.warn("GASv3 submission failed with HTTP Status Code %d: %s",t.statusCode,t.message),t.eventResponseList.forEach(t=>{console.warn("Event with message ID %s:\n",t.messageId,JSON.stringify(t,null,2))})):(console.info("GASv3 submission failed with HTTP Status Code %d: %s",t.statusCode,t.message),t.eventResponseList.forEach(t=>{console.debug("Event with message ID %s:\n",t.messageId,JSON.stringify(t,null,2))}))}}class _{static _buildProperties({userIdType:t,tenantIdType:n,tenantId:e,event:i,subproduct:o,product:u,env:s,datacenter:a,version:c,origin:l,orgId:f,workspaceId:p,aliases:h,groups:d,ic:v},g){return r.merge({},i,{product:u,env:s,datacenter:a,version:c,eventType:g,subproduct:o,userIdType:t,tenantIdType:n,tenantId:e,origin:l,orgId:f,workspaceId:p,aliases:h,groups:d,ic:v})}constructor({env:t,product:n,subproduct:e,sendEventHook:r,datacenter:s,version:a,origin:c,maxEventsInBatch:l,flushInterval:f,baseUrl:p,logger:h,errorHandler:_,perimeter:m,httpClient:b,httpRequestTimeout:I,maxRetries:w,ic:T}){u(t,"env"),u(n,"product"),this.console=g(h,console),this.config={env:t,product:n,subproduct:e,sendEventHook:r,datacenter:s,origin:g(c,"server"),version:a,ic:T},this.validationMode=function(t){return t===d?"quiet":"complete"}(t),this.responseCallback=y.callback,this.analyticsClient=new i({writeKey:"BLANK",flushAt:l||250,flushInterval:f||1e4,maxRetries:w||3,host:p||v(t,m,T),path:"/api/v1/batch",httpRequestTimeout:I,httpClient:new o(b,this)}),_&&"function"==typeof _&&this.analyticsClient.on("error",_),this.groups=void 0,this.aliases=void 0}_getTimeoutMilliseconds(t){const n=g(t,6e4);return n<5e3?(this.console.warn("timeoutMilliseconds was set less than the allowed minimum of 5000.\n Using the minimum allowed value instead."),5e3):n}_eventCallback(t){this.config.sendEventHook&&this.config.sendEventHook(t)}_buildCompleteTrackEvent({userIdType:t,userId:n,anonymousId:e,tenantIdType:i,tenantId:o,trackEvent:u,subproduct:s,product:a,os:c,timestamp:l,orgId:f,workspaceId:p,groups:h,validationMode:d}){const v=r.merge({},this.groups,h);return{userId:n,anonymousId:e,event:u.actionSubject+" "+u.action,properties:_._buildProperties({userIdType:t,tenantIdType:i,tenantId:o,event:u,subproduct:g(s,this.config.subproduct),product:g(a,this.config.product),env:this.config.env,ic:this.config.ic,datacenter:this.config.datacenter,version:this.config.version,origin:g(u.origin,this.config.origin),orgId:f,workspaceId:p,aliases:this.aliases,groups:r.isEmpty(v)?void 0:v},"track"),timestamp:l,context:{os:c,validationMode:null!=d?d:this.validationMode}}}_buildCompleteTraitEvent({entityType:t,entityId:n,entityTraits:e,os:r,timestamp:i,tenantId:o,tenantIdType:u,validationMode:s}){return{anonymousId:"dummy-id",traits:{entityId:n,entityTraits:e,entityType:t},timestamp:i,context:{os:r,validationMode:null!=s?s:this.validationMode},tenantId:o,tenantIdType:u}}_buildCompleteOperationalEvent({userIdType:t,userId:n,anonymousId:e,tenantIdType:r,tenantId:i,operationalEvent:o,subproduct:u,product:s,os:a,timestamp:c,orgId:l,workspaceId:f,validationMode:p}){return{userId:n,anonymousId:e,event:o.actionSubject+" "+o.action,properties:_._buildProperties({userIdType:t,tenantIdType:r,tenantId:i,event:o,subproduct:g(u,this.config.subproduct),product:g(s,this.config.product),env:this.config.env,ic:this.config.ic,datacenter:this.config.datacenter,version:this.config.version,origin:g(o.origin,this.config.origin),orgId:l,workspaceId:f,aliases:this.aliases,groups:this.groups},"operational"),timestamp:c,context:{os:a,validationMode:null!=p?p:this.validationMode}}}_buildCompleteUIEvent({userIdType:t,userId:n,anonymousId:e,tenantIdType:r,tenantId:i,uiEvent:o,subproduct:u,product:s,os:a,timestamp:c,orgId:l,workspaceId:f,validationMode:p}){return{userId:n,anonymousId:e,event:o.actionSubject+" "+o.action,properties:_._buildProperties({userIdType:t,tenantIdType:r,tenantId:i,event:o,subproduct:g(u,this.config.subproduct),product:g(s,this.config.product),env:this.config.env,ic:this.config.ic,datacenter:this.config.datacenter,version:this.config.version,origin:g(o.origin,this.config.origin),orgId:l,workspaceId:f,aliases:this.aliases,groups:this.groups},"ui"),timestamp:c,context:{os:a,validationMode:null!=p?p:this.validationMode}}}_buildScreenEvent({userIdType:t,userId:n,anonymousId:e,tenantIdType:r,tenantId:i,name:o,screenEvent:u,subproduct:s,product:a,os:c,timestamp:l,orgId:f,workspaceId:p,validationMode:h}){return{userId:n,anonymousId:e,name:o,properties:_._buildProperties({userIdType:t,tenantIdType:r,tenantId:i,event:u,subproduct:g(s,this.config.subproduct),product:g(a,this.config.product),env:this.config.env,ic:this.config.ic,datacenter:this.config.datacenter,version:this.config.version,origin:g(u.origin,this.config.origin),orgId:f,workspaceId:p,aliases:this.aliases,groups:this.groups},"screen"),timestamp:l,context:{os:c,validationMode:null!=h?h:this.validationMode}}}sendOperationalEvent({userIdType:t,userId:n,anonymousId:e,tenantIdType:r,tenantId:i,operationalEvent:o,subproduct:u,product:s,os:a,timestamp:c,orgId:l,workspaceId:p,validationMode:h}){return f({userIdType:t,userId:n,anonymousId:e,tenantIdType:r,tenantId:i,timestamp:c,operationalEvent:o}).then(()=>new Promise((f,d)=>{const v=this._buildCompleteOperationalEvent({userIdType:t,userId:n,anonymousId:e,tenantIdType:r,tenantId:i,operationalEvent:o,subproduct:u,product:s,os:a,timestamp:c,orgId:l,workspaceId:p,validationMode:h});this.analyticsClient.track(v,(t,n)=>{t?d(t):(this._eventCallback(v,n),f(n))})}))}sendTrackEvent({userIdType:t,userId:n,anonymousId:e,tenantIdType:r,tenantId:i,trackEvent:o,groups:u,subproduct:a,product:c,os:l,timestamp:f,orgId:p,workspaceId:h,validationMode:d}){return s({userIdType:t,userId:n,anonymousId:e,tenantIdType:r,tenantId:i,timestamp:f,trackEvent:o,groups:u}).then(()=>new Promise((s,v)=>{const g=this._buildCompleteTrackEvent({userIdType:t,userId:n,anonymousId:e,tenantIdType:r,tenantId:i,trackEvent:o,subproduct:a,product:c,os:l,timestamp:f,orgId:p,workspaceId:h,groups:u,validationMode:d});this.analyticsClient.track(g,(t,n)=>{t?v(t):(this._eventCallback(g,n),s(n))})}))}sendTraitEvent({entityType:t,entityId:n,entityTraits:e,os:r,timestamp:i,tenantId:o,tenantIdType:u,validationMode:s}){return a({entityType:t,entityId:n,entityTraits:e,timestamp:i,tenantId:o,tenantIdType:u}).then(()=>new Promise((a,c)=>{const l=this._buildCompleteTraitEvent({entityType:t,entityId:n,entityTraits:e,os:r,timestamp:i,tenantId:o,tenantIdType:u,validationMode:s});this.analyticsClient.identify(l,(t,n)=>{t?c(t):(this._eventCallback(l,n),a(n))})}))}sendUIEvent({userIdType:t,userId:n,anonymousId:e,tenantIdType:r,tenantId:i,uiEvent:o,subproduct:u,product:s,os:a,timestamp:l,orgId:f,workspaceId:p,validationMode:h}){return c({userIdType:t,userId:n,anonymousId:e,tenantIdType:r,tenantId:i,timestamp:l,uiEvent:o}).then(()=>new Promise((c,d)=>{const v=this._buildCompleteUIEvent({userIdType:t,userId:n,anonymousId:e,tenantIdType:r,tenantId:i,uiEvent:o,subproduct:u,product:s,os:a,timestamp:l,orgId:f,workspaceId:p,validationMode:h});this.analyticsClient.track(v,(t,n)=>{t?d(t):(this._eventCallback(v,n),c(n))})}))}sendScreenEvent({userIdType:t,userId:n,anonymousId:e,tenantIdType:r,tenantId:i,name:o,screenEvent:u,subproduct:s,product:a,os:c,timestamp:f,orgId:p,workspaceId:h,validationMode:d}){return l({userIdType:t,userId:n,anonymousId:e,tenantIdType:r,tenantId:i,name:o,timestamp:f,screenEvent:u}).then(()=>new Promise((l,v)=>{const g=this._buildScreenEvent({userIdType:t,userId:n,anonymousId:e,tenantIdType:r,tenantId:i,name:o,screenEvent:u,subproduct:s,product:a,os:c,timestamp:f,orgId:p,workspaceId:h,validationMode:d});this.analyticsClient.page(g,(t,n)=>{t?v(t):(this._eventCallback(g,n),l(n))})}))}gracefulShutdown(){return new Promise((t,n)=>{this.analyticsClient.closeAndFlush().then(n=>{t(n)}).catch(t=>{n(t)})})}setGroup(t,n){this.groups||(this.groups={}),h(t),this.groups[t]=n}clearGroups(){this.groups=void 0}setAlias(t,n){this.aliases||(this.aliases={}),p(t),this.aliases[t]=n}clearAliases(){this.aliases=void 0}setResponseCallback(t){this.responseCallback=t}getResponseCallback(){return this.responseCallback}setEventValidationMode(t){this.validationMode=t}}t.exports={AnalyticsClient:_}},378(t){"use strict";const n={};t.exports={isAllowedAliasType:function(t){return Object.values(n).includes(t)},ALIAS_TYPE:n}},60(t){"use strict";const n="id",e="type",r=[n,e],i=[n];t.exports={CONTAINER_OBJECT_FIELDS_ALLOWED:r,CONTAINER_OBJECT_FIELDS_MANDATORY:i,CONTAINER_OBJECT_FIELD_ID:n,CONTAINER_OBJECT_FIELD_TYPE:e,isAllowedContainerObjectField:function(t){return r.some(n=>n===t)},isValidContainerObjectField:function(t,n){return r.some(n=>n===t)&&"string"==typeof n}}},435(t,n,e){"use strict";const r=e(250),i="AJS_ANONYMOUS_USER",o="ATLASSIAN_ACCOUNT",u="EMAIL_UUID",s="SITE",a="SITE_USER",c="TRELLO_USER",l="TRELLO_WORKSPACE",f=[i,o,u,"ORG",s,a,c,l];t.exports={AJS_ANONYMOUS_USER:i,ATLASSIAN_ACCOUNT:o,EMAIL_UUID:u,ORG:"ORG",SITE:s,SITE_USER:a,TRELLO_USER:c,TRELLO_WORKSPACE:l,isValidEntityType:function(t){return f.includes(t)},isValidEntityTraitValue:function(t){return r.isFinite(t)||r.isString(t)&&!r.isEmpty(t)||r.isDate(t)||r.isBoolean(t)}}},159(t){"use strict";const n={TRANSACTION_ACCOUNT_ID:"transactionAccountId",PRODUCT_INTEGRATIONS_VENDOR_ID:"productIntegrationsVendorId"};t.exports={isAllowedGroupType:function(t){return Object.values(n).includes(t)},GROUP_TYPE:n}},350(t){"use strict";const n="cloudId",e="halpTeamId",r="loomOrgId",i="trelloWorkspaceId",o="none",u=[n,e,r,i,o];t.exports={CLOUD_ID:n,HALP_TEAM_ID:e,NONE:o,LOOM_ORG_ID:r,TRELLO_WORKSPACE_ID:i,isValidTenantType:function(t){return u.includes(t)}}},119(t){"use strict";const n="atlassianAccount",e="trello",r="hashedEmail",i="opsgenie",o="halp",u="customerAccount",s="loom";t.exports={ATLASSIAN_ACCOUNT:n,TRELLO:e,HASHED_EMAIL:r,OPSGENIE:i,HALP:o,CUSTOMER_ACCOUNT:u,LOOM:s,isValidUserIdType:function(t){return[n,e,r,i,o,u,s].includes(t)}}},823(t,n,e){"use strict";const{AnalyticsClient:r}=e(776),i=e(350),o=e(119),u=e(435),{GROUP_TYPE:s}=e(159),{ALIAS_TYPE:a}=e(378);t.exports={analyticsClient:function(t){return new r(t)},AnalyticsClient:r,tenantTypes:i,userTypes:o,entityTypes:u,aliasTypes:a,groupTypes:s}},644(t,n,e){"use strict";const r=e(250),i=e(350),o=e(119),u=e(435),{CONTAINER_OBJECT_FIELDS_MANDATORY:s,isAllowedContainerObjectField:a,isValidContainerObjectField:c}=e(60),{isPlainObject:l}=e(370),{isAllowedAliasType:f}=e(378),{isAllowedGroupType:p}=e(159),h="properties.containers";function d({entityType:t,entityTraits:n}){if(!u.isValidEntityType(t))throw new Error(`Unknown entityType ${t}`);if(!r.isObject(n))throw new Error("traits.entityTraits should be Object");r.forEach(n,(t,n)=>{if(!u.isValidEntityTraitValue(t))throw new Error(`entityTraits.${n}: ${t} should be one of [String|Number|Boolean|Date]`)})}function v({tenantId:t,tenantIdType:n}){if(t&&y(n,"tenantIdType"),n){if(!i.isValidTenantType(n))throw new Error(`Unknown tenantIdType ${n}`);n!==i.NONE&&y(t,"tenantId")}}function g({userIdType:t,userId:n,anonymousId:e}){if(function({userIdType:t,userId:n}){if(n&&y(t,"userIdType"),t){if(!o.isValidUserIdType(t))throw new Error(`Unknown userIdType ${t}`);y(n,"userId")}}({userIdType:t,userId:n}),!n&&!e)throw new Error("At least one set of identifiers must be passed - userIdType and userId, or anonymousId")}function y(t,n){if(!t)throw new Error(`Value ${n} cannot be undefined`);return t}function _(t){if(t&&t.containers){const n=t.containers;if(!l(n))throw new Error(`"${h}" is not an object.`);{const e={};Object.keys(n).forEach(t=>{e[t]=function(t,n){const e=n[t];if(e){if(l(e)){const t={};return r.merge(t,function(t){const n={};return s.forEach(e=>{const r=t[e];if(!c(e,r))throw new Error(`Mandatory ContainerObject field "${e}" is not valid: "${r}" ; expected a value of type "string"`);n[e]=r}),n}(e)),r.merge(t,function(t){const n={};return Object.keys(t).forEach(e=>{const r=t[e];if(a(e)){if(!c(e,r))throw new Error(`ContainerObject field "${e}" is not valid: "${r}" ; expected a value of type "string"`);n[e]=r}}),n}(e)),t}throw new Error(`ContainerObject "${h}.${t}" is not an object.`)}throw new Error(`Container Key "${h}.${t}" has no ContainerObject.`)}(t,n)}),t.containers=e}}}t.exports={requireValue:y,validateOperationalEvent:function({userIdType:t,userId:n,anonymousId:e,tenantIdType:r,tenantId:i,operationalEvent:o}){try{return g({userIdType:t,userId:n,anonymousId:e}),v({tenantId:i,tenantIdType:r}),y(o,"operationalEvent"),y(o.source,"operationalEvent.source"),y(o.action,"operationalEvent.action"),y(o.actionSubject,"operationalEvent.actionSubject"),_(o),Promise.resolve()}catch(t){return Promise.reject(t)}},validateTrackEvent:function({userIdType:t,userId:n,anonymousId:e,tenantIdType:r,tenantId:i,trackEvent:o,groups:u}){try{return g({userIdType:t,userId:n,anonymousId:e}),v({tenantId:i,tenantIdType:r}),y(o,"trackEvent"),y(o.source,"trackEvent.source"),y(o.action,"trackEvent.action"),y(o.actionSubject,"trackEvent.actionSubject"),_(o),function(t){t&&Object.keys(t).forEach(t=>{if(!p(t))throw new Error(`groups object has unsupported groupKey: ${t}`)})}(u),Promise.resolve()}catch(t){return Promise.reject(t)}},validateUIEvent:function({userIdType:t,userId:n,anonymousId:e,tenantIdType:r,tenantId:i,uiEvent:o}){try{return g({userIdType:t,userId:n,anonymousId:e}),v({tenantId:i,tenantIdType:r}),y(o,"uiEvent"),y(o.action,"uiEvent.action"),y(o.actionSubject,"uiEvent.actionSubject"),_(o),Promise.resolve()}catch(t){return Promise.reject(t)}},validateScreenEvent:function({userIdType:t,userId:n,anonymousId:e,tenantIdType:r,tenantId:i,name:o,screenEvent:u}){try{return g({userIdType:t,userId:n,anonymousId:e}),v({tenantId:i,tenantIdType:r}),y(o,"name"),y(u,"screenEvent"),y(u.platform,"screenEvent.platform"),_(u),Promise.resolve()}catch(t){return Promise.reject(t)}},validateTraitEvent:function({entityType:t,entityId:n,entityTraits:e,tenantId:r,tenantIdType:i}){try{return y(t,"entityType"),y(n,"entityId"),y(e,"entityTraits"),d({entityType:t,entityTraits:e}),v({tenantId:r,tenantIdType:i}),Promise.resolve()}catch(t){return Promise.reject(t)}},requireValidEntityData:d,requireValidUserData:g,requireValidTenantData:v,requireValidContainers:_,validateAliasType:function(t){if(y(t,"aliasType"),!f(t))throw new Error(`Unknown aliasType ${t}`)},validateGroupType:function(t){if(y(t,"groupType"),!p(t))throw new Error(`Unknown groupType ${t}`)},CONTAINERS_PATH_PREFIX:h}},370(t){"use strict";function n(t){return 1==(null!==(n=t)&&"object"==typeof n&&!1===Array.isArray(n))&&"[object Object]"===Object.prototype.toString.call(t);var n}t.exports={isPlainObject:function(t){if(!1===n(t))return!1;const e=t.constructor;if("function"!=typeof e)return!1;const r=e.prototype;return!1!==n(r)&&!1!==Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")}}},721(t,n,e){"use strict";function r(t,n){return new Promise(function(e,r){var i=setTimeout(function(){r(Error("Promise timed out"))},n);t.then(function(t){return clearTimeout(i),e(t)}).catch(r)})}function i(t,n,e){var i;return(i=e,new Promise(function(t){return setTimeout(t,i)})).then(function(){return r(function(){try{return Promise.resolve(n(t))}catch(t){return Promise.reject(t)}}(),1e3)}).catch(function(n){null==t||t.log("warn","Callback Error",{error:n}),null==t||t.stats.increment("callback_error")}).then(function(){return t})}e.d(n,{Analytics:()=>tt,FetchHTTPClient:()=>Q});var o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)};function u(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}var s=function(){return s=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var i in n=arguments[e])Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i]);return t},s.apply(this,arguments)};function a(t,n,e,r){return new(e||(e=Promise))(function(i,o){function u(t){try{a(r.next(t))}catch(t){o(t)}}function s(t){try{a(r.throw(t))}catch(t){o(t)}}function a(t){var n;t.done?i(t.value):(n=t.value,n instanceof e?n:new e(function(t){t(n)})).then(u,s)}a((r=r.apply(t,n||[])).next())})}function c(t,n){var e,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},u=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return u.next=s(0),u.throw=s(1),u.return=s(2),"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function s(s){return function(a){return function(s){if(e)throw new TypeError("Generator is already executing.");for(;u&&(u=0,s[0]&&(o=0)),o;)try{if(e=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=n.call(t,o)}catch(t){s=[6,t],r=0}finally{e=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}}function l(t,n,e){if(e||2===arguments.length)for(var r,i=0,o=n.length;i<o;i++)!r&&i in n||(r||(r=Array.prototype.slice.call(n,0,i)),r[i]=n[i]);return t.concat(r||Array.prototype.slice.call(n))}Object.create,Object.create;var f=function(t){function n(n,e){var r=t.call(this,"".concat(n," ").concat(e))||this;return r.field=n,r}return u(n,t),n}(Error);function p(t){var n=Math.random()+1,e=t.minTimeout,r=void 0===e?500:e,i=t.factor,o=void 0===i?2:i,u=t.attempt,s=t.maxTimeout,a=void 0===s?1/0:s;return Math.min(n*r*Math.pow(o,u),a)}for(var h,d=256,v=[];d--;)v[d]=(d+256).toString(16).substring(1);function g(){var t,n=0,e="";if(!h||d+16>256){for(h=Array(n=256);n--;)h[n]=256*Math.random()|0;n=d=0}for(;n<16;n++)t=h[d+n],e+=6==n?v[15&t|64]:8==n?v[63&t|128]:v[t],1&n&&n>1&&n<11&&(e+="-");return d++,e}class y{constructor(t){this.id=g(),this.items=[],this.sizeInBytes=0,this.maxEventCount=Math.max(1,t)}tryAdd(t){if(this.length===this.maxEventCount)return{success:!1,message:`Event limit of ${this.maxEventCount} has been exceeded.`};const n=this.calculateSize(t.context);return n>32768?{success:!1,message:"Event exceeds maximum event size of 32 KB"}:this.sizeInBytes+n>491520?{success:!1,message:"Event has caused batch size to exceed 480 KB"}:(this.items.push(t),this.sizeInBytes+=n,{success:!0})}get length(){return this.items.length}calculateSize(t){return encodeURI(JSON.stringify(t.event)).split(/%..|i/).length}getEvents(){return this.items.map(({context:t})=>t.event)}getContexts(){return this.items.map(t=>t.context)}resolveEvents(){this.items.forEach(({resolver:t,context:n})=>t(n))}}const _=require("buffer");function m(t){return new Promise(n=>setTimeout(n,t))}function b(){}class I{constructor({host:t,path:n,maxRetries:e,flushAt:r,flushInterval:i,writeKey:o,httpRequestTimeout:u,httpClient:s,disable:a},c){var l;this._emitter=c,this._maxRetries=e,this._flushAt=Math.max(r,1),this._flushInterval=i,this._auth=(l=`${o}:`,_.Buffer.from(l).toString("base64")),this._url=((t,n)=>new URL(n||"",t).href.replace(/\/$/,""))(t??"https://api.segment.io",n??"/v1/batch"),this._httpRequestTimeout=u??1e4,this._disable=Boolean(a),this._httpClient=s}createBatch(){this.pendingFlushTimeout&&clearTimeout(this.pendingFlushTimeout);const t=new y(this._flushAt);return this._batch=t,this.pendingFlushTimeout=setTimeout(()=>{t===this._batch&&(this._batch=void 0),this.pendingFlushTimeout=void 0,t.length&&this.send(t).catch(b)},this._flushInterval),t}clearBatch(){this.pendingFlushTimeout&&clearTimeout(this.pendingFlushTimeout),this._batch=void 0}flush(t){t&&(this._flushPendingItemsCount=t,this._batch&&this._batch.length===t&&(this.send(this._batch).catch(b),this.clearBatch()))}enqueue(t){const n=this._batch??this.createBatch(),{promise:e,resolve:r}=function(){var t,n,e=new Promise(function(e,r){t=e,n=r});return{resolve:t,reject:n,promise:e}}(),i={context:t,resolver:r};if(n.tryAdd(i).success){const t=n.length===this._flushPendingItemsCount;return(n.length===this._flushAt||t)&&(this.send(n).catch(b),this.clearBatch()),e}n.length&&(this.send(n).catch(b),this.clearBatch());const o=this.createBatch(),u=o.tryAdd(i);return u.success?(o.length===this._flushPendingItemsCount&&(this.send(o).catch(b),this.clearBatch()),e):(t.setFailedDelivery({reason:new Error(u.message)}),Promise.resolve(t))}async send(t){this._flushPendingItemsCount&&(this._flushPendingItemsCount-=t.length);const n=t.getEvents(),e=this._maxRetries+1;let r=0;for(;r<e;){let i;r++;try{if(this._disable)return t.resolveEvents();const e={url:this._url,method:"POST",headers:{"Content-Type":"application/json",Authorization:`Basic ${this._auth}`,"User-Agent":"analytics-node-next/latest"},data:{batch:n,sentAt:new Date},httpRequestTimeout:this._httpRequestTimeout};this._emitter.emit("http_request",{body:e.data,method:e.method,url:e.url,headers:e.headers});const r=await this._httpClient.makeRequest(e);if(r.status>=200&&r.status<300)return void t.resolveEvents();if(400===r.status)return void w(t,new Error(`[${r.status}] ${r.statusText}`));i=new Error(`[${r.status}] ${r.statusText}`)}catch(t){i=t}if(r===e)return void w(t,i);await m(p({attempt:r,minTimeout:25,maxTimeout:1e3}))}}}function w(t,n){t.getContexts().forEach(t=>t.setFailedDelivery({reason:n})),t.resolveEvents()}const T=()=>"object"==typeof process&&process&&"object"==typeof process.env&&process.env&&"string"==typeof process.version?"node":"object"==typeof window?"browser":"undefined"!=typeof WebSocketPair?"cloudflare-worker":"string"==typeof EdgeRuntime?"vercel-edge":"undefined"!=typeof WorkerGlobalScope&&"function"==typeof importScripts?"web-worker":"unknown";function E(t){function n(n){return function(t){t.updateEvent("context.library.name","@segment/analytics-node"),t.updateEvent("context.library.version","1.3.0");const n=T();"node"===n&&t.updateEvent("_metadata.nodeVersion",process.version),t.updateEvent("_metadata.jsRuntime",n)}(n),t.enqueue(n)}return{name:"Segment.io",type:"destination",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),alias:n,group:n,identify:n,page:n,screen:n,track:n}}function x(t,n,e){n.split&&(n=n.split("."));for(var r,i,o=0,u=n.length,s=t;o<u&&"__proto__"!=(i=""+n[o++])&&"constructor"!==i&&"prototype"!==i;)s=s[i]=o===u?e:typeof(r=s[i])==typeof n?r:0*n[o]!=0||~(""+n[o]).indexOf(".")?{}:[]}function A(t){return"string"==typeof t}function O(t){return null!=t}function j(t){return"object"===Object.prototype.toString.call(t).slice(8,-1).toLowerCase()}var k="is not a string",C="is not an object",S="is nil";var R=function(){function t(t){this.user=t.user,this.createMessageId=t.createMessageId}return t.prototype.track=function(t,n,e,r){return this.normalize(s(s({},this.baseEvent()),{event:t,type:"track",properties:null!=n?n:{},options:s({},e),integrations:s({},r)}))},t.prototype.page=function(t,n,e,r,i){var o,u={type:"page",properties:s({},e),options:s({},r),integrations:s({},i)};return null!==t&&(u.category=t,u.properties=null!==(o=u.properties)&&void 0!==o?o:{},u.properties.category=t),null!==n&&(u.name=n),this.normalize(s(s({},this.baseEvent()),u))},t.prototype.screen=function(t,n,e,r,i){var o={type:"screen",properties:s({},e),options:s({},r),integrations:s({},i)};return null!==t&&(o.category=t),null!==n&&(o.name=n),this.normalize(s(s({},this.baseEvent()),o))},t.prototype.identify=function(t,n,e,r){return this.normalize(s(s({},this.baseEvent()),{type:"identify",userId:t,traits:null!=n?n:{},options:s({},e),integrations:r}))},t.prototype.group=function(t,n,e,r){return this.normalize(s(s({},this.baseEvent()),{type:"group",traits:null!=n?n:{},options:s({},e),integrations:s({},r),groupId:t}))},t.prototype.alias=function(t,n,e,r){var i={userId:t,type:"alias",options:s({},e),integrations:s({},r)};return null!==n&&(i.previousId=n),void 0===t?this.normalize(s(s({},i),this.baseEvent())):this.normalize(s(s({},this.baseEvent()),i))},t.prototype.baseEvent=function(){var t={integrations:{},options:{}};if(!this.user)return t;var n=this.user;return n.id()&&(t.userId=n.id()),n.anonymousId()&&(t.anonymousId=n.anonymousId()),t},t.prototype.context=function(t){var n,e=["userId","anonymousId","timestamp"];delete t.integrations;var r=Object.keys(t),i=null!==(n=t.context)&&void 0!==n?n:{},o={};return r.forEach(function(n){"context"!==n&&(e.includes(n)?x(o,n,t[n]):x(i,n,t[n]))}),[i,o]},t.prototype.normalize=function(t){var n,e,r,i,o=Object.keys(null!==(n=t.integrations)&&void 0!==n?n:{}).reduce(function(n,e){var r,i;return s(s({},n),((r={})[e]=Boolean(null===(i=t.integrations)||void 0===i?void 0:i[e]),r))},{});t.options=(r=t.options||{},i=function(t,n){return void 0!==n},Object.keys(r).filter(function(t){return i(0,r[t])}).reduce(function(t,n){return t[n]=r[n],t},{}));var u=s(s({},o),null===(e=t.options)||void 0===e?void 0:e.integrations),a=t.options?this.context(t.options):[],c=a[0],l=a[1],p=(t.options,function(t,n){var e={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&n.indexOf(r)<0&&(e[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)n.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(e[r[i]]=t[r[i]])}return e}(t,["options"])),h=s(s(s({timestamp:new Date},p),{integrations:u,context:c}),l),d=s(s({},h),{messageId:this.createMessageId()});return function(t){!function(t){if(!O(t))throw new f("Event",S);if("object"!=typeof t)throw new f("Event",C)}(t),function(t){if(!A(t.type))throw new f(".type",k)}(t),"track"===t.type&&(function(t){if(!A(t.event))throw new f(".event",k)}(t),function(t){if(!j(t.properties))throw new f(".properties",C)}(t)),["group","identify"].includes(t.type)&&function(t){if(!j(t.traits))throw new f(".traits",C)}(t),function(t){var n=".userId/anonymousId/previousId/groupId",e=function(t){var n,e,r;return null!==(r=null!==(e=null!==(n=t.userId)&&void 0!==n?n:t.anonymousId)&&void 0!==e?e:t.groupId)&&void 0!==r?r:t.previousId}(t);if(!O(e))throw new f(n,S);if(!A(e))throw new f(n,k)}(t)}(d),d},t}();const P=()=>`node-next-${Date.now()}-${g()}`;class L extends R{constructor(){super({createMessageId:P})}}var D=function(){function t(){this._logs=[]}return t.prototype.log=function(t,n,e){var r=new Date;this._logs.push({level:t,message:n,time:r,extras:e})},Object.defineProperty(t.prototype,"logs",{get:function(){return this._logs},enumerable:!1,configurable:!0}),t.prototype.flush=function(){if(this.logs.length>1){var t=this._logs.reduce(function(t,n){var e,r,i,o=s(s({},n),{json:JSON.stringify(n.extras,null," "),extras:n.extras});delete o.time;var u=null!==(i=null===(r=n.time)||void 0===r?void 0:r.toISOString())&&void 0!==i?i:"";return t[u]&&(u="".concat(u,"-").concat(Math.random())),s(s({},t),((e={})[u]=o,e))},{});console.table?console.table(t):console.log(t)}else this.logs.forEach(function(t){var n=t.level,e=t.message,r=t.extras;"info"===n||"debug"===n?console.log(e,null!=r?r:""):console[n](e,null!=r?r:"")});this._logs=[]},t}(),M=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return u(n,t),n.prototype.gauge=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n]},n.prototype.increment=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n]},n.prototype.flush=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n]},n.prototype.serialize=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return[]},n}(function(){function t(){this.metrics=[]}return t.prototype.increment=function(t,n,e){void 0===n&&(n=1),this.metrics.push({metric:t,value:n,tags:null!=e?e:[],type:"counter",timestamp:Date.now()})},t.prototype.gauge=function(t,n,e){this.metrics.push({metric:t,value:n,tags:null!=e?e:[],type:"gauge",timestamp:Date.now()})},t.prototype.flush=function(){var t=this.metrics.map(function(t){return s(s({},t),{tags:t.tags.join(",")})});console.table?console.table(t):console.log(t),this.metrics=[]},t.prototype.serialize=function(){return this.metrics.map(function(t){return{m:t.metric,v:t.value,t:t.tags,k:(n=t.type,{gauge:"g",counter:"c"}[n]),e:t.timestamp};var n})},t}()),q=function(t){var n,e,r;this.retry=null===(n=t.retry)||void 0===n||n,this.type=null!==(e=t.type)&&void 0!==e?e:"plugin Error",this.reason=null!==(r=t.reason)&&void 0!==r?r:""},N=function(){function t(t,n,e,r){void 0===n&&(n=g()),void 0===e&&(e=new M),void 0===r&&(r=new D),this.attempts=0,this.event=t,this._id=n,this.logger=r,this.stats=e}return t.system=function(){},t.prototype.isSame=function(t){return t.id===this.id},t.prototype.cancel=function(t){if(t)throw t;throw new q({reason:"Context Cancel"})},t.prototype.log=function(t,n,e){this.logger.log(t,n,e)},Object.defineProperty(t.prototype,"id",{get:function(){return this._id},enumerable:!1,configurable:!0}),t.prototype.updateEvent=function(t,n){var e;if("integrations"===t.split(".")[0]){var r=t.split(".")[1];if(!1===(null===(e=this.event.integrations)||void 0===e?void 0:e[r]))return this.event}return x(this.event,t,n),this.event},t.prototype.failedDelivery=function(){return this._failedDelivery},t.prototype.setFailedDelivery=function(t){this._failedDelivery=t},t.prototype.logs=function(){return this.logger.logs},t.prototype.flush=function(){this.logger.flush(),this.stats.flush()},t.prototype.toJSON=function(){return{id:this._id,event:this.event,logs:this.logger.logs,metrics:this.stats.metrics}},t}();class U extends N{static system(){return new this({type:"track",event:"system"})}}const z=async(t,n,e,r)=>{try{const u=new U(t),s=await function(t,n,e,r){return a(this,void 0,void 0,function(){var o,u;return c(this,function(s){switch(s.label){case 0:return e.emit("dispatch_start",t),o=Date.now(),n.isEmpty()?[4,n.dispatchSingle(t)]:[3,2];case 1:return u=s.sent(),[3,4];case 2:return[4,n.dispatch(t)];case 3:u=s.sent(),s.label=4;case 4:return(null==r?void 0:r.callback)?[4,i(u,r.callback,(a=o,c=r.timeout,l=Date.now()-a,Math.max((null!=c?c:300)-l,0)))]:[3,6];case 5:u=s.sent(),s.label=6;case 6:return(null==r?void 0:r.debug)&&u.flush(),[2,u]}var a,c,l})})}(u,n,e,{...r?{callback:(o=r,t=>{const n=t.failedDelivery();return o(n?n.reason:void 0,t)})}:{}}),l=s.failedDelivery();l?e.emit("error",{code:"delivery_failure",reason:l.reason,ctx:s}):e.emit(t.type,s)}catch(t){e.emit("error",{code:"unknown",reason:t})}var o};var F=function(){function t(t){var n;this.callbacks={},this.warned=!1,this.maxListeners=null!==(n=null==t?void 0:t.maxListeners)&&void 0!==n?n:10}return t.prototype.warnIfPossibleMemoryLeak=function(t){this.warned||this.maxListeners&&this.callbacks[t].length>this.maxListeners&&(console.warn("Event Emitter: Possible memory leak detected; ".concat(String(t)," has exceeded ").concat(this.maxListeners," listeners.")),this.warned=!0)},t.prototype.on=function(t,n){return this.callbacks[t]?(this.callbacks[t].push(n),this.warnIfPossibleMemoryLeak(t)):this.callbacks[t]=[n],this},t.prototype.once=function(t,n){var e=this,r=function(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];e.off(t,r),n.apply(e,i)};return this.on(t,r),this},t.prototype.off=function(t,n){var e,r=(null!==(e=this.callbacks[t])&&void 0!==e?e:[]).filter(function(t){return t!==n});return this.callbacks[t]=r,this},t.prototype.emit=function(t){for(var n,e=this,r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];return(null!==(n=this.callbacks[t])&&void 0!==n?n:[]).forEach(function(t){t.apply(e,r)}),this},t}();class B extends F{}var $="onRemoveFromFuture",W=function(t){function n(n,e,r){var i=t.call(this)||this;return i.future=[],i.maxAttempts=n,i.queue=e,i.seen=null!=r?r:{},i}return u(n,t),n.prototype.push=function(){for(var t=this,n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var r=n.map(function(n){return!(t.updateAttempts(n)>t.maxAttempts||t.includes(n)||(t.queue.push(n),0))});return this.queue=this.queue.sort(function(n,e){return t.getAttempts(n)-t.getAttempts(e)}),r},n.prototype.pushWithBackoff=function(t){var n=this;if(0===this.getAttempts(t))return this.push(t)[0];var e=this.updateAttempts(t);if(e>this.maxAttempts||this.includes(t))return!1;var r=p({attempt:e-1});return setTimeout(function(){n.queue.push(t),n.future=n.future.filter(function(n){return n.id!==t.id}),n.emit($)},r),this.future.push(t),!0},n.prototype.getAttempts=function(t){var n;return null!==(n=this.seen[t.id])&&void 0!==n?n:0},n.prototype.updateAttempts=function(t){return this.seen[t.id]=this.getAttempts(t)+1,this.getAttempts(t)},n.prototype.includes=function(t){return this.queue.includes(t)||this.future.includes(t)||Boolean(this.queue.find(function(n){return n.id===t.id}))||Boolean(this.future.find(function(n){return n.id===t.id}))},n.prototype.pop=function(){return this.queue.shift()},Object.defineProperty(n.prototype,"length",{get:function(){return this.queue.length},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"todo",{get:function(){return this.queue.length+this.future.length},enumerable:!1,configurable:!0}),n}(F);function V(t,n){t.log("debug","plugin",{plugin:n.name});var e=(new Date).getTime(),r=n[t.event.type];return void 0===r?Promise.resolve(t):function(){return a(this,void 0,void 0,function(){var e;return c(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,r.apply(n,[t])];case 1:return[2,i.sent()];case 2:return e=i.sent(),[2,Promise.reject(e)];case 3:return[2]}})})}().then(function(t){var r=(new Date).getTime()-e;return t.stats.gauge("plugin_time",r,["plugin:".concat(n.name)]),t}).catch(function(e){if(e instanceof q&&"middleware_cancellation"===e.type)throw e;return e instanceof q?(t.log("warn",e.type,{plugin:n.name,error:e}),e):(t.log("error","plugin Error",{plugin:n.name,error:e}),t.stats.increment("plugin_error",1,["plugin:".concat(n.name)]),e)})}function G(t,n){return V(t,n).then(function(n){if(n instanceof N)return n;t.log("debug","Context canceled"),t.stats.increment("context_canceled"),t.cancel(n)})}var J=function(t){function n(n){var e,r,i,o=t.call(this)||this;return o.criticalTasks=(i=0,{done:function(){return e},run:function(t){var n,o=t();return"object"==typeof(n=o)&&null!==n&&"then"in n&&"function"==typeof n.then&&(1===++i&&(e=new Promise(function(t){return r=t})),o.finally(function(){return 0===--i&&r()})),o}}),o.plugins=[],o.failedInitializations=[],o.flushing=!1,o.queue=n,o.queue.on($,function(){o.scheduleFlush(0)}),o}return u(n,t),n.prototype.register=function(t,n,e){return a(this,void 0,void 0,function(){var r=this;return c(this,function(i){switch(i.label){case 0:return[4,Promise.resolve(n.load(t,e)).then(function(){r.plugins.push(n)}).catch(function(e){if("destination"===n.type)return r.failedInitializations.push(n.name),console.warn(n.name,e),void t.log("warn","Failed to load destination",{plugin:n.name,error:e});throw e})];case 1:return i.sent(),[2]}})})},n.prototype.deregister=function(t,n,e){return a(this,void 0,void 0,function(){var r;return c(this,function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),n.unload?[4,Promise.resolve(n.unload(t,e))]:[3,2];case 1:i.sent(),i.label=2;case 2:return this.plugins=this.plugins.filter(function(t){return t.name!==n.name}),[3,4];case 3:return r=i.sent(),t.log("warn","Failed to unload destination",{plugin:n.name,error:r}),[3,4];case 4:return[2]}})})},n.prototype.dispatch=function(t){return a(this,void 0,void 0,function(){var n;return c(this,function(e){return t.log("debug","Dispatching"),t.stats.increment("message_dispatched"),this.queue.push(t),n=this.subscribeToDelivery(t),this.scheduleFlush(0),[2,n]})})},n.prototype.subscribeToDelivery=function(t){return a(this,void 0,void 0,function(){var n=this;return c(this,function(e){return[2,new Promise(function(e){var r=function(i,o){i.isSame(t)&&(n.off("flush",r),e(i))};n.on("flush",r)})]})})},n.prototype.dispatchSingle=function(t){return a(this,void 0,void 0,function(){var n=this;return c(this,function(e){return t.log("debug","Dispatching"),t.stats.increment("message_dispatched"),this.queue.updateAttempts(t),t.attempts=1,[2,this.deliver(t).catch(function(e){return n.enqueuRetry(e,t)?n.subscribeToDelivery(t):(t.setFailedDelivery({reason:e}),t)})]})})},n.prototype.isEmpty=function(){return 0===this.queue.length},n.prototype.scheduleFlush=function(t){var n=this;void 0===t&&(t=500),this.flushing||(this.flushing=!0,setTimeout(function(){n.flush().then(function(){setTimeout(function(){n.flushing=!1,n.queue.length&&n.scheduleFlush(0)},0)})},t))},n.prototype.deliver=function(t){return a(this,void 0,void 0,function(){var n,e,r,i;return c(this,function(o){switch(o.label){case 0:return[4,this.criticalTasks.done()];case 1:o.sent(),n=Date.now(),o.label=2;case 2:return o.trys.push([2,4,,5]),[4,this.flushOne(t)];case 3:return t=o.sent(),e=Date.now()-n,this.emit("delivery_success",t),t.stats.gauge("delivered",e),t.log("debug","Delivered",t.event),[2,t];case 4:throw r=o.sent(),i=r,t.log("error","Failed to deliver",i),this.emit("delivery_failure",t,i),t.stats.increment("delivery_failed"),r;case 5:return[2]}})})},n.prototype.enqueuRetry=function(t,n){return!(t instanceof q&&!t.retry)&&this.queue.pushWithBackoff(n)},n.prototype.flush=function(){return a(this,void 0,void 0,function(){var t,n;return c(this,function(e){switch(e.label){case 0:if(0===this.queue.length)return[2,[]];if(!(t=this.queue.pop()))return[2,[]];t.attempts=this.queue.getAttempts(t),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.deliver(t)];case 2:return t=e.sent(),this.emit("flush",t,!0),[3,4];case 3:return n=e.sent(),this.enqueuRetry(n,t)||(t.setFailedDelivery({reason:n}),this.emit("flush",t,!1)),[2,[]];case 4:return[2,[t]]}})})},n.prototype.isReady=function(){return!0},n.prototype.availableExtensions=function(t){var n,e,r=this.plugins.filter(function(n){var e,r,i;if("destination"!==n.type&&"Segment.io"!==n.name)return!0;var o=void 0;return null===(e=n.alternativeNames)||void 0===e||e.forEach(function(n){void 0!==t[n]&&(o=t[n])}),null!==(i=null!==(r=t[n.name])&&void 0!==r?r:o)&&void 0!==i?i:!1!==("Segment.io"===n.name||t.All)}),i=(n="type",e={},r.forEach(function(t){var r,i=void 0,o=t[n];void 0!==(i="string"!=typeof o?JSON.stringify(o):o)&&(e[i]=l(l([],null!==(r=e[i])&&void 0!==r?r:[],!0),[t],!1))}),e),o=i.before,u=void 0===o?[]:o,s=i.enrichment,a=void 0===s?[]:s,c=i.destination,f=void 0===c?[]:c,p=i.after;return{before:u,enrichment:a,destinations:f,after:void 0===p?[]:p}},n.prototype.flushOne=function(t){var n,e;return a(this,void 0,void 0,function(){var r,i,o,u,s,a,l,f,p,h,d,v,g,y;return c(this,function(c){switch(c.label){case 0:if(!this.isReady())throw new Error("Not ready");t.attempts>1&&this.emit("delivery_retry",t),r=this.availableExtensions(null!==(n=t.event.integrations)&&void 0!==n?n:{}),i=r.before,o=r.enrichment,u=0,s=i,c.label=1;case 1:return u<s.length?(a=s[u],[4,G(t,a)]):[3,4];case 2:(h=c.sent())instanceof N&&(t=h),this.emit("message_enriched",t,a),c.label=3;case 3:return u++,[3,1];case 4:l=0,f=o,c.label=5;case 5:return l<f.length?(p=f[l],[4,V(t,p)]):[3,8];case 6:(h=c.sent())instanceof N&&(t=h),this.emit("message_enriched",t,p),c.label=7;case 7:return l++,[3,5];case 8:return d=this.availableExtensions(null!==(e=t.event.integrations)&&void 0!==e?e:{}),v=d.destinations,g=d.after,[4,new Promise(function(n,e){setTimeout(function(){var r=v.map(function(n){return V(t,n)});Promise.all(r).then(n).catch(e)},0)})];case 9:return c.sent(),t.stats.increment("message_delivered"),this.emit("message_delivered",t),y=g.map(function(n){return V(t,n)}),[4,Promise.all(y)];case 10:return c.sent(),[2,t]}})})},n}(F);class K extends W{constructor(){super(1,[])}getAttempts(t){return t.attempts??0}updateAttempts(t){return t.attempts=this.getAttempts(t)+1,this.getAttempts(t)}}class H extends J{constructor(){super(new K)}}class Y{constructor(){this.onabort=null,this.aborted=!1,this.eventEmitter=new F}toString(){return"[object AbortSignal]"}get[Symbol.toStringTag](){return"AbortSignal"}removeEventListener(...t){this.eventEmitter.off(...t)}addEventListener(...t){this.eventEmitter.on(...t)}dispatchEvent(t){const n={type:t,target:this},e=`on${t}`;"function"==typeof this[e]&&this[e](n),this.eventEmitter.emit(t,n)}}class Z{constructor(){this.signal=new Y}abort(){this.signal.aborted||(this.signal.aborted=!0,this.signal.dispatchEvent("abort"))}toString(){return"[object AbortController]"}get[Symbol.toStringTag](){return"AbortController"}}const X=async(...t)=>{if(globalThis.fetch)return globalThis.fetch(...t);if("string"!=typeof EdgeRuntime)return(await e.e(899).then(e.bind(e,899))).default(...t);throw new Error("Invariant: an edge runtime that does not support fetch should not exist")};class Q{constructor(t){this._fetch=t??X}async makeRequest(t){const[n,e]=(t=>{if("cloudflare-worker"===T())return[];const n=new(globalThis.AbortController||Z),e=setTimeout(()=>{n.abort()},t);return e?.unref?.(),[n.signal,e]})(t.httpRequestTimeout),r={url:t.url,method:t.method,headers:t.headers,body:JSON.stringify(t.data),signal:n};return this._fetch(t.url,r).finally(()=>clearTimeout(e))}}class tt extends B{constructor(t){super(),this._isClosed=!1,this._pendingEvents=0,this._isFlushing=!1,(t=>{if(!t.writeKey)throw new f("writeKey","writeKey is missing.")})(t),this._eventFactory=new L,this._queue=new H;const n=t.flushInterval??1e4;this._closeAndFlushDefaultTimeout=1.25*n;const{plugin:e,publisher:r}=(t=>{const n=new I(t,this);return{publisher:n,plugin:E(n)}})({writeKey:t.writeKey,host:t.host,path:t.path,maxRetries:t.maxRetries??3,flushAt:t.flushAt??t.maxEventsInBatch??15,httpRequestTimeout:t.httpRequestTimeout,disable:t.disable,flushInterval:n,httpClient:"function"==typeof t.httpClient?new Q(t.httpClient):t.httpClient??new Q});this._publisher=r,this.ready=this.register(e).then(()=>{}),this.emit("initialize",t),function(t){for(var n=t.constructor.prototype,e=0,r=Object.getOwnPropertyNames(n);e<r.length;e++){var i=r[e];if("constructor"!==i){var o=Object.getOwnPropertyDescriptor(t.constructor.prototype,i);o&&"function"==typeof o.value&&(t[i]=t[i].bind(t))}}}(this)}get VERSION(){return"1.3.0"}closeAndFlush({timeout:t=this._closeAndFlushDefaultTimeout}={}){return this.flush({timeout:t,close:!0})}async flush({timeout:t,close:n=!1}={}){if(this._isFlushing)return void console.warn("Overlapping flush calls detected. Please wait for the previous flush to finish before calling .flush again");this._isFlushing=!0,n&&(this._isClosed=!0),this._publisher.flush(this._pendingEvents);const e=new Promise(t=>{this._pendingEvents?this.once("drained",()=>{t()}):t()}).finally(()=>{this._isFlushing=!1});return t?r(e,t).catch(()=>{}):e}_dispatch(t,n){this._isClosed?this.emit("call_after_close",t):(this._pendingEvents++,z(t,this._queue,this,n).catch(t=>t).finally(()=>{this._pendingEvents--,this._pendingEvents||this.emit("drained")}))}alias({userId:t,previousId:n,context:e,timestamp:r,integrations:i},o){const u=this._eventFactory.alias(t,n,{context:e,integrations:i,timestamp:r});this._dispatch(u,o)}group({timestamp:t,groupId:n,userId:e,anonymousId:r,traits:i={},context:o,integrations:u},s){const a=this._eventFactory.group(n,i,{context:o,anonymousId:r,userId:e,timestamp:t,integrations:u});this._dispatch(a,s)}identify({userId:t,anonymousId:n,traits:e={},context:r,timestamp:i,integrations:o},u){const s=this._eventFactory.identify(t,e,{context:r,anonymousId:n,userId:t,timestamp:i,integrations:o});this._dispatch(s,u)}page({userId:t,anonymousId:n,category:e,name:r,properties:i,context:o,timestamp:u,integrations:s},a){const c=this._eventFactory.page(e??null,r??null,i,{context:o,anonymousId:n,userId:t,timestamp:u,integrations:s});this._dispatch(c,a)}screen({userId:t,anonymousId:n,category:e,name:r,properties:i,context:o,timestamp:u,integrations:s},a){const c=this._eventFactory.screen(e??null,r??null,i,{context:o,anonymousId:n,userId:t,timestamp:u,integrations:s});this._dispatch(c,a)}track({userId:t,anonymousId:n,event:e,properties:r,context:i,timestamp:o,integrations:u},s){const a=this._eventFactory.track(e,r,{context:i,userId:t,anonymousId:n,timestamp:o,integrations:u});this._dispatch(a,s)}register(...t){return this._queue.criticalTasks.run(async()=>{const n=U.system(),e=t.map(t=>this._queue.register(n,t,this));await Promise.all(e),this.emit("register",t.map(t=>t.name))})}async deregister(...t){const n=U.system(),e=t.map(t=>{const e=this._queue.plugins.find(n=>n.name===t);if(e)return this._queue.deregister(n,e,this);n.log("warn",`plugin ${t} not found`)});await Promise.all(e),this.emit("deregister",t)}}},250(t,n,e){var r;t=e.nmd(t),function(){var i,o="Expected a function",u="__lodash_hash_undefined__",s="__lodash_placeholder__",a=32,c=128,l=1/0,f=9007199254740991,p=NaN,h=4294967295,d=[["ary",c],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",a],["partialRight",64],["rearg",256]],v="[object Arguments]",g="[object Array]",y="[object Boolean]",_="[object Date]",m="[object Error]",b="[object Function]",I="[object GeneratorFunction]",w="[object Map]",T="[object Number]",E="[object Object]",x="[object Promise]",A="[object RegExp]",O="[object Set]",j="[object String]",k="[object Symbol]",C="[object WeakMap]",S="[object ArrayBuffer]",R="[object DataView]",P="[object Float32Array]",L="[object Float64Array]",D="[object Int8Array]",M="[object Int16Array]",q="[object Int32Array]",N="[object Uint8Array]",U="[object Uint8ClampedArray]",z="[object Uint16Array]",F="[object Uint32Array]",B=/\b__p \+= '';/g,$=/\b(__p \+=) '' \+/g,W=/(__e\(.*?\)|\b__t\)) \+\n'';/g,V=/&(?:amp|lt|gt|quot|#39);/g,G=/[&<>"']/g,J=RegExp(V.source),K=RegExp(G.source),H=/<%-([\s\S]+?)%>/g,Y=/<%([\s\S]+?)%>/g,Z=/<%=([\s\S]+?)%>/g,X=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Q=/^\w*$/,tt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,nt=/[\\^$.*+?()[\]{}|]/g,et=RegExp(nt.source),rt=/^\s+/,it=/\s/,ot=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ut=/\{\n\/\* \[wrapped with (.+)\] \*/,st=/,? & /,at=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ct=/[()=,{}\[\]\/\s]/,lt=/\\(\\)?/g,ft=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,pt=/\w*$/,ht=/^[-+]0x[0-9a-f]+$/i,dt=/^0b[01]+$/i,vt=/^\[object .+?Constructor\]$/,gt=/^0o[0-7]+$/i,yt=/^(?:0|[1-9]\d*)$/,_t=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,mt=/($^)/,bt=/['\n\r\u2028\u2029\\]/g,It="\\ud800-\\udfff",wt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Tt="\\u2700-\\u27bf",Et="a-z\\xdf-\\xf6\\xf8-\\xff",xt="A-Z\\xc0-\\xd6\\xd8-\\xde",At="\\ufe0e\\ufe0f",Ot="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",jt="["+It+"]",kt="["+Ot+"]",Ct="["+wt+"]",St="\\d+",Rt="["+Tt+"]",Pt="["+Et+"]",Lt="[^"+It+Ot+St+Tt+Et+xt+"]",Dt="\\ud83c[\\udffb-\\udfff]",Mt="[^"+It+"]",qt="(?:\\ud83c[\\udde6-\\uddff]){2}",Nt="[\\ud800-\\udbff][\\udc00-\\udfff]",Ut="["+xt+"]",zt="\\u200d",Ft="(?:"+Pt+"|"+Lt+")",Bt="(?:"+Ut+"|"+Lt+")",$t="(?:['’](?:d|ll|m|re|s|t|ve))?",Wt="(?:['’](?:D|LL|M|RE|S|T|VE))?",Vt="(?:"+Ct+"|"+Dt+")?",Gt="["+At+"]?",Jt=Gt+Vt+"(?:"+zt+"(?:"+[Mt,qt,Nt].join("|")+")"+Gt+Vt+")*",Kt="(?:"+[Rt,qt,Nt].join("|")+")"+Jt,Ht="(?:"+[Mt+Ct+"?",Ct,qt,Nt,jt].join("|")+")",Yt=RegExp("['’]","g"),Zt=RegExp(Ct,"g"),Xt=RegExp(Dt+"(?="+Dt+")|"+Ht+Jt,"g"),Qt=RegExp([Ut+"?"+Pt+"+"+$t+"(?="+[kt,Ut,"$"].join("|")+")",Bt+"+"+Wt+"(?="+[kt,Ut+Ft,"$"].join("|")+")",Ut+"?"+Ft+"+"+$t,Ut+"+"+Wt,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",St,Kt].join("|"),"g"),tn=RegExp("["+zt+It+wt+At+"]"),nn=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,en=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],rn=-1,on={};on[P]=on[L]=on[D]=on[M]=on[q]=on[N]=on[U]=on[z]=on[F]=!0,on[v]=on[g]=on[S]=on[y]=on[R]=on[_]=on[m]=on[b]=on[w]=on[T]=on[E]=on[A]=on[O]=on[j]=on[C]=!1;var un={};un[v]=un[g]=un[S]=un[R]=un[y]=un[_]=un[P]=un[L]=un[D]=un[M]=un[q]=un[w]=un[T]=un[E]=un[A]=un[O]=un[j]=un[k]=un[N]=un[U]=un[z]=un[F]=!0,un[m]=un[b]=un[C]=!1;var sn={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},an=parseFloat,cn=parseInt,ln="object"==typeof global&&global&&global.Object===Object&&global,fn="object"==typeof self&&self&&self.Object===Object&&self,pn=ln||fn||Function("return this")(),hn=n&&!n.nodeType&&n,dn=hn&&t&&!t.nodeType&&t,vn=dn&&dn.exports===hn,gn=vn&&ln.process,yn=function(){try{return dn&&dn.require&&dn.require("util").types||gn&&gn.binding&&gn.binding("util")}catch(t){}}(),_n=yn&&yn.isArrayBuffer,mn=yn&&yn.isDate,bn=yn&&yn.isMap,In=yn&&yn.isRegExp,wn=yn&&yn.isSet,Tn=yn&&yn.isTypedArray;function En(t,n,e){switch(e.length){case 0:return t.call(n);case 1:return t.call(n,e[0]);case 2:return t.call(n,e[0],e[1]);case 3:return t.call(n,e[0],e[1],e[2])}return t.apply(n,e)}function xn(t,n,e,r){for(var i=-1,o=null==t?0:t.length;++i<o;){var u=t[i];n(r,u,e(u),t)}return r}function An(t,n){for(var e=-1,r=null==t?0:t.length;++e<r&&!1!==n(t[e],e,t););return t}function On(t,n){for(var e=null==t?0:t.length;e--&&!1!==n(t[e],e,t););return t}function jn(t,n){for(var e=-1,r=null==t?0:t.length;++e<r;)if(!n(t[e],e,t))return!1;return!0}function kn(t,n){for(var e=-1,r=null==t?0:t.length,i=0,o=[];++e<r;){var u=t[e];n(u,e,t)&&(o[i++]=u)}return o}function Cn(t,n){return!(null==t||!t.length)&&zn(t,n,0)>-1}function Sn(t,n,e){for(var r=-1,i=null==t?0:t.length;++r<i;)if(e(n,t[r]))return!0;return!1}function Rn(t,n){for(var e=-1,r=null==t?0:t.length,i=Array(r);++e<r;)i[e]=n(t[e],e,t);return i}function Pn(t,n){for(var e=-1,r=n.length,i=t.length;++e<r;)t[i+e]=n[e];return t}function Ln(t,n,e,r){var i=-1,o=null==t?0:t.length;for(r&&o&&(e=t[++i]);++i<o;)e=n(e,t[i],i,t);return e}function Dn(t,n,e,r){var i=null==t?0:t.length;for(r&&i&&(e=t[--i]);i--;)e=n(e,t[i],i,t);return e}function Mn(t,n){for(var e=-1,r=null==t?0:t.length;++e<r;)if(n(t[e],e,t))return!0;return!1}var qn=Wn("length");function Nn(t,n,e){var r;return e(t,function(t,e,i){if(n(t,e,i))return r=e,!1}),r}function Un(t,n,e,r){for(var i=t.length,o=e+(r?1:-1);r?o--:++o<i;)if(n(t[o],o,t))return o;return-1}function zn(t,n,e){return n==n?function(t,n,e){for(var r=e-1,i=t.length;++r<i;)if(t[r]===n)return r;return-1}(t,n,e):Un(t,Bn,e)}function Fn(t,n,e,r){for(var i=e-1,o=t.length;++i<o;)if(r(t[i],n))return i;return-1}function Bn(t){return t!=t}function $n(t,n){var e=null==t?0:t.length;return e?Jn(t,n)/e:p}function Wn(t){return function(n){return null==n?i:n[t]}}function Vn(t){return function(n){return null==t?i:t[n]}}function Gn(t,n,e,r,i){return i(t,function(t,i,o){e=r?(r=!1,t):n(e,t,i,o)}),e}function Jn(t,n){for(var e,r=-1,o=t.length;++r<o;){var u=n(t[r]);u!==i&&(e=e===i?u:e+u)}return e}function Kn(t,n){for(var e=-1,r=Array(t);++e<t;)r[e]=n(e);return r}function Hn(t){return t?t.slice(0,pe(t)+1).replace(rt,""):t}function Yn(t){return function(n){return t(n)}}function Zn(t,n){return Rn(n,function(n){return t[n]})}function Xn(t,n){return t.has(n)}function Qn(t,n){for(var e=-1,r=t.length;++e<r&&zn(n,t[e],0)>-1;);return e}function te(t,n){for(var e=t.length;e--&&zn(n,t[e],0)>-1;);return e}var ne=Vn({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),ee=Vn({"&":"&","<":"<",">":">",'"':""","'":"'"});function re(t){return"\\"+sn[t]}function ie(t){return tn.test(t)}function oe(t){var n=-1,e=Array(t.size);return t.forEach(function(t,r){e[++n]=[r,t]}),e}function ue(t,n){return function(e){return t(n(e))}}function se(t,n){for(var e=-1,r=t.length,i=0,o=[];++e<r;){var u=t[e];u!==n&&u!==s||(t[e]=s,o[i++]=e)}return o}function ae(t){var n=-1,e=Array(t.size);return t.forEach(function(t){e[++n]=t}),e}function ce(t){var n=-1,e=Array(t.size);return t.forEach(function(t){e[++n]=[t,t]}),e}function le(t){return ie(t)?function(t){for(var n=Xt.lastIndex=0;Xt.test(t);)++n;return n}(t):qn(t)}function fe(t){return ie(t)?function(t){return t.match(Xt)||[]}(t):function(t){return t.split("")}(t)}function pe(t){for(var n=t.length;n--&&it.test(t.charAt(n)););return n}var he=Vn({"&":"&","<":"<",">":">",""":'"',"'":"'"}),de=function t(n){var e,r=(n=null==n?pn:de.defaults(pn.Object(),n,de.pick(pn,en))).Array,it=n.Date,It=n.Error,wt=n.Function,Tt=n.Math,Et=n.Object,xt=n.RegExp,At=n.String,Ot=n.TypeError,jt=r.prototype,kt=wt.prototype,Ct=Et.prototype,St=n["__core-js_shared__"],Rt=kt.toString,Pt=Ct.hasOwnProperty,Lt=0,Dt=(e=/[^.]+$/.exec(St&&St.keys&&St.keys.IE_PROTO||""))?"Symbol(src)_1."+e:"",Mt=Ct.toString,qt=Rt.call(Et),Nt=pn._,Ut=xt("^"+Rt.call(Pt).replace(nt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),zt=vn?n.Buffer:i,Ft=n.Symbol,Bt=n.Uint8Array,$t=zt?zt.allocUnsafe:i,Wt=ue(Et.getPrototypeOf,Et),Vt=Et.create,Gt=Ct.propertyIsEnumerable,Jt=jt.splice,Kt=Ft?Ft.isConcatSpreadable:i,Ht=Ft?Ft.iterator:i,Xt=Ft?Ft.toStringTag:i,tn=function(){try{var t=ao(Et,"defineProperty");return t({},"",{}),t}catch(t){}}(),sn=n.clearTimeout!==pn.clearTimeout&&n.clearTimeout,ln=it&&it.now!==pn.Date.now&&it.now,fn=n.setTimeout!==pn.setTimeout&&n.setTimeout,hn=Tt.ceil,dn=Tt.floor,gn=Et.getOwnPropertySymbols,yn=zt?zt.isBuffer:i,qn=n.isFinite,Vn=jt.join,ve=ue(Et.keys,Et),ge=Tt.max,ye=Tt.min,_e=it.now,me=n.parseInt,be=Tt.random,Ie=jt.reverse,we=ao(n,"DataView"),Te=ao(n,"Map"),Ee=ao(n,"Promise"),xe=ao(n,"Set"),Ae=ao(n,"WeakMap"),Oe=ao(Et,"create"),je=Ae&&new Ae,ke={},Ce=qo(we),Se=qo(Te),Re=qo(Ee),Pe=qo(xe),Le=qo(Ae),De=Ft?Ft.prototype:i,Me=De?De.valueOf:i,qe=De?De.toString:i;function Ne(t){if(ts(t)&&!$u(t)&&!(t instanceof Be)){if(t instanceof Fe)return t;if(Pt.call(t,"__wrapped__"))return No(t)}return new Fe(t)}var Ue=function(){function t(){}return function(n){if(!Qu(n))return{};if(Vt)return Vt(n);t.prototype=n;var e=new t;return t.prototype=i,e}}();function ze(){}function Fe(t,n){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!n,this.__index__=0,this.__values__=i}function Be(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=h,this.__views__=[]}function $e(t){var n=-1,e=null==t?0:t.length;for(this.clear();++n<e;){var r=t[n];this.set(r[0],r[1])}}function We(t){var n=-1,e=null==t?0:t.length;for(this.clear();++n<e;){var r=t[n];this.set(r[0],r[1])}}function Ve(t){var n=-1,e=null==t?0:t.length;for(this.clear();++n<e;){var r=t[n];this.set(r[0],r[1])}}function Ge(t){var n=-1,e=null==t?0:t.length;for(this.__data__=new Ve;++n<e;)this.add(t[n])}function Je(t){var n=this.__data__=new We(t);this.size=n.size}function Ke(t,n){var e=$u(t),r=!e&&Bu(t),i=!e&&!r&&Ju(t),o=!e&&!r&&!i&&as(t),u=e||r||i||o,s=u?Kn(t.length,At):[],a=s.length;for(var c in t)!n&&!Pt.call(t,c)||u&&("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||go(c,a))||s.push(c);return s}function He(t){var n=t.length;return n?t[Vr(0,n-1)]:i}function Ye(t,n){return Ro(Ai(t),or(n,0,t.length))}function Ze(t){return Ro(Ai(t))}function Xe(t,n,e){(e!==i&&!Uu(t[n],e)||e===i&&!(n in t))&&rr(t,n,e)}function Qe(t,n,e){var r=t[n];Pt.call(t,n)&&Uu(r,e)&&(e!==i||n in t)||rr(t,n,e)}function tr(t,n){for(var e=t.length;e--;)if(Uu(t[e][0],n))return e;return-1}function nr(t,n,e,r){return lr(t,function(t,i,o){n(r,t,e(t),o)}),r}function er(t,n){return t&&Oi(n,Cs(n),t)}function rr(t,n,e){"__proto__"==n&&tn?tn(t,n,{configurable:!0,enumerable:!0,value:e,writable:!0}):t[n]=e}function ir(t,n){for(var e=-1,o=n.length,u=r(o),s=null==t;++e<o;)u[e]=s?i:xs(t,n[e]);return u}function or(t,n,e){return t==t&&(e!==i&&(t=t<=e?t:e),n!==i&&(t=t>=n?t:n)),t}function ur(t,n,e,r,o,u){var s,a=1&n,c=2&n,l=4&n;if(e&&(s=o?e(t,r,o,u):e(t)),s!==i)return s;if(!Qu(t))return t;var f=$u(t);if(f){if(s=function(t){var n=t.length,e=new t.constructor(n);return n&&"string"==typeof t[0]&&Pt.call(t,"index")&&(e.index=t.index,e.input=t.input),e}(t),!a)return Ai(t,s)}else{var p=fo(t),h=p==b||p==I;if(Ju(t))return bi(t,a);if(p==E||p==v||h&&!o){if(s=c||h?{}:ho(t),!a)return c?function(t,n){return Oi(t,lo(t),n)}(t,function(t,n){return t&&Oi(n,Ss(n),t)}(s,t)):function(t,n){return Oi(t,co(t),n)}(t,er(s,t))}else{if(!un[p])return o?t:{};s=function(t,n,e){var r,i=t.constructor;switch(n){case S:return Ii(t);case y:case _:return new i(+t);case R:return function(t,n){var e=n?Ii(t.buffer):t.buffer;return new t.constructor(e,t.byteOffset,t.byteLength)}(t,e);case P:case L:case D:case M:case q:case N:case U:case z:case F:return wi(t,e);case w:return new i;case T:case j:return new i(t);case A:return function(t){var n=new t.constructor(t.source,pt.exec(t));return n.lastIndex=t.lastIndex,n}(t);case O:return new i;case k:return r=t,Me?Et(Me.call(r)):{}}}(t,p,a)}}u||(u=new Je);var d=u.get(t);if(d)return d;u.set(t,s),os(t)?t.forEach(function(r){s.add(ur(r,n,e,r,t,u))}):ns(t)&&t.forEach(function(r,i){s.set(i,ur(r,n,e,i,t,u))});var g=f?i:(l?c?no:to:c?Ss:Cs)(t);return An(g||t,function(r,i){g&&(r=t[i=r]),Qe(s,i,ur(r,n,e,i,t,u))}),s}function sr(t,n,e){var r=e.length;if(null==t)return!r;for(t=Et(t);r--;){var o=e[r],u=n[o],s=t[o];if(s===i&&!(o in t)||!u(s))return!1}return!0}function ar(t,n,e){if("function"!=typeof t)throw new Ot(o);return jo(function(){t.apply(i,e)},n)}function cr(t,n,e,r){var i=-1,o=Cn,u=!0,s=t.length,a=[],c=n.length;if(!s)return a;e&&(n=Rn(n,Yn(e))),r?(o=Sn,u=!1):n.length>=200&&(o=Xn,u=!1,n=new Ge(n));t:for(;++i<s;){var l=t[i],f=null==e?l:e(l);if(l=r||0!==l?l:0,u&&f==f){for(var p=c;p--;)if(n[p]===f)continue t;a.push(l)}else o(n,f,r)||a.push(l)}return a}Ne.templateSettings={escape:H,evaluate:Y,interpolate:Z,variable:"",imports:{_:Ne}},Ne.prototype=ze.prototype,Ne.prototype.constructor=Ne,Fe.prototype=Ue(ze.prototype),Fe.prototype.constructor=Fe,Be.prototype=Ue(ze.prototype),Be.prototype.constructor=Be,$e.prototype.clear=function(){this.__data__=Oe?Oe(null):{},this.size=0},$e.prototype.delete=function(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n},$e.prototype.get=function(t){var n=this.__data__;if(Oe){var e=n[t];return e===u?i:e}return Pt.call(n,t)?n[t]:i},$e.prototype.has=function(t){var n=this.__data__;return Oe?n[t]!==i:Pt.call(n,t)},$e.prototype.set=function(t,n){var e=this.__data__;return this.size+=this.has(t)?0:1,e[t]=Oe&&n===i?u:n,this},We.prototype.clear=function(){this.__data__=[],this.size=0},We.prototype.delete=function(t){var n=this.__data__,e=tr(n,t);return!(e<0||(e==n.length-1?n.pop():Jt.call(n,e,1),--this.size,0))},We.prototype.get=function(t){var n=this.__data__,e=tr(n,t);return e<0?i:n[e][1]},We.prototype.has=function(t){return tr(this.__data__,t)>-1},We.prototype.set=function(t,n){var e=this.__data__,r=tr(e,t);return r<0?(++this.size,e.push([t,n])):e[r][1]=n,this},Ve.prototype.clear=function(){this.size=0,this.__data__={hash:new $e,map:new(Te||We),string:new $e}},Ve.prototype.delete=function(t){var n=uo(this,t).delete(t);return this.size-=n?1:0,n},Ve.prototype.get=function(t){return uo(this,t).get(t)},Ve.prototype.has=function(t){return uo(this,t).has(t)},Ve.prototype.set=function(t,n){var e=uo(this,t),r=e.size;return e.set(t,n),this.size+=e.size==r?0:1,this},Ge.prototype.add=Ge.prototype.push=function(t){return this.__data__.set(t,u),this},Ge.prototype.has=function(t){return this.__data__.has(t)},Je.prototype.clear=function(){this.__data__=new We,this.size=0},Je.prototype.delete=function(t){var n=this.__data__,e=n.delete(t);return this.size=n.size,e},Je.prototype.get=function(t){return this.__data__.get(t)},Je.prototype.has=function(t){return this.__data__.has(t)},Je.prototype.set=function(t,n){var e=this.__data__;if(e instanceof We){var r=e.__data__;if(!Te||r.length<199)return r.push([t,n]),this.size=++e.size,this;e=this.__data__=new Ve(r)}return e.set(t,n),this.size=e.size,this};var lr=Ci(_r),fr=Ci(mr,!0);function pr(t,n){var e=!0;return lr(t,function(t,r,i){return e=!!n(t,r,i)}),e}function hr(t,n,e){for(var r=-1,o=t.length;++r<o;){var u=t[r],s=n(u);if(null!=s&&(a===i?s==s&&!ss(s):e(s,a)))var a=s,c=u}return c}function dr(t,n){var e=[];return lr(t,function(t,r,i){n(t,r,i)&&e.push(t)}),e}function vr(t,n,e,r,i){var o=-1,u=t.length;for(e||(e=vo),i||(i=[]);++o<u;){var s=t[o];n>0&&e(s)?n>1?vr(s,n-1,e,r,i):Pn(i,s):r||(i[i.length]=s)}return i}var gr=Si(),yr=Si(!0);function _r(t,n){return t&&gr(t,n,Cs)}function mr(t,n){return t&&yr(t,n,Cs)}function br(t,n){return kn(n,function(n){return Yu(t[n])})}function Ir(t,n){for(var e=0,r=(n=gi(n,t)).length;null!=t&&e<r;)t=t[Mo(n[e++])];return e&&e==r?t:i}function wr(t,n,e){var r=n(t);return $u(t)?r:Pn(r,e(t))}function Tr(t){return null==t?t===i?"[object Undefined]":"[object Null]":Xt&&Xt in Et(t)?function(t){var n=Pt.call(t,Xt),e=t[Xt];try{t[Xt]=i;var r=!0}catch(t){}var o=Mt.call(t);return r&&(n?t[Xt]=e:delete t[Xt]),o}(t):function(t){return Mt.call(t)}(t)}function Er(t,n){return t>n}function xr(t,n){return null!=t&&Pt.call(t,n)}function Ar(t,n){return null!=t&&n in Et(t)}function Or(t,n,e){for(var o=e?Sn:Cn,u=t[0].length,s=t.length,a=s,c=r(s),l=1/0,f=[];a--;){var p=t[a];a&&n&&(p=Rn(p,Yn(n))),l=ye(p.length,l),c[a]=!e&&(n||u>=120&&p.length>=120)?new Ge(a&&p):i}p=t[0];var h=-1,d=c[0];t:for(;++h<u&&f.length<l;){var v=p[h],g=n?n(v):v;if(v=e||0!==v?v:0,!(d?Xn(d,g):o(f,g,e))){for(a=s;--a;){var y=c[a];if(!(y?Xn(y,g):o(t[a],g,e)))continue t}d&&d.push(g),f.push(v)}}return f}function jr(t,n,e){var r=null==(t=xo(t,n=gi(n,t)))?t:t[Mo(Ho(n))];return null==r?i:En(r,t,e)}function kr(t){return ts(t)&&Tr(t)==v}function Cr(t,n,e,r,o){return t===n||(null==t||null==n||!ts(t)&&!ts(n)?t!=t&&n!=n:function(t,n,e,r,o,u){var s=$u(t),a=$u(n),c=s?g:fo(t),l=a?g:fo(n),f=(c=c==v?E:c)==E,p=(l=l==v?E:l)==E,h=c==l;if(h&&Ju(t)){if(!Ju(n))return!1;s=!0,f=!1}if(h&&!f)return u||(u=new Je),s||as(t)?Xi(t,n,e,r,o,u):function(t,n,e,r,i,o,u){switch(e){case R:if(t.byteLength!=n.byteLength||t.byteOffset!=n.byteOffset)return!1;t=t.buffer,n=n.buffer;case S:return!(t.byteLength!=n.byteLength||!o(new Bt(t),new Bt(n)));case y:case _:case T:return Uu(+t,+n);case m:return t.name==n.name&&t.message==n.message;case A:case j:return t==n+"";case w:var s=oe;case O:var a=1&r;if(s||(s=ae),t.size!=n.size&&!a)return!1;var c=u.get(t);if(c)return c==n;r|=2,u.set(t,n);var l=Xi(s(t),s(n),r,i,o,u);return u.delete(t),l;case k:if(Me)return Me.call(t)==Me.call(n)}return!1}(t,n,c,e,r,o,u);if(!(1&e)){var d=f&&Pt.call(t,"__wrapped__"),b=p&&Pt.call(n,"__wrapped__");if(d||b){var I=d?t.value():t,x=b?n.value():n;return u||(u=new Je),o(I,x,e,r,u)}}return!!h&&(u||(u=new Je),function(t,n,e,r,o,u){var s=1&e,a=to(t),c=a.length;if(c!=to(n).length&&!s)return!1;for(var l=c;l--;){var f=a[l];if(!(s?f in n:Pt.call(n,f)))return!1}var p=u.get(t),h=u.get(n);if(p&&h)return p==n&&h==t;var d=!0;u.set(t,n),u.set(n,t);for(var v=s;++l<c;){var g=t[f=a[l]],y=n[f];if(r)var _=s?r(y,g,f,n,t,u):r(g,y,f,t,n,u);if(!(_===i?g===y||o(g,y,e,r,u):_)){d=!1;break}v||(v="constructor"==f)}if(d&&!v){var m=t.constructor,b=n.constructor;m==b||!("constructor"in t)||!("constructor"in n)||"function"==typeof m&&m instanceof m&&"function"==typeof b&&b instanceof b||(d=!1)}return u.delete(t),u.delete(n),d}(t,n,e,r,o,u))}(t,n,e,r,Cr,o))}function Sr(t,n,e,r){var o=e.length,u=o,s=!r;if(null==t)return!u;for(t=Et(t);o--;){var a=e[o];if(s&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++o<u;){var c=(a=e[o])[0],l=t[c],f=a[1];if(s&&a[2]){if(l===i&&!(c in t))return!1}else{var p=new Je;if(r)var h=r(l,f,c,t,n,p);if(!(h===i?Cr(f,l,3,r,p):h))return!1}}return!0}function Rr(t){return!(!Qu(t)||(n=t,Dt&&Dt in n))&&(Yu(t)?Ut:vt).test(qo(t));var n}function Pr(t){return"function"==typeof t?t:null==t?ea:"object"==typeof t?$u(t)?Nr(t[0],t[1]):qr(t):fa(t)}function Lr(t){if(!Io(t))return ve(t);var n=[];for(var e in Et(t))Pt.call(t,e)&&"constructor"!=e&&n.push(e);return n}function Dr(t,n){return t<n}function Mr(t,n){var e=-1,i=Vu(t)?r(t.length):[];return lr(t,function(t,r,o){i[++e]=n(t,r,o)}),i}function qr(t){var n=so(t);return 1==n.length&&n[0][2]?To(n[0][0],n[0][1]):function(e){return e===t||Sr(e,t,n)}}function Nr(t,n){return _o(t)&&wo(n)?To(Mo(t),n):function(e){var r=xs(e,t);return r===i&&r===n?As(e,t):Cr(n,r,3)}}function Ur(t,n,e,r,o){t!==n&&gr(n,function(u,s){if(o||(o=new Je),Qu(u))!function(t,n,e,r,o,u,s){var a=Ao(t,e),c=Ao(n,e),l=s.get(c);if(l)Xe(t,e,l);else{var f=u?u(a,c,e+"",t,n,s):i,p=f===i;if(p){var h=$u(c),d=!h&&Ju(c),v=!h&&!d&&as(c);f=c,h||d||v?$u(a)?f=a:Gu(a)?f=Ai(a):d?(p=!1,f=bi(c,!0)):v?(p=!1,f=wi(c,!0)):f=[]:rs(c)||Bu(c)?(f=a,Bu(a)?f=gs(a):Qu(a)&&!Yu(a)||(f=ho(c))):p=!1}p&&(s.set(c,f),o(f,c,r,u,s),s.delete(c)),Xe(t,e,f)}}(t,n,s,e,Ur,r,o);else{var a=r?r(Ao(t,s),u,s+"",t,n,o):i;a===i&&(a=u),Xe(t,s,a)}},Ss)}function zr(t,n){var e=t.length;if(e)return go(n+=n<0?e:0,e)?t[n]:i}function Fr(t,n,e){n=n.length?Rn(n,function(t){return $u(t)?function(n){return Ir(n,1===t.length?t[0]:t)}:t}):[ea];var r=-1;n=Rn(n,Yn(oo()));var i=Mr(t,function(t,e,i){var o=Rn(n,function(n){return n(t)});return{criteria:o,index:++r,value:t}});return function(t){var n=t.length;for(t.sort(function(t,n){return function(t,n,e){for(var r=-1,i=t.criteria,o=n.criteria,u=i.length,s=e.length;++r<u;){var a=Ti(i[r],o[r]);if(a)return r>=s?a:a*("desc"==e[r]?-1:1)}return t.index-n.index}(t,n,e)});n--;)t[n]=t[n].value;return t}(i)}function Br(t,n,e){for(var r=-1,i=n.length,o={};++r<i;){var u=n[r],s=Ir(t,u);e(s,u)&&Yr(o,gi(u,t),s)}return o}function $r(t,n,e,r){var i=r?Fn:zn,o=-1,u=n.length,s=t;for(t===n&&(n=Ai(n)),e&&(s=Rn(t,Yn(e)));++o<u;)for(var a=0,c=n[o],l=e?e(c):c;(a=i(s,l,a,r))>-1;)s!==t&&Jt.call(s,a,1),Jt.call(t,a,1);return t}function Wr(t,n){for(var e=t?n.length:0,r=e-1;e--;){var i=n[e];if(e==r||i!==o){var o=i;go(i)?Jt.call(t,i,1):ai(t,i)}}return t}function Vr(t,n){return t+dn(be()*(n-t+1))}function Gr(t,n){var e="";if(!t||n<1||n>f)return e;do{n%2&&(e+=t),(n=dn(n/2))&&(t+=t)}while(n);return e}function Jr(t,n){return ko(Eo(t,n,ea),t+"")}function Kr(t){return He(Us(t))}function Hr(t,n){var e=Us(t);return Ro(e,or(n,0,e.length))}function Yr(t,n,e,r){if(!Qu(t))return t;for(var o=-1,u=(n=gi(n,t)).length,s=u-1,a=t;null!=a&&++o<u;){var c=Mo(n[o]),l=e;if("__proto__"===c||"constructor"===c||"prototype"===c)return t;if(o!=s){var f=a[c];(l=r?r(f,c,a):i)===i&&(l=Qu(f)?f:go(n[o+1])?[]:{})}Qe(a,c,l),a=a[c]}return t}var Zr=je?function(t,n){return je.set(t,n),t}:ea,Xr=tn?function(t,n){return tn(t,"toString",{configurable:!0,enumerable:!1,value:Qs(n),writable:!0})}:ea;function Qr(t){return Ro(Us(t))}function ti(t,n,e){var i=-1,o=t.length;n<0&&(n=-n>o?0:o+n),(e=e>o?o:e)<0&&(e+=o),o=n>e?0:e-n>>>0,n>>>=0;for(var u=r(o);++i<o;)u[i]=t[i+n];return u}function ni(t,n){var e;return lr(t,function(t,r,i){return!(e=n(t,r,i))}),!!e}function ei(t,n,e){var r=0,i=null==t?r:t.length;if("number"==typeof n&&n==n&&i<=2147483647){for(;r<i;){var o=r+i>>>1,u=t[o];null!==u&&!ss(u)&&(e?u<=n:u<n)?r=o+1:i=o}return i}return ri(t,n,ea,e)}function ri(t,n,e,r){var o=0,u=null==t?0:t.length;if(0===u)return 0;for(var s=(n=e(n))!=n,a=null===n,c=ss(n),l=n===i;o<u;){var f=dn((o+u)/2),p=e(t[f]),h=p!==i,d=null===p,v=p==p,g=ss(p);if(s)var y=r||v;else y=l?v&&(r||h):a?v&&h&&(r||!d):c?v&&h&&!d&&(r||!g):!d&&!g&&(r?p<=n:p<n);y?o=f+1:u=f}return ye(u,4294967294)}function ii(t,n){for(var e=-1,r=t.length,i=0,o=[];++e<r;){var u=t[e],s=n?n(u):u;if(!e||!Uu(s,a)){var a=s;o[i++]=0===u?0:u}}return o}function oi(t){return"number"==typeof t?t:ss(t)?p:+t}function ui(t){if("string"==typeof t)return t;if($u(t))return Rn(t,ui)+"";if(ss(t))return qe?qe.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}function si(t,n,e){var r=-1,i=Cn,o=t.length,u=!0,s=[],a=s;if(e)u=!1,i=Sn;else if(o>=200){var c=n?null:Gi(t);if(c)return ae(c);u=!1,i=Xn,a=new Ge}else a=n?[]:s;t:for(;++r<o;){var l=t[r],f=n?n(l):l;if(l=e||0!==l?l:0,u&&f==f){for(var p=a.length;p--;)if(a[p]===f)continue t;n&&a.push(f),s.push(l)}else i(a,f,e)||(a!==s&&a.push(f),s.push(l))}return s}function ai(t,n){return null==(t=xo(t,n=gi(n,t)))||delete t[Mo(Ho(n))]}function ci(t,n,e,r){return Yr(t,n,e(Ir(t,n)),r)}function li(t,n,e,r){for(var i=t.length,o=r?i:-1;(r?o--:++o<i)&&n(t[o],o,t););return e?ti(t,r?0:o,r?o+1:i):ti(t,r?o+1:0,r?i:o)}function fi(t,n){var e=t;return e instanceof Be&&(e=e.value()),Ln(n,function(t,n){return n.func.apply(n.thisArg,Pn([t],n.args))},e)}function pi(t,n,e){var i=t.length;if(i<2)return i?si(t[0]):[];for(var o=-1,u=r(i);++o<i;)for(var s=t[o],a=-1;++a<i;)a!=o&&(u[o]=cr(u[o]||s,t[a],n,e));return si(vr(u,1),n,e)}function hi(t,n,e){for(var r=-1,o=t.length,u=n.length,s={};++r<o;){var a=r<u?n[r]:i;e(s,t[r],a)}return s}function di(t){return Gu(t)?t:[]}function vi(t){return"function"==typeof t?t:ea}function gi(t,n){return $u(t)?t:_o(t,n)?[t]:Do(ys(t))}var yi=Jr;function _i(t,n,e){var r=t.length;return e=e===i?r:e,!n&&e>=r?t:ti(t,n,e)}var mi=sn||function(t){return pn.clearTimeout(t)};function bi(t,n){if(n)return t.slice();var e=t.length,r=$t?$t(e):new t.constructor(e);return t.copy(r),r}function Ii(t){var n=new t.constructor(t.byteLength);return new Bt(n).set(new Bt(t)),n}function wi(t,n){var e=n?Ii(t.buffer):t.buffer;return new t.constructor(e,t.byteOffset,t.length)}function Ti(t,n){if(t!==n){var e=t!==i,r=null===t,o=t==t,u=ss(t),s=n!==i,a=null===n,c=n==n,l=ss(n);if(!a&&!l&&!u&&t>n||u&&s&&c&&!a&&!l||r&&s&&c||!e&&c||!o)return 1;if(!r&&!u&&!l&&t<n||l&&e&&o&&!r&&!u||a&&e&&o||!s&&o||!c)return-1}return 0}function Ei(t,n,e,i){for(var o=-1,u=t.length,s=e.length,a=-1,c=n.length,l=ge(u-s,0),f=r(c+l),p=!i;++a<c;)f[a]=n[a];for(;++o<s;)(p||o<u)&&(f[e[o]]=t[o]);for(;l--;)f[a++]=t[o++];return f}function xi(t,n,e,i){for(var o=-1,u=t.length,s=-1,a=e.length,c=-1,l=n.length,f=ge(u-a,0),p=r(f+l),h=!i;++o<f;)p[o]=t[o];for(var d=o;++c<l;)p[d+c]=n[c];for(;++s<a;)(h||o<u)&&(p[d+e[s]]=t[o++]);return p}function Ai(t,n){var e=-1,i=t.length;for(n||(n=r(i));++e<i;)n[e]=t[e];return n}function Oi(t,n,e,r){var o=!e;e||(e={});for(var u=-1,s=n.length;++u<s;){var a=n[u],c=r?r(e[a],t[a],a,e,t):i;c===i&&(c=t[a]),o?rr(e,a,c):Qe(e,a,c)}return e}function ji(t,n){return function(e,r){var i=$u(e)?xn:nr,o=n?n():{};return i(e,t,oo(r,2),o)}}function ki(t){return Jr(function(n,e){var r=-1,o=e.length,u=o>1?e[o-1]:i,s=o>2?e[2]:i;for(u=t.length>3&&"function"==typeof u?(o--,u):i,s&&yo(e[0],e[1],s)&&(u=o<3?i:u,o=1),n=Et(n);++r<o;){var a=e[r];a&&t(n,a,r,u)}return n})}function Ci(t,n){return function(e,r){if(null==e)return e;if(!Vu(e))return t(e,r);for(var i=e.length,o=n?i:-1,u=Et(e);(n?o--:++o<i)&&!1!==r(u[o],o,u););return e}}function Si(t){return function(n,e,r){for(var i=-1,o=Et(n),u=r(n),s=u.length;s--;){var a=u[t?s:++i];if(!1===e(o[a],a,o))break}return n}}function Ri(t){return function(n){var e=ie(n=ys(n))?fe(n):i,r=e?e[0]:n.charAt(0),o=e?_i(e,1).join(""):n.slice(1);return r[t]()+o}}function Pi(t){return function(n){return Ln(Ys(Bs(n).replace(Yt,"")),t,"")}}function Li(t){return function(){var n=arguments;switch(n.length){case 0:return new t;case 1:return new t(n[0]);case 2:return new t(n[0],n[1]);case 3:return new t(n[0],n[1],n[2]);case 4:return new t(n[0],n[1],n[2],n[3]);case 5:return new t(n[0],n[1],n[2],n[3],n[4]);case 6:return new t(n[0],n[1],n[2],n[3],n[4],n[5]);case 7:return new t(n[0],n[1],n[2],n[3],n[4],n[5],n[6])}var e=Ue(t.prototype),r=t.apply(e,n);return Qu(r)?r:e}}function Di(t){return function(n,e,r){var o=Et(n);if(!Vu(n)){var u=oo(e,3);n=Cs(n),e=function(t){return u(o[t],t,o)}}var s=t(n,e,r);return s>-1?o[u?n[s]:s]:i}}function Mi(t){return Qi(function(n){var e=n.length,r=e,u=Fe.prototype.thru;for(t&&n.reverse();r--;){var s=n[r];if("function"!=typeof s)throw new Ot(o);if(u&&!a&&"wrapper"==ro(s))var a=new Fe([],!0)}for(r=a?r:e;++r<e;){var c=ro(s=n[r]),l="wrapper"==c?eo(s):i;a=l&&mo(l[0])&&424==l[1]&&!l[4].length&&1==l[9]?a[ro(l[0])].apply(a,l[3]):1==s.length&&mo(s)?a[c]():a.thru(s)}return function(){var t=arguments,r=t[0];if(a&&1==t.length&&$u(r))return a.plant(r).value();for(var i=0,o=e?n[i].apply(this,t):r;++i<e;)o=n[i].call(this,o);return o}})}function qi(t,n,e,o,u,s,a,l,f,p){var h=n&c,d=1&n,v=2&n,g=24&n,y=512&n,_=v?i:Li(t);return function c(){for(var m=arguments.length,b=r(m),I=m;I--;)b[I]=arguments[I];if(g)var w=io(c),T=function(t,n){for(var e=t.length,r=0;e--;)t[e]===n&&++r;return r}(b,w);if(o&&(b=Ei(b,o,u,g)),s&&(b=xi(b,s,a,g)),m-=T,g&&m<p){var E=se(b,w);return Wi(t,n,qi,c.placeholder,e,b,E,l,f,p-m)}var x=d?e:this,A=v?x[t]:t;return m=b.length,l?b=function(t,n){for(var e=t.length,r=ye(n.length,e),o=Ai(t);r--;){var u=n[r];t[r]=go(u,e)?o[u]:i}return t}(b,l):y&&m>1&&b.reverse(),h&&f<m&&(b.length=f),this&&this!==pn&&this instanceof c&&(A=_||Li(A)),A.apply(x,b)}}function Ni(t,n){return function(e,r){return function(t,n,e,r){return _r(t,function(t,i,o){n(r,e(t),i,o)}),r}(e,t,n(r),{})}}function Ui(t,n){return function(e,r){var o;if(e===i&&r===i)return n;if(e!==i&&(o=e),r!==i){if(o===i)return r;"string"==typeof e||"string"==typeof r?(e=ui(e),r=ui(r)):(e=oi(e),r=oi(r)),o=t(e,r)}return o}}function zi(t){return Qi(function(n){return n=Rn(n,Yn(oo())),Jr(function(e){var r=this;return t(n,function(t){return En(t,r,e)})})})}function Fi(t,n){var e=(n=n===i?" ":ui(n)).length;if(e<2)return e?Gr(n,t):n;var r=Gr(n,hn(t/le(n)));return ie(n)?_i(fe(r),0,t).join(""):r.slice(0,t)}function Bi(t){return function(n,e,o){return o&&"number"!=typeof o&&yo(n,e,o)&&(e=o=i),n=ps(n),e===i?(e=n,n=0):e=ps(e),function(t,n,e,i){for(var o=-1,u=ge(hn((n-t)/(e||1)),0),s=r(u);u--;)s[i?u:++o]=t,t+=e;return s}(n,e,o=o===i?n<e?1:-1:ps(o),t)}}function $i(t){return function(n,e){return"string"==typeof n&&"string"==typeof e||(n=vs(n),e=vs(e)),t(n,e)}}function Wi(t,n,e,r,o,u,s,c,l,f){var p=8&n;n|=p?a:64,4&(n&=~(p?64:a))||(n&=-4);var h=[t,n,o,p?u:i,p?s:i,p?i:u,p?i:s,c,l,f],d=e.apply(i,h);return mo(t)&&Oo(d,h),d.placeholder=r,Co(d,t,n)}function Vi(t){var n=Tt[t];return function(t,e){if(t=vs(t),(e=null==e?0:ye(hs(e),292))&&qn(t)){var r=(ys(t)+"e").split("e");return+((r=(ys(n(r[0]+"e"+(+r[1]+e)))+"e").split("e"))[0]+"e"+(+r[1]-e))}return n(t)}}var Gi=xe&&1/ae(new xe([,-0]))[1]==l?function(t){return new xe(t)}:sa;function Ji(t){return function(n){var e=fo(n);return e==w?oe(n):e==O?ce(n):function(t,n){return Rn(n,function(n){return[n,t[n]]})}(n,t(n))}}function Ki(t,n,e,u,l,f,p,h){var d=2&n;if(!d&&"function"!=typeof t)throw new Ot(o);var v=u?u.length:0;if(v||(n&=-97,u=l=i),p=p===i?p:ge(hs(p),0),h=h===i?h:hs(h),v-=l?l.length:0,64&n){var g=u,y=l;u=l=i}var _=d?i:eo(t),m=[t,n,e,u,l,g,y,f,p,h];if(_&&function(t,n){var e=t[1],r=n[1],i=e|r,o=i<131,u=r==c&&8==e||r==c&&256==e&&t[7].length<=n[8]||384==r&&n[7].length<=n[8]&&8==e;if(!o&&!u)return t;1&r&&(t[2]=n[2],i|=1&e?0:4);var a=n[3];if(a){var l=t[3];t[3]=l?Ei(l,a,n[4]):a,t[4]=l?se(t[3],s):n[4]}(a=n[5])&&(l=t[5],t[5]=l?xi(l,a,n[6]):a,t[6]=l?se(t[5],s):n[6]),(a=n[7])&&(t[7]=a),r&c&&(t[8]=null==t[8]?n[8]:ye(t[8],n[8])),null==t[9]&&(t[9]=n[9]),t[0]=n[0],t[1]=i}(m,_),t=m[0],n=m[1],e=m[2],u=m[3],l=m[4],!(h=m[9]=m[9]===i?d?0:t.length:ge(m[9]-v,0))&&24&n&&(n&=-25),n&&1!=n)b=8==n||16==n?function(t,n,e){var o=Li(t);return function u(){for(var s=arguments.length,a=r(s),c=s,l=io(u);c--;)a[c]=arguments[c];var f=s<3&&a[0]!==l&&a[s-1]!==l?[]:se(a,l);return(s-=f.length)<e?Wi(t,n,qi,u.placeholder,i,a,f,i,i,e-s):En(this&&this!==pn&&this instanceof u?o:t,this,a)}}(t,n,h):n!=a&&33!=n||l.length?qi.apply(i,m):function(t,n,e,i){var o=1&n,u=Li(t);return function n(){for(var s=-1,a=arguments.length,c=-1,l=i.length,f=r(l+a),p=this&&this!==pn&&this instanceof n?u:t;++c<l;)f[c]=i[c];for(;a--;)f[c++]=arguments[++s];return En(p,o?e:this,f)}}(t,n,e,u);else var b=function(t,n,e){var r=1&n,i=Li(t);return function n(){return(this&&this!==pn&&this instanceof n?i:t).apply(r?e:this,arguments)}}(t,n,e);return Co((_?Zr:Oo)(b,m),t,n)}function Hi(t,n,e,r){return t===i||Uu(t,Ct[e])&&!Pt.call(r,e)?n:t}function Yi(t,n,e,r,o,u){return Qu(t)&&Qu(n)&&(u.set(n,t),Ur(t,n,i,Yi,u),u.delete(n)),t}function Zi(t){return rs(t)?i:t}function Xi(t,n,e,r,o,u){var s=1&e,a=t.length,c=n.length;if(a!=c&&!(s&&c>a))return!1;var l=u.get(t),f=u.get(n);if(l&&f)return l==n&&f==t;var p=-1,h=!0,d=2&e?new Ge:i;for(u.set(t,n),u.set(n,t);++p<a;){var v=t[p],g=n[p];if(r)var y=s?r(g,v,p,n,t,u):r(v,g,p,t,n,u);if(y!==i){if(y)continue;h=!1;break}if(d){if(!Mn(n,function(t,n){if(!Xn(d,n)&&(v===t||o(v,t,e,r,u)))return d.push(n)})){h=!1;break}}else if(v!==g&&!o(v,g,e,r,u)){h=!1;break}}return u.delete(t),u.delete(n),h}function Qi(t){return ko(Eo(t,i,Wo),t+"")}function to(t){return wr(t,Cs,co)}function no(t){return wr(t,Ss,lo)}var eo=je?function(t){return je.get(t)}:sa;function ro(t){for(var n=t.name+"",e=ke[n],r=Pt.call(ke,n)?e.length:0;r--;){var i=e[r],o=i.func;if(null==o||o==t)return i.name}return n}function io(t){return(Pt.call(Ne,"placeholder")?Ne:t).placeholder}function oo(){var t=Ne.iteratee||ra;return t=t===ra?Pr:t,arguments.length?t(arguments[0],arguments[1]):t}function uo(t,n){var e,r,i=t.__data__;return("string"==(r=typeof(e=n))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==e:null===e)?i["string"==typeof n?"string":"hash"]:i.map}function so(t){for(var n=Cs(t),e=n.length;e--;){var r=n[e],i=t[r];n[e]=[r,i,wo(i)]}return n}function ao(t,n){var e=function(t,n){return null==t?i:t[n]}(t,n);return Rr(e)?e:i}var co=gn?function(t){return null==t?[]:(t=Et(t),kn(gn(t),function(n){return Gt.call(t,n)}))}:da,lo=gn?function(t){for(var n=[];t;)Pn(n,co(t)),t=Wt(t);return n}:da,fo=Tr;function po(t,n,e){for(var r=-1,i=(n=gi(n,t)).length,o=!1;++r<i;){var u=Mo(n[r]);if(!(o=null!=t&&e(t,u)))break;t=t[u]}return o||++r!=i?o:!!(i=null==t?0:t.length)&&Xu(i)&&go(u,i)&&($u(t)||Bu(t))}function ho(t){return"function"!=typeof t.constructor||Io(t)?{}:Ue(Wt(t))}function vo(t){return $u(t)||Bu(t)||!!(Kt&&t&&t[Kt])}function go(t,n){var e=typeof t;return!!(n=n??f)&&("number"==e||"symbol"!=e&&yt.test(t))&&t>-1&&t%1==0&&t<n}function yo(t,n,e){if(!Qu(e))return!1;var r=typeof n;return!!("number"==r?Vu(e)&&go(n,e.length):"string"==r&&n in e)&&Uu(e[n],t)}function _o(t,n){if($u(t))return!1;var e=typeof t;return!("number"!=e&&"symbol"!=e&&"boolean"!=e&&null!=t&&!ss(t))||Q.test(t)||!X.test(t)||null!=n&&t in Et(n)}function mo(t){var n=ro(t),e=Ne[n];if("function"!=typeof e||!(n in Be.prototype))return!1;if(t===e)return!0;var r=eo(e);return!!r&&t===r[0]}(we&&fo(new we(new ArrayBuffer(1)))!=R||Te&&fo(new Te)!=w||Ee&&fo(Ee.resolve())!=x||xe&&fo(new xe)!=O||Ae&&fo(new Ae)!=C)&&(fo=function(t){var n=Tr(t),e=n==E?t.constructor:i,r=e?qo(e):"";if(r)switch(r){case Ce:return R;case Se:return w;case Re:return x;case Pe:return O;case Le:return C}return n});var bo=St?Yu:va;function Io(t){var n=t&&t.constructor;return t===("function"==typeof n&&n.prototype||Ct)}function wo(t){return t==t&&!Qu(t)}function To(t,n){return function(e){return null!=e&&e[t]===n&&(n!==i||t in Et(e))}}function Eo(t,n,e){return n=ge(n===i?t.length-1:n,0),function(){for(var i=arguments,o=-1,u=ge(i.length-n,0),s=r(u);++o<u;)s[o]=i[n+o];o=-1;for(var a=r(n+1);++o<n;)a[o]=i[o];return a[n]=e(s),En(t,this,a)}}function xo(t,n){return n.length<2?t:Ir(t,ti(n,0,-1))}function Ao(t,n){if(("constructor"!==n||"function"!=typeof t[n])&&"__proto__"!=n)return t[n]}var Oo=So(Zr),jo=fn||function(t,n){return pn.setTimeout(t,n)},ko=So(Xr);function Co(t,n,e){var r=n+"";return ko(t,function(t,n){var e=n.length;if(!e)return t;var r=e-1;return n[r]=(e>1?"& ":"")+n[r],n=n.join(e>2?", ":" "),t.replace(ot,"{\n/* [wrapped with "+n+"] */\n")}(r,function(t,n){return An(d,function(e){var r="_."+e[0];n&e[1]&&!Cn(t,r)&&t.push(r)}),t.sort()}(function(t){var n=t.match(ut);return n?n[1].split(st):[]}(r),e)))}function So(t){var n=0,e=0;return function(){var r=_e(),o=16-(r-e);if(e=r,o>0){if(++n>=800)return arguments[0]}else n=0;return t.apply(i,arguments)}}function Ro(t,n){var e=-1,r=t.length,o=r-1;for(n=n===i?r:n;++e<n;){var u=Vr(e,o),s=t[u];t[u]=t[e],t[e]=s}return t.length=n,t}var Po,Lo,Do=(Po=Pu(function(t){var n=[];return 46===t.charCodeAt(0)&&n.push(""),t.replace(tt,function(t,e,r,i){n.push(r?i.replace(lt,"$1"):e||t)}),n},function(t){return 500===Lo.size&&Lo.clear(),t}),Lo=Po.cache,Po);function Mo(t){if("string"==typeof t||ss(t))return t;var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}function qo(t){if(null!=t){try{return Rt.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function No(t){if(t instanceof Be)return t.clone();var n=new Fe(t.__wrapped__,t.__chain__);return n.__actions__=Ai(t.__actions__),n.__index__=t.__index__,n.__values__=t.__values__,n}var Uo=Jr(function(t,n){return Gu(t)?cr(t,vr(n,1,Gu,!0)):[]}),zo=Jr(function(t,n){var e=Ho(n);return Gu(e)&&(e=i),Gu(t)?cr(t,vr(n,1,Gu,!0),oo(e,2)):[]}),Fo=Jr(function(t,n){var e=Ho(n);return Gu(e)&&(e=i),Gu(t)?cr(t,vr(n,1,Gu,!0),i,e):[]});function Bo(t,n,e){var r=null==t?0:t.length;if(!r)return-1;var i=null==e?0:hs(e);return i<0&&(i=ge(r+i,0)),Un(t,oo(n,3),i)}function $o(t,n,e){var r=null==t?0:t.length;if(!r)return-1;var o=r-1;return e!==i&&(o=hs(e),o=e<0?ge(r+o,0):ye(o,r-1)),Un(t,oo(n,3),o,!0)}function Wo(t){return null!=t&&t.length?vr(t,1):[]}function Vo(t){return t&&t.length?t[0]:i}var Go=Jr(function(t){var n=Rn(t,di);return n.length&&n[0]===t[0]?Or(n):[]}),Jo=Jr(function(t){var n=Ho(t),e=Rn(t,di);return n===Ho(e)?n=i:e.pop(),e.length&&e[0]===t[0]?Or(e,oo(n,2)):[]}),Ko=Jr(function(t){var n=Ho(t),e=Rn(t,di);return(n="function"==typeof n?n:i)&&e.pop(),e.length&&e[0]===t[0]?Or(e,i,n):[]});function Ho(t){var n=null==t?0:t.length;return n?t[n-1]:i}var Yo=Jr(Zo);function Zo(t,n){return t&&t.length&&n&&n.length?$r(t,n):t}var Xo=Qi(function(t,n){var e=null==t?0:t.length,r=ir(t,n);return Wr(t,Rn(n,function(t){return go(t,e)?+t:t}).sort(Ti)),r});function Qo(t){return null==t?t:Ie.call(t)}var tu=Jr(function(t){return si(vr(t,1,Gu,!0))}),nu=Jr(function(t){var n=Ho(t);return Gu(n)&&(n=i),si(vr(t,1,Gu,!0),oo(n,2))}),eu=Jr(function(t){var n=Ho(t);return n="function"==typeof n?n:i,si(vr(t,1,Gu,!0),i,n)});function ru(t){if(!t||!t.length)return[];var n=0;return t=kn(t,function(t){if(Gu(t))return n=ge(t.length,n),!0}),Kn(n,function(n){return Rn(t,Wn(n))})}function iu(t,n){if(!t||!t.length)return[];var e=ru(t);return null==n?e:Rn(e,function(t){return En(n,i,t)})}var ou=Jr(function(t,n){return Gu(t)?cr(t,n):[]}),uu=Jr(function(t){return pi(kn(t,Gu))}),su=Jr(function(t){var n=Ho(t);return Gu(n)&&(n=i),pi(kn(t,Gu),oo(n,2))}),au=Jr(function(t){var n=Ho(t);return n="function"==typeof n?n:i,pi(kn(t,Gu),i,n)}),cu=Jr(ru),lu=Jr(function(t){var n=t.length,e=n>1?t[n-1]:i;return e="function"==typeof e?(t.pop(),e):i,iu(t,e)});function fu(t){var n=Ne(t);return n.__chain__=!0,n}function pu(t,n){return n(t)}var hu=Qi(function(t){var n=t.length,e=n?t[0]:0,r=this.__wrapped__,o=function(n){return ir(n,t)};return!(n>1||this.__actions__.length)&&r instanceof Be&&go(e)?((r=r.slice(e,+e+(n?1:0))).__actions__.push({func:pu,args:[o],thisArg:i}),new Fe(r,this.__chain__).thru(function(t){return n&&!t.length&&t.push(i),t})):this.thru(o)}),du=ji(function(t,n,e){Pt.call(t,e)?++t[e]:rr(t,e,1)}),vu=Di(Bo),gu=Di($o);function yu(t,n){return($u(t)?An:lr)(t,oo(n,3))}function _u(t,n){return($u(t)?On:fr)(t,oo(n,3))}var mu=ji(function(t,n,e){Pt.call(t,e)?t[e].push(n):rr(t,e,[n])}),bu=Jr(function(t,n,e){var i=-1,o="function"==typeof n,u=Vu(t)?r(t.length):[];return lr(t,function(t){u[++i]=o?En(n,t,e):jr(t,n,e)}),u}),Iu=ji(function(t,n,e){rr(t,e,n)});function wu(t,n){return($u(t)?Rn:Mr)(t,oo(n,3))}var Tu=ji(function(t,n,e){t[e?0:1].push(n)},function(){return[[],[]]}),Eu=Jr(function(t,n){if(null==t)return[];var e=n.length;return e>1&&yo(t,n[0],n[1])?n=[]:e>2&&yo(n[0],n[1],n[2])&&(n=[n[0]]),Fr(t,vr(n,1),[])}),xu=ln||function(){return pn.Date.now()};function Au(t,n,e){return n=e?i:n,n=t&&null==n?t.length:n,Ki(t,c,i,i,i,i,n)}function Ou(t,n){var e;if("function"!=typeof n)throw new Ot(o);return t=hs(t),function(){return--t>0&&(e=n.apply(this,arguments)),t<=1&&(n=i),e}}var ju=Jr(function(t,n,e){var r=1;if(e.length){var i=se(e,io(ju));r|=a}return Ki(t,r,n,e,i)}),ku=Jr(function(t,n,e){var r=3;if(e.length){var i=se(e,io(ku));r|=a}return Ki(n,r,t,e,i)});function Cu(t,n,e){var r,u,s,a,c,l,f=0,p=!1,h=!1,d=!0;if("function"!=typeof t)throw new Ot(o);function v(n){var e=r,o=u;return r=u=i,f=n,a=t.apply(o,e)}function g(t){var e=t-l;return l===i||e>=n||e<0||h&&t-f>=s}function y(){var t=xu();if(g(t))return _(t);c=jo(y,function(t){var e=n-(t-l);return h?ye(e,s-(t-f)):e}(t))}function _(t){return c=i,d&&r?v(t):(r=u=i,a)}function m(){var t=xu(),e=g(t);if(r=arguments,u=this,l=t,e){if(c===i)return function(t){return f=t,c=jo(y,n),p?v(t):a}(l);if(h)return mi(c),c=jo(y,n),v(l)}return c===i&&(c=jo(y,n)),a}return n=vs(n)||0,Qu(e)&&(p=!!e.leading,s=(h="maxWait"in e)?ge(vs(e.maxWait)||0,n):s,d="trailing"in e?!!e.trailing:d),m.cancel=function(){c!==i&&mi(c),f=0,r=l=u=c=i},m.flush=function(){return c===i?a:_(xu())},m}var Su=Jr(function(t,n){return ar(t,1,n)}),Ru=Jr(function(t,n,e){return ar(t,vs(n)||0,e)});function Pu(t,n){if("function"!=typeof t||null!=n&&"function"!=typeof n)throw new Ot(o);var e=function(){var r=arguments,i=n?n.apply(this,r):r[0],o=e.cache;if(o.has(i))return o.get(i);var u=t.apply(this,r);return e.cache=o.set(i,u)||o,u};return e.cache=new(Pu.Cache||Ve),e}function Lu(t){if("function"!=typeof t)throw new Ot(o);return function(){var n=arguments;switch(n.length){case 0:return!t.call(this);case 1:return!t.call(this,n[0]);case 2:return!t.call(this,n[0],n[1]);case 3:return!t.call(this,n[0],n[1],n[2])}return!t.apply(this,n)}}Pu.Cache=Ve;var Du=yi(function(t,n){var e=(n=1==n.length&&$u(n[0])?Rn(n[0],Yn(oo())):Rn(vr(n,1),Yn(oo()))).length;return Jr(function(r){for(var i=-1,o=ye(r.length,e);++i<o;)r[i]=n[i].call(this,r[i]);return En(t,this,r)})}),Mu=Jr(function(t,n){var e=se(n,io(Mu));return Ki(t,a,i,n,e)}),qu=Jr(function(t,n){var e=se(n,io(qu));return Ki(t,64,i,n,e)}),Nu=Qi(function(t,n){return Ki(t,256,i,i,i,n)});function Uu(t,n){return t===n||t!=t&&n!=n}var zu=$i(Er),Fu=$i(function(t,n){return t>=n}),Bu=kr(function(){return arguments}())?kr:function(t){return ts(t)&&Pt.call(t,"callee")&&!Gt.call(t,"callee")},$u=r.isArray,Wu=_n?Yn(_n):function(t){return ts(t)&&Tr(t)==S};function Vu(t){return null!=t&&Xu(t.length)&&!Yu(t)}function Gu(t){return ts(t)&&Vu(t)}var Ju=yn||va,Ku=mn?Yn(mn):function(t){return ts(t)&&Tr(t)==_};function Hu(t){if(!ts(t))return!1;var n=Tr(t);return n==m||"[object DOMException]"==n||"string"==typeof t.message&&"string"==typeof t.name&&!rs(t)}function Yu(t){if(!Qu(t))return!1;var n=Tr(t);return n==b||n==I||"[object AsyncFunction]"==n||"[object Proxy]"==n}function Zu(t){return"number"==typeof t&&t==hs(t)}function Xu(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=f}function Qu(t){var n=typeof t;return null!=t&&("object"==n||"function"==n)}function ts(t){return null!=t&&"object"==typeof t}var ns=bn?Yn(bn):function(t){return ts(t)&&fo(t)==w};function es(t){return"number"==typeof t||ts(t)&&Tr(t)==T}function rs(t){if(!ts(t)||Tr(t)!=E)return!1;var n=Wt(t);if(null===n)return!0;var e=Pt.call(n,"constructor")&&n.constructor;return"function"==typeof e&&e instanceof e&&Rt.call(e)==qt}var is=In?Yn(In):function(t){return ts(t)&&Tr(t)==A},os=wn?Yn(wn):function(t){return ts(t)&&fo(t)==O};function us(t){return"string"==typeof t||!$u(t)&&ts(t)&&Tr(t)==j}function ss(t){return"symbol"==typeof t||ts(t)&&Tr(t)==k}var as=Tn?Yn(Tn):function(t){return ts(t)&&Xu(t.length)&&!!on[Tr(t)]},cs=$i(Dr),ls=$i(function(t,n){return t<=n});function fs(t){if(!t)return[];if(Vu(t))return us(t)?fe(t):Ai(t);if(Ht&&t[Ht])return function(t){for(var n,e=[];!(n=t.next()).done;)e.push(n.value);return e}(t[Ht]());var n=fo(t);return(n==w?oe:n==O?ae:Us)(t)}function ps(t){return t?(t=vs(t))===l||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function hs(t){var n=ps(t),e=n%1;return n==n?e?n-e:n:0}function ds(t){return t?or(hs(t),0,h):0}function vs(t){if("number"==typeof t)return t;if(ss(t))return p;if(Qu(t)){var n="function"==typeof t.valueOf?t.valueOf():t;t=Qu(n)?n+"":n}if("string"!=typeof t)return 0===t?t:+t;t=Hn(t);var e=dt.test(t);return e||gt.test(t)?cn(t.slice(2),e?2:8):ht.test(t)?p:+t}function gs(t){return Oi(t,Ss(t))}function ys(t){return null==t?"":ui(t)}var _s=ki(function(t,n){if(Io(n)||Vu(n))Oi(n,Cs(n),t);else for(var e in n)Pt.call(n,e)&&Qe(t,e,n[e])}),ms=ki(function(t,n){Oi(n,Ss(n),t)}),bs=ki(function(t,n,e,r){Oi(n,Ss(n),t,r)}),Is=ki(function(t,n,e,r){Oi(n,Cs(n),t,r)}),ws=Qi(ir),Ts=Jr(function(t,n){t=Et(t);var e=-1,r=n.length,o=r>2?n[2]:i;for(o&&yo(n[0],n[1],o)&&(r=1);++e<r;)for(var u=n[e],s=Ss(u),a=-1,c=s.length;++a<c;){var l=s[a],f=t[l];(f===i||Uu(f,Ct[l])&&!Pt.call(t,l))&&(t[l]=u[l])}return t}),Es=Jr(function(t){return t.push(i,Yi),En(Ps,i,t)});function xs(t,n,e){var r=null==t?i:Ir(t,n);return r===i?e:r}function As(t,n){return null!=t&&po(t,n,Ar)}var Os=Ni(function(t,n,e){null!=n&&"function"!=typeof n.toString&&(n=Mt.call(n)),t[n]=e},Qs(ea)),js=Ni(function(t,n,e){null!=n&&"function"!=typeof n.toString&&(n=Mt.call(n)),Pt.call(t,n)?t[n].push(e):t[n]=[e]},oo),ks=Jr(jr);function Cs(t){return Vu(t)?Ke(t):Lr(t)}function Ss(t){return Vu(t)?Ke(t,!0):function(t){if(!Qu(t))return function(t){var n=[];if(null!=t)for(var e in Et(t))n.push(e);return n}(t);var n=Io(t),e=[];for(var r in t)("constructor"!=r||!n&&Pt.call(t,r))&&e.push(r);return e}(t)}var Rs=ki(function(t,n,e){Ur(t,n,e)}),Ps=ki(function(t,n,e,r){Ur(t,n,e,r)}),Ls=Qi(function(t,n){var e={};if(null==t)return e;var r=!1;n=Rn(n,function(n){return n=gi(n,t),r||(r=n.length>1),n}),Oi(t,no(t),e),r&&(e=ur(e,7,Zi));for(var i=n.length;i--;)ai(e,n[i]);return e}),Ds=Qi(function(t,n){return null==t?{}:function(t,n){return Br(t,n,function(n,e){return As(t,e)})}(t,n)});function Ms(t,n){if(null==t)return{};var e=Rn(no(t),function(t){return[t]});return n=oo(n),Br(t,e,function(t,e){return n(t,e[0])})}var qs=Ji(Cs),Ns=Ji(Ss);function Us(t){return null==t?[]:Zn(t,Cs(t))}var zs=Pi(function(t,n,e){return n=n.toLowerCase(),t+(e?Fs(n):n)});function Fs(t){return Hs(ys(t).toLowerCase())}function Bs(t){return(t=ys(t))&&t.replace(_t,ne).replace(Zt,"")}var $s=Pi(function(t,n,e){return t+(e?"-":"")+n.toLowerCase()}),Ws=Pi(function(t,n,e){return t+(e?" ":"")+n.toLowerCase()}),Vs=Ri("toLowerCase"),Gs=Pi(function(t,n,e){return t+(e?"_":"")+n.toLowerCase()}),Js=Pi(function(t,n,e){return t+(e?" ":"")+Hs(n)}),Ks=Pi(function(t,n,e){return t+(e?" ":"")+n.toUpperCase()}),Hs=Ri("toUpperCase");function Ys(t,n,e){return t=ys(t),(n=e?i:n)===i?function(t){return nn.test(t)}(t)?function(t){return t.match(Qt)||[]}(t):function(t){return t.match(at)||[]}(t):t.match(n)||[]}var Zs=Jr(function(t,n){try{return En(t,i,n)}catch(t){return Hu(t)?t:new It(t)}}),Xs=Qi(function(t,n){return An(n,function(n){n=Mo(n),rr(t,n,ju(t[n],t))}),t});function Qs(t){return function(){return t}}var ta=Mi(),na=Mi(!0);function ea(t){return t}function ra(t){return Pr("function"==typeof t?t:ur(t,1))}var ia=Jr(function(t,n){return function(e){return jr(e,t,n)}}),oa=Jr(function(t,n){return function(e){return jr(t,e,n)}});function ua(t,n,e){var r=Cs(n),i=br(n,r);null!=e||Qu(n)&&(i.length||!r.length)||(e=n,n=t,t=this,i=br(n,Cs(n)));var o=!(Qu(e)&&"chain"in e&&!e.chain),u=Yu(t);return An(i,function(e){var r=n[e];t[e]=r,u&&(t.prototype[e]=function(){var n=this.__chain__;if(o||n){var e=t(this.__wrapped__);return(e.__actions__=Ai(this.__actions__)).push({func:r,args:arguments,thisArg:t}),e.__chain__=n,e}return r.apply(t,Pn([this.value()],arguments))})}),t}function sa(){}var aa=zi(Rn),ca=zi(jn),la=zi(Mn);function fa(t){return _o(t)?Wn(Mo(t)):function(t){return function(n){return Ir(n,t)}}(t)}var pa=Bi(),ha=Bi(!0);function da(){return[]}function va(){return!1}var ga,ya=Ui(function(t,n){return t+n},0),_a=Vi("ceil"),ma=Ui(function(t,n){return t/n},1),ba=Vi("floor"),Ia=Ui(function(t,n){return t*n},1),wa=Vi("round"),Ta=Ui(function(t,n){return t-n},0);return Ne.after=function(t,n){if("function"!=typeof n)throw new Ot(o);return t=hs(t),function(){if(--t<1)return n.apply(this,arguments)}},Ne.ary=Au,Ne.assign=_s,Ne.assignIn=ms,Ne.assignInWith=bs,Ne.assignWith=Is,Ne.at=ws,Ne.before=Ou,Ne.bind=ju,Ne.bindAll=Xs,Ne.bindKey=ku,Ne.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return $u(t)?t:[t]},Ne.chain=fu,Ne.chunk=function(t,n,e){n=(e?yo(t,n,e):n===i)?1:ge(hs(n),0);var o=null==t?0:t.length;if(!o||n<1)return[];for(var u=0,s=0,a=r(hn(o/n));u<o;)a[s++]=ti(t,u,u+=n);return a},Ne.compact=function(t){for(var n=-1,e=null==t?0:t.length,r=0,i=[];++n<e;){var o=t[n];o&&(i[r++]=o)}return i},Ne.concat=function(){var t=arguments.length;if(!t)return[];for(var n=r(t-1),e=arguments[0],i=t;i--;)n[i-1]=arguments[i];return Pn($u(e)?Ai(e):[e],vr(n,1))},Ne.cond=function(t){var n=null==t?0:t.length,e=oo();return t=n?Rn(t,function(t){if("function"!=typeof t[1])throw new Ot(o);return[e(t[0]),t[1]]}):[],Jr(function(e){for(var r=-1;++r<n;){var i=t[r];if(En(i[0],this,e))return En(i[1],this,e)}})},Ne.conforms=function(t){return function(t){var n=Cs(t);return function(e){return sr(e,t,n)}}(ur(t,1))},Ne.constant=Qs,Ne.countBy=du,Ne.create=function(t,n){var e=Ue(t);return null==n?e:er(e,n)},Ne.curry=function t(n,e,r){var o=Ki(n,8,i,i,i,i,i,e=r?i:e);return o.placeholder=t.placeholder,o},Ne.curryRight=function t(n,e,r){var o=Ki(n,16,i,i,i,i,i,e=r?i:e);return o.placeholder=t.placeholder,o},Ne.debounce=Cu,Ne.defaults=Ts,Ne.defaultsDeep=Es,Ne.defer=Su,Ne.delay=Ru,Ne.difference=Uo,Ne.differenceBy=zo,Ne.differenceWith=Fo,Ne.drop=function(t,n,e){var r=null==t?0:t.length;return r?ti(t,(n=e||n===i?1:hs(n))<0?0:n,r):[]},Ne.dropRight=function(t,n,e){var r=null==t?0:t.length;return r?ti(t,0,(n=r-(n=e||n===i?1:hs(n)))<0?0:n):[]},Ne.dropRightWhile=function(t,n){return t&&t.length?li(t,oo(n,3),!0,!0):[]},Ne.dropWhile=function(t,n){return t&&t.length?li(t,oo(n,3),!0):[]},Ne.fill=function(t,n,e,r){var o=null==t?0:t.length;return o?(e&&"number"!=typeof e&&yo(t,n,e)&&(e=0,r=o),function(t,n,e,r){var o=t.length;for((e=hs(e))<0&&(e=-e>o?0:o+e),(r=r===i||r>o?o:hs(r))<0&&(r+=o),r=e>r?0:ds(r);e<r;)t[e++]=n;return t}(t,n,e,r)):[]},Ne.filter=function(t,n){return($u(t)?kn:dr)(t,oo(n,3))},Ne.flatMap=function(t,n){return vr(wu(t,n),1)},Ne.flatMapDeep=function(t,n){return vr(wu(t,n),l)},Ne.flatMapDepth=function(t,n,e){return e=e===i?1:hs(e),vr(wu(t,n),e)},Ne.flatten=Wo,Ne.flattenDeep=function(t){return null!=t&&t.length?vr(t,l):[]},Ne.flattenDepth=function(t,n){return null!=t&&t.length?vr(t,n=n===i?1:hs(n)):[]},Ne.flip=function(t){return Ki(t,512)},Ne.flow=ta,Ne.flowRight=na,Ne.fromPairs=function(t){for(var n=-1,e=null==t?0:t.length,r={};++n<e;){var i=t[n];r[i[0]]=i[1]}return r},Ne.functions=function(t){return null==t?[]:br(t,Cs(t))},Ne.functionsIn=function(t){return null==t?[]:br(t,Ss(t))},Ne.groupBy=mu,Ne.initial=function(t){return null!=t&&t.length?ti(t,0,-1):[]},Ne.intersection=Go,Ne.intersectionBy=Jo,Ne.intersectionWith=Ko,Ne.invert=Os,Ne.invertBy=js,Ne.invokeMap=bu,Ne.iteratee=ra,Ne.keyBy=Iu,Ne.keys=Cs,Ne.keysIn=Ss,Ne.map=wu,Ne.mapKeys=function(t,n){var e={};return n=oo(n,3),_r(t,function(t,r,i){rr(e,n(t,r,i),t)}),e},Ne.mapValues=function(t,n){var e={};return n=oo(n,3),_r(t,function(t,r,i){rr(e,r,n(t,r,i))}),e},Ne.matches=function(t){return qr(ur(t,1))},Ne.matchesProperty=function(t,n){return Nr(t,ur(n,1))},Ne.memoize=Pu,Ne.merge=Rs,Ne.mergeWith=Ps,Ne.method=ia,Ne.methodOf=oa,Ne.mixin=ua,Ne.negate=Lu,Ne.nthArg=function(t){return t=hs(t),Jr(function(n){return zr(n,t)})},Ne.omit=Ls,Ne.omitBy=function(t,n){return Ms(t,Lu(oo(n)))},Ne.once=function(t){return Ou(2,t)},Ne.orderBy=function(t,n,e,r){return null==t?[]:($u(n)||(n=null==n?[]:[n]),$u(e=r?i:e)||(e=null==e?[]:[e]),Fr(t,n,e))},Ne.over=aa,Ne.overArgs=Du,Ne.overEvery=ca,Ne.overSome=la,Ne.partial=Mu,Ne.partialRight=qu,Ne.partition=Tu,Ne.pick=Ds,Ne.pickBy=Ms,Ne.property=fa,Ne.propertyOf=function(t){return function(n){return null==t?i:Ir(t,n)}},Ne.pull=Yo,Ne.pullAll=Zo,Ne.pullAllBy=function(t,n,e){return t&&t.length&&n&&n.length?$r(t,n,oo(e,2)):t},Ne.pullAllWith=function(t,n,e){return t&&t.length&&n&&n.length?$r(t,n,i,e):t},Ne.pullAt=Xo,Ne.range=pa,Ne.rangeRight=ha,Ne.rearg=Nu,Ne.reject=function(t,n){return($u(t)?kn:dr)(t,Lu(oo(n,3)))},Ne.remove=function(t,n){var e=[];if(!t||!t.length)return e;var r=-1,i=[],o=t.length;for(n=oo(n,3);++r<o;){var u=t[r];n(u,r,t)&&(e.push(u),i.push(r))}return Wr(t,i),e},Ne.rest=function(t,n){if("function"!=typeof t)throw new Ot(o);return Jr(t,n=n===i?n:hs(n))},Ne.reverse=Qo,Ne.sampleSize=function(t,n,e){return n=(e?yo(t,n,e):n===i)?1:hs(n),($u(t)?Ye:Hr)(t,n)},Ne.set=function(t,n,e){return null==t?t:Yr(t,n,e)},Ne.setWith=function(t,n,e,r){return r="function"==typeof r?r:i,null==t?t:Yr(t,n,e,r)},Ne.shuffle=function(t){return($u(t)?Ze:Qr)(t)},Ne.slice=function(t,n,e){var r=null==t?0:t.length;return r?(e&&"number"!=typeof e&&yo(t,n,e)?(n=0,e=r):(n=null==n?0:hs(n),e=e===i?r:hs(e)),ti(t,n,e)):[]},Ne.sortBy=Eu,Ne.sortedUniq=function(t){return t&&t.length?ii(t):[]},Ne.sortedUniqBy=function(t,n){return t&&t.length?ii(t,oo(n,2)):[]},Ne.split=function(t,n,e){return e&&"number"!=typeof e&&yo(t,n,e)&&(n=e=i),(e=e===i?h:e>>>0)?(t=ys(t))&&("string"==typeof n||null!=n&&!is(n))&&!(n=ui(n))&&ie(t)?_i(fe(t),0,e):t.split(n,e):[]},Ne.spread=function(t,n){if("function"!=typeof t)throw new Ot(o);return n=null==n?0:ge(hs(n),0),Jr(function(e){var r=e[n],i=_i(e,0,n);return r&&Pn(i,r),En(t,this,i)})},Ne.tail=function(t){var n=null==t?0:t.length;return n?ti(t,1,n):[]},Ne.take=function(t,n,e){return t&&t.length?ti(t,0,(n=e||n===i?1:hs(n))<0?0:n):[]},Ne.takeRight=function(t,n,e){var r=null==t?0:t.length;return r?ti(t,(n=r-(n=e||n===i?1:hs(n)))<0?0:n,r):[]},Ne.takeRightWhile=function(t,n){return t&&t.length?li(t,oo(n,3),!1,!0):[]},Ne.takeWhile=function(t,n){return t&&t.length?li(t,oo(n,3)):[]},Ne.tap=function(t,n){return n(t),t},Ne.throttle=function(t,n,e){var r=!0,i=!0;if("function"!=typeof t)throw new Ot(o);return Qu(e)&&(r="leading"in e?!!e.leading:r,i="trailing"in e?!!e.trailing:i),Cu(t,n,{leading:r,maxWait:n,trailing:i})},Ne.thru=pu,Ne.toArray=fs,Ne.toPairs=qs,Ne.toPairsIn=Ns,Ne.toPath=function(t){return $u(t)?Rn(t,Mo):ss(t)?[t]:Ai(Do(ys(t)))},Ne.toPlainObject=gs,Ne.transform=function(t,n,e){var r=$u(t),i=r||Ju(t)||as(t);if(n=oo(n,4),null==e){var o=t&&t.constructor;e=i?r?new o:[]:Qu(t)&&Yu(o)?Ue(Wt(t)):{}}return(i?An:_r)(t,function(t,r,i){return n(e,t,r,i)}),e},Ne.unary=function(t){return Au(t,1)},Ne.union=tu,Ne.unionBy=nu,Ne.unionWith=eu,Ne.uniq=function(t){return t&&t.length?si(t):[]},Ne.uniqBy=function(t,n){return t&&t.length?si(t,oo(n,2)):[]},Ne.uniqWith=function(t,n){return n="function"==typeof n?n:i,t&&t.length?si(t,i,n):[]},Ne.unset=function(t,n){return null==t||ai(t,n)},Ne.unzip=ru,Ne.unzipWith=iu,Ne.update=function(t,n,e){return null==t?t:ci(t,n,vi(e))},Ne.updateWith=function(t,n,e,r){return r="function"==typeof r?r:i,null==t?t:ci(t,n,vi(e),r)},Ne.values=Us,Ne.valuesIn=function(t){return null==t?[]:Zn(t,Ss(t))},Ne.without=ou,Ne.words=Ys,Ne.wrap=function(t,n){return Mu(vi(n),t)},Ne.xor=uu,Ne.xorBy=su,Ne.xorWith=au,Ne.zip=cu,Ne.zipObject=function(t,n){return hi(t||[],n||[],Qe)},Ne.zipObjectDeep=function(t,n){return hi(t||[],n||[],Yr)},Ne.zipWith=lu,Ne.entries=qs,Ne.entriesIn=Ns,Ne.extend=ms,Ne.extendWith=bs,ua(Ne,Ne),Ne.add=ya,Ne.attempt=Zs,Ne.camelCase=zs,Ne.capitalize=Fs,Ne.ceil=_a,Ne.clamp=function(t,n,e){return e===i&&(e=n,n=i),e!==i&&(e=(e=vs(e))==e?e:0),n!==i&&(n=(n=vs(n))==n?n:0),or(vs(t),n,e)},Ne.clone=function(t){return ur(t,4)},Ne.cloneDeep=function(t){return ur(t,5)},Ne.cloneDeepWith=function(t,n){return ur(t,5,n="function"==typeof n?n:i)},Ne.cloneWith=function(t,n){return ur(t,4,n="function"==typeof n?n:i)},Ne.conformsTo=function(t,n){return null==n||sr(t,n,Cs(n))},Ne.deburr=Bs,Ne.defaultTo=function(t,n){return null==t||t!=t?n:t},Ne.divide=ma,Ne.endsWith=function(t,n,e){t=ys(t),n=ui(n);var r=t.length,o=e=e===i?r:or(hs(e),0,r);return(e-=n.length)>=0&&t.slice(e,o)==n},Ne.eq=Uu,Ne.escape=function(t){return(t=ys(t))&&K.test(t)?t.replace(G,ee):t},Ne.escapeRegExp=function(t){return(t=ys(t))&&et.test(t)?t.replace(nt,"\\$&"):t},Ne.every=function(t,n,e){var r=$u(t)?jn:pr;return e&&yo(t,n,e)&&(n=i),r(t,oo(n,3))},Ne.find=vu,Ne.findIndex=Bo,Ne.findKey=function(t,n){return Nn(t,oo(n,3),_r)},Ne.findLast=gu,Ne.findLastIndex=$o,Ne.findLastKey=function(t,n){return Nn(t,oo(n,3),mr)},Ne.floor=ba,Ne.forEach=yu,Ne.forEachRight=_u,Ne.forIn=function(t,n){return null==t?t:gr(t,oo(n,3),Ss)},Ne.forInRight=function(t,n){return null==t?t:yr(t,oo(n,3),Ss)},Ne.forOwn=function(t,n){return t&&_r(t,oo(n,3))},Ne.forOwnRight=function(t,n){return t&&mr(t,oo(n,3))},Ne.get=xs,Ne.gt=zu,Ne.gte=Fu,Ne.has=function(t,n){return null!=t&&po(t,n,xr)},Ne.hasIn=As,Ne.head=Vo,Ne.identity=ea,Ne.includes=function(t,n,e,r){t=Vu(t)?t:Us(t),e=e&&!r?hs(e):0;var i=t.length;return e<0&&(e=ge(i+e,0)),us(t)?e<=i&&t.indexOf(n,e)>-1:!!i&&zn(t,n,e)>-1},Ne.indexOf=function(t,n,e){var r=null==t?0:t.length;if(!r)return-1;var i=null==e?0:hs(e);return i<0&&(i=ge(r+i,0)),zn(t,n,i)},Ne.inRange=function(t,n,e){return n=ps(n),e===i?(e=n,n=0):e=ps(e),function(t,n,e){return t>=ye(n,e)&&t<ge(n,e)}(t=vs(t),n,e)},Ne.invoke=ks,Ne.isArguments=Bu,Ne.isArray=$u,Ne.isArrayBuffer=Wu,Ne.isArrayLike=Vu,Ne.isArrayLikeObject=Gu,Ne.isBoolean=function(t){return!0===t||!1===t||ts(t)&&Tr(t)==y},Ne.isBuffer=Ju,Ne.isDate=Ku,Ne.isElement=function(t){return ts(t)&&1===t.nodeType&&!rs(t)},Ne.isEmpty=function(t){if(null==t)return!0;if(Vu(t)&&($u(t)||"string"==typeof t||"function"==typeof t.splice||Ju(t)||as(t)||Bu(t)))return!t.length;var n=fo(t);if(n==w||n==O)return!t.size;if(Io(t))return!Lr(t).length;for(var e in t)if(Pt.call(t,e))return!1;return!0},Ne.isEqual=function(t,n){return Cr(t,n)},Ne.isEqualWith=function(t,n,e){var r=(e="function"==typeof e?e:i)?e(t,n):i;return r===i?Cr(t,n,i,e):!!r},Ne.isError=Hu,Ne.isFinite=function(t){return"number"==typeof t&&qn(t)},Ne.isFunction=Yu,Ne.isInteger=Zu,Ne.isLength=Xu,Ne.isMap=ns,Ne.isMatch=function(t,n){return t===n||Sr(t,n,so(n))},Ne.isMatchWith=function(t,n,e){return e="function"==typeof e?e:i,Sr(t,n,so(n),e)},Ne.isNaN=function(t){return es(t)&&t!=+t},Ne.isNative=function(t){if(bo(t))throw new It("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Rr(t)},Ne.isNil=function(t){return null==t},Ne.isNull=function(t){return null===t},Ne.isNumber=es,Ne.isObject=Qu,Ne.isObjectLike=ts,Ne.isPlainObject=rs,Ne.isRegExp=is,Ne.isSafeInteger=function(t){return Zu(t)&&t>=-9007199254740991&&t<=f},Ne.isSet=os,Ne.isString=us,Ne.isSymbol=ss,Ne.isTypedArray=as,Ne.isUndefined=function(t){return t===i},Ne.isWeakMap=function(t){return ts(t)&&fo(t)==C},Ne.isWeakSet=function(t){return ts(t)&&"[object WeakSet]"==Tr(t)},Ne.join=function(t,n){return null==t?"":Vn.call(t,n)},Ne.kebabCase=$s,Ne.last=Ho,Ne.lastIndexOf=function(t,n,e){var r=null==t?0:t.length;if(!r)return-1;var o=r;return e!==i&&(o=(o=hs(e))<0?ge(r+o,0):ye(o,r-1)),n==n?function(t,n,e){for(var r=e+1;r--;)if(t[r]===n)return r;return r}(t,n,o):Un(t,Bn,o,!0)},Ne.lowerCase=Ws,Ne.lowerFirst=Vs,Ne.lt=cs,Ne.lte=ls,Ne.max=function(t){return t&&t.length?hr(t,ea,Er):i},Ne.maxBy=function(t,n){return t&&t.length?hr(t,oo(n,2),Er):i},Ne.mean=function(t){return $n(t,ea)},Ne.meanBy=function(t,n){return $n(t,oo(n,2))},Ne.min=function(t){return t&&t.length?hr(t,ea,Dr):i},Ne.minBy=function(t,n){return t&&t.length?hr(t,oo(n,2),Dr):i},Ne.stubArray=da,Ne.stubFalse=va,Ne.stubObject=function(){return{}},Ne.stubString=function(){return""},Ne.stubTrue=function(){return!0},Ne.multiply=Ia,Ne.nth=function(t,n){return t&&t.length?zr(t,hs(n)):i},Ne.noConflict=function(){return pn._===this&&(pn._=Nt),this},Ne.noop=sa,Ne.now=xu,Ne.pad=function(t,n,e){t=ys(t);var r=(n=hs(n))?le(t):0;if(!n||r>=n)return t;var i=(n-r)/2;return Fi(dn(i),e)+t+Fi(hn(i),e)},Ne.padEnd=function(t,n,e){t=ys(t);var r=(n=hs(n))?le(t):0;return n&&r<n?t+Fi(n-r,e):t},Ne.padStart=function(t,n,e){t=ys(t);var r=(n=hs(n))?le(t):0;return n&&r<n?Fi(n-r,e)+t:t},Ne.parseInt=function(t,n,e){return e||null==n?n=0:n&&(n=+n),me(ys(t).replace(rt,""),n||0)},Ne.random=function(t,n,e){if(e&&"boolean"!=typeof e&&yo(t,n,e)&&(n=e=i),e===i&&("boolean"==typeof n?(e=n,n=i):"boolean"==typeof t&&(e=t,t=i)),t===i&&n===i?(t=0,n=1):(t=ps(t),n===i?(n=t,t=0):n=ps(n)),t>n){var r=t;t=n,n=r}if(e||t%1||n%1){var o=be();return ye(t+o*(n-t+an("1e-"+((o+"").length-1))),n)}return Vr(t,n)},Ne.reduce=function(t,n,e){var r=$u(t)?Ln:Gn,i=arguments.length<3;return r(t,oo(n,4),e,i,lr)},Ne.reduceRight=function(t,n,e){var r=$u(t)?Dn:Gn,i=arguments.length<3;return r(t,oo(n,4),e,i,fr)},Ne.repeat=function(t,n,e){return n=(e?yo(t,n,e):n===i)?1:hs(n),Gr(ys(t),n)},Ne.replace=function(){var t=arguments,n=ys(t[0]);return t.length<3?n:n.replace(t[1],t[2])},Ne.result=function(t,n,e){var r=-1,o=(n=gi(n,t)).length;for(o||(o=1,t=i);++r<o;){var u=null==t?i:t[Mo(n[r])];u===i&&(r=o,u=e),t=Yu(u)?u.call(t):u}return t},Ne.round=wa,Ne.runInContext=t,Ne.sample=function(t){return($u(t)?He:Kr)(t)},Ne.size=function(t){if(null==t)return 0;if(Vu(t))return us(t)?le(t):t.length;var n=fo(t);return n==w||n==O?t.size:Lr(t).length},Ne.snakeCase=Gs,Ne.some=function(t,n,e){var r=$u(t)?Mn:ni;return e&&yo(t,n,e)&&(n=i),r(t,oo(n,3))},Ne.sortedIndex=function(t,n){return ei(t,n)},Ne.sortedIndexBy=function(t,n,e){return ri(t,n,oo(e,2))},Ne.sortedIndexOf=function(t,n){var e=null==t?0:t.length;if(e){var r=ei(t,n);if(r<e&&Uu(t[r],n))return r}return-1},Ne.sortedLastIndex=function(t,n){return ei(t,n,!0)},Ne.sortedLastIndexBy=function(t,n,e){return ri(t,n,oo(e,2),!0)},Ne.sortedLastIndexOf=function(t,n){if(null!=t&&t.length){var e=ei(t,n,!0)-1;if(Uu(t[e],n))return e}return-1},Ne.startCase=Js,Ne.startsWith=function(t,n,e){return t=ys(t),e=null==e?0:or(hs(e),0,t.length),n=ui(n),t.slice(e,e+n.length)==n},Ne.subtract=Ta,Ne.sum=function(t){return t&&t.length?Jn(t,ea):0},Ne.sumBy=function(t,n){return t&&t.length?Jn(t,oo(n,2)):0},Ne.template=function(t,n,e){var r=Ne.templateSettings;e&&yo(t,n,e)&&(n=i),t=ys(t),n=bs({},n,r,Hi);var o,u,s=bs({},n.imports,r.imports,Hi),a=Cs(s),c=Zn(s,a),l=0,f=n.interpolate||mt,p="__p += '",h=xt((n.escape||mt).source+"|"+f.source+"|"+(f===Z?ft:mt).source+"|"+(n.evaluate||mt).source+"|$","g"),d="//# sourceURL="+(Pt.call(n,"sourceURL")?(n.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++rn+"]")+"\n";t.replace(h,function(n,e,r,i,s,a){return r||(r=i),p+=t.slice(l,a).replace(bt,re),e&&(o=!0,p+="' +\n__e("+e+") +\n'"),s&&(u=!0,p+="';\n"+s+";\n__p += '"),r&&(p+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),l=a+n.length,n}),p+="';\n";var v=Pt.call(n,"variable")&&n.variable;if(v){if(ct.test(v))throw new It("Invalid `variable` option passed into `_.template`")}else p="with (obj) {\n"+p+"\n}\n";p=(u?p.replace(B,""):p).replace($,"$1").replace(W,"$1;"),p="function("+(v||"obj")+") {\n"+(v?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(u?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+p+"return __p\n}";var g=Zs(function(){return wt(a,d+"return "+p).apply(i,c)});if(g.source=p,Hu(g))throw g;return g},Ne.times=function(t,n){if((t=hs(t))<1||t>f)return[];var e=h,r=ye(t,h);n=oo(n),t-=h;for(var i=Kn(r,n);++e<t;)n(e);return i},Ne.toFinite=ps,Ne.toInteger=hs,Ne.toLength=ds,Ne.toLower=function(t){return ys(t).toLowerCase()},Ne.toNumber=vs,Ne.toSafeInteger=function(t){return t?or(hs(t),-9007199254740991,f):0===t?t:0},Ne.toString=ys,Ne.toUpper=function(t){return ys(t).toUpperCase()},Ne.trim=function(t,n,e){if((t=ys(t))&&(e||n===i))return Hn(t);if(!t||!(n=ui(n)))return t;var r=fe(t),o=fe(n);return _i(r,Qn(r,o),te(r,o)+1).join("")},Ne.trimEnd=function(t,n,e){if((t=ys(t))&&(e||n===i))return t.slice(0,pe(t)+1);if(!t||!(n=ui(n)))return t;var r=fe(t);return _i(r,0,te(r,fe(n))+1).join("")},Ne.trimStart=function(t,n,e){if((t=ys(t))&&(e||n===i))return t.replace(rt,"");if(!t||!(n=ui(n)))return t;var r=fe(t);return _i(r,Qn(r,fe(n))).join("")},Ne.truncate=function(t,n){var e=30,r="...";if(Qu(n)){var o="separator"in n?n.separator:o;e="length"in n?hs(n.length):e,r="omission"in n?ui(n.omission):r}var u=(t=ys(t)).length;if(ie(t)){var s=fe(t);u=s.length}if(e>=u)return t;var a=e-le(r);if(a<1)return r;var c=s?_i(s,0,a).join(""):t.slice(0,a);if(o===i)return c+r;if(s&&(a+=c.length-a),is(o)){if(t.slice(a).search(o)){var l,f=c;for(o.global||(o=xt(o.source,ys(pt.exec(o))+"g")),o.lastIndex=0;l=o.exec(f);)var p=l.index;c=c.slice(0,p===i?a:p)}}else if(t.indexOf(ui(o),a)!=a){var h=c.lastIndexOf(o);h>-1&&(c=c.slice(0,h))}return c+r},Ne.unescape=function(t){return(t=ys(t))&&J.test(t)?t.replace(V,he):t},Ne.uniqueId=function(t){var n=++Lt;return ys(t)+n},Ne.upperCase=Ks,Ne.upperFirst=Hs,Ne.each=yu,Ne.eachRight=_u,Ne.first=Vo,ua(Ne,(ga={},_r(Ne,function(t,n){Pt.call(Ne.prototype,n)||(ga[n]=t)}),ga),{chain:!1}),Ne.VERSION="4.17.21",An(["bind","bindKey","curry","curryRight","partial","partialRight"],function(t){Ne[t].placeholder=Ne}),An(["drop","take"],function(t,n){Be.prototype[t]=function(e){e=e===i?1:ge(hs(e),0);var r=this.__filtered__&&!n?new Be(this):this.clone();return r.__filtered__?r.__takeCount__=ye(e,r.__takeCount__):r.__views__.push({size:ye(e,h),type:t+(r.__dir__<0?"Right":"")}),r},Be.prototype[t+"Right"]=function(n){return this.reverse()[t](n).reverse()}}),An(["filter","map","takeWhile"],function(t,n){var e=n+1,r=1==e||3==e;Be.prototype[t]=function(t){var n=this.clone();return n.__iteratees__.push({iteratee:oo(t,3),type:e}),n.__filtered__=n.__filtered__||r,n}}),An(["head","last"],function(t,n){var e="take"+(n?"Right":"");Be.prototype[t]=function(){return this[e](1).value()[0]}}),An(["initial","tail"],function(t,n){var e="drop"+(n?"":"Right");Be.prototype[t]=function(){return this.__filtered__?new Be(this):this[e](1)}}),Be.prototype.compact=function(){return this.filter(ea)},Be.prototype.find=function(t){return this.filter(t).head()},Be.prototype.findLast=function(t){return this.reverse().find(t)},Be.prototype.invokeMap=Jr(function(t,n){return"function"==typeof t?new Be(this):this.map(function(e){return jr(e,t,n)})}),Be.prototype.reject=function(t){return this.filter(Lu(oo(t)))},Be.prototype.slice=function(t,n){t=hs(t);var e=this;return e.__filtered__&&(t>0||n<0)?new Be(e):(t<0?e=e.takeRight(-t):t&&(e=e.drop(t)),n!==i&&(e=(n=hs(n))<0?e.dropRight(-n):e.take(n-t)),e)},Be.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Be.prototype.toArray=function(){return this.take(h)},_r(Be.prototype,function(t,n){var e=/^(?:filter|find|map|reject)|While$/.test(n),r=/^(?:head|last)$/.test(n),o=Ne[r?"take"+("last"==n?"Right":""):n],u=r||/^find/.test(n);o&&(Ne.prototype[n]=function(){var n=this.__wrapped__,s=r?[1]:arguments,a=n instanceof Be,c=s[0],l=a||$u(n),f=function(t){var n=o.apply(Ne,Pn([t],s));return r&&p?n[0]:n};l&&e&&"function"==typeof c&&1!=c.length&&(a=l=!1);var p=this.__chain__,h=!!this.__actions__.length,d=u&&!p,v=a&&!h;if(!u&&l){n=v?n:new Be(this);var g=t.apply(n,s);return g.__actions__.push({func:pu,args:[f],thisArg:i}),new Fe(g,p)}return d&&v?t.apply(this,s):(g=this.thru(f),d?r?g.value()[0]:g.value():g)})}),An(["pop","push","shift","sort","splice","unshift"],function(t){var n=jt[t],e=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);Ne.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var i=this.value();return n.apply($u(i)?i:[],t)}return this[e](function(e){return n.apply($u(e)?e:[],t)})}}),_r(Be.prototype,function(t,n){var e=Ne[n];if(e){var r=e.name+"";Pt.call(ke,r)||(ke[r]=[]),ke[r].push({name:n,func:e})}}),ke[qi(i,2).name]=[{name:"wrapper",func:i}],Be.prototype.clone=function(){var t=new Be(this.__wrapped__);return t.__actions__=Ai(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Ai(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Ai(this.__views__),t},Be.prototype.reverse=function(){if(this.__filtered__){var t=new Be(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Be.prototype.value=function(){var t=this.__wrapped__.value(),n=this.__dir__,e=$u(t),r=n<0,i=e?t.length:0,o=function(t,n,e){for(var r=-1,i=e.length;++r<i;){var o=e[r],u=o.size;switch(o.type){case"drop":t+=u;break;case"dropRight":n-=u;break;case"take":n=ye(n,t+u);break;case"takeRight":t=ge(t,n-u)}}return{start:t,end:n}}(0,i,this.__views__),u=o.start,s=o.end,a=s-u,c=r?s:u-1,l=this.__iteratees__,f=l.length,p=0,h=ye(a,this.__takeCount__);if(!e||!r&&i==a&&h==a)return fi(t,this.__actions__);var d=[];t:for(;a--&&p<h;){for(var v=-1,g=t[c+=n];++v<f;){var y=l[v],_=y.iteratee,m=y.type,b=_(g);if(2==m)g=b;else if(!b){if(1==m)continue t;break t}}d[p++]=g}return d},Ne.prototype.at=hu,Ne.prototype.chain=function(){return fu(this)},Ne.prototype.commit=function(){return new Fe(this.value(),this.__chain__)},Ne.prototype.next=function(){this.__values__===i&&(this.__values__=fs(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?i:this.__values__[this.__index__++]}},Ne.prototype.plant=function(t){for(var n,e=this;e instanceof ze;){var r=No(e);r.__index__=0,r.__values__=i,n?o.__wrapped__=r:n=r;var o=r;e=e.__wrapped__}return o.__wrapped__=t,n},Ne.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof Be){var n=t;return this.__actions__.length&&(n=new Be(this)),(n=n.reverse()).__actions__.push({func:pu,args:[Qo],thisArg:i}),new Fe(n,this.__chain__)}return this.thru(Qo)},Ne.prototype.toJSON=Ne.prototype.valueOf=Ne.prototype.value=function(){return fi(this.__wrapped__,this.__actions__)},Ne.prototype.first=Ne.prototype.head,Ht&&(Ne.prototype[Ht]=function(){return this}),Ne}();pn._=de,(r=function(){return de}.call(n,e,n,t))===i||(t.exports=r)}.call(this)},611(t){"use strict";t.exports=require("http")},692(t){"use strict";t.exports=require("https")},203(t){"use strict";t.exports=require("stream")},16(t){"use strict";t.exports=require("url")},106(t){"use strict";t.exports=require("zlib")}};const n={};function e(r){const i=n[r];if(void 0!==i)return i.exports;const o=n[r]={id:r,loaded:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}e.m=t,e.n=t=>{const n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},e.d=(t,n)=>{if(Array.isArray(n))for(var r=0;r<n.length;){var i=n[r++],o=n[r++];e.o(t,i)?0===o&&r++:0===o?Object.defineProperty(t,i,{enumerable:!0,value:n[r++]}):Object.defineProperty(t,i,{enumerable:!0,get:o})}else for(var i in n)e.o(n,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:n[i]})},e.f={},e.e=t=>Promise.all(Object.keys(e.f).reduce((n,r)=>(e.f[r](t,n),n),[])),e.u=t=>t+".js",e.o=(t,n)=>Object.prototype.hasOwnProperty.call(t,n),e.r=t=>{Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),(()=>{const t={504:1};e.f.require=(n,r)=>{if(!t[n]){const r=require("../../"+e.u(n));t[n]||(n=>{const r=n.modules,i=n.ids,o=n.runtime;for(var u in r)e.o(r,u)&&(e.m[u]=r[u]);o&&o(e);for(var s=0;s<i.length;s++)t[i[s]]=1})(r)}}})();let r={};(()=>{"use strict";e.r(r),e.d(r,{analyticsClient:()=>t.analyticsClient,userTypes:()=>t.userTypes});var t=e(823)})(),module.exports=r})();
|
|
2
|
+
(()=>{var t={543(t,n,e){"use strict";const{FetchHTTPClient:r}=e(721);class i{constructor(t,n,e,r){this.success=t,this.statusCode=n,this.message=e,this.eventResponseList=r}}class o{constructor(t,n,e){this.messageId=t,this.results=n,this.segmentEvent=e}}class u{static toAnalyticsResponse(t,n,e){const r=JSON.parse(JSON.stringify(t.batch)),u=[],[s,a,c]=[e.success,n.status,n.statusText];if(a>=200&&a<=299){const t=JSON.parse(JSON.stringify(e));return"validationReports"in t&&t.validationReports.forEach(t=>{const n=r.find(n=>n.messageId===t.messageId);n&&u.push(new o(n.messageId,t.results,n))}),new i(s,a,c,u)}if(a>=400&&a<=499){const t=JSON.parse(JSON.stringify(e)).message,n="error"in t?t.error:c;return r.forEach(t=>{u.push(new o(t.messageId,[],t))}),new i(s,a,n,u)}return r.forEach(t=>{u.push(new o(t.messageId,[],t))}),new i(s,a,c,u)}}t.exports={AnalyticsFetchHTTPClient:class extends r{constructor(t,n){super(),this.httpClient="function"==typeof t?new r(t):null!=t?t:new r,this.analyticsClient=n}async makeRequest(t){const n=this.httpClient.makeRequest(t),e=await n;if(429===e.status)return n;const r=this.analyticsClient.getResponseCallback();if(null!==r){const n=await e.clone().json();r(u.toAnalyticsResponse(t.data,e,n))}return n}}}},776(t,n,e){"use strict";const r=e(250),{Analytics:i}=e(721),{AnalyticsFetchHTTPClient:o}=e(543),{requireValue:u,validateTrackEvent:s,validateTraitEvent:a,validateUIEvent:c,validateScreenEvent:l,validateOperationalEvent:f,validateAliasType:p,validateGroupType:h}=e(644),d="prod";function v(t,n,e){if(e)throw Error("baseUrl must be specified when interacting with IC environments.");return function(t){return t&&"fedramp-moderate"===t}(n)?t===d?"https://as.atlassian-us-gov-mod.com/api":"https://as.staging.atl-paas-us-gov-mod.net/api":t===d?"https://as.atlassian.com/api":"https://as.staging.atl-paas.net/api"}function g(t,n){return void 0===t?n:t}class y{static callback(t){const n=t.statusCode;n>=200&&n<=299?0===t.eventResponseList.length?console.debug("Event(s) submitted to GASv3"):t.eventResponseList.forEach(t=>{console.warn("Validation report for event with message ID %s:\n",t.messageId,JSON.stringify(t,null,2))}):400===n||404===n?(console.warn("GASv3 submission failed with HTTP Status Code %d: %s",t.statusCode,t.message),t.eventResponseList.forEach(t=>{console.warn("Event with message ID %s:\n",t.messageId,JSON.stringify(t,null,2))})):(console.info("GASv3 submission failed with HTTP Status Code %d: %s",t.statusCode,t.message),t.eventResponseList.forEach(t=>{console.debug("Event with message ID %s:\n",t.messageId,JSON.stringify(t,null,2))}))}}class _{static _buildProperties({userIdType:t,tenantIdType:n,tenantId:e,event:i,subproduct:o,product:u,env:s,datacenter:a,version:c,origin:l,orgId:f,workspaceId:p,aliases:h,groups:d,ic:v},g){return r.merge({},i,{product:u,env:s,datacenter:a,version:c,eventType:g,subproduct:o,userIdType:t,tenantIdType:n,tenantId:e,origin:l,orgId:f,workspaceId:p,aliases:h,groups:d,ic:v})}constructor({env:t,product:n,subproduct:e,sendEventHook:r,datacenter:s,version:a,origin:c,maxEventsInBatch:l,flushInterval:f,baseUrl:p,logger:h,errorHandler:_,perimeter:m,httpClient:b,httpRequestTimeout:I,maxRetries:w,ic:T}){u(t,"env"),u(n,"product"),this.console=g(h,console),this.config={env:t,product:n,subproduct:e,sendEventHook:r,datacenter:s,origin:g(c,"server"),version:a,ic:T},this.validationMode=function(t){return t===d?"quiet":"complete"}(t),this.responseCallback=y.callback,this.analyticsClient=new i({writeKey:"BLANK",flushAt:l||250,flushInterval:f||1e4,maxRetries:w||3,host:p||v(t,m,T),path:"/api/v1/batch",httpRequestTimeout:I,httpClient:new o(b,this)}),_&&"function"==typeof _&&this.analyticsClient.on("error",_),this.groups=void 0,this.aliases=void 0}_getTimeoutMilliseconds(t){const n=g(t,6e4);return n<5e3?(this.console.warn("timeoutMilliseconds was set less than the allowed minimum of 5000.\n Using the minimum allowed value instead."),5e3):n}_eventCallback(t){this.config.sendEventHook&&this.config.sendEventHook(t)}_buildCompleteTrackEvent({userIdType:t,userId:n,anonymousId:e,tenantIdType:i,tenantId:o,trackEvent:u,subproduct:s,product:a,os:c,timestamp:l,orgId:f,workspaceId:p,groups:h,validationMode:d}){const v=r.merge({},this.groups,h);return{userId:n,anonymousId:e,event:u.actionSubject+" "+u.action,properties:_._buildProperties({userIdType:t,tenantIdType:i,tenantId:o,event:u,subproduct:g(s,this.config.subproduct),product:g(a,this.config.product),env:this.config.env,ic:this.config.ic,datacenter:this.config.datacenter,version:this.config.version,origin:g(u.origin,this.config.origin),orgId:f,workspaceId:p,aliases:this.aliases,groups:r.isEmpty(v)?void 0:v},"track"),timestamp:l,context:{os:c,validationMode:null!=d?d:this.validationMode}}}_buildCompleteTraitEvent({entityType:t,entityId:n,entityTraits:e,os:r,timestamp:i,tenantId:o,tenantIdType:u,validationMode:s}){return{anonymousId:"dummy-id",traits:{entityId:n,entityTraits:e,entityType:t},timestamp:i,context:{os:r,validationMode:null!=s?s:this.validationMode},tenantId:o,tenantIdType:u}}_buildCompleteOperationalEvent({userIdType:t,userId:n,anonymousId:e,tenantIdType:r,tenantId:i,operationalEvent:o,subproduct:u,product:s,os:a,timestamp:c,orgId:l,workspaceId:f,validationMode:p}){return{userId:n,anonymousId:e,event:o.actionSubject+" "+o.action,properties:_._buildProperties({userIdType:t,tenantIdType:r,tenantId:i,event:o,subproduct:g(u,this.config.subproduct),product:g(s,this.config.product),env:this.config.env,ic:this.config.ic,datacenter:this.config.datacenter,version:this.config.version,origin:g(o.origin,this.config.origin),orgId:l,workspaceId:f,aliases:this.aliases,groups:this.groups},"operational"),timestamp:c,context:{os:a,validationMode:null!=p?p:this.validationMode}}}_buildCompleteUIEvent({userIdType:t,userId:n,anonymousId:e,tenantIdType:r,tenantId:i,uiEvent:o,subproduct:u,product:s,os:a,timestamp:c,orgId:l,workspaceId:f,validationMode:p}){return{userId:n,anonymousId:e,event:o.actionSubject+" "+o.action,properties:_._buildProperties({userIdType:t,tenantIdType:r,tenantId:i,event:o,subproduct:g(u,this.config.subproduct),product:g(s,this.config.product),env:this.config.env,ic:this.config.ic,datacenter:this.config.datacenter,version:this.config.version,origin:g(o.origin,this.config.origin),orgId:l,workspaceId:f,aliases:this.aliases,groups:this.groups},"ui"),timestamp:c,context:{os:a,validationMode:null!=p?p:this.validationMode}}}_buildScreenEvent({userIdType:t,userId:n,anonymousId:e,tenantIdType:r,tenantId:i,name:o,screenEvent:u,subproduct:s,product:a,os:c,timestamp:l,orgId:f,workspaceId:p,validationMode:h}){return{userId:n,anonymousId:e,name:o,properties:_._buildProperties({userIdType:t,tenantIdType:r,tenantId:i,event:u,subproduct:g(s,this.config.subproduct),product:g(a,this.config.product),env:this.config.env,ic:this.config.ic,datacenter:this.config.datacenter,version:this.config.version,origin:g(u.origin,this.config.origin),orgId:f,workspaceId:p,aliases:this.aliases,groups:this.groups},"screen"),timestamp:l,context:{os:c,validationMode:null!=h?h:this.validationMode}}}sendOperationalEvent({userIdType:t,userId:n,anonymousId:e,tenantIdType:r,tenantId:i,operationalEvent:o,subproduct:u,product:s,os:a,timestamp:c,orgId:l,workspaceId:p,validationMode:h}){return f({userIdType:t,userId:n,anonymousId:e,tenantIdType:r,tenantId:i,timestamp:c,operationalEvent:o}).then(()=>new Promise((f,d)=>{const v=this._buildCompleteOperationalEvent({userIdType:t,userId:n,anonymousId:e,tenantIdType:r,tenantId:i,operationalEvent:o,subproduct:u,product:s,os:a,timestamp:c,orgId:l,workspaceId:p,validationMode:h});this.analyticsClient.track(v,(t,n)=>{t?d(t):(this._eventCallback(v,n),f(n))})}))}sendTrackEvent({userIdType:t,userId:n,anonymousId:e,tenantIdType:r,tenantId:i,trackEvent:o,groups:u,subproduct:a,product:c,os:l,timestamp:f,orgId:p,workspaceId:h,validationMode:d}){return s({userIdType:t,userId:n,anonymousId:e,tenantIdType:r,tenantId:i,timestamp:f,trackEvent:o,groups:u}).then(()=>new Promise((s,v)=>{const g=this._buildCompleteTrackEvent({userIdType:t,userId:n,anonymousId:e,tenantIdType:r,tenantId:i,trackEvent:o,subproduct:a,product:c,os:l,timestamp:f,orgId:p,workspaceId:h,groups:u,validationMode:d});this.analyticsClient.track(g,(t,n)=>{t?v(t):(this._eventCallback(g,n),s(n))})}))}sendTraitEvent({entityType:t,entityId:n,entityTraits:e,os:r,timestamp:i,tenantId:o,tenantIdType:u,validationMode:s}){return a({entityType:t,entityId:n,entityTraits:e,timestamp:i,tenantId:o,tenantIdType:u}).then(()=>new Promise((a,c)=>{const l=this._buildCompleteTraitEvent({entityType:t,entityId:n,entityTraits:e,os:r,timestamp:i,tenantId:o,tenantIdType:u,validationMode:s});this.analyticsClient.identify(l,(t,n)=>{t?c(t):(this._eventCallback(l,n),a(n))})}))}sendUIEvent({userIdType:t,userId:n,anonymousId:e,tenantIdType:r,tenantId:i,uiEvent:o,subproduct:u,product:s,os:a,timestamp:l,orgId:f,workspaceId:p,validationMode:h}){return c({userIdType:t,userId:n,anonymousId:e,tenantIdType:r,tenantId:i,timestamp:l,uiEvent:o}).then(()=>new Promise((c,d)=>{const v=this._buildCompleteUIEvent({userIdType:t,userId:n,anonymousId:e,tenantIdType:r,tenantId:i,uiEvent:o,subproduct:u,product:s,os:a,timestamp:l,orgId:f,workspaceId:p,validationMode:h});this.analyticsClient.track(v,(t,n)=>{t?d(t):(this._eventCallback(v,n),c(n))})}))}sendScreenEvent({userIdType:t,userId:n,anonymousId:e,tenantIdType:r,tenantId:i,name:o,screenEvent:u,subproduct:s,product:a,os:c,timestamp:f,orgId:p,workspaceId:h,validationMode:d}){return l({userIdType:t,userId:n,anonymousId:e,tenantIdType:r,tenantId:i,name:o,timestamp:f,screenEvent:u}).then(()=>new Promise((l,v)=>{const g=this._buildScreenEvent({userIdType:t,userId:n,anonymousId:e,tenantIdType:r,tenantId:i,name:o,screenEvent:u,subproduct:s,product:a,os:c,timestamp:f,orgId:p,workspaceId:h,validationMode:d});this.analyticsClient.page(g,(t,n)=>{t?v(t):(this._eventCallback(g,n),l(n))})}))}gracefulShutdown(){return new Promise((t,n)=>{this.analyticsClient.closeAndFlush().then(n=>{t(n)}).catch(t=>{n(t)})})}setGroup(t,n){this.groups||(this.groups={}),h(t),this.groups[t]=n}clearGroups(){this.groups=void 0}setAlias(t,n){this.aliases||(this.aliases={}),p(t),this.aliases[t]=n}clearAliases(){this.aliases=void 0}setResponseCallback(t){this.responseCallback=t}getResponseCallback(){return this.responseCallback}setEventValidationMode(t){this.validationMode=t}}t.exports={AnalyticsClient:_}},378(t){"use strict";const n={};t.exports={isAllowedAliasType:function(t){return Object.values(n).includes(t)},ALIAS_TYPE:n}},60(t){"use strict";const n="id",e="type",r=[n,e],i=[n];t.exports={CONTAINER_OBJECT_FIELDS_ALLOWED:r,CONTAINER_OBJECT_FIELDS_MANDATORY:i,CONTAINER_OBJECT_FIELD_ID:n,CONTAINER_OBJECT_FIELD_TYPE:e,isAllowedContainerObjectField:function(t){return r.some(n=>n===t)},isValidContainerObjectField:function(t,n){return r.some(n=>n===t)&&"string"==typeof n}}},435(t,n,e){"use strict";const r=e(250),i="AJS_ANONYMOUS_USER",o="ATLASSIAN_ACCOUNT",u="EMAIL_UUID",s="SITE",a="SITE_USER",c="TRELLO_USER",l="TRELLO_WORKSPACE",f=[i,o,u,"ORG",s,a,c,l];t.exports={AJS_ANONYMOUS_USER:i,ATLASSIAN_ACCOUNT:o,EMAIL_UUID:u,ORG:"ORG",SITE:s,SITE_USER:a,TRELLO_USER:c,TRELLO_WORKSPACE:l,isValidEntityType:function(t){return f.includes(t)},isValidEntityTraitValue:function(t){return r.isFinite(t)||r.isString(t)&&!r.isEmpty(t)||r.isDate(t)||r.isBoolean(t)}}},159(t){"use strict";const n={TRANSACTION_ACCOUNT_ID:"transactionAccountId",PRODUCT_INTEGRATIONS_VENDOR_ID:"productIntegrationsVendorId"};t.exports={isAllowedGroupType:function(t){return Object.values(n).includes(t)},GROUP_TYPE:n}},350(t){"use strict";const n="cloudId",e="halpTeamId",r="loomOrgId",i="trelloWorkspaceId",o="none",u=[n,e,r,i,o];t.exports={CLOUD_ID:n,HALP_TEAM_ID:e,NONE:o,LOOM_ORG_ID:r,TRELLO_WORKSPACE_ID:i,isValidTenantType:function(t){return u.includes(t)}}},119(t){"use strict";const n="atlassianAccount",e="trello",r="hashedEmail",i="opsgenie",o="halp",u="customerAccount",s="loom";t.exports={ATLASSIAN_ACCOUNT:n,TRELLO:e,HASHED_EMAIL:r,OPSGENIE:i,HALP:o,CUSTOMER_ACCOUNT:u,LOOM:s,isValidUserIdType:function(t){return[n,e,r,i,o,u,s].includes(t)}}},823(t,n,e){"use strict";const{AnalyticsClient:r}=e(776),i=e(350),o=e(119),u=e(435),{GROUP_TYPE:s}=e(159),{ALIAS_TYPE:a}=e(378);t.exports={analyticsClient:function(t){return new r(t)},AnalyticsClient:r,tenantTypes:i,userTypes:o,entityTypes:u,aliasTypes:a,groupTypes:s}},644(t,n,e){"use strict";const r=e(250),i=e(350),o=e(119),u=e(435),{CONTAINER_OBJECT_FIELDS_MANDATORY:s,isAllowedContainerObjectField:a,isValidContainerObjectField:c}=e(60),{isPlainObject:l}=e(370),{isAllowedAliasType:f}=e(378),{isAllowedGroupType:p}=e(159),h="properties.containers";function d({entityType:t,entityTraits:n}){if(!u.isValidEntityType(t))throw new Error(`Unknown entityType ${t}`);if(!r.isObject(n))throw new Error("traits.entityTraits should be Object");r.forEach(n,(t,n)=>{if(!u.isValidEntityTraitValue(t))throw new Error(`entityTraits.${n}: ${t} should be one of [String|Number|Boolean|Date]`)})}function v({tenantId:t,tenantIdType:n}){if(t&&y(n,"tenantIdType"),n){if(!i.isValidTenantType(n))throw new Error(`Unknown tenantIdType ${n}`);n!==i.NONE&&y(t,"tenantId")}}function g({userIdType:t,userId:n,anonymousId:e}){if(function({userIdType:t,userId:n}){if(n&&y(t,"userIdType"),t){if(!o.isValidUserIdType(t))throw new Error(`Unknown userIdType ${t}`);y(n,"userId")}}({userIdType:t,userId:n}),!n&&!e)throw new Error("At least one set of identifiers must be passed - userIdType and userId, or anonymousId")}function y(t,n){if(!t)throw new Error(`Value ${n} cannot be undefined`);return t}function _(t){if(t&&t.containers){const n=t.containers;if(!l(n))throw new Error(`"${h}" is not an object.`);{const e={};Object.keys(n).forEach(t=>{e[t]=function(t,n){const e=n[t];if(e){if(l(e)){const t={};return r.merge(t,function(t){const n={};return s.forEach(e=>{const r=t[e];if(!c(e,r))throw new Error(`Mandatory ContainerObject field "${e}" is not valid: "${r}" ; expected a value of type "string"`);n[e]=r}),n}(e)),r.merge(t,function(t){const n={};return Object.keys(t).forEach(e=>{const r=t[e];if(a(e)){if(!c(e,r))throw new Error(`ContainerObject field "${e}" is not valid: "${r}" ; expected a value of type "string"`);n[e]=r}}),n}(e)),t}throw new Error(`ContainerObject "${h}.${t}" is not an object.`)}throw new Error(`Container Key "${h}.${t}" has no ContainerObject.`)}(t,n)}),t.containers=e}}}t.exports={requireValue:y,validateOperationalEvent:function({userIdType:t,userId:n,anonymousId:e,tenantIdType:r,tenantId:i,operationalEvent:o}){try{return g({userIdType:t,userId:n,anonymousId:e}),v({tenantId:i,tenantIdType:r}),y(o,"operationalEvent"),y(o.source,"operationalEvent.source"),y(o.action,"operationalEvent.action"),y(o.actionSubject,"operationalEvent.actionSubject"),_(o),Promise.resolve()}catch(t){return Promise.reject(t)}},validateTrackEvent:function({userIdType:t,userId:n,anonymousId:e,tenantIdType:r,tenantId:i,trackEvent:o,groups:u}){try{return g({userIdType:t,userId:n,anonymousId:e}),v({tenantId:i,tenantIdType:r}),y(o,"trackEvent"),y(o.source,"trackEvent.source"),y(o.action,"trackEvent.action"),y(o.actionSubject,"trackEvent.actionSubject"),_(o),function(t){t&&Object.keys(t).forEach(t=>{if(!p(t))throw new Error(`groups object has unsupported groupKey: ${t}`)})}(u),Promise.resolve()}catch(t){return Promise.reject(t)}},validateUIEvent:function({userIdType:t,userId:n,anonymousId:e,tenantIdType:r,tenantId:i,uiEvent:o}){try{return g({userIdType:t,userId:n,anonymousId:e}),v({tenantId:i,tenantIdType:r}),y(o,"uiEvent"),y(o.action,"uiEvent.action"),y(o.actionSubject,"uiEvent.actionSubject"),_(o),Promise.resolve()}catch(t){return Promise.reject(t)}},validateScreenEvent:function({userIdType:t,userId:n,anonymousId:e,tenantIdType:r,tenantId:i,name:o,screenEvent:u}){try{return g({userIdType:t,userId:n,anonymousId:e}),v({tenantId:i,tenantIdType:r}),y(o,"name"),y(u,"screenEvent"),y(u.platform,"screenEvent.platform"),_(u),Promise.resolve()}catch(t){return Promise.reject(t)}},validateTraitEvent:function({entityType:t,entityId:n,entityTraits:e,tenantId:r,tenantIdType:i}){try{return y(t,"entityType"),y(n,"entityId"),y(e,"entityTraits"),d({entityType:t,entityTraits:e}),v({tenantId:r,tenantIdType:i}),Promise.resolve()}catch(t){return Promise.reject(t)}},requireValidEntityData:d,requireValidUserData:g,requireValidTenantData:v,requireValidContainers:_,validateAliasType:function(t){if(y(t,"aliasType"),!f(t))throw new Error(`Unknown aliasType ${t}`)},validateGroupType:function(t){if(y(t,"groupType"),!p(t))throw new Error(`Unknown groupType ${t}`)},CONTAINERS_PATH_PREFIX:h}},370(t){"use strict";function n(t){return 1==(null!==(n=t)&&"object"==typeof n&&!1===Array.isArray(n))&&"[object Object]"===Object.prototype.toString.call(t);var n}t.exports={isPlainObject:function(t){if(!1===n(t))return!1;const e=t.constructor;if("function"!=typeof e)return!1;const r=e.prototype;return!1!==n(r)&&!1!==Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")}}},721(t,n,e){"use strict";function r(t,n){return new Promise(function(e,r){var i=setTimeout(function(){r(Error("Promise timed out"))},n);t.then(function(t){return clearTimeout(i),e(t)}).catch(r)})}function i(t,n,e){var i;return(i=e,new Promise(function(t){return setTimeout(t,i)})).then(function(){return r(function(){try{return Promise.resolve(n(t))}catch(t){return Promise.reject(t)}}(),1e3)}).catch(function(n){null==t||t.log("warn","Callback Error",{error:n}),null==t||t.stats.increment("callback_error")}).then(function(){return t})}e.d(n,{Analytics:()=>tt,FetchHTTPClient:()=>Q});var o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)};function u(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}var s=function(){return s=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var i in n=arguments[e])Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i]);return t},s.apply(this,arguments)};function a(t,n,e,r){return new(e||(e=Promise))(function(i,o){function u(t){try{a(r.next(t))}catch(t){o(t)}}function s(t){try{a(r.throw(t))}catch(t){o(t)}}function a(t){var n;t.done?i(t.value):(n=t.value,n instanceof e?n:new e(function(t){t(n)})).then(u,s)}a((r=r.apply(t,n||[])).next())})}function c(t,n){var e,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},u=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return u.next=s(0),u.throw=s(1),u.return=s(2),"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function s(s){return function(a){return function(s){if(e)throw new TypeError("Generator is already executing.");for(;u&&(u=0,s[0]&&(o=0)),o;)try{if(e=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=n.call(t,o)}catch(t){s=[6,t],r=0}finally{e=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}}function l(t,n,e){if(e||2===arguments.length)for(var r,i=0,o=n.length;i<o;i++)!r&&i in n||(r||(r=Array.prototype.slice.call(n,0,i)),r[i]=n[i]);return t.concat(r||Array.prototype.slice.call(n))}Object.create,Object.create;var f=function(t){function n(n,e){var r=t.call(this,"".concat(n," ").concat(e))||this;return r.field=n,r}return u(n,t),n}(Error);function p(t){var n=Math.random()+1,e=t.minTimeout,r=void 0===e?500:e,i=t.factor,o=void 0===i?2:i,u=t.attempt,s=t.maxTimeout,a=void 0===s?1/0:s;return Math.min(n*r*Math.pow(o,u),a)}for(var h,d=256,v=[];d--;)v[d]=(d+256).toString(16).substring(1);function g(){var t,n=0,e="";if(!h||d+16>256){for(h=Array(n=256);n--;)h[n]=256*Math.random()|0;n=d=0}for(;n<16;n++)t=h[d+n],e+=6==n?v[15&t|64]:8==n?v[63&t|128]:v[t],1&n&&n>1&&n<11&&(e+="-");return d++,e}class y{constructor(t){this.id=g(),this.items=[],this.sizeInBytes=0,this.maxEventCount=Math.max(1,t)}tryAdd(t){if(this.length===this.maxEventCount)return{success:!1,message:`Event limit of ${this.maxEventCount} has been exceeded.`};const n=this.calculateSize(t.context);return n>32768?{success:!1,message:"Event exceeds maximum event size of 32 KB"}:this.sizeInBytes+n>491520?{success:!1,message:"Event has caused batch size to exceed 480 KB"}:(this.items.push(t),this.sizeInBytes+=n,{success:!0})}get length(){return this.items.length}calculateSize(t){return encodeURI(JSON.stringify(t.event)).split(/%..|i/).length}getEvents(){return this.items.map(({context:t})=>t.event)}getContexts(){return this.items.map(t=>t.context)}resolveEvents(){this.items.forEach(({resolver:t,context:n})=>t(n))}}const _=require("buffer");function m(t){return new Promise(n=>setTimeout(n,t))}function b(){}class I{constructor({host:t,path:n,maxRetries:e,flushAt:r,flushInterval:i,writeKey:o,httpRequestTimeout:u,httpClient:s,disable:a},c){var l;this._emitter=c,this._maxRetries=e,this._flushAt=Math.max(r,1),this._flushInterval=i,this._auth=(l=`${o}:`,_.Buffer.from(l).toString("base64")),this._url=((t,n)=>new URL(n||"",t).href.replace(/\/$/,""))(t??"https://api.segment.io",n??"/v1/batch"),this._httpRequestTimeout=u??1e4,this._disable=Boolean(a),this._httpClient=s}createBatch(){this.pendingFlushTimeout&&clearTimeout(this.pendingFlushTimeout);const t=new y(this._flushAt);return this._batch=t,this.pendingFlushTimeout=setTimeout(()=>{t===this._batch&&(this._batch=void 0),this.pendingFlushTimeout=void 0,t.length&&this.send(t).catch(b)},this._flushInterval),t}clearBatch(){this.pendingFlushTimeout&&clearTimeout(this.pendingFlushTimeout),this._batch=void 0}flush(t){t&&(this._flushPendingItemsCount=t,this._batch&&this._batch.length===t&&(this.send(this._batch).catch(b),this.clearBatch()))}enqueue(t){const n=this._batch??this.createBatch(),{promise:e,resolve:r}=function(){var t,n,e=new Promise(function(e,r){t=e,n=r});return{resolve:t,reject:n,promise:e}}(),i={context:t,resolver:r};if(n.tryAdd(i).success){const t=n.length===this._flushPendingItemsCount;return(n.length===this._flushAt||t)&&(this.send(n).catch(b),this.clearBatch()),e}n.length&&(this.send(n).catch(b),this.clearBatch());const o=this.createBatch(),u=o.tryAdd(i);return u.success?(o.length===this._flushPendingItemsCount&&(this.send(o).catch(b),this.clearBatch()),e):(t.setFailedDelivery({reason:new Error(u.message)}),Promise.resolve(t))}async send(t){this._flushPendingItemsCount&&(this._flushPendingItemsCount-=t.length);const n=t.getEvents(),e=this._maxRetries+1;let r=0;for(;r<e;){let i;r++;try{if(this._disable)return t.resolveEvents();const e={url:this._url,method:"POST",headers:{"Content-Type":"application/json",Authorization:`Basic ${this._auth}`,"User-Agent":"analytics-node-next/latest"},data:{batch:n,sentAt:new Date},httpRequestTimeout:this._httpRequestTimeout};this._emitter.emit("http_request",{body:e.data,method:e.method,url:e.url,headers:e.headers});const r=await this._httpClient.makeRequest(e);if(r.status>=200&&r.status<300)return void t.resolveEvents();if(400===r.status)return void w(t,new Error(`[${r.status}] ${r.statusText}`));i=new Error(`[${r.status}] ${r.statusText}`)}catch(t){i=t}if(r===e)return void w(t,i);await m(p({attempt:r,minTimeout:25,maxTimeout:1e3}))}}}function w(t,n){t.getContexts().forEach(t=>t.setFailedDelivery({reason:n})),t.resolveEvents()}const T=()=>"object"==typeof process&&process&&"object"==typeof process.env&&process.env&&"string"==typeof process.version?"node":"object"==typeof window?"browser":"undefined"!=typeof WebSocketPair?"cloudflare-worker":"string"==typeof EdgeRuntime?"vercel-edge":"undefined"!=typeof WorkerGlobalScope&&"function"==typeof importScripts?"web-worker":"unknown";function E(t){function n(n){return function(t){t.updateEvent("context.library.name","@segment/analytics-node"),t.updateEvent("context.library.version","1.3.0");const n=T();"node"===n&&t.updateEvent("_metadata.nodeVersion",process.version),t.updateEvent("_metadata.jsRuntime",n)}(n),t.enqueue(n)}return{name:"Segment.io",type:"destination",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),alias:n,group:n,identify:n,page:n,screen:n,track:n}}function x(t,n,e){n.split&&(n=n.split("."));for(var r,i,o=0,u=n.length,s=t;o<u&&"__proto__"!=(i=""+n[o++])&&"constructor"!==i&&"prototype"!==i;)s=s[i]=o===u?e:typeof(r=s[i])==typeof n?r:0*n[o]!=0||~(""+n[o]).indexOf(".")?{}:[]}function A(t){return"string"==typeof t}function O(t){return null!=t}function j(t){return"object"===Object.prototype.toString.call(t).slice(8,-1).toLowerCase()}var k="is not a string",C="is not an object",S="is nil";var R=function(){function t(t){this.user=t.user,this.createMessageId=t.createMessageId}return t.prototype.track=function(t,n,e,r){return this.normalize(s(s({},this.baseEvent()),{event:t,type:"track",properties:null!=n?n:{},options:s({},e),integrations:s({},r)}))},t.prototype.page=function(t,n,e,r,i){var o,u={type:"page",properties:s({},e),options:s({},r),integrations:s({},i)};return null!==t&&(u.category=t,u.properties=null!==(o=u.properties)&&void 0!==o?o:{},u.properties.category=t),null!==n&&(u.name=n),this.normalize(s(s({},this.baseEvent()),u))},t.prototype.screen=function(t,n,e,r,i){var o={type:"screen",properties:s({},e),options:s({},r),integrations:s({},i)};return null!==t&&(o.category=t),null!==n&&(o.name=n),this.normalize(s(s({},this.baseEvent()),o))},t.prototype.identify=function(t,n,e,r){return this.normalize(s(s({},this.baseEvent()),{type:"identify",userId:t,traits:null!=n?n:{},options:s({},e),integrations:r}))},t.prototype.group=function(t,n,e,r){return this.normalize(s(s({},this.baseEvent()),{type:"group",traits:null!=n?n:{},options:s({},e),integrations:s({},r),groupId:t}))},t.prototype.alias=function(t,n,e,r){var i={userId:t,type:"alias",options:s({},e),integrations:s({},r)};return null!==n&&(i.previousId=n),void 0===t?this.normalize(s(s({},i),this.baseEvent())):this.normalize(s(s({},this.baseEvent()),i))},t.prototype.baseEvent=function(){var t={integrations:{},options:{}};if(!this.user)return t;var n=this.user;return n.id()&&(t.userId=n.id()),n.anonymousId()&&(t.anonymousId=n.anonymousId()),t},t.prototype.context=function(t){var n,e=["userId","anonymousId","timestamp"];delete t.integrations;var r=Object.keys(t),i=null!==(n=t.context)&&void 0!==n?n:{},o={};return r.forEach(function(n){"context"!==n&&(e.includes(n)?x(o,n,t[n]):x(i,n,t[n]))}),[i,o]},t.prototype.normalize=function(t){var n,e,r,i,o=Object.keys(null!==(n=t.integrations)&&void 0!==n?n:{}).reduce(function(n,e){var r,i;return s(s({},n),((r={})[e]=Boolean(null===(i=t.integrations)||void 0===i?void 0:i[e]),r))},{});t.options=(r=t.options||{},i=function(t,n){return void 0!==n},Object.keys(r).filter(function(t){return i(0,r[t])}).reduce(function(t,n){return t[n]=r[n],t},{}));var u=s(s({},o),null===(e=t.options)||void 0===e?void 0:e.integrations),a=t.options?this.context(t.options):[],c=a[0],l=a[1],p=(t.options,function(t,n){var e={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&n.indexOf(r)<0&&(e[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)n.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(e[r[i]]=t[r[i]])}return e}(t,["options"])),h=s(s(s({timestamp:new Date},p),{integrations:u,context:c}),l),d=s(s({},h),{messageId:this.createMessageId()});return function(t){!function(t){if(!O(t))throw new f("Event",S);if("object"!=typeof t)throw new f("Event",C)}(t),function(t){if(!A(t.type))throw new f(".type",k)}(t),"track"===t.type&&(function(t){if(!A(t.event))throw new f(".event",k)}(t),function(t){if(!j(t.properties))throw new f(".properties",C)}(t)),["group","identify"].includes(t.type)&&function(t){if(!j(t.traits))throw new f(".traits",C)}(t),function(t){var n=".userId/anonymousId/previousId/groupId",e=function(t){var n,e,r;return null!==(r=null!==(e=null!==(n=t.userId)&&void 0!==n?n:t.anonymousId)&&void 0!==e?e:t.groupId)&&void 0!==r?r:t.previousId}(t);if(!O(e))throw new f(n,S);if(!A(e))throw new f(n,k)}(t)}(d),d},t}();const P=()=>`node-next-${Date.now()}-${g()}`;class L extends R{constructor(){super({createMessageId:P})}}var D=function(){function t(){this._logs=[]}return t.prototype.log=function(t,n,e){var r=new Date;this._logs.push({level:t,message:n,time:r,extras:e})},Object.defineProperty(t.prototype,"logs",{get:function(){return this._logs},enumerable:!1,configurable:!0}),t.prototype.flush=function(){if(this.logs.length>1){var t=this._logs.reduce(function(t,n){var e,r,i,o=s(s({},n),{json:JSON.stringify(n.extras,null," "),extras:n.extras});delete o.time;var u=null!==(i=null===(r=n.time)||void 0===r?void 0:r.toISOString())&&void 0!==i?i:"";return t[u]&&(u="".concat(u,"-").concat(Math.random())),s(s({},t),((e={})[u]=o,e))},{});console.table?console.table(t):console.log(t)}else this.logs.forEach(function(t){var n=t.level,e=t.message,r=t.extras;"info"===n||"debug"===n?console.log(e,null!=r?r:""):console[n](e,null!=r?r:"")});this._logs=[]},t}(),M=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return u(n,t),n.prototype.gauge=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n]},n.prototype.increment=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n]},n.prototype.flush=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n]},n.prototype.serialize=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return[]},n}(function(){function t(){this.metrics=[]}return t.prototype.increment=function(t,n,e){void 0===n&&(n=1),this.metrics.push({metric:t,value:n,tags:null!=e?e:[],type:"counter",timestamp:Date.now()})},t.prototype.gauge=function(t,n,e){this.metrics.push({metric:t,value:n,tags:null!=e?e:[],type:"gauge",timestamp:Date.now()})},t.prototype.flush=function(){var t=this.metrics.map(function(t){return s(s({},t),{tags:t.tags.join(",")})});console.table?console.table(t):console.log(t),this.metrics=[]},t.prototype.serialize=function(){return this.metrics.map(function(t){return{m:t.metric,v:t.value,t:t.tags,k:(n=t.type,{gauge:"g",counter:"c"}[n]),e:t.timestamp};var n})},t}()),q=function(t){var n,e,r;this.retry=null===(n=t.retry)||void 0===n||n,this.type=null!==(e=t.type)&&void 0!==e?e:"plugin Error",this.reason=null!==(r=t.reason)&&void 0!==r?r:""},N=function(){function t(t,n,e,r){void 0===n&&(n=g()),void 0===e&&(e=new M),void 0===r&&(r=new D),this.attempts=0,this.event=t,this._id=n,this.logger=r,this.stats=e}return t.system=function(){},t.prototype.isSame=function(t){return t.id===this.id},t.prototype.cancel=function(t){if(t)throw t;throw new q({reason:"Context Cancel"})},t.prototype.log=function(t,n,e){this.logger.log(t,n,e)},Object.defineProperty(t.prototype,"id",{get:function(){return this._id},enumerable:!1,configurable:!0}),t.prototype.updateEvent=function(t,n){var e;if("integrations"===t.split(".")[0]){var r=t.split(".")[1];if(!1===(null===(e=this.event.integrations)||void 0===e?void 0:e[r]))return this.event}return x(this.event,t,n),this.event},t.prototype.failedDelivery=function(){return this._failedDelivery},t.prototype.setFailedDelivery=function(t){this._failedDelivery=t},t.prototype.logs=function(){return this.logger.logs},t.prototype.flush=function(){this.logger.flush(),this.stats.flush()},t.prototype.toJSON=function(){return{id:this._id,event:this.event,logs:this.logger.logs,metrics:this.stats.metrics}},t}();class U extends N{static system(){return new this({type:"track",event:"system"})}}const z=async(t,n,e,r)=>{try{const u=new U(t),s=await function(t,n,e,r){return a(this,void 0,void 0,function(){var o,u;return c(this,function(s){switch(s.label){case 0:return e.emit("dispatch_start",t),o=Date.now(),n.isEmpty()?[4,n.dispatchSingle(t)]:[3,2];case 1:return u=s.sent(),[3,4];case 2:return[4,n.dispatch(t)];case 3:u=s.sent(),s.label=4;case 4:return(null==r?void 0:r.callback)?[4,i(u,r.callback,(a=o,c=r.timeout,l=Date.now()-a,Math.max((null!=c?c:300)-l,0)))]:[3,6];case 5:u=s.sent(),s.label=6;case 6:return(null==r?void 0:r.debug)&&u.flush(),[2,u]}var a,c,l})})}(u,n,e,{...r?{callback:(o=r,t=>{const n=t.failedDelivery();return o(n?n.reason:void 0,t)})}:{}}),l=s.failedDelivery();l?e.emit("error",{code:"delivery_failure",reason:l.reason,ctx:s}):e.emit(t.type,s)}catch(t){e.emit("error",{code:"unknown",reason:t})}var o};var F=function(){function t(t){var n;this.callbacks={},this.warned=!1,this.maxListeners=null!==(n=null==t?void 0:t.maxListeners)&&void 0!==n?n:10}return t.prototype.warnIfPossibleMemoryLeak=function(t){this.warned||this.maxListeners&&this.callbacks[t].length>this.maxListeners&&(console.warn("Event Emitter: Possible memory leak detected; ".concat(String(t)," has exceeded ").concat(this.maxListeners," listeners.")),this.warned=!0)},t.prototype.on=function(t,n){return this.callbacks[t]?(this.callbacks[t].push(n),this.warnIfPossibleMemoryLeak(t)):this.callbacks[t]=[n],this},t.prototype.once=function(t,n){var e=this,r=function(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];e.off(t,r),n.apply(e,i)};return this.on(t,r),this},t.prototype.off=function(t,n){var e,r=(null!==(e=this.callbacks[t])&&void 0!==e?e:[]).filter(function(t){return t!==n});return this.callbacks[t]=r,this},t.prototype.emit=function(t){for(var n,e=this,r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];return(null!==(n=this.callbacks[t])&&void 0!==n?n:[]).forEach(function(t){t.apply(e,r)}),this},t}();class B extends F{}var $="onRemoveFromFuture",W=function(t){function n(n,e,r){var i=t.call(this)||this;return i.future=[],i.maxAttempts=n,i.queue=e,i.seen=null!=r?r:{},i}return u(n,t),n.prototype.push=function(){for(var t=this,n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var r=n.map(function(n){return!(t.updateAttempts(n)>t.maxAttempts||t.includes(n)||(t.queue.push(n),0))});return this.queue=this.queue.sort(function(n,e){return t.getAttempts(n)-t.getAttempts(e)}),r},n.prototype.pushWithBackoff=function(t){var n=this;if(0===this.getAttempts(t))return this.push(t)[0];var e=this.updateAttempts(t);if(e>this.maxAttempts||this.includes(t))return!1;var r=p({attempt:e-1});return setTimeout(function(){n.queue.push(t),n.future=n.future.filter(function(n){return n.id!==t.id}),n.emit($)},r),this.future.push(t),!0},n.prototype.getAttempts=function(t){var n;return null!==(n=this.seen[t.id])&&void 0!==n?n:0},n.prototype.updateAttempts=function(t){return this.seen[t.id]=this.getAttempts(t)+1,this.getAttempts(t)},n.prototype.includes=function(t){return this.queue.includes(t)||this.future.includes(t)||Boolean(this.queue.find(function(n){return n.id===t.id}))||Boolean(this.future.find(function(n){return n.id===t.id}))},n.prototype.pop=function(){return this.queue.shift()},Object.defineProperty(n.prototype,"length",{get:function(){return this.queue.length},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"todo",{get:function(){return this.queue.length+this.future.length},enumerable:!1,configurable:!0}),n}(F);function V(t,n){t.log("debug","plugin",{plugin:n.name});var e=(new Date).getTime(),r=n[t.event.type];return void 0===r?Promise.resolve(t):function(){return a(this,void 0,void 0,function(){var e;return c(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,r.apply(n,[t])];case 1:return[2,i.sent()];case 2:return e=i.sent(),[2,Promise.reject(e)];case 3:return[2]}})})}().then(function(t){var r=(new Date).getTime()-e;return t.stats.gauge("plugin_time",r,["plugin:".concat(n.name)]),t}).catch(function(e){if(e instanceof q&&"middleware_cancellation"===e.type)throw e;return e instanceof q?(t.log("warn",e.type,{plugin:n.name,error:e}),e):(t.log("error","plugin Error",{plugin:n.name,error:e}),t.stats.increment("plugin_error",1,["plugin:".concat(n.name)]),e)})}function G(t,n){return V(t,n).then(function(n){if(n instanceof N)return n;t.log("debug","Context canceled"),t.stats.increment("context_canceled"),t.cancel(n)})}var J=function(t){function n(n){var e,r,i,o=t.call(this)||this;return o.criticalTasks=(i=0,{done:function(){return e},run:function(t){var n,o=t();return"object"==typeof(n=o)&&null!==n&&"then"in n&&"function"==typeof n.then&&(1===++i&&(e=new Promise(function(t){return r=t})),o.finally(function(){return 0===--i&&r()})),o}}),o.plugins=[],o.failedInitializations=[],o.flushing=!1,o.queue=n,o.queue.on($,function(){o.scheduleFlush(0)}),o}return u(n,t),n.prototype.register=function(t,n,e){return a(this,void 0,void 0,function(){var r=this;return c(this,function(i){switch(i.label){case 0:return[4,Promise.resolve(n.load(t,e)).then(function(){r.plugins.push(n)}).catch(function(e){if("destination"===n.type)return r.failedInitializations.push(n.name),console.warn(n.name,e),void t.log("warn","Failed to load destination",{plugin:n.name,error:e});throw e})];case 1:return i.sent(),[2]}})})},n.prototype.deregister=function(t,n,e){return a(this,void 0,void 0,function(){var r;return c(this,function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),n.unload?[4,Promise.resolve(n.unload(t,e))]:[3,2];case 1:i.sent(),i.label=2;case 2:return this.plugins=this.plugins.filter(function(t){return t.name!==n.name}),[3,4];case 3:return r=i.sent(),t.log("warn","Failed to unload destination",{plugin:n.name,error:r}),[3,4];case 4:return[2]}})})},n.prototype.dispatch=function(t){return a(this,void 0,void 0,function(){var n;return c(this,function(e){return t.log("debug","Dispatching"),t.stats.increment("message_dispatched"),this.queue.push(t),n=this.subscribeToDelivery(t),this.scheduleFlush(0),[2,n]})})},n.prototype.subscribeToDelivery=function(t){return a(this,void 0,void 0,function(){var n=this;return c(this,function(e){return[2,new Promise(function(e){var r=function(i,o){i.isSame(t)&&(n.off("flush",r),e(i))};n.on("flush",r)})]})})},n.prototype.dispatchSingle=function(t){return a(this,void 0,void 0,function(){var n=this;return c(this,function(e){return t.log("debug","Dispatching"),t.stats.increment("message_dispatched"),this.queue.updateAttempts(t),t.attempts=1,[2,this.deliver(t).catch(function(e){return n.enqueuRetry(e,t)?n.subscribeToDelivery(t):(t.setFailedDelivery({reason:e}),t)})]})})},n.prototype.isEmpty=function(){return 0===this.queue.length},n.prototype.scheduleFlush=function(t){var n=this;void 0===t&&(t=500),this.flushing||(this.flushing=!0,setTimeout(function(){n.flush().then(function(){setTimeout(function(){n.flushing=!1,n.queue.length&&n.scheduleFlush(0)},0)})},t))},n.prototype.deliver=function(t){return a(this,void 0,void 0,function(){var n,e,r,i;return c(this,function(o){switch(o.label){case 0:return[4,this.criticalTasks.done()];case 1:o.sent(),n=Date.now(),o.label=2;case 2:return o.trys.push([2,4,,5]),[4,this.flushOne(t)];case 3:return t=o.sent(),e=Date.now()-n,this.emit("delivery_success",t),t.stats.gauge("delivered",e),t.log("debug","Delivered",t.event),[2,t];case 4:throw r=o.sent(),i=r,t.log("error","Failed to deliver",i),this.emit("delivery_failure",t,i),t.stats.increment("delivery_failed"),r;case 5:return[2]}})})},n.prototype.enqueuRetry=function(t,n){return!(t instanceof q&&!t.retry)&&this.queue.pushWithBackoff(n)},n.prototype.flush=function(){return a(this,void 0,void 0,function(){var t,n;return c(this,function(e){switch(e.label){case 0:if(0===this.queue.length)return[2,[]];if(!(t=this.queue.pop()))return[2,[]];t.attempts=this.queue.getAttempts(t),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.deliver(t)];case 2:return t=e.sent(),this.emit("flush",t,!0),[3,4];case 3:return n=e.sent(),this.enqueuRetry(n,t)||(t.setFailedDelivery({reason:n}),this.emit("flush",t,!1)),[2,[]];case 4:return[2,[t]]}})})},n.prototype.isReady=function(){return!0},n.prototype.availableExtensions=function(t){var n,e,r=this.plugins.filter(function(n){var e,r,i;if("destination"!==n.type&&"Segment.io"!==n.name)return!0;var o=void 0;return null===(e=n.alternativeNames)||void 0===e||e.forEach(function(n){void 0!==t[n]&&(o=t[n])}),null!==(i=null!==(r=t[n.name])&&void 0!==r?r:o)&&void 0!==i?i:!1!==("Segment.io"===n.name||t.All)}),i=(n="type",e={},r.forEach(function(t){var r,i=void 0,o=t[n];void 0!==(i="string"!=typeof o?JSON.stringify(o):o)&&(e[i]=l(l([],null!==(r=e[i])&&void 0!==r?r:[],!0),[t],!1))}),e),o=i.before,u=void 0===o?[]:o,s=i.enrichment,a=void 0===s?[]:s,c=i.destination,f=void 0===c?[]:c,p=i.after;return{before:u,enrichment:a,destinations:f,after:void 0===p?[]:p}},n.prototype.flushOne=function(t){var n,e;return a(this,void 0,void 0,function(){var r,i,o,u,s,a,l,f,p,h,d,v,g,y;return c(this,function(c){switch(c.label){case 0:if(!this.isReady())throw new Error("Not ready");t.attempts>1&&this.emit("delivery_retry",t),r=this.availableExtensions(null!==(n=t.event.integrations)&&void 0!==n?n:{}),i=r.before,o=r.enrichment,u=0,s=i,c.label=1;case 1:return u<s.length?(a=s[u],[4,G(t,a)]):[3,4];case 2:(h=c.sent())instanceof N&&(t=h),this.emit("message_enriched",t,a),c.label=3;case 3:return u++,[3,1];case 4:l=0,f=o,c.label=5;case 5:return l<f.length?(p=f[l],[4,V(t,p)]):[3,8];case 6:(h=c.sent())instanceof N&&(t=h),this.emit("message_enriched",t,p),c.label=7;case 7:return l++,[3,5];case 8:return d=this.availableExtensions(null!==(e=t.event.integrations)&&void 0!==e?e:{}),v=d.destinations,g=d.after,[4,new Promise(function(n,e){setTimeout(function(){var r=v.map(function(n){return V(t,n)});Promise.all(r).then(n).catch(e)},0)})];case 9:return c.sent(),t.stats.increment("message_delivered"),this.emit("message_delivered",t),y=g.map(function(n){return V(t,n)}),[4,Promise.all(y)];case 10:return c.sent(),[2,t]}})})},n}(F);class K extends W{constructor(){super(1,[])}getAttempts(t){return t.attempts??0}updateAttempts(t){return t.attempts=this.getAttempts(t)+1,this.getAttempts(t)}}class H extends J{constructor(){super(new K)}}class Y{constructor(){this.onabort=null,this.aborted=!1,this.eventEmitter=new F}toString(){return"[object AbortSignal]"}get[Symbol.toStringTag](){return"AbortSignal"}removeEventListener(...t){this.eventEmitter.off(...t)}addEventListener(...t){this.eventEmitter.on(...t)}dispatchEvent(t){const n={type:t,target:this},e=`on${t}`;"function"==typeof this[e]&&this[e](n),this.eventEmitter.emit(t,n)}}class Z{constructor(){this.signal=new Y}abort(){this.signal.aborted||(this.signal.aborted=!0,this.signal.dispatchEvent("abort"))}toString(){return"[object AbortController]"}get[Symbol.toStringTag](){return"AbortController"}}const X=async(...t)=>{if(globalThis.fetch)return globalThis.fetch(...t);if("string"!=typeof EdgeRuntime)return(await e.e(899).then(e.bind(e,899))).default(...t);throw new Error("Invariant: an edge runtime that does not support fetch should not exist")};class Q{constructor(t){this._fetch=t??X}async makeRequest(t){const[n,e]=(t=>{if("cloudflare-worker"===T())return[];const n=new(globalThis.AbortController||Z),e=setTimeout(()=>{n.abort()},t);return e?.unref?.(),[n.signal,e]})(t.httpRequestTimeout),r={url:t.url,method:t.method,headers:t.headers,body:JSON.stringify(t.data),signal:n};return this._fetch(t.url,r).finally(()=>clearTimeout(e))}}class tt extends B{constructor(t){super(),this._isClosed=!1,this._pendingEvents=0,this._isFlushing=!1,(t=>{if(!t.writeKey)throw new f("writeKey","writeKey is missing.")})(t),this._eventFactory=new L,this._queue=new H;const n=t.flushInterval??1e4;this._closeAndFlushDefaultTimeout=1.25*n;const{plugin:e,publisher:r}=(t=>{const n=new I(t,this);return{publisher:n,plugin:E(n)}})({writeKey:t.writeKey,host:t.host,path:t.path,maxRetries:t.maxRetries??3,flushAt:t.flushAt??t.maxEventsInBatch??15,httpRequestTimeout:t.httpRequestTimeout,disable:t.disable,flushInterval:n,httpClient:"function"==typeof t.httpClient?new Q(t.httpClient):t.httpClient??new Q});this._publisher=r,this.ready=this.register(e).then(()=>{}),this.emit("initialize",t),function(t){for(var n=t.constructor.prototype,e=0,r=Object.getOwnPropertyNames(n);e<r.length;e++){var i=r[e];if("constructor"!==i){var o=Object.getOwnPropertyDescriptor(t.constructor.prototype,i);o&&"function"==typeof o.value&&(t[i]=t[i].bind(t))}}}(this)}get VERSION(){return"1.3.0"}closeAndFlush({timeout:t=this._closeAndFlushDefaultTimeout}={}){return this.flush({timeout:t,close:!0})}async flush({timeout:t,close:n=!1}={}){if(this._isFlushing)return void console.warn("Overlapping flush calls detected. Please wait for the previous flush to finish before calling .flush again");this._isFlushing=!0,n&&(this._isClosed=!0),this._publisher.flush(this._pendingEvents);const e=new Promise(t=>{this._pendingEvents?this.once("drained",()=>{t()}):t()}).finally(()=>{this._isFlushing=!1});return t?r(e,t).catch(()=>{}):e}_dispatch(t,n){this._isClosed?this.emit("call_after_close",t):(this._pendingEvents++,z(t,this._queue,this,n).catch(t=>t).finally(()=>{this._pendingEvents--,this._pendingEvents||this.emit("drained")}))}alias({userId:t,previousId:n,context:e,timestamp:r,integrations:i},o){const u=this._eventFactory.alias(t,n,{context:e,integrations:i,timestamp:r});this._dispatch(u,o)}group({timestamp:t,groupId:n,userId:e,anonymousId:r,traits:i={},context:o,integrations:u},s){const a=this._eventFactory.group(n,i,{context:o,anonymousId:r,userId:e,timestamp:t,integrations:u});this._dispatch(a,s)}identify({userId:t,anonymousId:n,traits:e={},context:r,timestamp:i,integrations:o},u){const s=this._eventFactory.identify(t,e,{context:r,anonymousId:n,userId:t,timestamp:i,integrations:o});this._dispatch(s,u)}page({userId:t,anonymousId:n,category:e,name:r,properties:i,context:o,timestamp:u,integrations:s},a){const c=this._eventFactory.page(e??null,r??null,i,{context:o,anonymousId:n,userId:t,timestamp:u,integrations:s});this._dispatch(c,a)}screen({userId:t,anonymousId:n,category:e,name:r,properties:i,context:o,timestamp:u,integrations:s},a){const c=this._eventFactory.screen(e??null,r??null,i,{context:o,anonymousId:n,userId:t,timestamp:u,integrations:s});this._dispatch(c,a)}track({userId:t,anonymousId:n,event:e,properties:r,context:i,timestamp:o,integrations:u},s){const a=this._eventFactory.track(e,r,{context:i,userId:t,anonymousId:n,timestamp:o,integrations:u});this._dispatch(a,s)}register(...t){return this._queue.criticalTasks.run(async()=>{const n=U.system(),e=t.map(t=>this._queue.register(n,t,this));await Promise.all(e),this.emit("register",t.map(t=>t.name))})}async deregister(...t){const n=U.system(),e=t.map(t=>{const e=this._queue.plugins.find(n=>n.name===t);if(e)return this._queue.deregister(n,e,this);n.log("warn",`plugin ${t} not found`)});await Promise.all(e),this.emit("deregister",t)}}},250(t,n,e){var r;t=e.nmd(t),function(){var i,o="Expected a function",u="__lodash_hash_undefined__",s="__lodash_placeholder__",a=32,c=128,l=1/0,f=9007199254740991,p=NaN,h=4294967295,d=[["ary",c],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",a],["partialRight",64],["rearg",256]],v="[object Arguments]",g="[object Array]",y="[object Boolean]",_="[object Date]",m="[object Error]",b="[object Function]",I="[object GeneratorFunction]",w="[object Map]",T="[object Number]",E="[object Object]",x="[object Promise]",A="[object RegExp]",O="[object Set]",j="[object String]",k="[object Symbol]",C="[object WeakMap]",S="[object ArrayBuffer]",R="[object DataView]",P="[object Float32Array]",L="[object Float64Array]",D="[object Int8Array]",M="[object Int16Array]",q="[object Int32Array]",N="[object Uint8Array]",U="[object Uint8ClampedArray]",z="[object Uint16Array]",F="[object Uint32Array]",B=/\b__p \+= '';/g,$=/\b(__p \+=) '' \+/g,W=/(__e\(.*?\)|\b__t\)) \+\n'';/g,V=/&(?:amp|lt|gt|quot|#39);/g,G=/[&<>"']/g,J=RegExp(V.source),K=RegExp(G.source),H=/<%-([\s\S]+?)%>/g,Y=/<%([\s\S]+?)%>/g,Z=/<%=([\s\S]+?)%>/g,X=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Q=/^\w*$/,tt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,nt=/[\\^$.*+?()[\]{}|]/g,et=RegExp(nt.source),rt=/^\s+/,it=/\s/,ot=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ut=/\{\n\/\* \[wrapped with (.+)\] \*/,st=/,? & /,at=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ct=/[()=,{}\[\]\/\s]/,lt=/\\(\\)?/g,ft=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,pt=/\w*$/,ht=/^[-+]0x[0-9a-f]+$/i,dt=/^0b[01]+$/i,vt=/^\[object .+?Constructor\]$/,gt=/^0o[0-7]+$/i,yt=/^(?:0|[1-9]\d*)$/,_t=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,mt=/($^)/,bt=/['\n\r\u2028\u2029\\]/g,It="\\ud800-\\udfff",wt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Tt="\\u2700-\\u27bf",Et="a-z\\xdf-\\xf6\\xf8-\\xff",xt="A-Z\\xc0-\\xd6\\xd8-\\xde",At="\\ufe0e\\ufe0f",Ot="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",jt="["+It+"]",kt="["+Ot+"]",Ct="["+wt+"]",St="\\d+",Rt="["+Tt+"]",Pt="["+Et+"]",Lt="[^"+It+Ot+St+Tt+Et+xt+"]",Dt="\\ud83c[\\udffb-\\udfff]",Mt="[^"+It+"]",qt="(?:\\ud83c[\\udde6-\\uddff]){2}",Nt="[\\ud800-\\udbff][\\udc00-\\udfff]",Ut="["+xt+"]",zt="\\u200d",Ft="(?:"+Pt+"|"+Lt+")",Bt="(?:"+Ut+"|"+Lt+")",$t="(?:['’](?:d|ll|m|re|s|t|ve))?",Wt="(?:['’](?:D|LL|M|RE|S|T|VE))?",Vt="(?:"+Ct+"|"+Dt+")?",Gt="["+At+"]?",Jt=Gt+Vt+"(?:"+zt+"(?:"+[Mt,qt,Nt].join("|")+")"+Gt+Vt+")*",Kt="(?:"+[Rt,qt,Nt].join("|")+")"+Jt,Ht="(?:"+[Mt+Ct+"?",Ct,qt,Nt,jt].join("|")+")",Yt=RegExp("['’]","g"),Zt=RegExp(Ct,"g"),Xt=RegExp(Dt+"(?="+Dt+")|"+Ht+Jt,"g"),Qt=RegExp([Ut+"?"+Pt+"+"+$t+"(?="+[kt,Ut,"$"].join("|")+")",Bt+"+"+Wt+"(?="+[kt,Ut+Ft,"$"].join("|")+")",Ut+"?"+Ft+"+"+$t,Ut+"+"+Wt,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",St,Kt].join("|"),"g"),tn=RegExp("["+zt+It+wt+At+"]"),nn=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,en=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],rn=-1,on={};on[P]=on[L]=on[D]=on[M]=on[q]=on[N]=on[U]=on[z]=on[F]=!0,on[v]=on[g]=on[S]=on[y]=on[R]=on[_]=on[m]=on[b]=on[w]=on[T]=on[E]=on[A]=on[O]=on[j]=on[C]=!1;var un={};un[v]=un[g]=un[S]=un[R]=un[y]=un[_]=un[P]=un[L]=un[D]=un[M]=un[q]=un[w]=un[T]=un[E]=un[A]=un[O]=un[j]=un[k]=un[N]=un[U]=un[z]=un[F]=!0,un[m]=un[b]=un[C]=!1;var sn={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},an=parseFloat,cn=parseInt,ln="object"==typeof global&&global&&global.Object===Object&&global,fn="object"==typeof self&&self&&self.Object===Object&&self,pn=ln||fn||Function("return this")(),hn=n&&!n.nodeType&&n,dn=hn&&t&&!t.nodeType&&t,vn=dn&&dn.exports===hn,gn=vn&&ln.process,yn=function(){try{return dn&&dn.require&&dn.require("util").types||gn&&gn.binding&&gn.binding("util")}catch(t){}}(),_n=yn&&yn.isArrayBuffer,mn=yn&&yn.isDate,bn=yn&&yn.isMap,In=yn&&yn.isRegExp,wn=yn&&yn.isSet,Tn=yn&&yn.isTypedArray;function En(t,n,e){switch(e.length){case 0:return t.call(n);case 1:return t.call(n,e[0]);case 2:return t.call(n,e[0],e[1]);case 3:return t.call(n,e[0],e[1],e[2])}return t.apply(n,e)}function xn(t,n,e,r){for(var i=-1,o=null==t?0:t.length;++i<o;){var u=t[i];n(r,u,e(u),t)}return r}function An(t,n){for(var e=-1,r=null==t?0:t.length;++e<r&&!1!==n(t[e],e,t););return t}function On(t,n){for(var e=null==t?0:t.length;e--&&!1!==n(t[e],e,t););return t}function jn(t,n){for(var e=-1,r=null==t?0:t.length;++e<r;)if(!n(t[e],e,t))return!1;return!0}function kn(t,n){for(var e=-1,r=null==t?0:t.length,i=0,o=[];++e<r;){var u=t[e];n(u,e,t)&&(o[i++]=u)}return o}function Cn(t,n){return!(null==t||!t.length)&&zn(t,n,0)>-1}function Sn(t,n,e){for(var r=-1,i=null==t?0:t.length;++r<i;)if(e(n,t[r]))return!0;return!1}function Rn(t,n){for(var e=-1,r=null==t?0:t.length,i=Array(r);++e<r;)i[e]=n(t[e],e,t);return i}function Pn(t,n){for(var e=-1,r=n.length,i=t.length;++e<r;)t[i+e]=n[e];return t}function Ln(t,n,e,r){var i=-1,o=null==t?0:t.length;for(r&&o&&(e=t[++i]);++i<o;)e=n(e,t[i],i,t);return e}function Dn(t,n,e,r){var i=null==t?0:t.length;for(r&&i&&(e=t[--i]);i--;)e=n(e,t[i],i,t);return e}function Mn(t,n){for(var e=-1,r=null==t?0:t.length;++e<r;)if(n(t[e],e,t))return!0;return!1}var qn=Wn("length");function Nn(t,n,e){var r;return e(t,function(t,e,i){if(n(t,e,i))return r=e,!1}),r}function Un(t,n,e,r){for(var i=t.length,o=e+(r?1:-1);r?o--:++o<i;)if(n(t[o],o,t))return o;return-1}function zn(t,n,e){return n==n?function(t,n,e){for(var r=e-1,i=t.length;++r<i;)if(t[r]===n)return r;return-1}(t,n,e):Un(t,Bn,e)}function Fn(t,n,e,r){for(var i=e-1,o=t.length;++i<o;)if(r(t[i],n))return i;return-1}function Bn(t){return t!=t}function $n(t,n){var e=null==t?0:t.length;return e?Jn(t,n)/e:p}function Wn(t){return function(n){return null==n?i:n[t]}}function Vn(t){return function(n){return null==t?i:t[n]}}function Gn(t,n,e,r,i){return i(t,function(t,i,o){e=r?(r=!1,t):n(e,t,i,o)}),e}function Jn(t,n){for(var e,r=-1,o=t.length;++r<o;){var u=n(t[r]);u!==i&&(e=e===i?u:e+u)}return e}function Kn(t,n){for(var e=-1,r=Array(t);++e<t;)r[e]=n(e);return r}function Hn(t){return t?t.slice(0,pe(t)+1).replace(rt,""):t}function Yn(t){return function(n){return t(n)}}function Zn(t,n){return Rn(n,function(n){return t[n]})}function Xn(t,n){return t.has(n)}function Qn(t,n){for(var e=-1,r=t.length;++e<r&&zn(n,t[e],0)>-1;);return e}function te(t,n){for(var e=t.length;e--&&zn(n,t[e],0)>-1;);return e}var ne=Vn({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),ee=Vn({"&":"&","<":"<",">":">",'"':""","'":"'"});function re(t){return"\\"+sn[t]}function ie(t){return tn.test(t)}function oe(t){var n=-1,e=Array(t.size);return t.forEach(function(t,r){e[++n]=[r,t]}),e}function ue(t,n){return function(e){return t(n(e))}}function se(t,n){for(var e=-1,r=t.length,i=0,o=[];++e<r;){var u=t[e];u!==n&&u!==s||(t[e]=s,o[i++]=e)}return o}function ae(t){var n=-1,e=Array(t.size);return t.forEach(function(t){e[++n]=t}),e}function ce(t){var n=-1,e=Array(t.size);return t.forEach(function(t){e[++n]=[t,t]}),e}function le(t){return ie(t)?function(t){for(var n=Xt.lastIndex=0;Xt.test(t);)++n;return n}(t):qn(t)}function fe(t){return ie(t)?function(t){return t.match(Xt)||[]}(t):function(t){return t.split("")}(t)}function pe(t){for(var n=t.length;n--&&it.test(t.charAt(n)););return n}var he=Vn({"&":"&","<":"<",">":">",""":'"',"'":"'"}),de=function t(n){var e,r=(n=null==n?pn:de.defaults(pn.Object(),n,de.pick(pn,en))).Array,it=n.Date,It=n.Error,wt=n.Function,Tt=n.Math,Et=n.Object,xt=n.RegExp,At=n.String,Ot=n.TypeError,jt=r.prototype,kt=wt.prototype,Ct=Et.prototype,St=n["__core-js_shared__"],Rt=kt.toString,Pt=Ct.hasOwnProperty,Lt=0,Dt=(e=/[^.]+$/.exec(St&&St.keys&&St.keys.IE_PROTO||""))?"Symbol(src)_1."+e:"",Mt=Ct.toString,qt=Rt.call(Et),Nt=pn._,Ut=xt("^"+Rt.call(Pt).replace(nt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),zt=vn?n.Buffer:i,Ft=n.Symbol,Bt=n.Uint8Array,$t=zt?zt.allocUnsafe:i,Wt=ue(Et.getPrototypeOf,Et),Vt=Et.create,Gt=Ct.propertyIsEnumerable,Jt=jt.splice,Kt=Ft?Ft.isConcatSpreadable:i,Ht=Ft?Ft.iterator:i,Xt=Ft?Ft.toStringTag:i,tn=function(){try{var t=ao(Et,"defineProperty");return t({},"",{}),t}catch(t){}}(),sn=n.clearTimeout!==pn.clearTimeout&&n.clearTimeout,ln=it&&it.now!==pn.Date.now&&it.now,fn=n.setTimeout!==pn.setTimeout&&n.setTimeout,hn=Tt.ceil,dn=Tt.floor,gn=Et.getOwnPropertySymbols,yn=zt?zt.isBuffer:i,qn=n.isFinite,Vn=jt.join,ve=ue(Et.keys,Et),ge=Tt.max,ye=Tt.min,_e=it.now,me=n.parseInt,be=Tt.random,Ie=jt.reverse,we=ao(n,"DataView"),Te=ao(n,"Map"),Ee=ao(n,"Promise"),xe=ao(n,"Set"),Ae=ao(n,"WeakMap"),Oe=ao(Et,"create"),je=Ae&&new Ae,ke={},Ce=qo(we),Se=qo(Te),Re=qo(Ee),Pe=qo(xe),Le=qo(Ae),De=Ft?Ft.prototype:i,Me=De?De.valueOf:i,qe=De?De.toString:i;function Ne(t){if(ts(t)&&!$u(t)&&!(t instanceof Be)){if(t instanceof Fe)return t;if(Pt.call(t,"__wrapped__"))return No(t)}return new Fe(t)}var Ue=function(){function t(){}return function(n){if(!Qu(n))return{};if(Vt)return Vt(n);t.prototype=n;var e=new t;return t.prototype=i,e}}();function ze(){}function Fe(t,n){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!n,this.__index__=0,this.__values__=i}function Be(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=h,this.__views__=[]}function $e(t){var n=-1,e=null==t?0:t.length;for(this.clear();++n<e;){var r=t[n];this.set(r[0],r[1])}}function We(t){var n=-1,e=null==t?0:t.length;for(this.clear();++n<e;){var r=t[n];this.set(r[0],r[1])}}function Ve(t){var n=-1,e=null==t?0:t.length;for(this.clear();++n<e;){var r=t[n];this.set(r[0],r[1])}}function Ge(t){var n=-1,e=null==t?0:t.length;for(this.__data__=new Ve;++n<e;)this.add(t[n])}function Je(t){var n=this.__data__=new We(t);this.size=n.size}function Ke(t,n){var e=$u(t),r=!e&&Bu(t),i=!e&&!r&&Ju(t),o=!e&&!r&&!i&&as(t),u=e||r||i||o,s=u?Kn(t.length,At):[],a=s.length;for(var c in t)!n&&!Pt.call(t,c)||u&&("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||go(c,a))||s.push(c);return s}function He(t){var n=t.length;return n?t[Vr(0,n-1)]:i}function Ye(t,n){return Ro(Ai(t),or(n,0,t.length))}function Ze(t){return Ro(Ai(t))}function Xe(t,n,e){(e!==i&&!Uu(t[n],e)||e===i&&!(n in t))&&rr(t,n,e)}function Qe(t,n,e){var r=t[n];Pt.call(t,n)&&Uu(r,e)&&(e!==i||n in t)||rr(t,n,e)}function tr(t,n){for(var e=t.length;e--;)if(Uu(t[e][0],n))return e;return-1}function nr(t,n,e,r){return lr(t,function(t,i,o){n(r,t,e(t),o)}),r}function er(t,n){return t&&Oi(n,Cs(n),t)}function rr(t,n,e){"__proto__"==n&&tn?tn(t,n,{configurable:!0,enumerable:!0,value:e,writable:!0}):t[n]=e}function ir(t,n){for(var e=-1,o=n.length,u=r(o),s=null==t;++e<o;)u[e]=s?i:xs(t,n[e]);return u}function or(t,n,e){return t==t&&(e!==i&&(t=t<=e?t:e),n!==i&&(t=t>=n?t:n)),t}function ur(t,n,e,r,o,u){var s,a=1&n,c=2&n,l=4&n;if(e&&(s=o?e(t,r,o,u):e(t)),s!==i)return s;if(!Qu(t))return t;var f=$u(t);if(f){if(s=function(t){var n=t.length,e=new t.constructor(n);return n&&"string"==typeof t[0]&&Pt.call(t,"index")&&(e.index=t.index,e.input=t.input),e}(t),!a)return Ai(t,s)}else{var p=fo(t),h=p==b||p==I;if(Ju(t))return bi(t,a);if(p==E||p==v||h&&!o){if(s=c||h?{}:ho(t),!a)return c?function(t,n){return Oi(t,lo(t),n)}(t,function(t,n){return t&&Oi(n,Ss(n),t)}(s,t)):function(t,n){return Oi(t,co(t),n)}(t,er(s,t))}else{if(!un[p])return o?t:{};s=function(t,n,e){var r,i=t.constructor;switch(n){case S:return Ii(t);case y:case _:return new i(+t);case R:return function(t,n){var e=n?Ii(t.buffer):t.buffer;return new t.constructor(e,t.byteOffset,t.byteLength)}(t,e);case P:case L:case D:case M:case q:case N:case U:case z:case F:return wi(t,e);case w:return new i;case T:case j:return new i(t);case A:return function(t){var n=new t.constructor(t.source,pt.exec(t));return n.lastIndex=t.lastIndex,n}(t);case O:return new i;case k:return r=t,Me?Et(Me.call(r)):{}}}(t,p,a)}}u||(u=new Je);var d=u.get(t);if(d)return d;u.set(t,s),os(t)?t.forEach(function(r){s.add(ur(r,n,e,r,t,u))}):ns(t)&&t.forEach(function(r,i){s.set(i,ur(r,n,e,i,t,u))});var g=f?i:(l?c?no:to:c?Ss:Cs)(t);return An(g||t,function(r,i){g&&(r=t[i=r]),Qe(s,i,ur(r,n,e,i,t,u))}),s}function sr(t,n,e){var r=e.length;if(null==t)return!r;for(t=Et(t);r--;){var o=e[r],u=n[o],s=t[o];if(s===i&&!(o in t)||!u(s))return!1}return!0}function ar(t,n,e){if("function"!=typeof t)throw new Ot(o);return jo(function(){t.apply(i,e)},n)}function cr(t,n,e,r){var i=-1,o=Cn,u=!0,s=t.length,a=[],c=n.length;if(!s)return a;e&&(n=Rn(n,Yn(e))),r?(o=Sn,u=!1):n.length>=200&&(o=Xn,u=!1,n=new Ge(n));t:for(;++i<s;){var l=t[i],f=null==e?l:e(l);if(l=r||0!==l?l:0,u&&f==f){for(var p=c;p--;)if(n[p]===f)continue t;a.push(l)}else o(n,f,r)||a.push(l)}return a}Ne.templateSettings={escape:H,evaluate:Y,interpolate:Z,variable:"",imports:{_:Ne}},Ne.prototype=ze.prototype,Ne.prototype.constructor=Ne,Fe.prototype=Ue(ze.prototype),Fe.prototype.constructor=Fe,Be.prototype=Ue(ze.prototype),Be.prototype.constructor=Be,$e.prototype.clear=function(){this.__data__=Oe?Oe(null):{},this.size=0},$e.prototype.delete=function(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n},$e.prototype.get=function(t){var n=this.__data__;if(Oe){var e=n[t];return e===u?i:e}return Pt.call(n,t)?n[t]:i},$e.prototype.has=function(t){var n=this.__data__;return Oe?n[t]!==i:Pt.call(n,t)},$e.prototype.set=function(t,n){var e=this.__data__;return this.size+=this.has(t)?0:1,e[t]=Oe&&n===i?u:n,this},We.prototype.clear=function(){this.__data__=[],this.size=0},We.prototype.delete=function(t){var n=this.__data__,e=tr(n,t);return!(e<0||(e==n.length-1?n.pop():Jt.call(n,e,1),--this.size,0))},We.prototype.get=function(t){var n=this.__data__,e=tr(n,t);return e<0?i:n[e][1]},We.prototype.has=function(t){return tr(this.__data__,t)>-1},We.prototype.set=function(t,n){var e=this.__data__,r=tr(e,t);return r<0?(++this.size,e.push([t,n])):e[r][1]=n,this},Ve.prototype.clear=function(){this.size=0,this.__data__={hash:new $e,map:new(Te||We),string:new $e}},Ve.prototype.delete=function(t){var n=uo(this,t).delete(t);return this.size-=n?1:0,n},Ve.prototype.get=function(t){return uo(this,t).get(t)},Ve.prototype.has=function(t){return uo(this,t).has(t)},Ve.prototype.set=function(t,n){var e=uo(this,t),r=e.size;return e.set(t,n),this.size+=e.size==r?0:1,this},Ge.prototype.add=Ge.prototype.push=function(t){return this.__data__.set(t,u),this},Ge.prototype.has=function(t){return this.__data__.has(t)},Je.prototype.clear=function(){this.__data__=new We,this.size=0},Je.prototype.delete=function(t){var n=this.__data__,e=n.delete(t);return this.size=n.size,e},Je.prototype.get=function(t){return this.__data__.get(t)},Je.prototype.has=function(t){return this.__data__.has(t)},Je.prototype.set=function(t,n){var e=this.__data__;if(e instanceof We){var r=e.__data__;if(!Te||r.length<199)return r.push([t,n]),this.size=++e.size,this;e=this.__data__=new Ve(r)}return e.set(t,n),this.size=e.size,this};var lr=Ci(_r),fr=Ci(mr,!0);function pr(t,n){var e=!0;return lr(t,function(t,r,i){return e=!!n(t,r,i)}),e}function hr(t,n,e){for(var r=-1,o=t.length;++r<o;){var u=t[r],s=n(u);if(null!=s&&(a===i?s==s&&!ss(s):e(s,a)))var a=s,c=u}return c}function dr(t,n){var e=[];return lr(t,function(t,r,i){n(t,r,i)&&e.push(t)}),e}function vr(t,n,e,r,i){var o=-1,u=t.length;for(e||(e=vo),i||(i=[]);++o<u;){var s=t[o];n>0&&e(s)?n>1?vr(s,n-1,e,r,i):Pn(i,s):r||(i[i.length]=s)}return i}var gr=Si(),yr=Si(!0);function _r(t,n){return t&&gr(t,n,Cs)}function mr(t,n){return t&&yr(t,n,Cs)}function br(t,n){return kn(n,function(n){return Yu(t[n])})}function Ir(t,n){for(var e=0,r=(n=gi(n,t)).length;null!=t&&e<r;)t=t[Mo(n[e++])];return e&&e==r?t:i}function wr(t,n,e){var r=n(t);return $u(t)?r:Pn(r,e(t))}function Tr(t){return null==t?t===i?"[object Undefined]":"[object Null]":Xt&&Xt in Et(t)?function(t){var n=Pt.call(t,Xt),e=t[Xt];try{t[Xt]=i;var r=!0}catch(t){}var o=Mt.call(t);return r&&(n?t[Xt]=e:delete t[Xt]),o}(t):function(t){return Mt.call(t)}(t)}function Er(t,n){return t>n}function xr(t,n){return null!=t&&Pt.call(t,n)}function Ar(t,n){return null!=t&&n in Et(t)}function Or(t,n,e){for(var o=e?Sn:Cn,u=t[0].length,s=t.length,a=s,c=r(s),l=1/0,f=[];a--;){var p=t[a];a&&n&&(p=Rn(p,Yn(n))),l=ye(p.length,l),c[a]=!e&&(n||u>=120&&p.length>=120)?new Ge(a&&p):i}p=t[0];var h=-1,d=c[0];t:for(;++h<u&&f.length<l;){var v=p[h],g=n?n(v):v;if(v=e||0!==v?v:0,!(d?Xn(d,g):o(f,g,e))){for(a=s;--a;){var y=c[a];if(!(y?Xn(y,g):o(t[a],g,e)))continue t}d&&d.push(g),f.push(v)}}return f}function jr(t,n,e){var r=null==(t=xo(t,n=gi(n,t)))?t:t[Mo(Ho(n))];return null==r?i:En(r,t,e)}function kr(t){return ts(t)&&Tr(t)==v}function Cr(t,n,e,r,o){return t===n||(null==t||null==n||!ts(t)&&!ts(n)?t!=t&&n!=n:function(t,n,e,r,o,u){var s=$u(t),a=$u(n),c=s?g:fo(t),l=a?g:fo(n),f=(c=c==v?E:c)==E,p=(l=l==v?E:l)==E,h=c==l;if(h&&Ju(t)){if(!Ju(n))return!1;s=!0,f=!1}if(h&&!f)return u||(u=new Je),s||as(t)?Xi(t,n,e,r,o,u):function(t,n,e,r,i,o,u){switch(e){case R:if(t.byteLength!=n.byteLength||t.byteOffset!=n.byteOffset)return!1;t=t.buffer,n=n.buffer;case S:return!(t.byteLength!=n.byteLength||!o(new Bt(t),new Bt(n)));case y:case _:case T:return Uu(+t,+n);case m:return t.name==n.name&&t.message==n.message;case A:case j:return t==n+"";case w:var s=oe;case O:var a=1&r;if(s||(s=ae),t.size!=n.size&&!a)return!1;var c=u.get(t);if(c)return c==n;r|=2,u.set(t,n);var l=Xi(s(t),s(n),r,i,o,u);return u.delete(t),l;case k:if(Me)return Me.call(t)==Me.call(n)}return!1}(t,n,c,e,r,o,u);if(!(1&e)){var d=f&&Pt.call(t,"__wrapped__"),b=p&&Pt.call(n,"__wrapped__");if(d||b){var I=d?t.value():t,x=b?n.value():n;return u||(u=new Je),o(I,x,e,r,u)}}return!!h&&(u||(u=new Je),function(t,n,e,r,o,u){var s=1&e,a=to(t),c=a.length;if(c!=to(n).length&&!s)return!1;for(var l=c;l--;){var f=a[l];if(!(s?f in n:Pt.call(n,f)))return!1}var p=u.get(t),h=u.get(n);if(p&&h)return p==n&&h==t;var d=!0;u.set(t,n),u.set(n,t);for(var v=s;++l<c;){var g=t[f=a[l]],y=n[f];if(r)var _=s?r(y,g,f,n,t,u):r(g,y,f,t,n,u);if(!(_===i?g===y||o(g,y,e,r,u):_)){d=!1;break}v||(v="constructor"==f)}if(d&&!v){var m=t.constructor,b=n.constructor;m==b||!("constructor"in t)||!("constructor"in n)||"function"==typeof m&&m instanceof m&&"function"==typeof b&&b instanceof b||(d=!1)}return u.delete(t),u.delete(n),d}(t,n,e,r,o,u))}(t,n,e,r,Cr,o))}function Sr(t,n,e,r){var o=e.length,u=o,s=!r;if(null==t)return!u;for(t=Et(t);o--;){var a=e[o];if(s&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++o<u;){var c=(a=e[o])[0],l=t[c],f=a[1];if(s&&a[2]){if(l===i&&!(c in t))return!1}else{var p=new Je;if(r)var h=r(l,f,c,t,n,p);if(!(h===i?Cr(f,l,3,r,p):h))return!1}}return!0}function Rr(t){return!(!Qu(t)||(n=t,Dt&&Dt in n))&&(Yu(t)?Ut:vt).test(qo(t));var n}function Pr(t){return"function"==typeof t?t:null==t?ea:"object"==typeof t?$u(t)?Nr(t[0],t[1]):qr(t):fa(t)}function Lr(t){if(!Io(t))return ve(t);var n=[];for(var e in Et(t))Pt.call(t,e)&&"constructor"!=e&&n.push(e);return n}function Dr(t,n){return t<n}function Mr(t,n){var e=-1,i=Vu(t)?r(t.length):[];return lr(t,function(t,r,o){i[++e]=n(t,r,o)}),i}function qr(t){var n=so(t);return 1==n.length&&n[0][2]?To(n[0][0],n[0][1]):function(e){return e===t||Sr(e,t,n)}}function Nr(t,n){return _o(t)&&wo(n)?To(Mo(t),n):function(e){var r=xs(e,t);return r===i&&r===n?As(e,t):Cr(n,r,3)}}function Ur(t,n,e,r,o){t!==n&&gr(n,function(u,s){if(o||(o=new Je),Qu(u))!function(t,n,e,r,o,u,s){var a=Ao(t,e),c=Ao(n,e),l=s.get(c);if(l)Xe(t,e,l);else{var f=u?u(a,c,e+"",t,n,s):i,p=f===i;if(p){var h=$u(c),d=!h&&Ju(c),v=!h&&!d&&as(c);f=c,h||d||v?$u(a)?f=a:Gu(a)?f=Ai(a):d?(p=!1,f=bi(c,!0)):v?(p=!1,f=wi(c,!0)):f=[]:rs(c)||Bu(c)?(f=a,Bu(a)?f=gs(a):Qu(a)&&!Yu(a)||(f=ho(c))):p=!1}p&&(s.set(c,f),o(f,c,r,u,s),s.delete(c)),Xe(t,e,f)}}(t,n,s,e,Ur,r,o);else{var a=r?r(Ao(t,s),u,s+"",t,n,o):i;a===i&&(a=u),Xe(t,s,a)}},Ss)}function zr(t,n){var e=t.length;if(e)return go(n+=n<0?e:0,e)?t[n]:i}function Fr(t,n,e){n=n.length?Rn(n,function(t){return $u(t)?function(n){return Ir(n,1===t.length?t[0]:t)}:t}):[ea];var r=-1;n=Rn(n,Yn(oo()));var i=Mr(t,function(t,e,i){var o=Rn(n,function(n){return n(t)});return{criteria:o,index:++r,value:t}});return function(t){var n=t.length;for(t.sort(function(t,n){return function(t,n,e){for(var r=-1,i=t.criteria,o=n.criteria,u=i.length,s=e.length;++r<u;){var a=Ti(i[r],o[r]);if(a)return r>=s?a:a*("desc"==e[r]?-1:1)}return t.index-n.index}(t,n,e)});n--;)t[n]=t[n].value;return t}(i)}function Br(t,n,e){for(var r=-1,i=n.length,o={};++r<i;){var u=n[r],s=Ir(t,u);e(s,u)&&Yr(o,gi(u,t),s)}return o}function $r(t,n,e,r){var i=r?Fn:zn,o=-1,u=n.length,s=t;for(t===n&&(n=Ai(n)),e&&(s=Rn(t,Yn(e)));++o<u;)for(var a=0,c=n[o],l=e?e(c):c;(a=i(s,l,a,r))>-1;)s!==t&&Jt.call(s,a,1),Jt.call(t,a,1);return t}function Wr(t,n){for(var e=t?n.length:0,r=e-1;e--;){var i=n[e];if(e==r||i!==o){var o=i;go(i)?Jt.call(t,i,1):ai(t,i)}}return t}function Vr(t,n){return t+dn(be()*(n-t+1))}function Gr(t,n){var e="";if(!t||n<1||n>f)return e;do{n%2&&(e+=t),(n=dn(n/2))&&(t+=t)}while(n);return e}function Jr(t,n){return ko(Eo(t,n,ea),t+"")}function Kr(t){return He(Us(t))}function Hr(t,n){var e=Us(t);return Ro(e,or(n,0,e.length))}function Yr(t,n,e,r){if(!Qu(t))return t;for(var o=-1,u=(n=gi(n,t)).length,s=u-1,a=t;null!=a&&++o<u;){var c=Mo(n[o]),l=e;if("__proto__"===c||"constructor"===c||"prototype"===c)return t;if(o!=s){var f=a[c];(l=r?r(f,c,a):i)===i&&(l=Qu(f)?f:go(n[o+1])?[]:{})}Qe(a,c,l),a=a[c]}return t}var Zr=je?function(t,n){return je.set(t,n),t}:ea,Xr=tn?function(t,n){return tn(t,"toString",{configurable:!0,enumerable:!1,value:Qs(n),writable:!0})}:ea;function Qr(t){return Ro(Us(t))}function ti(t,n,e){var i=-1,o=t.length;n<0&&(n=-n>o?0:o+n),(e=e>o?o:e)<0&&(e+=o),o=n>e?0:e-n>>>0,n>>>=0;for(var u=r(o);++i<o;)u[i]=t[i+n];return u}function ni(t,n){var e;return lr(t,function(t,r,i){return!(e=n(t,r,i))}),!!e}function ei(t,n,e){var r=0,i=null==t?r:t.length;if("number"==typeof n&&n==n&&i<=2147483647){for(;r<i;){var o=r+i>>>1,u=t[o];null!==u&&!ss(u)&&(e?u<=n:u<n)?r=o+1:i=o}return i}return ri(t,n,ea,e)}function ri(t,n,e,r){var o=0,u=null==t?0:t.length;if(0===u)return 0;for(var s=(n=e(n))!=n,a=null===n,c=ss(n),l=n===i;o<u;){var f=dn((o+u)/2),p=e(t[f]),h=p!==i,d=null===p,v=p==p,g=ss(p);if(s)var y=r||v;else y=l?v&&(r||h):a?v&&h&&(r||!d):c?v&&h&&!d&&(r||!g):!d&&!g&&(r?p<=n:p<n);y?o=f+1:u=f}return ye(u,4294967294)}function ii(t,n){for(var e=-1,r=t.length,i=0,o=[];++e<r;){var u=t[e],s=n?n(u):u;if(!e||!Uu(s,a)){var a=s;o[i++]=0===u?0:u}}return o}function oi(t){return"number"==typeof t?t:ss(t)?p:+t}function ui(t){if("string"==typeof t)return t;if($u(t))return Rn(t,ui)+"";if(ss(t))return qe?qe.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}function si(t,n,e){var r=-1,i=Cn,o=t.length,u=!0,s=[],a=s;if(e)u=!1,i=Sn;else if(o>=200){var c=n?null:Gi(t);if(c)return ae(c);u=!1,i=Xn,a=new Ge}else a=n?[]:s;t:for(;++r<o;){var l=t[r],f=n?n(l):l;if(l=e||0!==l?l:0,u&&f==f){for(var p=a.length;p--;)if(a[p]===f)continue t;n&&a.push(f),s.push(l)}else i(a,f,e)||(a!==s&&a.push(f),s.push(l))}return s}function ai(t,n){return null==(t=xo(t,n=gi(n,t)))||delete t[Mo(Ho(n))]}function ci(t,n,e,r){return Yr(t,n,e(Ir(t,n)),r)}function li(t,n,e,r){for(var i=t.length,o=r?i:-1;(r?o--:++o<i)&&n(t[o],o,t););return e?ti(t,r?0:o,r?o+1:i):ti(t,r?o+1:0,r?i:o)}function fi(t,n){var e=t;return e instanceof Be&&(e=e.value()),Ln(n,function(t,n){return n.func.apply(n.thisArg,Pn([t],n.args))},e)}function pi(t,n,e){var i=t.length;if(i<2)return i?si(t[0]):[];for(var o=-1,u=r(i);++o<i;)for(var s=t[o],a=-1;++a<i;)a!=o&&(u[o]=cr(u[o]||s,t[a],n,e));return si(vr(u,1),n,e)}function hi(t,n,e){for(var r=-1,o=t.length,u=n.length,s={};++r<o;){var a=r<u?n[r]:i;e(s,t[r],a)}return s}function di(t){return Gu(t)?t:[]}function vi(t){return"function"==typeof t?t:ea}function gi(t,n){return $u(t)?t:_o(t,n)?[t]:Do(ys(t))}var yi=Jr;function _i(t,n,e){var r=t.length;return e=e===i?r:e,!n&&e>=r?t:ti(t,n,e)}var mi=sn||function(t){return pn.clearTimeout(t)};function bi(t,n){if(n)return t.slice();var e=t.length,r=$t?$t(e):new t.constructor(e);return t.copy(r),r}function Ii(t){var n=new t.constructor(t.byteLength);return new Bt(n).set(new Bt(t)),n}function wi(t,n){var e=n?Ii(t.buffer):t.buffer;return new t.constructor(e,t.byteOffset,t.length)}function Ti(t,n){if(t!==n){var e=t!==i,r=null===t,o=t==t,u=ss(t),s=n!==i,a=null===n,c=n==n,l=ss(n);if(!a&&!l&&!u&&t>n||u&&s&&c&&!a&&!l||r&&s&&c||!e&&c||!o)return 1;if(!r&&!u&&!l&&t<n||l&&e&&o&&!r&&!u||a&&e&&o||!s&&o||!c)return-1}return 0}function Ei(t,n,e,i){for(var o=-1,u=t.length,s=e.length,a=-1,c=n.length,l=ge(u-s,0),f=r(c+l),p=!i;++a<c;)f[a]=n[a];for(;++o<s;)(p||o<u)&&(f[e[o]]=t[o]);for(;l--;)f[a++]=t[o++];return f}function xi(t,n,e,i){for(var o=-1,u=t.length,s=-1,a=e.length,c=-1,l=n.length,f=ge(u-a,0),p=r(f+l),h=!i;++o<f;)p[o]=t[o];for(var d=o;++c<l;)p[d+c]=n[c];for(;++s<a;)(h||o<u)&&(p[d+e[s]]=t[o++]);return p}function Ai(t,n){var e=-1,i=t.length;for(n||(n=r(i));++e<i;)n[e]=t[e];return n}function Oi(t,n,e,r){var o=!e;e||(e={});for(var u=-1,s=n.length;++u<s;){var a=n[u],c=r?r(e[a],t[a],a,e,t):i;c===i&&(c=t[a]),o?rr(e,a,c):Qe(e,a,c)}return e}function ji(t,n){return function(e,r){var i=$u(e)?xn:nr,o=n?n():{};return i(e,t,oo(r,2),o)}}function ki(t){return Jr(function(n,e){var r=-1,o=e.length,u=o>1?e[o-1]:i,s=o>2?e[2]:i;for(u=t.length>3&&"function"==typeof u?(o--,u):i,s&&yo(e[0],e[1],s)&&(u=o<3?i:u,o=1),n=Et(n);++r<o;){var a=e[r];a&&t(n,a,r,u)}return n})}function Ci(t,n){return function(e,r){if(null==e)return e;if(!Vu(e))return t(e,r);for(var i=e.length,o=n?i:-1,u=Et(e);(n?o--:++o<i)&&!1!==r(u[o],o,u););return e}}function Si(t){return function(n,e,r){for(var i=-1,o=Et(n),u=r(n),s=u.length;s--;){var a=u[t?s:++i];if(!1===e(o[a],a,o))break}return n}}function Ri(t){return function(n){var e=ie(n=ys(n))?fe(n):i,r=e?e[0]:n.charAt(0),o=e?_i(e,1).join(""):n.slice(1);return r[t]()+o}}function Pi(t){return function(n){return Ln(Ys(Bs(n).replace(Yt,"")),t,"")}}function Li(t){return function(){var n=arguments;switch(n.length){case 0:return new t;case 1:return new t(n[0]);case 2:return new t(n[0],n[1]);case 3:return new t(n[0],n[1],n[2]);case 4:return new t(n[0],n[1],n[2],n[3]);case 5:return new t(n[0],n[1],n[2],n[3],n[4]);case 6:return new t(n[0],n[1],n[2],n[3],n[4],n[5]);case 7:return new t(n[0],n[1],n[2],n[3],n[4],n[5],n[6])}var e=Ue(t.prototype),r=t.apply(e,n);return Qu(r)?r:e}}function Di(t){return function(n,e,r){var o=Et(n);if(!Vu(n)){var u=oo(e,3);n=Cs(n),e=function(t){return u(o[t],t,o)}}var s=t(n,e,r);return s>-1?o[u?n[s]:s]:i}}function Mi(t){return Qi(function(n){var e=n.length,r=e,u=Fe.prototype.thru;for(t&&n.reverse();r--;){var s=n[r];if("function"!=typeof s)throw new Ot(o);if(u&&!a&&"wrapper"==ro(s))var a=new Fe([],!0)}for(r=a?r:e;++r<e;){var c=ro(s=n[r]),l="wrapper"==c?eo(s):i;a=l&&mo(l[0])&&424==l[1]&&!l[4].length&&1==l[9]?a[ro(l[0])].apply(a,l[3]):1==s.length&&mo(s)?a[c]():a.thru(s)}return function(){var t=arguments,r=t[0];if(a&&1==t.length&&$u(r))return a.plant(r).value();for(var i=0,o=e?n[i].apply(this,t):r;++i<e;)o=n[i].call(this,o);return o}})}function qi(t,n,e,o,u,s,a,l,f,p){var h=n&c,d=1&n,v=2&n,g=24&n,y=512&n,_=v?i:Li(t);return function c(){for(var m=arguments.length,b=r(m),I=m;I--;)b[I]=arguments[I];if(g)var w=io(c),T=function(t,n){for(var e=t.length,r=0;e--;)t[e]===n&&++r;return r}(b,w);if(o&&(b=Ei(b,o,u,g)),s&&(b=xi(b,s,a,g)),m-=T,g&&m<p){var E=se(b,w);return Wi(t,n,qi,c.placeholder,e,b,E,l,f,p-m)}var x=d?e:this,A=v?x[t]:t;return m=b.length,l?b=function(t,n){for(var e=t.length,r=ye(n.length,e),o=Ai(t);r--;){var u=n[r];t[r]=go(u,e)?o[u]:i}return t}(b,l):y&&m>1&&b.reverse(),h&&f<m&&(b.length=f),this&&this!==pn&&this instanceof c&&(A=_||Li(A)),A.apply(x,b)}}function Ni(t,n){return function(e,r){return function(t,n,e,r){return _r(t,function(t,i,o){n(r,e(t),i,o)}),r}(e,t,n(r),{})}}function Ui(t,n){return function(e,r){var o;if(e===i&&r===i)return n;if(e!==i&&(o=e),r!==i){if(o===i)return r;"string"==typeof e||"string"==typeof r?(e=ui(e),r=ui(r)):(e=oi(e),r=oi(r)),o=t(e,r)}return o}}function zi(t){return Qi(function(n){return n=Rn(n,Yn(oo())),Jr(function(e){var r=this;return t(n,function(t){return En(t,r,e)})})})}function Fi(t,n){var e=(n=n===i?" ":ui(n)).length;if(e<2)return e?Gr(n,t):n;var r=Gr(n,hn(t/le(n)));return ie(n)?_i(fe(r),0,t).join(""):r.slice(0,t)}function Bi(t){return function(n,e,o){return o&&"number"!=typeof o&&yo(n,e,o)&&(e=o=i),n=ps(n),e===i?(e=n,n=0):e=ps(e),function(t,n,e,i){for(var o=-1,u=ge(hn((n-t)/(e||1)),0),s=r(u);u--;)s[i?u:++o]=t,t+=e;return s}(n,e,o=o===i?n<e?1:-1:ps(o),t)}}function $i(t){return function(n,e){return"string"==typeof n&&"string"==typeof e||(n=vs(n),e=vs(e)),t(n,e)}}function Wi(t,n,e,r,o,u,s,c,l,f){var p=8&n;n|=p?a:64,4&(n&=~(p?64:a))||(n&=-4);var h=[t,n,o,p?u:i,p?s:i,p?i:u,p?i:s,c,l,f],d=e.apply(i,h);return mo(t)&&Oo(d,h),d.placeholder=r,Co(d,t,n)}function Vi(t){var n=Tt[t];return function(t,e){if(t=vs(t),(e=null==e?0:ye(hs(e),292))&&qn(t)){var r=(ys(t)+"e").split("e");return+((r=(ys(n(r[0]+"e"+(+r[1]+e)))+"e").split("e"))[0]+"e"+(+r[1]-e))}return n(t)}}var Gi=xe&&1/ae(new xe([,-0]))[1]==l?function(t){return new xe(t)}:sa;function Ji(t){return function(n){var e=fo(n);return e==w?oe(n):e==O?ce(n):function(t,n){return Rn(n,function(n){return[n,t[n]]})}(n,t(n))}}function Ki(t,n,e,u,l,f,p,h){var d=2&n;if(!d&&"function"!=typeof t)throw new Ot(o);var v=u?u.length:0;if(v||(n&=-97,u=l=i),p=p===i?p:ge(hs(p),0),h=h===i?h:hs(h),v-=l?l.length:0,64&n){var g=u,y=l;u=l=i}var _=d?i:eo(t),m=[t,n,e,u,l,g,y,f,p,h];if(_&&function(t,n){var e=t[1],r=n[1],i=e|r,o=i<131,u=r==c&&8==e||r==c&&256==e&&t[7].length<=n[8]||384==r&&n[7].length<=n[8]&&8==e;if(!o&&!u)return t;1&r&&(t[2]=n[2],i|=1&e?0:4);var a=n[3];if(a){var l=t[3];t[3]=l?Ei(l,a,n[4]):a,t[4]=l?se(t[3],s):n[4]}(a=n[5])&&(l=t[5],t[5]=l?xi(l,a,n[6]):a,t[6]=l?se(t[5],s):n[6]),(a=n[7])&&(t[7]=a),r&c&&(t[8]=null==t[8]?n[8]:ye(t[8],n[8])),null==t[9]&&(t[9]=n[9]),t[0]=n[0],t[1]=i}(m,_),t=m[0],n=m[1],e=m[2],u=m[3],l=m[4],!(h=m[9]=m[9]===i?d?0:t.length:ge(m[9]-v,0))&&24&n&&(n&=-25),n&&1!=n)b=8==n||16==n?function(t,n,e){var o=Li(t);return function u(){for(var s=arguments.length,a=r(s),c=s,l=io(u);c--;)a[c]=arguments[c];var f=s<3&&a[0]!==l&&a[s-1]!==l?[]:se(a,l);return(s-=f.length)<e?Wi(t,n,qi,u.placeholder,i,a,f,i,i,e-s):En(this&&this!==pn&&this instanceof u?o:t,this,a)}}(t,n,h):n!=a&&33!=n||l.length?qi.apply(i,m):function(t,n,e,i){var o=1&n,u=Li(t);return function n(){for(var s=-1,a=arguments.length,c=-1,l=i.length,f=r(l+a),p=this&&this!==pn&&this instanceof n?u:t;++c<l;)f[c]=i[c];for(;a--;)f[c++]=arguments[++s];return En(p,o?e:this,f)}}(t,n,e,u);else var b=function(t,n,e){var r=1&n,i=Li(t);return function n(){return(this&&this!==pn&&this instanceof n?i:t).apply(r?e:this,arguments)}}(t,n,e);return Co((_?Zr:Oo)(b,m),t,n)}function Hi(t,n,e,r){return t===i||Uu(t,Ct[e])&&!Pt.call(r,e)?n:t}function Yi(t,n,e,r,o,u){return Qu(t)&&Qu(n)&&(u.set(n,t),Ur(t,n,i,Yi,u),u.delete(n)),t}function Zi(t){return rs(t)?i:t}function Xi(t,n,e,r,o,u){var s=1&e,a=t.length,c=n.length;if(a!=c&&!(s&&c>a))return!1;var l=u.get(t),f=u.get(n);if(l&&f)return l==n&&f==t;var p=-1,h=!0,d=2&e?new Ge:i;for(u.set(t,n),u.set(n,t);++p<a;){var v=t[p],g=n[p];if(r)var y=s?r(g,v,p,n,t,u):r(v,g,p,t,n,u);if(y!==i){if(y)continue;h=!1;break}if(d){if(!Mn(n,function(t,n){if(!Xn(d,n)&&(v===t||o(v,t,e,r,u)))return d.push(n)})){h=!1;break}}else if(v!==g&&!o(v,g,e,r,u)){h=!1;break}}return u.delete(t),u.delete(n),h}function Qi(t){return ko(Eo(t,i,Wo),t+"")}function to(t){return wr(t,Cs,co)}function no(t){return wr(t,Ss,lo)}var eo=je?function(t){return je.get(t)}:sa;function ro(t){for(var n=t.name+"",e=ke[n],r=Pt.call(ke,n)?e.length:0;r--;){var i=e[r],o=i.func;if(null==o||o==t)return i.name}return n}function io(t){return(Pt.call(Ne,"placeholder")?Ne:t).placeholder}function oo(){var t=Ne.iteratee||ra;return t=t===ra?Pr:t,arguments.length?t(arguments[0],arguments[1]):t}function uo(t,n){var e,r,i=t.__data__;return("string"==(r=typeof(e=n))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==e:null===e)?i["string"==typeof n?"string":"hash"]:i.map}function so(t){for(var n=Cs(t),e=n.length;e--;){var r=n[e],i=t[r];n[e]=[r,i,wo(i)]}return n}function ao(t,n){var e=function(t,n){return null==t?i:t[n]}(t,n);return Rr(e)?e:i}var co=gn?function(t){return null==t?[]:(t=Et(t),kn(gn(t),function(n){return Gt.call(t,n)}))}:da,lo=gn?function(t){for(var n=[];t;)Pn(n,co(t)),t=Wt(t);return n}:da,fo=Tr;function po(t,n,e){for(var r=-1,i=(n=gi(n,t)).length,o=!1;++r<i;){var u=Mo(n[r]);if(!(o=null!=t&&e(t,u)))break;t=t[u]}return o||++r!=i?o:!!(i=null==t?0:t.length)&&Xu(i)&&go(u,i)&&($u(t)||Bu(t))}function ho(t){return"function"!=typeof t.constructor||Io(t)?{}:Ue(Wt(t))}function vo(t){return $u(t)||Bu(t)||!!(Kt&&t&&t[Kt])}function go(t,n){var e=typeof t;return!!(n=n??f)&&("number"==e||"symbol"!=e&&yt.test(t))&&t>-1&&t%1==0&&t<n}function yo(t,n,e){if(!Qu(e))return!1;var r=typeof n;return!!("number"==r?Vu(e)&&go(n,e.length):"string"==r&&n in e)&&Uu(e[n],t)}function _o(t,n){if($u(t))return!1;var e=typeof t;return!("number"!=e&&"symbol"!=e&&"boolean"!=e&&null!=t&&!ss(t))||Q.test(t)||!X.test(t)||null!=n&&t in Et(n)}function mo(t){var n=ro(t),e=Ne[n];if("function"!=typeof e||!(n in Be.prototype))return!1;if(t===e)return!0;var r=eo(e);return!!r&&t===r[0]}(we&&fo(new we(new ArrayBuffer(1)))!=R||Te&&fo(new Te)!=w||Ee&&fo(Ee.resolve())!=x||xe&&fo(new xe)!=O||Ae&&fo(new Ae)!=C)&&(fo=function(t){var n=Tr(t),e=n==E?t.constructor:i,r=e?qo(e):"";if(r)switch(r){case Ce:return R;case Se:return w;case Re:return x;case Pe:return O;case Le:return C}return n});var bo=St?Yu:va;function Io(t){var n=t&&t.constructor;return t===("function"==typeof n&&n.prototype||Ct)}function wo(t){return t==t&&!Qu(t)}function To(t,n){return function(e){return null!=e&&e[t]===n&&(n!==i||t in Et(e))}}function Eo(t,n,e){return n=ge(n===i?t.length-1:n,0),function(){for(var i=arguments,o=-1,u=ge(i.length-n,0),s=r(u);++o<u;)s[o]=i[n+o];o=-1;for(var a=r(n+1);++o<n;)a[o]=i[o];return a[n]=e(s),En(t,this,a)}}function xo(t,n){return n.length<2?t:Ir(t,ti(n,0,-1))}function Ao(t,n){if(("constructor"!==n||"function"!=typeof t[n])&&"__proto__"!=n)return t[n]}var Oo=So(Zr),jo=fn||function(t,n){return pn.setTimeout(t,n)},ko=So(Xr);function Co(t,n,e){var r=n+"";return ko(t,function(t,n){var e=n.length;if(!e)return t;var r=e-1;return n[r]=(e>1?"& ":"")+n[r],n=n.join(e>2?", ":" "),t.replace(ot,"{\n/* [wrapped with "+n+"] */\n")}(r,function(t,n){return An(d,function(e){var r="_."+e[0];n&e[1]&&!Cn(t,r)&&t.push(r)}),t.sort()}(function(t){var n=t.match(ut);return n?n[1].split(st):[]}(r),e)))}function So(t){var n=0,e=0;return function(){var r=_e(),o=16-(r-e);if(e=r,o>0){if(++n>=800)return arguments[0]}else n=0;return t.apply(i,arguments)}}function Ro(t,n){var e=-1,r=t.length,o=r-1;for(n=n===i?r:n;++e<n;){var u=Vr(e,o),s=t[u];t[u]=t[e],t[e]=s}return t.length=n,t}var Po,Lo,Do=(Po=Pu(function(t){var n=[];return 46===t.charCodeAt(0)&&n.push(""),t.replace(tt,function(t,e,r,i){n.push(r?i.replace(lt,"$1"):e||t)}),n},function(t){return 500===Lo.size&&Lo.clear(),t}),Lo=Po.cache,Po);function Mo(t){if("string"==typeof t||ss(t))return t;var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}function qo(t){if(null!=t){try{return Rt.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function No(t){if(t instanceof Be)return t.clone();var n=new Fe(t.__wrapped__,t.__chain__);return n.__actions__=Ai(t.__actions__),n.__index__=t.__index__,n.__values__=t.__values__,n}var Uo=Jr(function(t,n){return Gu(t)?cr(t,vr(n,1,Gu,!0)):[]}),zo=Jr(function(t,n){var e=Ho(n);return Gu(e)&&(e=i),Gu(t)?cr(t,vr(n,1,Gu,!0),oo(e,2)):[]}),Fo=Jr(function(t,n){var e=Ho(n);return Gu(e)&&(e=i),Gu(t)?cr(t,vr(n,1,Gu,!0),i,e):[]});function Bo(t,n,e){var r=null==t?0:t.length;if(!r)return-1;var i=null==e?0:hs(e);return i<0&&(i=ge(r+i,0)),Un(t,oo(n,3),i)}function $o(t,n,e){var r=null==t?0:t.length;if(!r)return-1;var o=r-1;return e!==i&&(o=hs(e),o=e<0?ge(r+o,0):ye(o,r-1)),Un(t,oo(n,3),o,!0)}function Wo(t){return null!=t&&t.length?vr(t,1):[]}function Vo(t){return t&&t.length?t[0]:i}var Go=Jr(function(t){var n=Rn(t,di);return n.length&&n[0]===t[0]?Or(n):[]}),Jo=Jr(function(t){var n=Ho(t),e=Rn(t,di);return n===Ho(e)?n=i:e.pop(),e.length&&e[0]===t[0]?Or(e,oo(n,2)):[]}),Ko=Jr(function(t){var n=Ho(t),e=Rn(t,di);return(n="function"==typeof n?n:i)&&e.pop(),e.length&&e[0]===t[0]?Or(e,i,n):[]});function Ho(t){var n=null==t?0:t.length;return n?t[n-1]:i}var Yo=Jr(Zo);function Zo(t,n){return t&&t.length&&n&&n.length?$r(t,n):t}var Xo=Qi(function(t,n){var e=null==t?0:t.length,r=ir(t,n);return Wr(t,Rn(n,function(t){return go(t,e)?+t:t}).sort(Ti)),r});function Qo(t){return null==t?t:Ie.call(t)}var tu=Jr(function(t){return si(vr(t,1,Gu,!0))}),nu=Jr(function(t){var n=Ho(t);return Gu(n)&&(n=i),si(vr(t,1,Gu,!0),oo(n,2))}),eu=Jr(function(t){var n=Ho(t);return n="function"==typeof n?n:i,si(vr(t,1,Gu,!0),i,n)});function ru(t){if(!t||!t.length)return[];var n=0;return t=kn(t,function(t){if(Gu(t))return n=ge(t.length,n),!0}),Kn(n,function(n){return Rn(t,Wn(n))})}function iu(t,n){if(!t||!t.length)return[];var e=ru(t);return null==n?e:Rn(e,function(t){return En(n,i,t)})}var ou=Jr(function(t,n){return Gu(t)?cr(t,n):[]}),uu=Jr(function(t){return pi(kn(t,Gu))}),su=Jr(function(t){var n=Ho(t);return Gu(n)&&(n=i),pi(kn(t,Gu),oo(n,2))}),au=Jr(function(t){var n=Ho(t);return n="function"==typeof n?n:i,pi(kn(t,Gu),i,n)}),cu=Jr(ru),lu=Jr(function(t){var n=t.length,e=n>1?t[n-1]:i;return e="function"==typeof e?(t.pop(),e):i,iu(t,e)});function fu(t){var n=Ne(t);return n.__chain__=!0,n}function pu(t,n){return n(t)}var hu=Qi(function(t){var n=t.length,e=n?t[0]:0,r=this.__wrapped__,o=function(n){return ir(n,t)};return!(n>1||this.__actions__.length)&&r instanceof Be&&go(e)?((r=r.slice(e,+e+(n?1:0))).__actions__.push({func:pu,args:[o],thisArg:i}),new Fe(r,this.__chain__).thru(function(t){return n&&!t.length&&t.push(i),t})):this.thru(o)}),du=ji(function(t,n,e){Pt.call(t,e)?++t[e]:rr(t,e,1)}),vu=Di(Bo),gu=Di($o);function yu(t,n){return($u(t)?An:lr)(t,oo(n,3))}function _u(t,n){return($u(t)?On:fr)(t,oo(n,3))}var mu=ji(function(t,n,e){Pt.call(t,e)?t[e].push(n):rr(t,e,[n])}),bu=Jr(function(t,n,e){var i=-1,o="function"==typeof n,u=Vu(t)?r(t.length):[];return lr(t,function(t){u[++i]=o?En(n,t,e):jr(t,n,e)}),u}),Iu=ji(function(t,n,e){rr(t,e,n)});function wu(t,n){return($u(t)?Rn:Mr)(t,oo(n,3))}var Tu=ji(function(t,n,e){t[e?0:1].push(n)},function(){return[[],[]]}),Eu=Jr(function(t,n){if(null==t)return[];var e=n.length;return e>1&&yo(t,n[0],n[1])?n=[]:e>2&&yo(n[0],n[1],n[2])&&(n=[n[0]]),Fr(t,vr(n,1),[])}),xu=ln||function(){return pn.Date.now()};function Au(t,n,e){return n=e?i:n,n=t&&null==n?t.length:n,Ki(t,c,i,i,i,i,n)}function Ou(t,n){var e;if("function"!=typeof n)throw new Ot(o);return t=hs(t),function(){return--t>0&&(e=n.apply(this,arguments)),t<=1&&(n=i),e}}var ju=Jr(function(t,n,e){var r=1;if(e.length){var i=se(e,io(ju));r|=a}return Ki(t,r,n,e,i)}),ku=Jr(function(t,n,e){var r=3;if(e.length){var i=se(e,io(ku));r|=a}return Ki(n,r,t,e,i)});function Cu(t,n,e){var r,u,s,a,c,l,f=0,p=!1,h=!1,d=!0;if("function"!=typeof t)throw new Ot(o);function v(n){var e=r,o=u;return r=u=i,f=n,a=t.apply(o,e)}function g(t){var e=t-l;return l===i||e>=n||e<0||h&&t-f>=s}function y(){var t=xu();if(g(t))return _(t);c=jo(y,function(t){var e=n-(t-l);return h?ye(e,s-(t-f)):e}(t))}function _(t){return c=i,d&&r?v(t):(r=u=i,a)}function m(){var t=xu(),e=g(t);if(r=arguments,u=this,l=t,e){if(c===i)return function(t){return f=t,c=jo(y,n),p?v(t):a}(l);if(h)return mi(c),c=jo(y,n),v(l)}return c===i&&(c=jo(y,n)),a}return n=vs(n)||0,Qu(e)&&(p=!!e.leading,s=(h="maxWait"in e)?ge(vs(e.maxWait)||0,n):s,d="trailing"in e?!!e.trailing:d),m.cancel=function(){c!==i&&mi(c),f=0,r=l=u=c=i},m.flush=function(){return c===i?a:_(xu())},m}var Su=Jr(function(t,n){return ar(t,1,n)}),Ru=Jr(function(t,n,e){return ar(t,vs(n)||0,e)});function Pu(t,n){if("function"!=typeof t||null!=n&&"function"!=typeof n)throw new Ot(o);var e=function(){var r=arguments,i=n?n.apply(this,r):r[0],o=e.cache;if(o.has(i))return o.get(i);var u=t.apply(this,r);return e.cache=o.set(i,u)||o,u};return e.cache=new(Pu.Cache||Ve),e}function Lu(t){if("function"!=typeof t)throw new Ot(o);return function(){var n=arguments;switch(n.length){case 0:return!t.call(this);case 1:return!t.call(this,n[0]);case 2:return!t.call(this,n[0],n[1]);case 3:return!t.call(this,n[0],n[1],n[2])}return!t.apply(this,n)}}Pu.Cache=Ve;var Du=yi(function(t,n){var e=(n=1==n.length&&$u(n[0])?Rn(n[0],Yn(oo())):Rn(vr(n,1),Yn(oo()))).length;return Jr(function(r){for(var i=-1,o=ye(r.length,e);++i<o;)r[i]=n[i].call(this,r[i]);return En(t,this,r)})}),Mu=Jr(function(t,n){var e=se(n,io(Mu));return Ki(t,a,i,n,e)}),qu=Jr(function(t,n){var e=se(n,io(qu));return Ki(t,64,i,n,e)}),Nu=Qi(function(t,n){return Ki(t,256,i,i,i,n)});function Uu(t,n){return t===n||t!=t&&n!=n}var zu=$i(Er),Fu=$i(function(t,n){return t>=n}),Bu=kr(function(){return arguments}())?kr:function(t){return ts(t)&&Pt.call(t,"callee")&&!Gt.call(t,"callee")},$u=r.isArray,Wu=_n?Yn(_n):function(t){return ts(t)&&Tr(t)==S};function Vu(t){return null!=t&&Xu(t.length)&&!Yu(t)}function Gu(t){return ts(t)&&Vu(t)}var Ju=yn||va,Ku=mn?Yn(mn):function(t){return ts(t)&&Tr(t)==_};function Hu(t){if(!ts(t))return!1;var n=Tr(t);return n==m||"[object DOMException]"==n||"string"==typeof t.message&&"string"==typeof t.name&&!rs(t)}function Yu(t){if(!Qu(t))return!1;var n=Tr(t);return n==b||n==I||"[object AsyncFunction]"==n||"[object Proxy]"==n}function Zu(t){return"number"==typeof t&&t==hs(t)}function Xu(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=f}function Qu(t){var n=typeof t;return null!=t&&("object"==n||"function"==n)}function ts(t){return null!=t&&"object"==typeof t}var ns=bn?Yn(bn):function(t){return ts(t)&&fo(t)==w};function es(t){return"number"==typeof t||ts(t)&&Tr(t)==T}function rs(t){if(!ts(t)||Tr(t)!=E)return!1;var n=Wt(t);if(null===n)return!0;var e=Pt.call(n,"constructor")&&n.constructor;return"function"==typeof e&&e instanceof e&&Rt.call(e)==qt}var is=In?Yn(In):function(t){return ts(t)&&Tr(t)==A},os=wn?Yn(wn):function(t){return ts(t)&&fo(t)==O};function us(t){return"string"==typeof t||!$u(t)&&ts(t)&&Tr(t)==j}function ss(t){return"symbol"==typeof t||ts(t)&&Tr(t)==k}var as=Tn?Yn(Tn):function(t){return ts(t)&&Xu(t.length)&&!!on[Tr(t)]},cs=$i(Dr),ls=$i(function(t,n){return t<=n});function fs(t){if(!t)return[];if(Vu(t))return us(t)?fe(t):Ai(t);if(Ht&&t[Ht])return function(t){for(var n,e=[];!(n=t.next()).done;)e.push(n.value);return e}(t[Ht]());var n=fo(t);return(n==w?oe:n==O?ae:Us)(t)}function ps(t){return t?(t=vs(t))===l||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function hs(t){var n=ps(t),e=n%1;return n==n?e?n-e:n:0}function ds(t){return t?or(hs(t),0,h):0}function vs(t){if("number"==typeof t)return t;if(ss(t))return p;if(Qu(t)){var n="function"==typeof t.valueOf?t.valueOf():t;t=Qu(n)?n+"":n}if("string"!=typeof t)return 0===t?t:+t;t=Hn(t);var e=dt.test(t);return e||gt.test(t)?cn(t.slice(2),e?2:8):ht.test(t)?p:+t}function gs(t){return Oi(t,Ss(t))}function ys(t){return null==t?"":ui(t)}var _s=ki(function(t,n){if(Io(n)||Vu(n))Oi(n,Cs(n),t);else for(var e in n)Pt.call(n,e)&&Qe(t,e,n[e])}),ms=ki(function(t,n){Oi(n,Ss(n),t)}),bs=ki(function(t,n,e,r){Oi(n,Ss(n),t,r)}),Is=ki(function(t,n,e,r){Oi(n,Cs(n),t,r)}),ws=Qi(ir),Ts=Jr(function(t,n){t=Et(t);var e=-1,r=n.length,o=r>2?n[2]:i;for(o&&yo(n[0],n[1],o)&&(r=1);++e<r;)for(var u=n[e],s=Ss(u),a=-1,c=s.length;++a<c;){var l=s[a],f=t[l];(f===i||Uu(f,Ct[l])&&!Pt.call(t,l))&&(t[l]=u[l])}return t}),Es=Jr(function(t){return t.push(i,Yi),En(Ps,i,t)});function xs(t,n,e){var r=null==t?i:Ir(t,n);return r===i?e:r}function As(t,n){return null!=t&&po(t,n,Ar)}var Os=Ni(function(t,n,e){null!=n&&"function"!=typeof n.toString&&(n=Mt.call(n)),t[n]=e},Qs(ea)),js=Ni(function(t,n,e){null!=n&&"function"!=typeof n.toString&&(n=Mt.call(n)),Pt.call(t,n)?t[n].push(e):t[n]=[e]},oo),ks=Jr(jr);function Cs(t){return Vu(t)?Ke(t):Lr(t)}function Ss(t){return Vu(t)?Ke(t,!0):function(t){if(!Qu(t))return function(t){var n=[];if(null!=t)for(var e in Et(t))n.push(e);return n}(t);var n=Io(t),e=[];for(var r in t)("constructor"!=r||!n&&Pt.call(t,r))&&e.push(r);return e}(t)}var Rs=ki(function(t,n,e){Ur(t,n,e)}),Ps=ki(function(t,n,e,r){Ur(t,n,e,r)}),Ls=Qi(function(t,n){var e={};if(null==t)return e;var r=!1;n=Rn(n,function(n){return n=gi(n,t),r||(r=n.length>1),n}),Oi(t,no(t),e),r&&(e=ur(e,7,Zi));for(var i=n.length;i--;)ai(e,n[i]);return e}),Ds=Qi(function(t,n){return null==t?{}:function(t,n){return Br(t,n,function(n,e){return As(t,e)})}(t,n)});function Ms(t,n){if(null==t)return{};var e=Rn(no(t),function(t){return[t]});return n=oo(n),Br(t,e,function(t,e){return n(t,e[0])})}var qs=Ji(Cs),Ns=Ji(Ss);function Us(t){return null==t?[]:Zn(t,Cs(t))}var zs=Pi(function(t,n,e){return n=n.toLowerCase(),t+(e?Fs(n):n)});function Fs(t){return Hs(ys(t).toLowerCase())}function Bs(t){return(t=ys(t))&&t.replace(_t,ne).replace(Zt,"")}var $s=Pi(function(t,n,e){return t+(e?"-":"")+n.toLowerCase()}),Ws=Pi(function(t,n,e){return t+(e?" ":"")+n.toLowerCase()}),Vs=Ri("toLowerCase"),Gs=Pi(function(t,n,e){return t+(e?"_":"")+n.toLowerCase()}),Js=Pi(function(t,n,e){return t+(e?" ":"")+Hs(n)}),Ks=Pi(function(t,n,e){return t+(e?" ":"")+n.toUpperCase()}),Hs=Ri("toUpperCase");function Ys(t,n,e){return t=ys(t),(n=e?i:n)===i?function(t){return nn.test(t)}(t)?function(t){return t.match(Qt)||[]}(t):function(t){return t.match(at)||[]}(t):t.match(n)||[]}var Zs=Jr(function(t,n){try{return En(t,i,n)}catch(t){return Hu(t)?t:new It(t)}}),Xs=Qi(function(t,n){return An(n,function(n){n=Mo(n),rr(t,n,ju(t[n],t))}),t});function Qs(t){return function(){return t}}var ta=Mi(),na=Mi(!0);function ea(t){return t}function ra(t){return Pr("function"==typeof t?t:ur(t,1))}var ia=Jr(function(t,n){return function(e){return jr(e,t,n)}}),oa=Jr(function(t,n){return function(e){return jr(t,e,n)}});function ua(t,n,e){var r=Cs(n),i=br(n,r);null!=e||Qu(n)&&(i.length||!r.length)||(e=n,n=t,t=this,i=br(n,Cs(n)));var o=!(Qu(e)&&"chain"in e&&!e.chain),u=Yu(t);return An(i,function(e){var r=n[e];t[e]=r,u&&(t.prototype[e]=function(){var n=this.__chain__;if(o||n){var e=t(this.__wrapped__);return(e.__actions__=Ai(this.__actions__)).push({func:r,args:arguments,thisArg:t}),e.__chain__=n,e}return r.apply(t,Pn([this.value()],arguments))})}),t}function sa(){}var aa=zi(Rn),ca=zi(jn),la=zi(Mn);function fa(t){return _o(t)?Wn(Mo(t)):function(t){return function(n){return Ir(n,t)}}(t)}var pa=Bi(),ha=Bi(!0);function da(){return[]}function va(){return!1}var ga,ya=Ui(function(t,n){return t+n},0),_a=Vi("ceil"),ma=Ui(function(t,n){return t/n},1),ba=Vi("floor"),Ia=Ui(function(t,n){return t*n},1),wa=Vi("round"),Ta=Ui(function(t,n){return t-n},0);return Ne.after=function(t,n){if("function"!=typeof n)throw new Ot(o);return t=hs(t),function(){if(--t<1)return n.apply(this,arguments)}},Ne.ary=Au,Ne.assign=_s,Ne.assignIn=ms,Ne.assignInWith=bs,Ne.assignWith=Is,Ne.at=ws,Ne.before=Ou,Ne.bind=ju,Ne.bindAll=Xs,Ne.bindKey=ku,Ne.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return $u(t)?t:[t]},Ne.chain=fu,Ne.chunk=function(t,n,e){n=(e?yo(t,n,e):n===i)?1:ge(hs(n),0);var o=null==t?0:t.length;if(!o||n<1)return[];for(var u=0,s=0,a=r(hn(o/n));u<o;)a[s++]=ti(t,u,u+=n);return a},Ne.compact=function(t){for(var n=-1,e=null==t?0:t.length,r=0,i=[];++n<e;){var o=t[n];o&&(i[r++]=o)}return i},Ne.concat=function(){var t=arguments.length;if(!t)return[];for(var n=r(t-1),e=arguments[0],i=t;i--;)n[i-1]=arguments[i];return Pn($u(e)?Ai(e):[e],vr(n,1))},Ne.cond=function(t){var n=null==t?0:t.length,e=oo();return t=n?Rn(t,function(t){if("function"!=typeof t[1])throw new Ot(o);return[e(t[0]),t[1]]}):[],Jr(function(e){for(var r=-1;++r<n;){var i=t[r];if(En(i[0],this,e))return En(i[1],this,e)}})},Ne.conforms=function(t){return function(t){var n=Cs(t);return function(e){return sr(e,t,n)}}(ur(t,1))},Ne.constant=Qs,Ne.countBy=du,Ne.create=function(t,n){var e=Ue(t);return null==n?e:er(e,n)},Ne.curry=function t(n,e,r){var o=Ki(n,8,i,i,i,i,i,e=r?i:e);return o.placeholder=t.placeholder,o},Ne.curryRight=function t(n,e,r){var o=Ki(n,16,i,i,i,i,i,e=r?i:e);return o.placeholder=t.placeholder,o},Ne.debounce=Cu,Ne.defaults=Ts,Ne.defaultsDeep=Es,Ne.defer=Su,Ne.delay=Ru,Ne.difference=Uo,Ne.differenceBy=zo,Ne.differenceWith=Fo,Ne.drop=function(t,n,e){var r=null==t?0:t.length;return r?ti(t,(n=e||n===i?1:hs(n))<0?0:n,r):[]},Ne.dropRight=function(t,n,e){var r=null==t?0:t.length;return r?ti(t,0,(n=r-(n=e||n===i?1:hs(n)))<0?0:n):[]},Ne.dropRightWhile=function(t,n){return t&&t.length?li(t,oo(n,3),!0,!0):[]},Ne.dropWhile=function(t,n){return t&&t.length?li(t,oo(n,3),!0):[]},Ne.fill=function(t,n,e,r){var o=null==t?0:t.length;return o?(e&&"number"!=typeof e&&yo(t,n,e)&&(e=0,r=o),function(t,n,e,r){var o=t.length;for((e=hs(e))<0&&(e=-e>o?0:o+e),(r=r===i||r>o?o:hs(r))<0&&(r+=o),r=e>r?0:ds(r);e<r;)t[e++]=n;return t}(t,n,e,r)):[]},Ne.filter=function(t,n){return($u(t)?kn:dr)(t,oo(n,3))},Ne.flatMap=function(t,n){return vr(wu(t,n),1)},Ne.flatMapDeep=function(t,n){return vr(wu(t,n),l)},Ne.flatMapDepth=function(t,n,e){return e=e===i?1:hs(e),vr(wu(t,n),e)},Ne.flatten=Wo,Ne.flattenDeep=function(t){return null!=t&&t.length?vr(t,l):[]},Ne.flattenDepth=function(t,n){return null!=t&&t.length?vr(t,n=n===i?1:hs(n)):[]},Ne.flip=function(t){return Ki(t,512)},Ne.flow=ta,Ne.flowRight=na,Ne.fromPairs=function(t){for(var n=-1,e=null==t?0:t.length,r={};++n<e;){var i=t[n];r[i[0]]=i[1]}return r},Ne.functions=function(t){return null==t?[]:br(t,Cs(t))},Ne.functionsIn=function(t){return null==t?[]:br(t,Ss(t))},Ne.groupBy=mu,Ne.initial=function(t){return null!=t&&t.length?ti(t,0,-1):[]},Ne.intersection=Go,Ne.intersectionBy=Jo,Ne.intersectionWith=Ko,Ne.invert=Os,Ne.invertBy=js,Ne.invokeMap=bu,Ne.iteratee=ra,Ne.keyBy=Iu,Ne.keys=Cs,Ne.keysIn=Ss,Ne.map=wu,Ne.mapKeys=function(t,n){var e={};return n=oo(n,3),_r(t,function(t,r,i){rr(e,n(t,r,i),t)}),e},Ne.mapValues=function(t,n){var e={};return n=oo(n,3),_r(t,function(t,r,i){rr(e,r,n(t,r,i))}),e},Ne.matches=function(t){return qr(ur(t,1))},Ne.matchesProperty=function(t,n){return Nr(t,ur(n,1))},Ne.memoize=Pu,Ne.merge=Rs,Ne.mergeWith=Ps,Ne.method=ia,Ne.methodOf=oa,Ne.mixin=ua,Ne.negate=Lu,Ne.nthArg=function(t){return t=hs(t),Jr(function(n){return zr(n,t)})},Ne.omit=Ls,Ne.omitBy=function(t,n){return Ms(t,Lu(oo(n)))},Ne.once=function(t){return Ou(2,t)},Ne.orderBy=function(t,n,e,r){return null==t?[]:($u(n)||(n=null==n?[]:[n]),$u(e=r?i:e)||(e=null==e?[]:[e]),Fr(t,n,e))},Ne.over=aa,Ne.overArgs=Du,Ne.overEvery=ca,Ne.overSome=la,Ne.partial=Mu,Ne.partialRight=qu,Ne.partition=Tu,Ne.pick=Ds,Ne.pickBy=Ms,Ne.property=fa,Ne.propertyOf=function(t){return function(n){return null==t?i:Ir(t,n)}},Ne.pull=Yo,Ne.pullAll=Zo,Ne.pullAllBy=function(t,n,e){return t&&t.length&&n&&n.length?$r(t,n,oo(e,2)):t},Ne.pullAllWith=function(t,n,e){return t&&t.length&&n&&n.length?$r(t,n,i,e):t},Ne.pullAt=Xo,Ne.range=pa,Ne.rangeRight=ha,Ne.rearg=Nu,Ne.reject=function(t,n){return($u(t)?kn:dr)(t,Lu(oo(n,3)))},Ne.remove=function(t,n){var e=[];if(!t||!t.length)return e;var r=-1,i=[],o=t.length;for(n=oo(n,3);++r<o;){var u=t[r];n(u,r,t)&&(e.push(u),i.push(r))}return Wr(t,i),e},Ne.rest=function(t,n){if("function"!=typeof t)throw new Ot(o);return Jr(t,n=n===i?n:hs(n))},Ne.reverse=Qo,Ne.sampleSize=function(t,n,e){return n=(e?yo(t,n,e):n===i)?1:hs(n),($u(t)?Ye:Hr)(t,n)},Ne.set=function(t,n,e){return null==t?t:Yr(t,n,e)},Ne.setWith=function(t,n,e,r){return r="function"==typeof r?r:i,null==t?t:Yr(t,n,e,r)},Ne.shuffle=function(t){return($u(t)?Ze:Qr)(t)},Ne.slice=function(t,n,e){var r=null==t?0:t.length;return r?(e&&"number"!=typeof e&&yo(t,n,e)?(n=0,e=r):(n=null==n?0:hs(n),e=e===i?r:hs(e)),ti(t,n,e)):[]},Ne.sortBy=Eu,Ne.sortedUniq=function(t){return t&&t.length?ii(t):[]},Ne.sortedUniqBy=function(t,n){return t&&t.length?ii(t,oo(n,2)):[]},Ne.split=function(t,n,e){return e&&"number"!=typeof e&&yo(t,n,e)&&(n=e=i),(e=e===i?h:e>>>0)?(t=ys(t))&&("string"==typeof n||null!=n&&!is(n))&&!(n=ui(n))&&ie(t)?_i(fe(t),0,e):t.split(n,e):[]},Ne.spread=function(t,n){if("function"!=typeof t)throw new Ot(o);return n=null==n?0:ge(hs(n),0),Jr(function(e){var r=e[n],i=_i(e,0,n);return r&&Pn(i,r),En(t,this,i)})},Ne.tail=function(t){var n=null==t?0:t.length;return n?ti(t,1,n):[]},Ne.take=function(t,n,e){return t&&t.length?ti(t,0,(n=e||n===i?1:hs(n))<0?0:n):[]},Ne.takeRight=function(t,n,e){var r=null==t?0:t.length;return r?ti(t,(n=r-(n=e||n===i?1:hs(n)))<0?0:n,r):[]},Ne.takeRightWhile=function(t,n){return t&&t.length?li(t,oo(n,3),!1,!0):[]},Ne.takeWhile=function(t,n){return t&&t.length?li(t,oo(n,3)):[]},Ne.tap=function(t,n){return n(t),t},Ne.throttle=function(t,n,e){var r=!0,i=!0;if("function"!=typeof t)throw new Ot(o);return Qu(e)&&(r="leading"in e?!!e.leading:r,i="trailing"in e?!!e.trailing:i),Cu(t,n,{leading:r,maxWait:n,trailing:i})},Ne.thru=pu,Ne.toArray=fs,Ne.toPairs=qs,Ne.toPairsIn=Ns,Ne.toPath=function(t){return $u(t)?Rn(t,Mo):ss(t)?[t]:Ai(Do(ys(t)))},Ne.toPlainObject=gs,Ne.transform=function(t,n,e){var r=$u(t),i=r||Ju(t)||as(t);if(n=oo(n,4),null==e){var o=t&&t.constructor;e=i?r?new o:[]:Qu(t)&&Yu(o)?Ue(Wt(t)):{}}return(i?An:_r)(t,function(t,r,i){return n(e,t,r,i)}),e},Ne.unary=function(t){return Au(t,1)},Ne.union=tu,Ne.unionBy=nu,Ne.unionWith=eu,Ne.uniq=function(t){return t&&t.length?si(t):[]},Ne.uniqBy=function(t,n){return t&&t.length?si(t,oo(n,2)):[]},Ne.uniqWith=function(t,n){return n="function"==typeof n?n:i,t&&t.length?si(t,i,n):[]},Ne.unset=function(t,n){return null==t||ai(t,n)},Ne.unzip=ru,Ne.unzipWith=iu,Ne.update=function(t,n,e){return null==t?t:ci(t,n,vi(e))},Ne.updateWith=function(t,n,e,r){return r="function"==typeof r?r:i,null==t?t:ci(t,n,vi(e),r)},Ne.values=Us,Ne.valuesIn=function(t){return null==t?[]:Zn(t,Ss(t))},Ne.without=ou,Ne.words=Ys,Ne.wrap=function(t,n){return Mu(vi(n),t)},Ne.xor=uu,Ne.xorBy=su,Ne.xorWith=au,Ne.zip=cu,Ne.zipObject=function(t,n){return hi(t||[],n||[],Qe)},Ne.zipObjectDeep=function(t,n){return hi(t||[],n||[],Yr)},Ne.zipWith=lu,Ne.entries=qs,Ne.entriesIn=Ns,Ne.extend=ms,Ne.extendWith=bs,ua(Ne,Ne),Ne.add=ya,Ne.attempt=Zs,Ne.camelCase=zs,Ne.capitalize=Fs,Ne.ceil=_a,Ne.clamp=function(t,n,e){return e===i&&(e=n,n=i),e!==i&&(e=(e=vs(e))==e?e:0),n!==i&&(n=(n=vs(n))==n?n:0),or(vs(t),n,e)},Ne.clone=function(t){return ur(t,4)},Ne.cloneDeep=function(t){return ur(t,5)},Ne.cloneDeepWith=function(t,n){return ur(t,5,n="function"==typeof n?n:i)},Ne.cloneWith=function(t,n){return ur(t,4,n="function"==typeof n?n:i)},Ne.conformsTo=function(t,n){return null==n||sr(t,n,Cs(n))},Ne.deburr=Bs,Ne.defaultTo=function(t,n){return null==t||t!=t?n:t},Ne.divide=ma,Ne.endsWith=function(t,n,e){t=ys(t),n=ui(n);var r=t.length,o=e=e===i?r:or(hs(e),0,r);return(e-=n.length)>=0&&t.slice(e,o)==n},Ne.eq=Uu,Ne.escape=function(t){return(t=ys(t))&&K.test(t)?t.replace(G,ee):t},Ne.escapeRegExp=function(t){return(t=ys(t))&&et.test(t)?t.replace(nt,"\\$&"):t},Ne.every=function(t,n,e){var r=$u(t)?jn:pr;return e&&yo(t,n,e)&&(n=i),r(t,oo(n,3))},Ne.find=vu,Ne.findIndex=Bo,Ne.findKey=function(t,n){return Nn(t,oo(n,3),_r)},Ne.findLast=gu,Ne.findLastIndex=$o,Ne.findLastKey=function(t,n){return Nn(t,oo(n,3),mr)},Ne.floor=ba,Ne.forEach=yu,Ne.forEachRight=_u,Ne.forIn=function(t,n){return null==t?t:gr(t,oo(n,3),Ss)},Ne.forInRight=function(t,n){return null==t?t:yr(t,oo(n,3),Ss)},Ne.forOwn=function(t,n){return t&&_r(t,oo(n,3))},Ne.forOwnRight=function(t,n){return t&&mr(t,oo(n,3))},Ne.get=xs,Ne.gt=zu,Ne.gte=Fu,Ne.has=function(t,n){return null!=t&&po(t,n,xr)},Ne.hasIn=As,Ne.head=Vo,Ne.identity=ea,Ne.includes=function(t,n,e,r){t=Vu(t)?t:Us(t),e=e&&!r?hs(e):0;var i=t.length;return e<0&&(e=ge(i+e,0)),us(t)?e<=i&&t.indexOf(n,e)>-1:!!i&&zn(t,n,e)>-1},Ne.indexOf=function(t,n,e){var r=null==t?0:t.length;if(!r)return-1;var i=null==e?0:hs(e);return i<0&&(i=ge(r+i,0)),zn(t,n,i)},Ne.inRange=function(t,n,e){return n=ps(n),e===i?(e=n,n=0):e=ps(e),function(t,n,e){return t>=ye(n,e)&&t<ge(n,e)}(t=vs(t),n,e)},Ne.invoke=ks,Ne.isArguments=Bu,Ne.isArray=$u,Ne.isArrayBuffer=Wu,Ne.isArrayLike=Vu,Ne.isArrayLikeObject=Gu,Ne.isBoolean=function(t){return!0===t||!1===t||ts(t)&&Tr(t)==y},Ne.isBuffer=Ju,Ne.isDate=Ku,Ne.isElement=function(t){return ts(t)&&1===t.nodeType&&!rs(t)},Ne.isEmpty=function(t){if(null==t)return!0;if(Vu(t)&&($u(t)||"string"==typeof t||"function"==typeof t.splice||Ju(t)||as(t)||Bu(t)))return!t.length;var n=fo(t);if(n==w||n==O)return!t.size;if(Io(t))return!Lr(t).length;for(var e in t)if(Pt.call(t,e))return!1;return!0},Ne.isEqual=function(t,n){return Cr(t,n)},Ne.isEqualWith=function(t,n,e){var r=(e="function"==typeof e?e:i)?e(t,n):i;return r===i?Cr(t,n,i,e):!!r},Ne.isError=Hu,Ne.isFinite=function(t){return"number"==typeof t&&qn(t)},Ne.isFunction=Yu,Ne.isInteger=Zu,Ne.isLength=Xu,Ne.isMap=ns,Ne.isMatch=function(t,n){return t===n||Sr(t,n,so(n))},Ne.isMatchWith=function(t,n,e){return e="function"==typeof e?e:i,Sr(t,n,so(n),e)},Ne.isNaN=function(t){return es(t)&&t!=+t},Ne.isNative=function(t){if(bo(t))throw new It("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Rr(t)},Ne.isNil=function(t){return null==t},Ne.isNull=function(t){return null===t},Ne.isNumber=es,Ne.isObject=Qu,Ne.isObjectLike=ts,Ne.isPlainObject=rs,Ne.isRegExp=is,Ne.isSafeInteger=function(t){return Zu(t)&&t>=-9007199254740991&&t<=f},Ne.isSet=os,Ne.isString=us,Ne.isSymbol=ss,Ne.isTypedArray=as,Ne.isUndefined=function(t){return t===i},Ne.isWeakMap=function(t){return ts(t)&&fo(t)==C},Ne.isWeakSet=function(t){return ts(t)&&"[object WeakSet]"==Tr(t)},Ne.join=function(t,n){return null==t?"":Vn.call(t,n)},Ne.kebabCase=$s,Ne.last=Ho,Ne.lastIndexOf=function(t,n,e){var r=null==t?0:t.length;if(!r)return-1;var o=r;return e!==i&&(o=(o=hs(e))<0?ge(r+o,0):ye(o,r-1)),n==n?function(t,n,e){for(var r=e+1;r--;)if(t[r]===n)return r;return r}(t,n,o):Un(t,Bn,o,!0)},Ne.lowerCase=Ws,Ne.lowerFirst=Vs,Ne.lt=cs,Ne.lte=ls,Ne.max=function(t){return t&&t.length?hr(t,ea,Er):i},Ne.maxBy=function(t,n){return t&&t.length?hr(t,oo(n,2),Er):i},Ne.mean=function(t){return $n(t,ea)},Ne.meanBy=function(t,n){return $n(t,oo(n,2))},Ne.min=function(t){return t&&t.length?hr(t,ea,Dr):i},Ne.minBy=function(t,n){return t&&t.length?hr(t,oo(n,2),Dr):i},Ne.stubArray=da,Ne.stubFalse=va,Ne.stubObject=function(){return{}},Ne.stubString=function(){return""},Ne.stubTrue=function(){return!0},Ne.multiply=Ia,Ne.nth=function(t,n){return t&&t.length?zr(t,hs(n)):i},Ne.noConflict=function(){return pn._===this&&(pn._=Nt),this},Ne.noop=sa,Ne.now=xu,Ne.pad=function(t,n,e){t=ys(t);var r=(n=hs(n))?le(t):0;if(!n||r>=n)return t;var i=(n-r)/2;return Fi(dn(i),e)+t+Fi(hn(i),e)},Ne.padEnd=function(t,n,e){t=ys(t);var r=(n=hs(n))?le(t):0;return n&&r<n?t+Fi(n-r,e):t},Ne.padStart=function(t,n,e){t=ys(t);var r=(n=hs(n))?le(t):0;return n&&r<n?Fi(n-r,e)+t:t},Ne.parseInt=function(t,n,e){return e||null==n?n=0:n&&(n=+n),me(ys(t).replace(rt,""),n||0)},Ne.random=function(t,n,e){if(e&&"boolean"!=typeof e&&yo(t,n,e)&&(n=e=i),e===i&&("boolean"==typeof n?(e=n,n=i):"boolean"==typeof t&&(e=t,t=i)),t===i&&n===i?(t=0,n=1):(t=ps(t),n===i?(n=t,t=0):n=ps(n)),t>n){var r=t;t=n,n=r}if(e||t%1||n%1){var o=be();return ye(t+o*(n-t+an("1e-"+((o+"").length-1))),n)}return Vr(t,n)},Ne.reduce=function(t,n,e){var r=$u(t)?Ln:Gn,i=arguments.length<3;return r(t,oo(n,4),e,i,lr)},Ne.reduceRight=function(t,n,e){var r=$u(t)?Dn:Gn,i=arguments.length<3;return r(t,oo(n,4),e,i,fr)},Ne.repeat=function(t,n,e){return n=(e?yo(t,n,e):n===i)?1:hs(n),Gr(ys(t),n)},Ne.replace=function(){var t=arguments,n=ys(t[0]);return t.length<3?n:n.replace(t[1],t[2])},Ne.result=function(t,n,e){var r=-1,o=(n=gi(n,t)).length;for(o||(o=1,t=i);++r<o;){var u=null==t?i:t[Mo(n[r])];u===i&&(r=o,u=e),t=Yu(u)?u.call(t):u}return t},Ne.round=wa,Ne.runInContext=t,Ne.sample=function(t){return($u(t)?He:Kr)(t)},Ne.size=function(t){if(null==t)return 0;if(Vu(t))return us(t)?le(t):t.length;var n=fo(t);return n==w||n==O?t.size:Lr(t).length},Ne.snakeCase=Gs,Ne.some=function(t,n,e){var r=$u(t)?Mn:ni;return e&&yo(t,n,e)&&(n=i),r(t,oo(n,3))},Ne.sortedIndex=function(t,n){return ei(t,n)},Ne.sortedIndexBy=function(t,n,e){return ri(t,n,oo(e,2))},Ne.sortedIndexOf=function(t,n){var e=null==t?0:t.length;if(e){var r=ei(t,n);if(r<e&&Uu(t[r],n))return r}return-1},Ne.sortedLastIndex=function(t,n){return ei(t,n,!0)},Ne.sortedLastIndexBy=function(t,n,e){return ri(t,n,oo(e,2),!0)},Ne.sortedLastIndexOf=function(t,n){if(null!=t&&t.length){var e=ei(t,n,!0)-1;if(Uu(t[e],n))return e}return-1},Ne.startCase=Js,Ne.startsWith=function(t,n,e){return t=ys(t),e=null==e?0:or(hs(e),0,t.length),n=ui(n),t.slice(e,e+n.length)==n},Ne.subtract=Ta,Ne.sum=function(t){return t&&t.length?Jn(t,ea):0},Ne.sumBy=function(t,n){return t&&t.length?Jn(t,oo(n,2)):0},Ne.template=function(t,n,e){var r=Ne.templateSettings;e&&yo(t,n,e)&&(n=i),t=ys(t),n=bs({},n,r,Hi);var o,u,s=bs({},n.imports,r.imports,Hi),a=Cs(s),c=Zn(s,a),l=0,f=n.interpolate||mt,p="__p += '",h=xt((n.escape||mt).source+"|"+f.source+"|"+(f===Z?ft:mt).source+"|"+(n.evaluate||mt).source+"|$","g"),d="//# sourceURL="+(Pt.call(n,"sourceURL")?(n.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++rn+"]")+"\n";t.replace(h,function(n,e,r,i,s,a){return r||(r=i),p+=t.slice(l,a).replace(bt,re),e&&(o=!0,p+="' +\n__e("+e+") +\n'"),s&&(u=!0,p+="';\n"+s+";\n__p += '"),r&&(p+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),l=a+n.length,n}),p+="';\n";var v=Pt.call(n,"variable")&&n.variable;if(v){if(ct.test(v))throw new It("Invalid `variable` option passed into `_.template`")}else p="with (obj) {\n"+p+"\n}\n";p=(u?p.replace(B,""):p).replace($,"$1").replace(W,"$1;"),p="function("+(v||"obj")+") {\n"+(v?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(u?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+p+"return __p\n}";var g=Zs(function(){return wt(a,d+"return "+p).apply(i,c)});if(g.source=p,Hu(g))throw g;return g},Ne.times=function(t,n){if((t=hs(t))<1||t>f)return[];var e=h,r=ye(t,h);n=oo(n),t-=h;for(var i=Kn(r,n);++e<t;)n(e);return i},Ne.toFinite=ps,Ne.toInteger=hs,Ne.toLength=ds,Ne.toLower=function(t){return ys(t).toLowerCase()},Ne.toNumber=vs,Ne.toSafeInteger=function(t){return t?or(hs(t),-9007199254740991,f):0===t?t:0},Ne.toString=ys,Ne.toUpper=function(t){return ys(t).toUpperCase()},Ne.trim=function(t,n,e){if((t=ys(t))&&(e||n===i))return Hn(t);if(!t||!(n=ui(n)))return t;var r=fe(t),o=fe(n);return _i(r,Qn(r,o),te(r,o)+1).join("")},Ne.trimEnd=function(t,n,e){if((t=ys(t))&&(e||n===i))return t.slice(0,pe(t)+1);if(!t||!(n=ui(n)))return t;var r=fe(t);return _i(r,0,te(r,fe(n))+1).join("")},Ne.trimStart=function(t,n,e){if((t=ys(t))&&(e||n===i))return t.replace(rt,"");if(!t||!(n=ui(n)))return t;var r=fe(t);return _i(r,Qn(r,fe(n))).join("")},Ne.truncate=function(t,n){var e=30,r="...";if(Qu(n)){var o="separator"in n?n.separator:o;e="length"in n?hs(n.length):e,r="omission"in n?ui(n.omission):r}var u=(t=ys(t)).length;if(ie(t)){var s=fe(t);u=s.length}if(e>=u)return t;var a=e-le(r);if(a<1)return r;var c=s?_i(s,0,a).join(""):t.slice(0,a);if(o===i)return c+r;if(s&&(a+=c.length-a),is(o)){if(t.slice(a).search(o)){var l,f=c;for(o.global||(o=xt(o.source,ys(pt.exec(o))+"g")),o.lastIndex=0;l=o.exec(f);)var p=l.index;c=c.slice(0,p===i?a:p)}}else if(t.indexOf(ui(o),a)!=a){var h=c.lastIndexOf(o);h>-1&&(c=c.slice(0,h))}return c+r},Ne.unescape=function(t){return(t=ys(t))&&J.test(t)?t.replace(V,he):t},Ne.uniqueId=function(t){var n=++Lt;return ys(t)+n},Ne.upperCase=Ks,Ne.upperFirst=Hs,Ne.each=yu,Ne.eachRight=_u,Ne.first=Vo,ua(Ne,(ga={},_r(Ne,function(t,n){Pt.call(Ne.prototype,n)||(ga[n]=t)}),ga),{chain:!1}),Ne.VERSION="4.17.21",An(["bind","bindKey","curry","curryRight","partial","partialRight"],function(t){Ne[t].placeholder=Ne}),An(["drop","take"],function(t,n){Be.prototype[t]=function(e){e=e===i?1:ge(hs(e),0);var r=this.__filtered__&&!n?new Be(this):this.clone();return r.__filtered__?r.__takeCount__=ye(e,r.__takeCount__):r.__views__.push({size:ye(e,h),type:t+(r.__dir__<0?"Right":"")}),r},Be.prototype[t+"Right"]=function(n){return this.reverse()[t](n).reverse()}}),An(["filter","map","takeWhile"],function(t,n){var e=n+1,r=1==e||3==e;Be.prototype[t]=function(t){var n=this.clone();return n.__iteratees__.push({iteratee:oo(t,3),type:e}),n.__filtered__=n.__filtered__||r,n}}),An(["head","last"],function(t,n){var e="take"+(n?"Right":"");Be.prototype[t]=function(){return this[e](1).value()[0]}}),An(["initial","tail"],function(t,n){var e="drop"+(n?"":"Right");Be.prototype[t]=function(){return this.__filtered__?new Be(this):this[e](1)}}),Be.prototype.compact=function(){return this.filter(ea)},Be.prototype.find=function(t){return this.filter(t).head()},Be.prototype.findLast=function(t){return this.reverse().find(t)},Be.prototype.invokeMap=Jr(function(t,n){return"function"==typeof t?new Be(this):this.map(function(e){return jr(e,t,n)})}),Be.prototype.reject=function(t){return this.filter(Lu(oo(t)))},Be.prototype.slice=function(t,n){t=hs(t);var e=this;return e.__filtered__&&(t>0||n<0)?new Be(e):(t<0?e=e.takeRight(-t):t&&(e=e.drop(t)),n!==i&&(e=(n=hs(n))<0?e.dropRight(-n):e.take(n-t)),e)},Be.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Be.prototype.toArray=function(){return this.take(h)},_r(Be.prototype,function(t,n){var e=/^(?:filter|find|map|reject)|While$/.test(n),r=/^(?:head|last)$/.test(n),o=Ne[r?"take"+("last"==n?"Right":""):n],u=r||/^find/.test(n);o&&(Ne.prototype[n]=function(){var n=this.__wrapped__,s=r?[1]:arguments,a=n instanceof Be,c=s[0],l=a||$u(n),f=function(t){var n=o.apply(Ne,Pn([t],s));return r&&p?n[0]:n};l&&e&&"function"==typeof c&&1!=c.length&&(a=l=!1);var p=this.__chain__,h=!!this.__actions__.length,d=u&&!p,v=a&&!h;if(!u&&l){n=v?n:new Be(this);var g=t.apply(n,s);return g.__actions__.push({func:pu,args:[f],thisArg:i}),new Fe(g,p)}return d&&v?t.apply(this,s):(g=this.thru(f),d?r?g.value()[0]:g.value():g)})}),An(["pop","push","shift","sort","splice","unshift"],function(t){var n=jt[t],e=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);Ne.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var i=this.value();return n.apply($u(i)?i:[],t)}return this[e](function(e){return n.apply($u(e)?e:[],t)})}}),_r(Be.prototype,function(t,n){var e=Ne[n];if(e){var r=e.name+"";Pt.call(ke,r)||(ke[r]=[]),ke[r].push({name:n,func:e})}}),ke[qi(i,2).name]=[{name:"wrapper",func:i}],Be.prototype.clone=function(){var t=new Be(this.__wrapped__);return t.__actions__=Ai(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Ai(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Ai(this.__views__),t},Be.prototype.reverse=function(){if(this.__filtered__){var t=new Be(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Be.prototype.value=function(){var t=this.__wrapped__.value(),n=this.__dir__,e=$u(t),r=n<0,i=e?t.length:0,o=function(t,n,e){for(var r=-1,i=e.length;++r<i;){var o=e[r],u=o.size;switch(o.type){case"drop":t+=u;break;case"dropRight":n-=u;break;case"take":n=ye(n,t+u);break;case"takeRight":t=ge(t,n-u)}}return{start:t,end:n}}(0,i,this.__views__),u=o.start,s=o.end,a=s-u,c=r?s:u-1,l=this.__iteratees__,f=l.length,p=0,h=ye(a,this.__takeCount__);if(!e||!r&&i==a&&h==a)return fi(t,this.__actions__);var d=[];t:for(;a--&&p<h;){for(var v=-1,g=t[c+=n];++v<f;){var y=l[v],_=y.iteratee,m=y.type,b=_(g);if(2==m)g=b;else if(!b){if(1==m)continue t;break t}}d[p++]=g}return d},Ne.prototype.at=hu,Ne.prototype.chain=function(){return fu(this)},Ne.prototype.commit=function(){return new Fe(this.value(),this.__chain__)},Ne.prototype.next=function(){this.__values__===i&&(this.__values__=fs(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?i:this.__values__[this.__index__++]}},Ne.prototype.plant=function(t){for(var n,e=this;e instanceof ze;){var r=No(e);r.__index__=0,r.__values__=i,n?o.__wrapped__=r:n=r;var o=r;e=e.__wrapped__}return o.__wrapped__=t,n},Ne.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof Be){var n=t;return this.__actions__.length&&(n=new Be(this)),(n=n.reverse()).__actions__.push({func:pu,args:[Qo],thisArg:i}),new Fe(n,this.__chain__)}return this.thru(Qo)},Ne.prototype.toJSON=Ne.prototype.valueOf=Ne.prototype.value=function(){return fi(this.__wrapped__,this.__actions__)},Ne.prototype.first=Ne.prototype.head,Ht&&(Ne.prototype[Ht]=function(){return this}),Ne}();pn._=de,(r=function(){return de}.call(n,e,n,t))===i||(t.exports=r)}.call(this)},611(t){"use strict";t.exports=require("http")},692(t){"use strict";t.exports=require("https")},203(t){"use strict";t.exports=require("stream")},16(t){"use strict";t.exports=require("url")},106(t){"use strict";t.exports=require("zlib")}};const n={};function e(r){const i=n[r];if(void 0!==i)return i.exports;const o=n[r]={id:r,loaded:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}e.m=t,e.n=t=>{const n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},e.d=(t,n)=>{if(Array.isArray(n))for(var r=0;r<n.length;){var i=n[r++],o=n[r++];e.o(t,i)?0===o&&r++:0===o?Object.defineProperty(t,i,{enumerable:!0,value:n[r++]}):Object.defineProperty(t,i,{enumerable:!0,get:o})}else for(var i in n)e.o(n,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:n[i]})},e.f={},e.e=t=>Promise.all(Object.keys(e.f).reduce((n,r)=>(e.f[r](t,n),n),[])),e.u=t=>t+".js",e.o=(t,n)=>Object.prototype.hasOwnProperty.call(t,n),e.r=t=>{Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),(()=>{const t={504:1};e.f.require=(n,r)=>{if(!t[n]){const r=require("../../"+e.u(n));t[n]||(n=>{const r=n.modules,i=n.ids,o=n.runtime;for(var u in r)e.o(r,u)&&(e.m[u]=r[u]);o&&o(e);for(var s=0;s<i.length;s++)t[i[s]]=1})(r)}}})();let r={};for(var i in(()=>{"use strict";e.r(r),e.d(r,{analyticsClient:()=>t.analyticsClient,userTypes:()=>t.userTypes});var t=e(823)})(),exports.analyticsClient=r.analyticsClient,exports.userTypes=r.userTypes,r)-1===["analyticsClient","userTypes"].indexOf(i)&&(exports[i]=r[i]);Object.defineProperty(exports,"__esModule",{value:!0})})();
|
package/packages/ari/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";const e={d:(r,t)=>{if(Array.isArray(t))for(var s=0;s<t.length;){var o=t[s++],i=t[s++];e.o(r,o)?0===i&&s++:0===i?Object.defineProperty(r,o,{enumerable:!0,value:t[s++]}):Object.defineProperty(r,o,{enumerable:!0,get:i})}else for(var o in t)e.o(t,o)&&!e.o(r,o)&&Object.defineProperty(r,o,{enumerable:!0,get:t[o]})},o:(e,r)=>Object.prototype.hasOwnProperty.call(e,r),r:e=>{Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}};let r={};e.r(r),e.d(r,{AnyAri:()=>p,Ari:()=>d,CompassWorkspaceAri:()=>m,ConfluenceWorkspaceAri:()=>w,EcosystemAppAri:()=>v,EcosystemAppEnvironmentVersionAri:()=>S,EcosystemAppPlacementAri:()=>T,GraphWorkspaceAri:()=>$,JiraWorkspaceAri:()=>k});var t=class extends Error{};function s(e){if("cloud"!==e&&"third-party"!==e)throw new t(`Identifier must have a qualifier of 'cloud' or 'third-party'. Received: ${e}`)}function o(e){if("ati"!==e)throw new t(`ATI must have a qualifier of 'ati'. Received: ${e}`)}var i=class{static getIdentifierSegments(e,r){let s=e.split(":");if(s.length<r)throw new t(`Input string must have ${r} segments.`);return s.length>r?[...s.slice(0,4),s.slice(4,s.length).join(":")]:s}};function a(e,r){if(r&&e!==r)throw new t(`Invalid resource owner - ${e}, expected ${r}.`)}function u(e,r){if(r&&e!==r)throw new t(`Invalid resource type - ${e}, expected ${r}.`)}var n=class extends i{static fromString(e,r){let t=this.getIdentifierSegments(e,5),[s,o,i,a,u]=t,[n,...c]=u.split("/"),l={qualifier:s,platformQualifier:o,cloudId:a,resourceOwner:i,resourceType:n,resourceId:c.join("/"),resourceIdSegmentValues:null!=r&&r.resourceIdSlug?this.ariSegmentValuesFromSlug(r.resourceIdSlug,c.join("/"),Object.keys(r.resourceIdSegmentFormats)):{}};return this.fromOpts(l,r)}static fromOpts(e,r){let{qualifier:o="ari",platformQualifier:i="cloud",resourceOwner:n,cloudId:c,resourceId:l,resourceIdSegmentValues:d,resourceType:p}=e;return function(e){if("ari"!==e)throw new t(`ARI must have a qualifier of 'ari'. Received: ${e}`)}(o),s(i),function(e,r=new RegExp("^[a-zA-Z0-9_\\-.]{0,255}$")){if(!e.match(r))throw new t(`Invalid cloud ID, expected ID of format ${r}.`)}(e.cloudId||"",null==r?void 0:r.cloudId),a(n,null==r?void 0:r.resourceOwner),u(p,null==r?void 0:r.resourceType),function(e,r){Object.entries(e).forEach(([e,s])=>{!function(e,r=new RegExp("[!a-zA-Z0-9\\-_.~@:;{}=]+(/[!a-zA-Z0-9\\-_.~@:;{}=]+)*"),s="resourceId"){let o=new RegExp(`^${r.source}$`);if(!e.match(o))throw new t(`Invalid ${s} - ${e}, expected ID of format ${o}.`)}(s,null==r?void 0:r[e],e)})}(d,null==r?void 0:r.resourceIdSegmentFormats),{qualifier:o,resourceOwner:n,resourceType:p,platformQualifier:i,cloudId:c,resourceId:l,resourceIdSegmentValues:d}}static ariSegmentValuesFromSlug(e,r,s){let o=new RegExp("^"+e.replace(/\{(.*?)\}/g,"(?<$1>.*?)")+"$").exec(r);if(!o)throw new t(`Segment '${r}' don't match expected slug: ${e}`);return s.forEach(r=>{var s;if(null==(s=o.groups)||!s[r])throw new t(`No value supplied for '${r}' based on slug ${e}`)}),o.groups||{}}},c=class extends i{static fromString(e,r){let t=this.getIdentifierSegments(e,4),[i="ati",n="cloud",c,l]=t;return o(i),s(n),a(c,null==r?void 0:r.resourceOwner),u(l,null==r?void 0:r.resourceType),{platformQualifier:n,resourceOwner:c,resourceType:l}}static fromOpts(e,r){let{qualifier:t,platformQualifier:i,resourceOwner:n,resourceType:c}=e;return o(t),s(i),a(n,null==r?void 0:r.resourceOwner),u(c,null==r?void 0:r.resourceType),{platformQualifier:i,resourceOwner:n,resourceType:c}}},l=class e{constructor(e,r,t){this._platformQualifier=e,this._resourceOwner=r,this._resourceType=t}get platformQualifier(){return this._platformQualifier}get resourceOwner(){return this._resourceOwner}get resourceType(){return this._resourceType}static create(r){return new e(r.platformQualifier||"cloud",r.resourceOwner,r.resourceType)}static parse(r,t){let s=c.fromString(r,t);return new e(s.platformQualifier,s.resourceOwner,s.resourceType)}toString(){return`ati:${this.platformQualifier}:${this.resourceOwner}:${this.resourceType}`}toJSON(){return this.toString()}toOpts(){return{platformQualifier:this._platformQualifier,resourceOwner:this._resourceOwner,resourceType:this._resourceType}}},d=class{constructor(e){this._ati=l.create({platformQualifier:e.platformQualifier||"cloud",resourceOwner:e.resourceOwner,resourceType:e.resourceType}),this._cloudId=""!==e.cloudId?e.cloudId:void 0,this._resourceId=e.resourceId}get platformQualifier(){return this._ati.platformQualifier}get cloudId(){return this._cloudId}get resourceOwner(){return this._ati.resourceOwner}get resourceType(){return this._ati.resourceType}get resourceId(){return this._resourceId}get ati(){return this._ati}equals(e){return this.toString()===e.toString()}toString(){return`ari:${this.platformQualifier}:${this.resourceOwner}:${this.cloudId||""}:${this.resourceType}/${this.resourceId}`}toJSON(){return this.toString()}toOpts(){return{platformQualifier:this.platformQualifier,resourceOwner:this.resourceOwner,cloudId:this.cloudId,resourceType:this.resourceType,resourceId:this.resourceId}}},p=class e extends d{constructor(e){super(e)}static create(r,t){let s={...r,resourceIdSegmentValues:{}},o=n.fromOpts(s,t);return new e(o)}static parse(r,t){let s=n.fromString(r,t);return new e(s)}static check(r){try{return e.parse(r.toString()),!0}catch(e){return!1}}asAnyAri(){return this}},I=class extends d{static check(e){try{return this.parse(e.toString()),!0}catch(e){return!1}}asAnyAri(){return p.parse(this.toString())}},f={qualifier:"ari",platformQualifier:"cloud",cloudId:new RegExp("^[a-zA-Z0-9_\\-.]{1,255}$"),resourceOwner:"compass",resourceType:"workspace",resourceIdSlug:"{workspaceId}",resourceIdSegmentFormats:{workspaceId:/[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}/}},m=class e extends I{constructor(e){super(e),this._siteId=e.cloudId||"",this._workspaceId=e.resourceIdSegmentValues.workspaceId}get siteId(){return this._siteId}get workspaceId(){return this._workspaceId}static create(r){let t={qualifier:f.qualifier,platformQualifier:f.platformQualifier,cloudId:r.siteId,resourceOwner:f.resourceOwner,resourceType:f.resourceType,resourceId:`${r.workspaceId}`,resourceIdSegmentValues:{workspaceId:r.workspaceId}},s=n.fromOpts(t,f);return new e(s)}static parse(r){let t=n.fromString(r,f);return new e(t)}getVariables(){return{siteId:this.siteId,workspaceId:this.workspaceId}}},g={qualifier:"ari",platformQualifier:"cloud",cloudId:new RegExp("^[a-zA-Z0-9_\\-.]{1,255}$"),resourceOwner:"confluence",resourceType:"workspace",resourceIdSlug:"{activationId}",resourceIdSegmentFormats:{activationId:/[a-zA-Z0-9\-]+/}},w=class e extends I{constructor(e){super(e),this._siteId=e.cloudId||"",this._activationId=e.resourceIdSegmentValues.activationId}get siteId(){return this._siteId}get activationId(){return this._activationId}static create(r){let t={qualifier:g.qualifier,platformQualifier:g.platformQualifier,cloudId:r.siteId,resourceOwner:g.resourceOwner,resourceType:g.resourceType,resourceId:`${r.activationId}`,resourceIdSegmentValues:{activationId:r.activationId}},s=n.fromOpts(t,g);return new e(s)}static parse(r){let t=n.fromString(r,g);return new e(t)}getVariables(){return{siteId:this.siteId,activationId:this.activationId}}},h={qualifier:"ari",platformQualifier:"cloud",cloudId:new RegExp("^$"),resourceOwner:"ecosystem",resourceType:"app",resourceIdSlug:"{appId}",resourceIdSegmentFormats:{appId:/[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}/}},v=class e extends I{constructor(e){super(e),this._appId=e.resourceIdSegmentValues.appId}get appId(){return this._appId}static create(r){let t={qualifier:h.qualifier,platformQualifier:h.platformQualifier,cloudId:void 0,resourceOwner:h.resourceOwner,resourceType:h.resourceType,resourceId:`${r.appId}`,resourceIdSegmentValues:{appId:r.appId}},s=n.fromOpts(t,h);return new e(s)}static parse(r){let t=n.fromString(r,h);return new e(t)}getVariables(){return{appId:this.appId}}},y={qualifier:"ari",platformQualifier:"cloud",cloudId:new RegExp("^$"),resourceOwner:"ecosystem",resourceType:"app-environment-version",resourceIdSlug:"{appId}/{environmentId}/{versionId}",resourceIdSegmentFormats:{appId:/[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}/,environmentId:/[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}/,versionId:/[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}/}},S=class e extends I{constructor(e){super(e),this._appId=e.resourceIdSegmentValues.appId,this._environmentId=e.resourceIdSegmentValues.environmentId,this._versionId=e.resourceIdSegmentValues.versionId}get appId(){return this._appId}get environmentId(){return this._environmentId}get versionId(){return this._versionId}static create(r){let t={qualifier:y.qualifier,platformQualifier:y.platformQualifier,cloudId:void 0,resourceOwner:y.resourceOwner,resourceType:y.resourceType,resourceId:`${r.appId}/${r.environmentId}/${r.versionId}`,resourceIdSegmentValues:{appId:r.appId,environmentId:r.environmentId,versionId:r.versionId}},s=n.fromOpts(t,y);return new e(s)}static parse(r){let t=n.fromString(r,y);return new e(t)}getVariables(){return{appId:this.appId,environmentId:this.environmentId,versionId:this.versionId}}},O={qualifier:"ari",platformQualifier:"cloud",cloudId:new RegExp("^$"),resourceOwner:"ecosystem",resourceType:"app-placement",resourceIdSlug:"{placementType}/{placementId}",resourceIdSegmentFormats:{placementType:/(isolation-context|region|customer-data-plane)/,placementId:/[a-zA-Z0-9-._]+/}},T=class e extends I{constructor(e){super(e),this._placementType=e.resourceIdSegmentValues.placementType,this._placementId=e.resourceIdSegmentValues.placementId}get placementType(){return this._placementType}get placementId(){return this._placementId}static create(r){let t={qualifier:O.qualifier,platformQualifier:O.platformQualifier,cloudId:void 0,resourceOwner:O.resourceOwner,resourceType:O.resourceType,resourceId:`${r.placementType}/${r.placementId}`,resourceIdSegmentValues:{placementType:r.placementType,placementId:r.placementId}},s=n.fromOpts(t,O);return new e(s)}static parse(r){let t=n.fromString(r,O);return new e(t)}getVariables(){return{placementType:this.placementType,placementId:this.placementId}}},_={qualifier:"ari",platformQualifier:"cloud",cloudId:new RegExp("^$"),resourceOwner:"graph",resourceType:"workspace",resourceIdSlug:"{workspaceId}",resourceIdSegmentFormats:{workspaceId:/[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}/}},$=class e extends I{constructor(e){super(e),this._workspaceId=e.resourceIdSegmentValues.workspaceId}get workspaceId(){return this._workspaceId}static create(r){let t={qualifier:_.qualifier,platformQualifier:_.platformQualifier,cloudId:void 0,resourceOwner:_.resourceOwner,resourceType:_.resourceType,resourceId:`${r.workspaceId}`,resourceIdSegmentValues:{workspaceId:r.workspaceId}},s=n.fromOpts(t,_);return new e(s)}static parse(r){let t=n.fromString(r,_);return new e(t)}getVariables(){return{workspaceId:this.workspaceId}}},Q={qualifier:"ari",platformQualifier:"cloud",cloudId:new RegExp("^[a-zA-Z0-9_\\-.]{1,255}$"),resourceOwner:"jira",resourceType:"workspace",resourceIdSlug:"{activationId}",resourceIdSegmentFormats:{activationId:/[a-zA-Z0-9\-]+/}},k=class e extends I{constructor(e){super(e),this._siteId=e.cloudId||"",this._activationId=e.resourceIdSegmentValues.activationId}get siteId(){return this._siteId}get activationId(){return this._activationId}static create(r){let t={qualifier:Q.qualifier,platformQualifier:Q.platformQualifier,cloudId:r.siteId,resourceOwner:Q.resourceOwner,resourceType:Q.resourceType,resourceId:`${r.activationId}`,resourceIdSegmentValues:{activationId:r.activationId}},s=n.fromOpts(t,Q);return new e(s)}static parse(r){let t=n.fromString(r,Q);return new e(t)}getVariables(){return{siteId:this.siteId,activationId:this.activationId}}};module.exports=r})();
|
|
1
|
+
(()=>{"use strict";const e={d:(r,t)=>{if(Array.isArray(t))for(var s=0;s<t.length;){var o=t[s++],i=t[s++];e.o(r,o)?0===i&&s++:0===i?Object.defineProperty(r,o,{enumerable:!0,value:t[s++]}):Object.defineProperty(r,o,{enumerable:!0,get:i})}else for(var o in t)e.o(t,o)&&!e.o(r,o)&&Object.defineProperty(r,o,{enumerable:!0,get:t[o]})},o:(e,r)=>Object.prototype.hasOwnProperty.call(e,r),r:e=>{Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}};let r={};e.r(r),e.d(r,{AnyAri:()=>d,Ari:()=>l,CompassWorkspaceAri:()=>m,ConfluenceWorkspaceAri:()=>w,EcosystemAppAri:()=>y,EcosystemAppEnvironmentVersionAri:()=>S,EcosystemAppPlacementAri:()=>A,GraphWorkspaceAri:()=>_,JiraWorkspaceAri:()=>k});var t=class extends Error{};function s(e){if("cloud"!==e&&"third-party"!==e)throw new t(`Identifier must have a qualifier of 'cloud' or 'third-party'. Received: ${e}`)}function o(e){if("ati"!==e)throw new t(`ATI must have a qualifier of 'ati'. Received: ${e}`)}var i=class{static getIdentifierSegments(e,r){let s=e.split(":");if(s.length<r)throw new t(`Input string must have ${r} segments.`);return s.length>r?[...s.slice(0,4),s.slice(4,s.length).join(":")]:s}};function a(e,r){if(r&&e!==r)throw new t(`Invalid resource owner - ${e}, expected ${r}.`)}function u(e,r){if(r&&e!==r)throw new t(`Invalid resource type - ${e}, expected ${r}.`)}var n=class extends i{static fromString(e,r){let t=this.getIdentifierSegments(e,5),[s,o,i,a,u]=t,[n,...c]=u.split("/"),p={qualifier:s,platformQualifier:o,cloudId:a,resourceOwner:i,resourceType:n,resourceId:c.join("/"),resourceIdSegmentValues:null!=r&&r.resourceIdSlug?this.ariSegmentValuesFromSlug(r.resourceIdSlug,c.join("/"),Object.keys(r.resourceIdSegmentFormats)):{}};return this.fromOpts(p,r)}static fromOpts(e,r){let{qualifier:o="ari",platformQualifier:i="cloud",resourceOwner:n,cloudId:c,resourceId:p,resourceIdSegmentValues:l,resourceType:d}=e;return function(e){if("ari"!==e)throw new t(`ARI must have a qualifier of 'ari'. Received: ${e}`)}(o),s(i),function(e,r=new RegExp("^[a-zA-Z0-9_\\-.]{0,255}$")){if(!e.match(r))throw new t(`Invalid cloud ID, expected ID of format ${r}.`)}(e.cloudId||"",null==r?void 0:r.cloudId),a(n,null==r?void 0:r.resourceOwner),u(d,null==r?void 0:r.resourceType),function(e,r){Object.entries(e).forEach(([e,s])=>{!function(e,r=new RegExp("[!a-zA-Z0-9\\-_.~@:;{}=]+(/[!a-zA-Z0-9\\-_.~@:;{}=]+)*"),s="resourceId"){let o=new RegExp(`^${r.source}$`);if(!e.match(o))throw new t(`Invalid ${s} - ${e}, expected ID of format ${o}.`)}(s,null==r?void 0:r[e],e)})}(l,null==r?void 0:r.resourceIdSegmentFormats),{qualifier:o,resourceOwner:n,resourceType:d,platformQualifier:i,cloudId:c,resourceId:p,resourceIdSegmentValues:l}}static ariSegmentValuesFromSlug(e,r,s){let o=new RegExp("^"+e.replace(/\{(.*?)\}/g,"(?<$1>.*?)")+"$").exec(r);if(!o)throw new t(`Segment '${r}' don't match expected slug: ${e}`);return s.forEach(r=>{var s;if(null==(s=o.groups)||!s[r])throw new t(`No value supplied for '${r}' based on slug ${e}`)}),o.groups||{}}},c=class extends i{static fromString(e,r){let t=this.getIdentifierSegments(e,4),[i="ati",n="cloud",c,p]=t;return o(i),s(n),a(c,null==r?void 0:r.resourceOwner),u(p,null==r?void 0:r.resourceType),{platformQualifier:n,resourceOwner:c,resourceType:p}}static fromOpts(e,r){let{qualifier:t,platformQualifier:i,resourceOwner:n,resourceType:c}=e;return o(t),s(i),a(n,null==r?void 0:r.resourceOwner),u(c,null==r?void 0:r.resourceType),{platformQualifier:i,resourceOwner:n,resourceType:c}}},p=class e{constructor(e,r,t){this._platformQualifier=e,this._resourceOwner=r,this._resourceType=t}get platformQualifier(){return this._platformQualifier}get resourceOwner(){return this._resourceOwner}get resourceType(){return this._resourceType}static create(r){return new e(r.platformQualifier||"cloud",r.resourceOwner,r.resourceType)}static parse(r,t){let s=c.fromString(r,t);return new e(s.platformQualifier,s.resourceOwner,s.resourceType)}toString(){return`ati:${this.platformQualifier}:${this.resourceOwner}:${this.resourceType}`}toJSON(){return this.toString()}toOpts(){return{platformQualifier:this._platformQualifier,resourceOwner:this._resourceOwner,resourceType:this._resourceType}}},l=class{constructor(e){this._ati=p.create({platformQualifier:e.platformQualifier||"cloud",resourceOwner:e.resourceOwner,resourceType:e.resourceType}),this._cloudId=""!==e.cloudId?e.cloudId:void 0,this._resourceId=e.resourceId}get platformQualifier(){return this._ati.platformQualifier}get cloudId(){return this._cloudId}get resourceOwner(){return this._ati.resourceOwner}get resourceType(){return this._ati.resourceType}get resourceId(){return this._resourceId}get ati(){return this._ati}equals(e){return this.toString()===e.toString()}toString(){return`ari:${this.platformQualifier}:${this.resourceOwner}:${this.cloudId||""}:${this.resourceType}/${this.resourceId}`}toJSON(){return this.toString()}toOpts(){return{platformQualifier:this.platformQualifier,resourceOwner:this.resourceOwner,cloudId:this.cloudId,resourceType:this.resourceType,resourceId:this.resourceId}}},d=class e extends l{constructor(e){super(e)}static create(r,t){let s={...r,resourceIdSegmentValues:{}},o=n.fromOpts(s,t);return new e(o)}static parse(r,t){let s=n.fromString(r,t);return new e(s)}static check(r){try{return e.parse(r.toString()),!0}catch(e){return!1}}asAnyAri(){return this}},I=class extends l{static check(e){try{return this.parse(e.toString()),!0}catch(e){return!1}}asAnyAri(){return d.parse(this.toString())}},f={qualifier:"ari",platformQualifier:"cloud",cloudId:new RegExp("^[a-zA-Z0-9_\\-.]{1,255}$"),resourceOwner:"compass",resourceType:"workspace",resourceIdSlug:"{workspaceId}",resourceIdSegmentFormats:{workspaceId:/[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}/}},m=class e extends I{constructor(e){super(e),this._siteId=e.cloudId||"",this._workspaceId=e.resourceIdSegmentValues.workspaceId}get siteId(){return this._siteId}get workspaceId(){return this._workspaceId}static create(r){let t={qualifier:f.qualifier,platformQualifier:f.platformQualifier,cloudId:r.siteId,resourceOwner:f.resourceOwner,resourceType:f.resourceType,resourceId:`${r.workspaceId}`,resourceIdSegmentValues:{workspaceId:r.workspaceId}},s=n.fromOpts(t,f);return new e(s)}static parse(r){let t=n.fromString(r,f);return new e(t)}getVariables(){return{siteId:this.siteId,workspaceId:this.workspaceId}}},g={qualifier:"ari",platformQualifier:"cloud",cloudId:new RegExp("^[a-zA-Z0-9_\\-.]{1,255}$"),resourceOwner:"confluence",resourceType:"workspace",resourceIdSlug:"{activationId}",resourceIdSegmentFormats:{activationId:/[a-zA-Z0-9\-]+/}},w=class e extends I{constructor(e){super(e),this._siteId=e.cloudId||"",this._activationId=e.resourceIdSegmentValues.activationId}get siteId(){return this._siteId}get activationId(){return this._activationId}static create(r){let t={qualifier:g.qualifier,platformQualifier:g.platformQualifier,cloudId:r.siteId,resourceOwner:g.resourceOwner,resourceType:g.resourceType,resourceId:`${r.activationId}`,resourceIdSegmentValues:{activationId:r.activationId}},s=n.fromOpts(t,g);return new e(s)}static parse(r){let t=n.fromString(r,g);return new e(t)}getVariables(){return{siteId:this.siteId,activationId:this.activationId}}},h={qualifier:"ari",platformQualifier:"cloud",cloudId:new RegExp("^$"),resourceOwner:"ecosystem",resourceType:"app",resourceIdSlug:"{appId}",resourceIdSegmentFormats:{appId:/[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}/}},y=class e extends I{constructor(e){super(e),this._appId=e.resourceIdSegmentValues.appId}get appId(){return this._appId}static create(r){let t={qualifier:h.qualifier,platformQualifier:h.platformQualifier,cloudId:void 0,resourceOwner:h.resourceOwner,resourceType:h.resourceType,resourceId:`${r.appId}`,resourceIdSegmentValues:{appId:r.appId}},s=n.fromOpts(t,h);return new e(s)}static parse(r){let t=n.fromString(r,h);return new e(t)}getVariables(){return{appId:this.appId}}},v={qualifier:"ari",platformQualifier:"cloud",cloudId:new RegExp("^$"),resourceOwner:"ecosystem",resourceType:"app-environment-version",resourceIdSlug:"{appId}/{environmentId}/{versionId}",resourceIdSegmentFormats:{appId:/[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}/,environmentId:/[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}/,versionId:/[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}/}},S=class e extends I{constructor(e){super(e),this._appId=e.resourceIdSegmentValues.appId,this._environmentId=e.resourceIdSegmentValues.environmentId,this._versionId=e.resourceIdSegmentValues.versionId}get appId(){return this._appId}get environmentId(){return this._environmentId}get versionId(){return this._versionId}static create(r){let t={qualifier:v.qualifier,platformQualifier:v.platformQualifier,cloudId:void 0,resourceOwner:v.resourceOwner,resourceType:v.resourceType,resourceId:`${r.appId}/${r.environmentId}/${r.versionId}`,resourceIdSegmentValues:{appId:r.appId,environmentId:r.environmentId,versionId:r.versionId}},s=n.fromOpts(t,v);return new e(s)}static parse(r){let t=n.fromString(r,v);return new e(t)}getVariables(){return{appId:this.appId,environmentId:this.environmentId,versionId:this.versionId}}},O={qualifier:"ari",platformQualifier:"cloud",cloudId:new RegExp("^$"),resourceOwner:"ecosystem",resourceType:"app-placement",resourceIdSlug:"{placementType}/{placementId}",resourceIdSegmentFormats:{placementType:/(isolation-context|region|customer-data-plane)/,placementId:/[a-zA-Z0-9-._]+/}},A=class e extends I{constructor(e){super(e),this._placementType=e.resourceIdSegmentValues.placementType,this._placementId=e.resourceIdSegmentValues.placementId}get placementType(){return this._placementType}get placementId(){return this._placementId}static create(r){let t={qualifier:O.qualifier,platformQualifier:O.platformQualifier,cloudId:void 0,resourceOwner:O.resourceOwner,resourceType:O.resourceType,resourceId:`${r.placementType}/${r.placementId}`,resourceIdSegmentValues:{placementType:r.placementType,placementId:r.placementId}},s=n.fromOpts(t,O);return new e(s)}static parse(r){let t=n.fromString(r,O);return new e(t)}getVariables(){return{placementType:this.placementType,placementId:this.placementId}}},T={qualifier:"ari",platformQualifier:"cloud",cloudId:new RegExp("^$"),resourceOwner:"graph",resourceType:"workspace",resourceIdSlug:"{workspaceId}",resourceIdSegmentFormats:{workspaceId:/[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}/}},_=class e extends I{constructor(e){super(e),this._workspaceId=e.resourceIdSegmentValues.workspaceId}get workspaceId(){return this._workspaceId}static create(r){let t={qualifier:T.qualifier,platformQualifier:T.platformQualifier,cloudId:void 0,resourceOwner:T.resourceOwner,resourceType:T.resourceType,resourceId:`${r.workspaceId}`,resourceIdSegmentValues:{workspaceId:r.workspaceId}},s=n.fromOpts(t,T);return new e(s)}static parse(r){let t=n.fromString(r,T);return new e(t)}getVariables(){return{workspaceId:this.workspaceId}}},$={qualifier:"ari",platformQualifier:"cloud",cloudId:new RegExp("^[a-zA-Z0-9_\\-.]{1,255}$"),resourceOwner:"jira",resourceType:"workspace",resourceIdSlug:"{activationId}",resourceIdSegmentFormats:{activationId:/[a-zA-Z0-9\-]+/}},k=class e extends I{constructor(e){super(e),this._siteId=e.cloudId||"",this._activationId=e.resourceIdSegmentValues.activationId}get siteId(){return this._siteId}get activationId(){return this._activationId}static create(r){let t={qualifier:$.qualifier,platformQualifier:$.platformQualifier,cloudId:r.siteId,resourceOwner:$.resourceOwner,resourceType:$.resourceType,resourceId:`${r.activationId}`,resourceIdSegmentValues:{activationId:r.activationId}},s=n.fromOpts(t,$);return new e(s)}static parse(r){let t=n.fromString(r,$);return new e(t)}getVariables(){return{siteId:this.siteId,activationId:this.activationId}}};for(var x in exports.AnyAri=r.AnyAri,exports.Ari=r.Ari,exports.CompassWorkspaceAri=r.CompassWorkspaceAri,exports.ConfluenceWorkspaceAri=r.ConfluenceWorkspaceAri,exports.EcosystemAppAri=r.EcosystemAppAri,exports.EcosystemAppEnvironmentVersionAri=r.EcosystemAppEnvironmentVersionAri,exports.EcosystemAppPlacementAri=r.EcosystemAppPlacementAri,exports.GraphWorkspaceAri=r.GraphWorkspaceAri,exports.JiraWorkspaceAri=r.JiraWorkspaceAri,r)-1===["AnyAri","Ari","CompassWorkspaceAri","ConfluenceWorkspaceAri","EcosystemAppAri","EcosystemAppEnvironmentVersionAri","EcosystemAppPlacementAri","GraphWorkspaceAri","JiraWorkspaceAri"].indexOf(x)&&(exports[x]=r[x]);Object.defineProperty(exports,"__esModule",{value:!0})})();
|