@walkeros/web-destination-amplitude 4.8.1 → 4.8.2
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 +40 -0
- package/README.md +7 -0
- package/dist/dev.d.mts +56 -46
- package/dist/dev.d.ts +56 -46
- package/dist/dev.js +1 -1
- package/dist/dev.js.map +1 -1
- package/dist/dev.mjs +1 -1
- package/dist/dev.mjs.map +1 -1
- package/dist/examples/index.d.mts +56 -46
- package/dist/examples/index.d.ts +56 -46
- package/dist/examples/index.js +31 -13
- package/dist/examples/index.mjs +32 -14
- package/dist/index.browser.js +1 -1
- package/dist/index.d.mts +46 -46
- package/dist/index.d.ts +46 -46
- package/dist/index.es5.js +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/walkerOS.json +133 -37
- package/package.json +7 -4
package/dist/index.browser.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var Destination=(()=>{var e,t,r=Object.create,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,s=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,l=(e,t)=>function(){return e&&(t=(0,e[o(e)[0]])(e=0)),t},u=(e,t)=>function(){return t||(0,e[o(e)[0]])((t={exports:{}}).exports,t),t.exports},c=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},d=(e,t,r,s)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))a.call(e,l)||l===r||n(e,l,{get:()=>t[l],enumerable:!(s=i(t,l))||s.enumerable});return e},h=(e,t,i)=>(i=null!=e?r(s(e)):{},d(!t&&e&&e.__esModule?i:n(i,"default",{value:e,enumerable:!0}),e)),p=(e,t,r)=>((e,t,r)=>t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);function f(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}function g(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}function v(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})}function m(e,t){var r,n,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(l){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}function y(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function b(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}function w(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}var S,k,x,E,C,I,O,T,A,R,P,_,M,N,L,D,U,F,j,B,q,z,W,V,$,H,K,G,J,Q,X,Y,Z,ee,te,re,ne,ie,oe,se,ae,le,ue,ce,de,he,pe,fe,ge,ve,me,ye,be,we,Se,ke,xe,Ee,Ce,Ie,Oe,Te,Ae,Re,Pe,_e,Me,Ne=l({"../../../../node_modules/tslib/tslib.es6.mjs"(){e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(t,r)},t=function(){return t=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},t.apply(this,arguments)}}}),Le=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/types/event/event.js"(){var e,t;(e=S||(S={})).SET="$set",e.SET_ONCE="$setOnce",e.ADD="$add",e.APPEND="$append",e.PREPEND="$prepend",e.REMOVE="$remove",e.PREINSERT="$preInsert",e.POSTINSERT="$postInsert",e.UNSET="$unset",e.CLEAR_ALL="$clearAll",(t=k||(k={})).IDENTIFY="$identify",t.GROUP_IDENTIFY="$groupidentify",t.REVENUE="revenue_amount"}}),De=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/types/constants.js"(){x="-",C="".concat(E="AMP","_unsent"),I="$default_instance",O="https://api2.amplitude.com/2/httpapi",T="https://api.eu.amplitude.com/2/httpapi",A="https://api2.amplitude.com/batch",R="https://api.eu.amplitude.com/batch",P="utm_campaign",_="utm_content",M="utm_id",N="utm_medium",L="utm_source",D="utm_term",U="dclid",F="fbclid",j="gbraid",B="gclid",q="ko_click_id",z="li_fat_id",W="msclkid",V="rdt_cid",$="ttclid",H="twclid",K="wbraid",G={utm_campaign:void 0,utm_content:void 0,utm_id:void 0,utm_medium:void 0,utm_source:void 0,utm_term:void 0,referrer:void 0,referring_domain:void 0,dclid:void 0,gbraid:void 0,gclid:void 0,fbclid:void 0,ko_click_id:void 0,li_fat_id:void 0,msclkid:void 0,rdt_cid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0},J=["access-control-allow-origin","access-control-allow-credentials","access-control-expose-headers","access-control-max-age","access-control-allow-methods","access-control-allow-headers","accept-patch","accept-ranges","age","allow","alt-svc","cache-control","connection","content-disposition","content-encoding","content-language","content-length","content-location","content-md5","content-range","content-type","date","delta-base","etag","expires","im","last-modified","link","location","permanent","p3p","pragma","proxy-authenticate","public-key-pins","retry-after","server","status","strict-transport-security","trailer","transfer-encoding","tk","upgrade","vary","via","warning","www-authenticate","x-b3-traceid","x-frame-options"],Q=["authorization","cookie","set-cookie"]}}),Ue=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/utils/valid-properties.js"(){Ne(),X=function(e){if(Object.keys(e).length>1e3)return!1;for(var t in e){var r=e[t];if(!Y(t,r))return!1}return!0},Y=function(e,t){var r,n;if("string"!=typeof e)return!1;if(Array.isArray(t)){var i=!0;try{for(var o=y(t),s=o.next();!s.done;s=o.next()){var a=s.value;if(Array.isArray(a))return!1;if("object"==typeof a)i=i&&X(a);else if(!["number","string"].includes(typeof a))return!1;if(!i)return!1}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}}else{if(null==t)return!1;if("object"==typeof t)return X(t);if(!["number","string","boolean"].includes(typeof t))return!1}return!0}}}),Fe=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/identify.js"(){var e;Ne(),De(),Ue(),Z=function(){function e(){this._propertySet=new Set,this._properties={}}return e.prototype.getUserProperties=function(){return t({},this._properties)},e.prototype.set=function(e,t){return this._safeSet(ee.SET,e,t),this},e.prototype.setOnce=function(e,t){return this._safeSet(ee.SET_ONCE,e,t),this},e.prototype.append=function(e,t){return this._safeSet(ee.APPEND,e,t),this},e.prototype.prepend=function(e,t){return this._safeSet(ee.PREPEND,e,t),this},e.prototype.postInsert=function(e,t){return this._safeSet(ee.POSTINSERT,e,t),this},e.prototype.preInsert=function(e,t){return this._safeSet(ee.PREINSERT,e,t),this},e.prototype.remove=function(e,t){return this._safeSet(ee.REMOVE,e,t),this},e.prototype.add=function(e,t){return this._safeSet(ee.ADD,e,t),this},e.prototype.unset=function(e){return this._safeSet(ee.UNSET,e,x),this},e.prototype.clearAll=function(){return this._properties={},this._properties[ee.CLEAR_ALL]=x,this},e.prototype._safeSet=function(e,t,r){if(this._validate(e,t,r)){var n=this._properties[e];return void 0===n&&(n={},this._properties[e]=n),n[t]=r,this._propertySet.add(t),!0}return!1},e.prototype._validate=function(e,t,r){return void 0===this._properties[ee.CLEAR_ALL]&&(!this._propertySet.has(t)&&(e===ee.ADD?"number"==typeof r:e===ee.UNSET||e===ee.REMOVE||Y(t,r)))},e}(),(e=ee||(ee={})).SET="$set",e.SET_ONCE="$setOnce",e.ADD="$add",e.APPEND="$append",e.PREPEND="$prepend",e.REMOVE="$remove",e.PREINSERT="$preInsert",e.POSTINSERT="$postInsert",e.UNSET="$unset",e.CLEAR_ALL="$clearAll",te=[ee.CLEAR_ALL,ee.UNSET,ee.SET,ee.SET_ONCE,ee.ADD,ee.APPEND,ee.PREPEND,ee.PREINSERT,ee.POSTINSERT,ee.REMOVE]}}),je=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/types/messages.js"(){re="Event tracked successfully",ne="Unexpected error occurred",ie="Event rejected due to exceeded retry count",oe="Event skipped due to optOut config",se="Event rejected due to missing API key",ae="Invalid API key",le="Client not initialized"}}),Be=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/types/status.js"(){var e;(e=ue||(ue={})).Unknown="unknown",e.Skipped="skipped",e.Success="success",e.RateLimit="rate_limit",e.PayloadTooLarge="payload_too_large",e.Invalid="invalid",e.Failed="failed",e.Timeout="Timeout",e.SystemError="SystemError"}}),qe=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/utils/result-builder.js"(){Be(),ce=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=ue.Unknown),{event:e,code:t,message:r}}}}),ze=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/global-scope.js"(){de=function(){var e="ampIntegrationContext";return"undefined"!=typeof globalThis&&void 0!==globalThis[e]?globalThis[e]:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:void 0}}}),We=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/utils/uuid.js"(){Ne(),ze(),he=function(e){return e?(e^16*Math.random()>>e/4).toString(16):(String(1e7)+String(-1e3)+String(-4e3)+String(-8e3)+String(-1e11)).replace(/[018]/g,fe)},pe=w([],b(Array(256).keys()),!1).map(function(e){return e.toString(16).padStart(2,"0")}),fe=function(e){var t,r=de();if(!(null===(t=null==r?void 0:r.crypto)||void 0===t?void 0:t.getRandomValues))return he(e);var n=r.crypto.getRandomValues(new Uint8Array(16));return n[6]=15&n[6]|64,n[8]=63&n[8]|128,w([],b(n.entries()),!1).map(function(e){var t=b(e,2),r=t[0],n=t[1];return[4,6,8,10].includes(r)?"-".concat(pe[n]):pe[n]}).join("")}}}),Ve=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/timeline.js"(){Ne(),qe(),We(),ge=function(){function e(e){this.client=e,this.queue=[],this.applying=!1,this.plugins=[],this.pluginStatus=new Map,this._optOutListeners=[]}return e.prototype.register=function(e,t){var r,n;return v(this,void 0,void 0,function(){var i;return m(this,function(o){switch(o.label){case 0:return void 0===e.name&&(e.name=fe(),this.loggerProvider.warn("Plugin name is undefined.\n Generating a random UUID for plugin name: ".concat(e.name,".\n Set a name for the plugin to prevent it from being added multiple times."))),i=e.name,this.pluginStatus.has(i)?(this.loggerProvider.warn("Plugin with name ".concat(i," already exists, skipping registration")),[2]):(e.type=null!==(r=e.type)&&void 0!==r?r:"enrichment",this.pluginStatus.set(i,"locked"),[4,null===(n=e.setup)||void 0===n?void 0:n.call(e,t,this.client)]);case 1:return o.sent(),"locked"!==this.pluginStatus.get(i)?[2]:(this.plugins.push(e),this.pluginStatus.set(i,"installed"),[2])}})})},e.prototype.deregister=function(e,t){var r;return v(this,void 0,void 0,function(){var n,i;return m(this,function(o){switch(o.label){case 0:return this.pluginStatus.delete(e),-1===(n=this.plugins.findIndex(function(t){return t.name===e}))?(t.loggerProvider.warn("Plugin with name ".concat(e," does not exist, skipping deregistration")),[2]):(i=this.plugins[n],this.plugins.splice(n,1),[4,null===(r=i.teardown)||void 0===r?void 0:r.call(i)]);case 1:return o.sent(),[2]}})})},e.prototype.reset=function(e){this._clearOptOutListeners(),this.applying=!1,this.plugins.map(function(e){var t;return null===(t=e.teardown)||void 0===t?void 0:t.call(e)}),this.plugins=[],this.pluginStatus.clear(),this.client=e},e.prototype.push=function(e){var t=this;return new Promise(function(r){t.queue.push([e,r]),t.scheduleApply(0)})},e.prototype.scheduleApply=function(e){var t=this;this.applying||(this.applying=!0,setTimeout(function(){t.apply(t.queue.shift()).then(function(){t.applying=!1,t.queue.length>0&&t.scheduleApply(0)})},e))},e.prototype.apply=function(e){return v(this,void 0,void 0,function(){var r,n,i,o,s,a,l,u,c,d,h,p,f,g,v,w,S,k,x,E;return m(this,function(m){switch(m.label){case 0:if(!e)return[2];r=b(e,1),n=r[0],i=b(e,2),o=i[1],this.loggerProvider.log("Timeline.apply: Initial event",n),s=this.plugins.filter(function(e){return"before"===e.type}),m.label=1;case 1:m.trys.push([1,6,7,8]),a=y(s),l=a.next(),m.label=2;case 2:return l.done?[3,5]:(p=l.value).execute?[4,p.execute(t({},n))]:[3,4];case 3:if(null===(f=m.sent()))return this.loggerProvider.log("Timeline.apply: Event filtered out by before plugin '".concat(String(p.name),"', event: ").concat(JSON.stringify(n))),o({event:n,code:0,message:""}),[2];n=f,this.loggerProvider.log("Timeline.apply: Event after before plugin '".concat(String(p.name),"', event: ").concat(JSON.stringify(n))),m.label=4;case 4:return l=a.next(),[3,2];case 5:return[3,8];case 6:return u=m.sent(),S={error:u},[3,8];case 7:try{l&&!l.done&&(k=a.return)&&k.call(a)}finally{if(S)throw S.error}return[7];case 8:c=this.plugins.filter(function(e){return"enrichment"===e.type||void 0===e.type}),m.label=9;case 9:m.trys.push([9,14,15,16]),d=y(c),h=d.next(),m.label=10;case 10:return h.done?[3,13]:(p=h.value).execute?[4,p.execute(t({},n))]:[3,12];case 11:if(null===(f=m.sent()))return this.loggerProvider.log("Timeline.apply: Event filtered out by enrichment plugin '".concat(String(p.name),"', event: ").concat(JSON.stringify(n))),o({event:n,code:0,message:""}),[2];n=f,this.loggerProvider.log("Timeline.apply: Event after enrichment plugin '".concat(String(p.name),"', event: ").concat(JSON.stringify(n))),m.label=12;case 12:return h=d.next(),[3,10];case 13:return[3,16];case 14:return g=m.sent(),x={error:g},[3,16];case 15:try{h&&!h.done&&(E=d.return)&&E.call(d)}finally{if(x)throw x.error}return[7];case 16:return v=this.plugins.filter(function(e){return"destination"===e.type}),this.loggerProvider.log("Timeline.apply: Final event before destinations, event: ".concat(JSON.stringify(n))),w=v.map(function(e){var r=t({},n);return e.execute(r).catch(function(e){return ce(r,0,String(e))})}),Promise.all(w).then(function(e){var t=b(e,1)[0]||ce(n,100,"Event not tracked, no destination plugins on the instance");o(t)}),[2]}})})},e.prototype.flush=function(){return v(this,void 0,void 0,function(){var e,t,r,n=this;return m(this,function(i){switch(i.label){case 0:return e=this.queue,this.queue=[],[4,Promise.all(e.map(function(e){return n.apply(e)}))];case 1:return i.sent(),t=this.plugins.filter(function(e){return"destination"===e.type}),r=t.map(function(e){return e.flush&&e.flush()}),[4,Promise.all(r)];case 2:return i.sent(),[2]}})})},e.prototype.addOptOutListener=function(e){this._optOutListeners.push(e)},e.prototype._clearOptOutListeners=function(){this._optOutListeners=[]},e.prototype.onIdentityChanged=function(e){this.plugins.forEach(function(t){var r;null===(r=t.onIdentityChanged)||void 0===r||r.call(t,e)})},e.prototype.onSessionIdChanged=function(e){this.plugins.forEach(function(t){var r;null===(r=t.onSessionIdChanged)||void 0===r||r.call(t,e)})},e.prototype.onOptOutChanged=function(e){this.plugins.forEach(function(t){var r;null===(r=t.onOptOutChanged)||void 0===r||r.call(t,e)}),this._callOptOutListeners(e)},e.prototype._callOptOutListeners=function(e){return v(this,void 0,void 0,function(){var t,r,n,i,o,s,a;return m(this,function(l){switch(l.label){case 0:l.trys.push([0,7,8,9]),t=y(this._optOutListeners),r=t.next(),l.label=1;case 1:if(r.done)return[3,6];n=r.value,l.label=2;case 2:return l.trys.push([2,4,,5]),[4,n(e)];case 3:return l.sent(),[3,5];case 4:return i=l.sent(),this.loggerProvider.error("Error calling optOut listener",i),[3,5];case 5:return r=t.next(),[3,1];case 6:return[3,9];case 7:return o=l.sent(),s={error:o},[3,9];case 8:try{r&&!r.done&&(a=t.return)&&a.call(t)}finally{if(s)throw s.error}return[7];case 9:return[2]}})})},e.prototype.onReset=function(){this.plugins.forEach(function(e){var t;null===(t=e.onReset)||void 0===t||t.call(e)})},e}()}}),$e=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/utils/event-builder.js"(){Ne(),Fe(),Le(),ve=function(e,r,n){return t(t(t({},"string"==typeof e?{event_type:e}:e),n),r&&{event_properties:r})},me=function(e,r){return t(t({},r),{event_type:k.IDENTIFY,user_properties:e.getUserProperties()})},ye=function(e,r,n,i){var o;return t(t({},i),{event_type:k.GROUP_IDENTIFY,group_properties:n.getUserProperties(),groups:(o={},o[e]=r,o)})},be=function(e,r,n){var i,o=new Z;return o.set(e,r),t(t({},n),{event_type:k.IDENTIFY,user_properties:o.getUserProperties(),groups:(i={},i[e]=r,i)})},we=function(e,r){return t(t({},r),{event_type:k.REVENUE,event_properties:e.getEventProperties()})}}}),He=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/utils/return-wrapper.js"(){Se=function(e){return{promise:e||Promise.resolve()}}}}),Ke=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/core-client.js"(){Ne(),Le(),Fe(),je(),Ve(),$e(),qe(),He(),ke=function(){function e(e){void 0===e&&(e="$default"),this.initializing=!1,this.isReady=!1,this.q=[],this.dispatchQ=[],this.logEvent=this.track.bind(this),this.timeline=new ge(this),this.name=e}return e.prototype._init=function(e){return v(this,void 0,void 0,function(){return m(this,function(t){switch(t.label){case 0:return this.config=e,this.timeline.reset(this),this.timeline.loggerProvider=this.config.loggerProvider,[4,this.runQueuedFunctions("q")];case 1:return t.sent(),this.isReady=!0,[2]}})})},e.prototype.runQueuedFunctions=function(e){return v(this,void 0,void 0,function(){var t,r,n,i,o,s,a,l;return m(this,function(u){switch(u.label){case 0:t=this[e],this[e]=[],u.label=1;case 1:u.trys.push([1,8,9,10]),r=y(t),n=r.next(),u.label=2;case 2:return n.done?[3,7]:(i=n.value,(o=i())&&"promise"in o?[4,o.promise]:[3,4]);case 3:return u.sent(),[3,6];case 4:return[4,o];case 5:u.sent(),u.label=6;case 6:return n=r.next(),[3,2];case 7:return[3,10];case 8:return s=u.sent(),a={error:s},[3,10];case 9:try{n&&!n.done&&(l=r.return)&&l.call(r)}finally{if(a)throw a.error}return[7];case 10:return this[e].length?[4,this.runQueuedFunctions(e)]:[3,12];case 11:u.sent(),u.label=12;case 12:return[2]}})})},e.prototype.track=function(e,t,r){var n=ve(e,t,r);return this.userProperties=this.getOperationAppliedUserProperties(n.user_properties),Se(this.dispatch(n))},e.prototype.identify=function(e,t){var r=me(e,t);return this.userProperties=this.getOperationAppliedUserProperties(r.user_properties),Se(this.dispatch(r))},e.prototype.groupIdentify=function(e,t,r,n){var i=ye(e,t,r,n);return Se(this.dispatch(i))},e.prototype.setGroup=function(e,t,r){var n=be(e,t,r);return this.userProperties=this.getOperationAppliedUserProperties(n.user_properties),Se(this.dispatch(n))},e.prototype.revenue=function(e,t){var r=we(e,t);return Se(this.dispatch(r))},e.prototype.add=function(e){return this.isReady?this._addPlugin(e):(this.q.push(this._addPlugin.bind(this,e)),Se())},e.prototype._addPlugin=function(e){return Se(this.timeline.register(e,this.config))},e.prototype.remove=function(e){return this.isReady?this._removePlugin(e):(this.q.push(this._removePlugin.bind(this,e)),Se())},e.prototype._removePlugin=function(e){return Se(this.timeline.deregister(e,this.config))},e.prototype.dispatchWithCallback=function(e,t){if(!this.isReady)return t(ce(e,0,le));this.process(e).then(t)},e.prototype.dispatch=function(e){return v(this,void 0,void 0,function(){var t=this;return m(this,function(r){return this.isReady?[2,this.process(e)]:[2,new Promise(function(r){t.dispatchQ.push(t.dispatchWithCallback.bind(t,e,r))})]})})},e.prototype.getOperationAppliedUserProperties=function(e){var r,n=null!==(r=this.userProperties)&&void 0!==r?r:{},i=t({},n);if(void 0===e)return i;var o={};return Object.keys(e).forEach(function(t){Object.values(S).includes(t)||(o[t]=e[t])}),te.forEach(function(t){if(Object.keys(e).includes(t)){var r=e[t];switch(t){case S.CLEAR_ALL:Object.keys(i).forEach(function(e){delete i[e]});break;case S.UNSET:Object.keys(r).forEach(function(e){delete i[e]});break;case S.SET:Object.assign(i,r)}}}),Object.assign(i,o),i},e.prototype.process=function(e){return v(this,void 0,void 0,function(){var t,r,n;return m(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),this.config.optOut?[2,ce(e,0,oe)]:(e.event_type===k.IDENTIFY&&this.timeline.onIdentityChanged({userProperties:this.userProperties}),[4,this.timeline.push(e)]);case 1:return 200===(n=i.sent()).code?this.config.loggerProvider.log(n.message):100===n.code?this.config.loggerProvider.warn(n.message):this.config.loggerProvider.error(n.message),[2,n];case 2:return t=i.sent(),r=String(t),this.config.loggerProvider.error(r),[2,n=ce(e,0,r)];case 3:return[2]}})})},e.prototype.setOptOut=function(e){this.isReady?this._setOptOut(e):this.q.push(this._setOptOut.bind(this,Boolean(e)))},e.prototype._setOptOut=function(e){this.config.optOut!==e&&(this.config.optOut=Boolean(e),this.timeline.onOptOutChanged(e))},e.prototype.flush=function(){return Se(this.timeline.flush())},e.prototype.plugin=function(e){var t=this.timeline.plugins.find(function(t){return t.name===e});if(void 0!==t)return t;this.config.loggerProvider.debug("Cannot find plugin with name ".concat(e))},e.prototype.plugins=function(e){return this.timeline.plugins.filter(function(t){return t instanceof e})},e}()}}),Ge=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/revenue.js"(){var e;Ne(),Ue(),xe=function(){function e(){this.productId="",this.quantity=1,this.price=0}return e.prototype.setProductId=function(e){return this.productId=e,this},e.prototype.setQuantity=function(e){return e>0&&(this.quantity=e),this},e.prototype.setPrice=function(e){return this.price=e,this},e.prototype.setRevenueType=function(e){return this.revenueType=e,this},e.prototype.setCurrency=function(e){return this.currency=e,this},e.prototype.setRevenue=function(e){return this.revenue=e,this},e.prototype.setReceipt=function(e){return this.receipt=e,this},e.prototype.setReceiptSig=function(e){return this.receiptSig=e,this},e.prototype.setEventProperties=function(e){try{var t=JSON.parse(JSON.stringify(e));X(t)&&(this.properties=t)}catch(e){}return this},e.prototype.getEventProperties=function(){var e=this.properties?t({},this.properties):{};return e[Ee.REVENUE_PRODUCT_ID]=this.productId,e[Ee.REVENUE_QUANTITY]=this.quantity,e[Ee.REVENUE_PRICE]=this.price,e[Ee.REVENUE_TYPE]=this.revenueType,e[Ee.REVENUE_CURRENCY]=this.currency,e[Ee.REVENUE]=this.revenue,e[Ee.RECEIPT]=this.receipt,e[Ee.RECEIPT_SIG]=this.receiptSig,e},e}(),(e=Ee||(Ee={})).REVENUE_PRODUCT_ID="$productId",e.REVENUE_QUANTITY="$quantity",e.REVENUE_PRICE="$price",e.REVENUE_TYPE="$revenueType",e.REVENUE_CURRENCY="$currency",e.REVENUE="$revenue",e.RECEIPT="$receipt",e.RECEIPT_SIG="$receiptSig"}}),Je=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/utils/chunk.js"(){Ce=function(e,t){var r=Math.max(t,1);return e.reduce(function(e,t,n){var i=Math.floor(n/r);return e[i]||(e[i]=[]),e[i].push(t),e},[])}}}),Qe=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/types/loglevel.js"(){var e;(e=Ie||(Ie={}))[e.None=0]="None",e[e.Error=1]="Error",e[e.Warn=2]="Warn",e[e.Verbose=3]="Verbose",e[e.Debug=4]="Debug"}}),Xe=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/logger.js"(){Qe(),Oe="Amplitude Logger ",Te=function(){function e(){this.logLevel=Ie.None}return e.prototype.disable=function(){this.logLevel=Ie.None},e.prototype.enable=function(e){void 0===e&&(e=Ie.Warn),this.logLevel=e},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<Ie.Verbose||console.log("".concat(Oe,"[Log]: ").concat(e.join(" ")))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<Ie.Warn||console.warn("".concat(Oe,"[Warn]: ").concat(e.join(" ")))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<Ie.Error||console.error("".concat(Oe,"[Error]: ").concat(e.join(" ")))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<Ie.Debug||console.log("".concat(Oe,"[Debug]: ").concat(e.join(" ")))},e}()}}),Ye=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/config.js"(){De(),Xe(),Qe(),Ae=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,instanceName:I,logLevel:Ie.Warn,loggerProvider:new Te,offline:!1,optOut:!1,serverUrl:O,serverZone:"US",useBatch:!1}},Re=function(){function e(e){var t,r,n,i;this._optOut=!1;var o=Ae();this.apiKey=e.apiKey,this.flushIntervalMillis=null!==(t=e.flushIntervalMillis)&&void 0!==t?t:o.flushIntervalMillis,this.flushMaxRetries=e.flushMaxRetries||o.flushMaxRetries,this.flushQueueSize=e.flushQueueSize||o.flushQueueSize,this.instanceName=e.instanceName||o.instanceName,this.loggerProvider=e.loggerProvider||o.loggerProvider,this.logLevel=null!==(r=e.logLevel)&&void 0!==r?r:o.logLevel,this.minIdLength=e.minIdLength,this.plan=e.plan,this.ingestionMetadata=e.ingestionMetadata,this.offline=void 0!==e.offline?e.offline:o.offline,this.optOut=null!==(n=e.optOut)&&void 0!==n?n:o.optOut,this.serverUrl=e.serverUrl,this.serverZone=e.serverZone||o.serverZone,this.storageProvider=e.storageProvider,this.transportProvider=e.transportProvider,this.useBatch=null!==(i=e.useBatch)&&void 0!==i?i:o.useBatch,this.loggerProvider.enable(this.logLevel);var s=_e(e.serverUrl,e.serverZone,e.useBatch);this.serverZone=s.serverZone,this.serverUrl=s.serverUrl}return Object.defineProperty(e.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut=e},enumerable:!1,configurable:!0}),e}(),Pe=function(e,t){return"EU"===e?t?R:T:t?A:O},_e=function(e,t,r){if(void 0===e&&(e=""),void 0===t&&(t=Ae().serverZone),void 0===r&&(r=Ae().useBatch),e)return{serverUrl:e,serverZone:void 0};var n=["US","EU"].includes(t)?t:Ae().serverZone;return{serverZone:n,serverUrl:Pe(n,r)}},Me=function(){function e(){this.sdk={metrics:{histogram:{}}}}return e.prototype.recordHistogram=function(e,t){this.sdk.metrics.histogram[e]=t},e}()}});function Ze(e){return e>=200&&e<300}var et,tt,rt,nt,it,ot,st,at,lt=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/utils/status-code.js"(){}}),ut=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/utils/debug.js"(){Ne(),Qe(),et=function(e){return void 0===e&&(e=0),((new Error).stack||"").split("\n").slice(2+e).map(function(e){return e.trim()})},tt=function(e){return function(){var r=t({},e.config);return{logger:r.loggerProvider,logLevel:r.logLevel}}},rt=function(e,t){var r,n;t=(t=t.replace(/\[(\w+)\]/g,".$1")).replace(/^\./,"");try{for(var i=y(t.split(".")),o=i.next();!o.done;o=i.next()){var s=o.value;if(!(s in e))return;e=e[s]}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return e},nt=function(e,t){return function(){var r,n,i={};try{for(var o=y(t),s=o.next();!s.done;s=o.next()){var a=s.value;i[a]=rt(e,a)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return i}},it=function(e,t,r,n,i){return void 0===i&&(i=null),function(){for(var o=[],s=0;s<arguments.length;s++)o[s]=arguments[s];var a=r(),l=a.logger,u=a.logLevel;if(u&&u<Ie.Debug||!u||!l)return e.apply(i,o);var c={type:"invoke public method",name:t,args:o,stacktrace:et(1),time:{start:(new Date).toISOString()},states:{}};n&&c.states&&(c.states.before=n());var d=e.apply(i,o);return d&&d.promise?d.promise.then(function(){n&&c.states&&(c.states.after=n()),c.time&&(c.time.end=(new Date).toISOString()),l.debug(JSON.stringify(c,null,2))}):(n&&c.states&&(c.states.after=n()),c.time&&(c.time.end=(new Date).toISOString()),l.debug(JSON.stringify(c,null,2))),d}}}});function ct(e){var t="";try{"body"in e&&(t=JSON.stringify(e.body,null,2))}catch(e){}return t}var dt,ht,pt,ft,gt,vt,mt,yt,bt=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/plugins/destination.js"(){Ne(),Be(),je(),De(),Je(),qe(),Ye(),We(),lt(),ut(),ot=new Set([O,T,A,R]),st=function(e,t){return void 0===t&&(t=!1),!!ot.has(e)||t},at=function(){function e(e){this.name="amplitude",this.type="destination",this.retryTimeout=1e3,this.throttleTimeout=3e4,this.storageKey="",this.scheduleId=null,this.scheduledTimeout=0,this.flushId=null,this.queue=[],this.diagnosticsClient=null==e?void 0:e.diagnosticsClient}return e.prototype.setup=function(e){var t;return v(this,void 0,void 0,function(){var r,n=this;return m(this,function(i){switch(i.label){case 0:return this.config=e,this.storageKey="".concat(C,"_").concat(this.config.apiKey.substring(0,10)),[4,null===(t=this.config.storageProvider)||void 0===t?void 0:t.get(this.storageKey)];case 1:return(r=i.sent())&&r.length>0&&Promise.all(r.map(function(e){return n.execute(e)})).catch(),[2,Promise.resolve(void 0)]}})})},e.prototype.execute=function(e){var t=this;return e.insert_id||(e.insert_id=fe()),new Promise(function(r){var n={event:e,attempts:0,callback:function(e){return r(e)},timeout:0};t.queue.push(n),t.schedule(t.config.flushIntervalMillis),t.saveEvents()})},e.prototype.removeEventsExceedFlushMaxRetries=function(e){var t=this;return e.filter(function(e){return e.attempts+=1,e.attempts<t.config.flushMaxRetries||(t.fulfillRequest([e],500,ie),!1)})},e.prototype.scheduleEvents=function(e){var t=this;e.forEach(function(e){t.schedule(0===e.timeout?t.config.flushIntervalMillis:e.timeout)})},e.prototype.schedule=function(e){var t=this;if(!this.config.offline)return null===this.scheduleId||this.scheduleId&&e>this.scheduledTimeout?(this.scheduleId&&clearTimeout(this.scheduleId),this.scheduledTimeout=e,void(this.scheduleId=setTimeout(function(){t.queue=t.queue.map(function(e){return e.timeout=0,e}),t.flush(!0)},e))):void 0},e.prototype.resetSchedule=function(){this.scheduleId=null,this.scheduledTimeout=0},e.prototype.flush=function(e){return void 0===e&&(e=!1),v(this,void 0,void 0,function(){var t,r,n=this;return m(this,function(i){switch(i.label){case 0:return this.config.offline?(this.resetSchedule(),this.config.loggerProvider.debug("Skipping flush while offline."),[2]):this.flushId?(this.resetSchedule(),this.config.loggerProvider.debug("Skipping flush because previous flush has not resolved."),[2]):(this.flushId=this.scheduleId,this.resetSchedule(),t=[],r=[],this.queue.forEach(function(e){return 0===e.timeout?t.push(e):r.push(e)}),[4,Ce(t,this.config.flushQueueSize).reduce(function(t,r){return v(n,void 0,void 0,function(){return m(this,function(n){switch(n.label){case 0:return[4,t];case 1:return n.sent(),[4,this.send(r,e)];case 2:return[2,n.sent()]}})})},Promise.resolve())]);case 1:return i.sent(),this.flushId=null,this.scheduleEvents(this.queue),[2]}})})},e.prototype.send=function(e,t){var r;return void 0===t&&(t=!0),v(this,void 0,void 0,function(){var n,i,o,s,a,l;return m(this,function(u){switch(u.label){case 0:if(!this.config.apiKey)return[2,this.fulfillRequest(e,400,se)];n={api_key:this.config.apiKey,events:e.map(function(e){var t=e.event;t.extra;return g(t,["extra"])}),options:{min_id_length:this.config.minIdLength},client_upload_time:(new Date).toISOString(),request_metadata:this.config.requestMetadata},this.config.requestMetadata=new Me,u.label=1;case 1:return u.trys.push([1,3,,4]),i=_e(this.config.serverUrl,this.config.serverZone,this.config.useBatch).serverUrl,o=st(i,this.config.enableRequestBodyCompression),[4,this.config.transportProvider.send(i,n,o)];case 2:return null===(s=u.sent())?(this.fulfillRequest(e,0,ne),[2]):t?(this.handleResponse(s,e),[3,4]):("body"in s?this.fulfillRequest(e,s.statusCode,"".concat(s.status,": ").concat(ct(s))):this.fulfillRequest(e,s.statusCode,s.status),[2]);case 3:return a=u.sent(),l=(c=a)instanceof Error?c.message:String(c),this.config.loggerProvider.error(l),null===(r=this.diagnosticsClient)||void 0===r||r.recordEvent("analytics.events.unsuccessful.from.catch.error",{events:e.map(function(e){return e.event.event_type}),message:l,stack_trace:et()}),this.handleResponse({status:ue.Failed,statusCode:0},e),[3,4];case 4:return[2]}var c})})},e.prototype.handleResponse=function(e,t){var r;Ze(e.statusCode)||null===(r=this.diagnosticsClient)||void 0===r||r.recordEvent("analytics.events.unsuccessful",{events:t.map(function(e){return e.event.event_type}),code:e.statusCode,status:e.status,body:ct(e),stack_trace:et()});var n=e.status;switch(n){case ue.Success:this.handleSuccessResponse(e,t);break;case ue.Invalid:this.handleInvalidResponse(e,t);break;case ue.PayloadTooLarge:this.handlePayloadTooLargeResponse(e,t);break;case ue.RateLimit:this.handleRateLimitResponse(e,t);break;default:this.config.loggerProvider.warn("{code: 0, error: \"Status '".concat(n,"' provided for ").concat(t.length,' events"}')),this.handleOtherResponse(t)}},e.prototype.handleSuccessResponse=function(e,t){this.fulfillRequest(t,e.statusCode,re)},e.prototype.handleInvalidResponse=function(e,t){var r=this;if(e.body.missingField||e.body.error.startsWith(ae))this.fulfillRequest(t,e.statusCode,e.body.error);else{var n=w(w(w(w([],b(Object.values(e.body.eventsWithInvalidFields)),!1),b(Object.values(e.body.eventsWithMissingFields)),!1),b(Object.values(e.body.eventsWithInvalidIdLengths)),!1),b(e.body.silencedEvents),!1).flat(),i=new Set(n),o=t.filter(function(t,n){if(!i.has(n))return!0;r.fulfillRequest([t],e.statusCode,e.body.error)});o.length>0&&this.config.loggerProvider.warn(ct(e));var s=this.removeEventsExceedFlushMaxRetries(o);this.scheduleEvents(s)}},e.prototype.handlePayloadTooLargeResponse=function(e,t){if(1!==t.length){this.config.loggerProvider.warn(ct(e)),this.config.flushQueueSize/=2;var r=this.removeEventsExceedFlushMaxRetries(t);this.scheduleEvents(r)}else this.fulfillRequest(t,e.statusCode,e.body.error)},e.prototype.handleRateLimitResponse=function(e,t){var r=this,n=Object.keys(e.body.exceededDailyQuotaUsers),i=Object.keys(e.body.exceededDailyQuotaDevices),o=e.body.throttledEvents,s=new Set(n),a=new Set(i),l=new Set(o),u=t.filter(function(t,n){if(!(t.event.user_id&&s.has(t.event.user_id)||t.event.device_id&&a.has(t.event.device_id)))return l.has(n)&&(t.timeout=r.throttleTimeout),!0;r.fulfillRequest([t],e.statusCode,e.body.error)});u.length>0&&this.config.loggerProvider.warn(ct(e));var c=this.removeEventsExceedFlushMaxRetries(u);this.scheduleEvents(c)},e.prototype.handleOtherResponse=function(e){var t=this,r=e.map(function(e){return e.timeout=e.attempts*t.retryTimeout,e}),n=this.removeEventsExceedFlushMaxRetries(r);this.scheduleEvents(n)},e.prototype.fulfillRequest=function(e,t,r){var n,i,o;Ze(t)?null===(o=this.diagnosticsClient)||void 0===o||o.increment("analytics.events.sent",e.length):(null===(n=this.diagnosticsClient)||void 0===n||n.increment("analytics.events.dropped",e.length),null===(i=this.diagnosticsClient)||void 0===i||i.recordEvent("analytics.events.dropped",{events:e.map(function(e){return e.event.event_type}),code:t,message:r,stack_trace:et()})),this.removeEvents(e),e.forEach(function(e){return e.callback(ce(e.event,t,r))})},e.prototype.saveEvents=function(){if(this.config.storageProvider){var e=this.queue.map(function(e){return e.event});this.config.storageProvider.set(this.storageKey,e)}},e.prototype.removeEvents=function(e){this.queue=this.queue.filter(function(t){return!e.some(function(e){return e.event.insert_id===t.event.insert_id})}),this.saveEvents()},e}()}});function wt(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function St(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}var kt,xt,Et,Ct,It,Ot,Tt,At,Rt,Pt,_t,Mt,Nt,Lt,Dt,Ut,Ft,jt,Bt,qt,zt,Wt,Vt,$t,Ht,Kt,Gt,Jt,Qt,Xt,Yt,Zt,er,tr,rr,nr,ir,or,sr=l({"../../../../node_modules/@amplitude/analytics-connector/dist/analytics-connector.esm.js"(){dt=function(){function e(){}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:ht(),platform:"Web",os:void 0,deviceModel:void 0}},e}(),ht=function(){return"undefined"!=typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},pt=function(){function e(){this.queue=[]}return e.prototype.logEvent=function(e){this.receiver?this.receiver(e):this.queue.length<512&&this.queue.push(e)},e.prototype.setEventReceiver=function(e){this.receiver=e,this.queue.length>0&&(this.queue.forEach(function(t){e(t)}),this.queue=[])},e}(),ft=function(){return ft=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},ft.apply(this,arguments)},gt=function(e,t){var r,n,i=typeof e;if(i!==typeof t)return!1;try{for(var o=wt(["string","number","boolean","undefined"]),s=o.next();!s.done;s=o.next()){if(s.value===i)return e===t}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}if(null==e&&null==t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;var a=Array.isArray(e),l=Array.isArray(t);if(a!==l)return!1;if(!a||!l){var u=Object.keys(e).sort(),c=Object.keys(t).sort();if(!gt(u,c))return!1;var d=!0;return Object.keys(e).forEach(function(r){gt(e[r],t[r])||(d=!1)}),d}for(var h=0;h<e.length;h++)if(!gt(e[h],t[h]))return!1;return!0},Object.entries||(Object.entries=function(e){for(var t=Object.keys(e),r=t.length,n=new Array(r);r--;)n[r]=[t[r],e[t[r]]];return n}),vt=function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var e=this,t=ft({},this.identity.userProperties),r=ft(ft({},this.identity),{userProperties:t});return{setUserId:function(e){return r.userId=e,this},setDeviceId:function(e){return r.deviceId=e,this},setUserProperties:function(e){return r.userProperties=e,this},setOptOut:function(e){return r.optOut=e,this},updateUserProperties:function(e){var t,n,i,o,s,a,l=r.userProperties||{};try{for(var u=wt(Object.entries(e)),c=u.next();!c.done;c=u.next()){var d=St(c.value,2),h=d[0],p=d[1];switch(h){case"$set":try{for(var f=(i=void 0,wt(Object.entries(p))),g=f.next();!g.done;g=f.next()){var v=St(g.value,2),m=v[0],y=v[1];l[m]=y}}catch(e){i={error:e}}finally{try{g&&!g.done&&(o=f.return)&&o.call(f)}finally{if(i)throw i.error}}break;case"$unset":try{for(var b=(s=void 0,wt(Object.keys(p))),w=b.next();!w.done;w=b.next()){delete l[m=w.value]}}catch(e){s={error:e}}finally{try{w&&!w.done&&(a=b.return)&&a.call(b)}finally{if(s)throw s.error}}break;case"$clearAll":l={}}}}catch(e){t={error:e}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(t)throw t.error}}return r.userProperties=l,this},commit:function(){return e.setIdentity(r),this}}},e.prototype.getIdentity=function(){return ft({},this.identity)},e.prototype.setIdentity=function(e){var t=ft({},this.identity);this.identity=ft({},e),gt(t,this.identity)||this.listeners.forEach(function(t){t(e)})},e.prototype.addIdentityListener=function(e){this.listeners.add(e)},e.prototype.removeIdentityListener=function(e){this.listeners.delete(e)},e}(),mt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:self,yt=function(){function e(){this.identityStore=new vt,this.eventBridge=new pt,this.applicationContextProvider=new dt}return e.getInstance=function(t){return mt.analyticsConnectorInstances||(mt.analyticsConnectorInstances={}),mt.analyticsConnectorInstances[t]||(mt.analyticsConnectorInstances[t]=new e),mt.analyticsConnectorInstances[t]},e}()}}),ar=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/analytics-connector.js"(){sr(),De(),kt=function(e){return void 0===e&&(e=I),yt.getInstance(e)},xt=function(e,t){kt(t).identityStore.editIdentity().setUserId(e).commit()},Et=function(e,t){kt(t).identityStore.editIdentity().setDeviceId(e).commit()}}}),lr=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/plugins/identity.js"(){Ne(),ar(),Ct=function(){function e(){this.name="identity",this.type="before",this.identityStore=kt().identityStore}return e.prototype.execute=function(e){return v(this,void 0,void 0,function(){var t;return m(this,function(r){return(t=e.user_properties)&&this.identityStore.editIdentity().updateUserProperties(t).commit(),[2,e]})})},e.prototype.setup=function(e){return v(this,void 0,void 0,function(){return m(this,function(t){return e.instanceName&&(this.identityStore=kt(e.instanceName).identityStore),[2]})})},e}()}}),ur=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/session.js"(){It=function(e,t){return void 0===t&&(t=Date.now()),Date.now()-t>e}}}),cr=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/cookie-name.js"(){De(),Ot=function(e,t,r){return void 0===t&&(t=""),void 0===r&&(r=10),[E,t,e.substring(0,r)].filter(Boolean).join("_")},Tt=function(e){return"".concat(E.toLowerCase(),"_").concat(e.substring(0,6))}}}),dr=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/language.js"(){At=function(){var e,t,r,n;if("undefined"==typeof navigator)return"";var i=navigator.userLanguage;return null!==(n=null!==(r=null!==(t=null===(e=navigator.languages)||void 0===e?void 0:e[0])&&void 0!==t?t:navigator.language)&&void 0!==r?r:i)&&void 0!==n?n:""}}}),hr=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/query-params.js"(){ze(),Rt=function(){var e,t=de();return(null===(e=null==t?void 0:t.location)||void 0===e?void 0:e.search)?t.location.search.substring(1).split("&").filter(Boolean).reduce(function(e,t){var r=t.split("=",2),n=Pt(r[0]),i=Pt(r[1]);return i?(e[n]=i,e):e},{}):{}},Pt=function(e){void 0===e&&(e="");try{return decodeURIComponent(e)}catch(e){return""}}}}),pr=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/utils/url-utils.js"(){_t=function(e,t){return!t||!t.length||t.some(function(t){return"string"==typeof t?e===t:e.match(t)})},Mt=function(e,t){var r=e;try{r=decodeURI(e)}catch(e){null==t||t.error("Malformed URI sequence: ",e)}return r}}}),fr=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/utils/sampling.js"(){Nt=function(e){var t=0;if(0===e.length)return t;for(var r=0;r<e.length;r++){t=(t<<5)-t+e.charCodeAt(r),t|=0}return t},Lt=function(e,t){var r=Nt(e.toString());return 31*Math.abs(r)%1e5/1e5<t}}}),gr=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/utils/omit-undefined.js"(){Dt=function(e){var t={};for(var r in e){var n=e[r];n&&(t[r]=n)}return t}}}),vr=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/storage/memory.js"(){Ne(),Ut=function(){function e(){this.memoryStorage=new Map}return e.prototype.isEnabled=function(){return v(this,void 0,void 0,function(){return m(this,function(e){return[2,!0]})})},e.prototype.get=function(e){return v(this,void 0,void 0,function(){return m(this,function(t){return[2,this.memoryStorage.get(e)]})})},e.prototype.getRaw=function(e){return v(this,void 0,void 0,function(){var t;return m(this,function(r){switch(r.label){case 0:return[4,this.get(e)];case 1:return[2,(t=r.sent())?JSON.stringify(t):void 0]}})})},e.prototype.set=function(e,t){return v(this,void 0,void 0,function(){return m(this,function(r){return this.memoryStorage.set(e,t),[2]})})},e.prototype.remove=function(e){return v(this,void 0,void 0,function(){return m(this,function(t){return this.memoryStorage.delete(e),[2]})})},e.prototype.reset=function(){return v(this,void 0,void 0,function(){return m(this,function(e){return this.memoryStorage.clear(),[2]})})},e}()}}),mr=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/storage/cookie.js"(){Ne(),ze(),Ft=function(){var e,t=de();return null===(e=null==t?void 0:t.navigator)||void 0===e?void 0:e.locks},jt=function(){function e(e,r){void 0===r&&(r={}),this.options=t({},e),this.config=r}return e.prototype.isEnabled=function(){return v(this,void 0,void 0,function(){var r,n,i,o,s=this;return m(this,function(a){switch(a.label){case 0:return r="AMP_TEST",n=t({},this.options),i=new e(n),o=String(Date.now()),[4,i.transaction(r,function(e){var t,n;try{e.set(o);var i=e.get()===o;return!i&&s.config.diagnosticsClient&&(null===(t=s.config.diagnosticsClient)||void 0===t||t.recordEvent("cookies.isEnabled.failure",{reason:"Test Value mismatch",testKey:r,testValue:o,sync:!0})),i}catch(e){if(s.config.diagnosticsClient){var a=e instanceof Error?e.message:String(e);null===(n=s.config.diagnosticsClient)||void 0===n||n.recordEvent("cookies.isEnabled.failure",{reason:"Cookie getter/setter failed",testKey:r,testValue:o,error:a,sync:!0})}return!1}finally{e.set(null)}})];case 1:return[2,a.sent()]}})})},e.prototype.get=function(e){return v(this,void 0,void 0,function(){var t;return m(this,function(r){switch(r.label){case 0:return[4,this.getRaw(e)];case 1:return t=r.sent(),[2,this.decodeCookieValue(e,t)]}})})},e.prototype.decodeCookieValue=function(e,t){if(t)try{var r=zt(t);return void 0===r?void console.error("Amplitude Logger [Error]: Failed to decode cookie value for key: ".concat(e,", value: ").concat(t)):JSON.parse(r)}catch(r){return void console.error("Amplitude Logger [Error]: Failed to parse cookie value for key: ".concat(e,", value: ").concat(t))}},e.prototype.getSync=function(e){var t=this.getRawSync(e);return this.decodeCookieValue(e,t)},e.prototype.getRaw=function(e){var t,r;return v(this,void 0,void 0,function(){var n,i,o,s,a,l,u,c,d;return m(this,function(h){switch(h.label){case 0:n=de(),i=n,h.label=1;case 1:return h.trys.push([1,4,,5]),(o=null==i?void 0:i.cookieStore)?[4,o.getAll(e)]:[3,3];case 2:if(s=h.sent()){s.length>1&&(null===(t=this.config.diagnosticsClient)||void 0===t||t.recordEvent("cookies.duplicate",{cookies:s.map(function(e){return e.domain})}),null===(r=this.config.diagnosticsClient)||void 0===r||r.increment("cookies.duplicate.occurrence.cookieStore"));try{for(a=y(s),l=a.next();!l.done;l=a.next())if(u=l.value,Wt(u.domain,this.options.domain))return[2,u.value]}catch(e){c={error:e}}finally{try{l&&!l.done&&(d=a.return)&&d.call(a)}finally{if(c)throw c.error}}}h.label=3;case 3:return[3,5];case 4:return h.sent(),[3,5];case 5:return[2,this.getRawSync(e)]}})})},e.prototype.getRawSync=function(e){var t,r,n=this,i=de(),o=(null!==(r=null===(t=null==i?void 0:i.document)||void 0===t?void 0:t.cookie.split("; "))&&void 0!==r?r:[]).filter(function(t){return 0===t.indexOf(e+"=")}),s=void 0,a=this.config.duplicateResolverFn;if("function"==typeof a&&o.length>1&&(s=o.find(function(t){var r;try{var i=a(t.substring(e.length+1));return i||null===(r=n.config.diagnosticsClient)||void 0===r||r.increment("cookies.duplicate.occurrence.document.cookie"),i}catch(e){return!1}})),s||(s=o[0]),s)return s.substring(e.length+1)},e.prototype.set=function(e,t){return v(this,void 0,void 0,function(){return m(this,function(r){return this.setSync(e,t),[2]})})},e.prototype.setSync=function(e,t){var r;try{var n=null!==(r=this.options.expirationDays)&&void 0!==r?r:0,i=null!==t?n:-1,o=void 0;if(i){var s=new Date;s.setTime(s.getTime()+24*i*60*60*1e3),o=s}var a="".concat(e,"=").concat(btoa(encodeURIComponent(JSON.stringify(t))));o&&(a+="; expires=".concat(o.toUTCString())),a+="; path=/",this.options.domain&&(a+="; domain=".concat(this.options.domain)),this.options.secure&&(a+="; Secure"),this.options.sameSite&&(a+="; SameSite=".concat(this.options.sameSite));var l=de();(null==l?void 0:l.document)&&(l.document.cookie=a)}catch(t){var u=t instanceof Error?t.message:String(t);console.error("Amplitude Logger [Error]: Failed to set cookie for key: ".concat(e,". Error: ").concat(u))}},e.prototype.remove=function(e){return v(this,void 0,void 0,function(){return m(this,function(t){switch(t.label){case 0:return[4,this.set(e,null)];case 1:return t.sent(),[2]}})})},e.prototype.reset=function(){return v(this,void 0,void 0,function(){return m(this,function(e){return[2]})})},e.isDomainWritable=function(t){return v(this,void 0,void 0,function(){var r,n;return m(this,function(i){switch(i.label){case 0:if(e.cachedTlds[t])return[2,!0];r="AMP_TLDTEST",n=new e({domain:"."+t}),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,n.transaction(r,function(r){if(e.cachedTlds[t])return!0;try{r.set(1);var n=!!r.get();return n&&(e.cachedTlds[t]=!0),n}finally{r.set(null)}})];case 2:return[2,!!i.sent()];case 3:return i.sent(),[2,!1];case 4:return[2]}})})},e.prototype.transaction=function(e,t){return v(this,void 0,void 0,function(){var r,n,i=this;return m(this,function(o){switch(o.label){case 0:if(r=Ft(),n=function(){return t({get:function(){return i.getSync(e)},set:function(t){return i.setSync(e,t)}})},!r)return[2,n()];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,r.request("com.amplitude:cookie-lock:".concat(e),n)];case 2:return[2,o.sent()];case 3:return o.sent(),[2,n()];case 4:return[2]}})})},e.cachedTlds={},e}(),Bt=function(e){try{return decodeURIComponent(atob(e))}catch(e){return}},qt=function(e){try{return decodeURIComponent(atob(decodeURIComponent(e)))}catch(e){return}},zt=function(e){var t;return null!==(t=Bt(e))&&void 0!==t?t:qt(e)},Wt=function(e,t){if(""===e&&""===t)return!0;if(!e||!t)return!1;var r=e.startsWith(".")?e.substring(1):e,n=t.startsWith(".")?t.substring(1):t;return r.toLowerCase()===n.toLowerCase()}}}),yr=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/storage/helpers.js"(){De(),Vt=function(e,t,r){return void 0===t&&(t=""),void 0===r&&(r=10),[E,t,e.substring(0,r)].filter(Boolean).join("_")}}}),br=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/storage/browser-storage.js"(){Ne(),$t=function(){function e(e){this.storage=e}return e.prototype.isEnabled=function(){return v(this,void 0,void 0,function(){var t,r,n;return m(this,function(i){switch(i.label){case 0:if(!this.storage)return[2,!1];t=String(Date.now()),r=new e(this.storage),n="AMP_TEST",i.label=1;case 1:return i.trys.push([1,4,5,7]),[4,r.set(n,t)];case 2:return i.sent(),[4,r.get(n)];case 3:return[2,i.sent()===t];case 4:return i.sent(),[2,!1];case 5:return[4,r.remove(n)];case 6:return i.sent(),[7];case 7:return[2]}})})},e.prototype.get=function(e){return v(this,void 0,void 0,function(){var t;return m(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.getRaw(e)];case 1:return(t=r.sent())?[2,JSON.parse(t)]:[2,void 0];case 2:return r.sent(),console.error("[Amplitude] Error: Could not get value from storage"),[2,void 0];case 3:return[2]}})})},e.prototype.getRaw=function(e){var t;return v(this,void 0,void 0,function(){return m(this,function(r){return[2,(null===(t=this.storage)||void 0===t?void 0:t.getItem(e))||void 0]})})},e.prototype.set=function(e,t){var r;return v(this,void 0,void 0,function(){return m(this,function(n){try{null===(r=this.storage)||void 0===r||r.setItem(e,JSON.stringify(t))}catch(e){}return[2]})})},e.prototype.remove=function(e){var t;return v(this,void 0,void 0,function(){return m(this,function(r){try{null===(t=this.storage)||void 0===t||t.removeItem(e)}catch(e){}return[2]})})},e.prototype.reset=function(){var e;return v(this,void 0,void 0,function(){return m(this,function(t){try{null===(e=this.storage)||void 0===e||e.clear()}catch(e){}return[2]})})},e}()}}),wr=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/diagnostics/diagnostics-storage.js"(){Ne(),ze(),Ht={TAGS:"tags",COUNTERS:"counters",HISTOGRAMS:"histograms",EVENTS:"events",INTERNAL:"internal"},Kt={LAST_FLUSH_TIMESTAMP:"last_flush_timestamp"},Gt=function(){function e(e,t){this.dbPromise=null,this.logger=t,this.dbName="AMP_diagnostics_".concat(e.substring(0,10))}return e.isSupported=function(){var e;return void 0!==(null===(e=de())||void 0===e?void 0:e.indexedDB)},e.prototype.getDB=function(){return v(this,void 0,void 0,function(){return m(this,function(e){return this.dbPromise||(this.dbPromise=this.openDB()),[2,this.dbPromise]})})},e.prototype.openDB=function(){var e=this;return new Promise(function(t,r){var n=indexedDB.open(e.dbName,1);n.onerror=function(){e.dbPromise=null,r(new Error("Failed to open IndexedDB"))},n.onsuccess=function(){var r=n.result;r.onclose=function(){e.dbPromise=null,e.logger.debug("DiagnosticsStorage: DB connection closed.")},r.onerror=function(t){e.logger.debug("DiagnosticsStorage: A global database error occurred.",t),r.close()},t(r)},n.onupgradeneeded=function(t){var r=t.target.result;e.createTables(r)}})},e.prototype.createTables=function(e){(e.objectStoreNames.contains(Ht.TAGS)||e.createObjectStore(Ht.TAGS,{keyPath:"key"}),e.objectStoreNames.contains(Ht.COUNTERS)||e.createObjectStore(Ht.COUNTERS,{keyPath:"key"}),e.objectStoreNames.contains(Ht.HISTOGRAMS)||e.createObjectStore(Ht.HISTOGRAMS,{keyPath:"key"}),e.objectStoreNames.contains(Ht.EVENTS))||e.createObjectStore(Ht.EVENTS,{keyPath:"id",autoIncrement:!0}).createIndex("time_idx","time",{unique:!1});e.objectStoreNames.contains(Ht.INTERNAL)||e.createObjectStore(Ht.INTERNAL,{keyPath:"key"})},e.prototype.setTags=function(e){return v(this,void 0,void 0,function(){var t,r,n,i,o=this;return m(this,function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),0===Object.entries(e).length?[2]:[4,this.getDB()];case 1:return t=s.sent(),r=t.transaction([Ht.TAGS],"readwrite"),n=r.objectStore(Ht.TAGS),[2,new Promise(function(t){var i=Object.entries(e);r.oncomplete=function(){t()},r.onabort=function(e){o.logger.debug("DiagnosticsStorage: Failed to set tags",e),t()},i.forEach(function(e){var t=b(e,2),r=t[0],i=t[1];n.put({key:r,value:i}).onerror=function(e){o.logger.debug("DiagnosticsStorage: Failed to set tag",r,i,e)}})})];case 2:return i=s.sent(),this.logger.debug("DiagnosticsStorage: Failed to set tags",i),[3,3];case 3:return[2]}})})},e.prototype.incrementCounters=function(e){return v(this,void 0,void 0,function(){var t,r,n,i,o=this;return m(this,function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),0===Object.entries(e).length?[2]:[4,this.getDB()];case 1:return t=s.sent(),r=t.transaction([Ht.COUNTERS],"readwrite"),n=r.objectStore(Ht.COUNTERS),[2,new Promise(function(t){var i=Object.entries(e);r.oncomplete=function(){t()},r.onabort=function(e){o.logger.debug("DiagnosticsStorage: Failed to increment counters",e),t()},i.forEach(function(e){var t=b(e,2),r=t[0],i=t[1],s=n.get(r);s.onsuccess=function(){var e=s.result,t=e?e.value:0;n.put({key:r,value:t+i}).onerror=function(e){o.logger.debug("DiagnosticsStorage: Failed to update counter",r,e)}},s.onerror=function(e){o.logger.debug("DiagnosticsStorage: Failed to read existing counter",r,e)}})})];case 2:return i=s.sent(),this.logger.debug("DiagnosticsStorage: Failed to increment counters",i),[3,3];case 3:return[2]}})})},e.prototype.setHistogramStats=function(e){return v(this,void 0,void 0,function(){var t,r,n,i,o=this;return m(this,function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),0===Object.entries(e).length?[2]:[4,this.getDB()];case 1:return t=s.sent(),r=t.transaction([Ht.HISTOGRAMS],"readwrite"),n=r.objectStore(Ht.HISTOGRAMS),[2,new Promise(function(t){var i=Object.entries(e);r.oncomplete=function(){t()},r.onabort=function(e){o.logger.debug("DiagnosticsStorage: Failed to set histogram stats",e),t()},i.forEach(function(e){var t=b(e,2),r=t[0],i=t[1],s=n.get(r);s.onsuccess=function(){var e,t=s.result;e=t?{key:r,count:t.count+i.count,min:Math.min(t.min,i.min),max:Math.max(t.max,i.max),sum:t.sum+i.sum}:{key:r,count:i.count,min:i.min,max:i.max,sum:i.sum},n.put(e).onerror=function(e){o.logger.debug("DiagnosticsStorage: Failed to set histogram stats",r,e)}},s.onerror=function(e){o.logger.debug("DiagnosticsStorage: Failed to read existing histogram stats",r,e)}})})];case 2:return i=s.sent(),this.logger.debug("DiagnosticsStorage: Failed to set histogram stats",i),[3,3];case 3:return[2]}})})},e.prototype.addEventRecords=function(e){return v(this,void 0,void 0,function(){var t,r,n,i,o=this;return m(this,function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),0===e.length?[2]:[4,this.getDB()];case 1:return t=s.sent(),r=t.transaction([Ht.EVENTS],"readwrite"),n=r.objectStore(Ht.EVENTS),[2,new Promise(function(t){r.oncomplete=function(){t()},r.onabort=function(e){o.logger.debug("DiagnosticsStorage: Failed to add event records",e),t()};var i=n.count();i.onsuccess=function(){var t=i.result,r=Math.max(0,10-t);r<e.length&&o.logger.debug("DiagnosticsStorage: Only added ".concat(r," of ").concat(e.length," events due to storage limit")),e.slice(0,r).forEach(function(e){n.add(e).onerror=function(e){o.logger.debug("DiagnosticsStorage: Failed to add event record",e)}})},i.onerror=function(e){o.logger.debug("DiagnosticsStorage: Failed to count existing events",e)}})];case 2:return i=s.sent(),this.logger.debug("DiagnosticsStorage: Failed to add event records",i),[3,3];case 3:return[2]}})})},e.prototype.setInternal=function(e,t){return v(this,void 0,void 0,function(){var r,n,i,o;return m(this,function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),[4,this.getDB()];case 1:return r=s.sent(),n=r.transaction([Ht.INTERNAL],"readwrite"),i=n.objectStore(Ht.INTERNAL),[2,new Promise(function(r,o){n.onabort=function(){return o(new Error("Failed to set internal value"))};var s=i.put({key:e,value:t});s.onsuccess=function(){return r()},s.onerror=function(){return o(new Error("Failed to set internal value"))}})];case 2:return o=s.sent(),this.logger.debug("DiagnosticsStorage: Failed to set internal value",o),[3,3];case 3:return[2]}})})},e.prototype.getInternal=function(e){return v(this,void 0,void 0,function(){var t,r,n,i;return m(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this.getDB()];case 1:return t=o.sent(),r=t.transaction([Ht.INTERNAL],"readonly"),n=r.objectStore(Ht.INTERNAL),[2,new Promise(function(t,i){r.onabort=function(){return i(new Error("Failed to get internal value"))};var o=n.get(e);o.onsuccess=function(){return t(o.result)},o.onerror=function(){return i(new Error("Failed to get internal value"))}})];case 2:return i=o.sent(),this.logger.debug("DiagnosticsStorage: Failed to get internal value",i),[2,void 0];case 3:return[2]}})})},e.prototype.getLastFlushTimestamp=function(){return v(this,void 0,void 0,function(){var e,t;return m(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.getInternal(Kt.LAST_FLUSH_TIMESTAMP)];case 1:return[2,(e=r.sent())?parseInt(e.value,10):void 0];case 2:return t=r.sent(),this.logger.debug("DiagnosticsStorage: Failed to get last flush timestamp",t),[2,void 0];case 3:return[2]}})})},e.prototype.setLastFlushTimestamp=function(e){return v(this,void 0,void 0,function(){var t;return m(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.setInternal(Kt.LAST_FLUSH_TIMESTAMP,e.toString())];case 1:return r.sent(),[3,3];case 2:return t=r.sent(),this.logger.debug("DiagnosticsStorage: Failed to set last flush timestamp",t),[3,3];case 3:return[2]}})})},e.prototype.clearTable=function(e,t){return new Promise(function(r,n){var i=e.objectStore(t).clear();i.onsuccess=function(){return r()},i.onerror=function(){return n(new Error("Failed to clear table ".concat(t)))}})},e.prototype.getAllAndClear=function(){return v(this,void 0,void 0,function(){var e,t,r,n,i,o,s,a;return m(this,function(l){switch(l.label){case 0:return l.trys.push([0,4,,5]),[4,this.getDB()];case 1:return e=l.sent(),t=e.transaction([Ht.TAGS,Ht.COUNTERS,Ht.HISTOGRAMS,Ht.EVENTS],"readwrite"),[4,Promise.all([this.getAllFromStore(t,Ht.TAGS),this.getAllFromStore(t,Ht.COUNTERS),this.getAllFromStore(t,Ht.HISTOGRAMS),this.getAllFromStore(t,Ht.EVENTS)])];case 2:return r=b.apply(void 0,[l.sent(),4]),n=r[0],i=r[1],o=r[2],s=r[3],[4,Promise.all([this.clearTable(t,Ht.COUNTERS),this.clearTable(t,Ht.HISTOGRAMS),this.clearTable(t,Ht.EVENTS)])];case 3:return l.sent(),[2,{tags:n,counters:i,histogramStats:o,events:s}];case 4:return a=l.sent(),this.logger.debug("DiagnosticsStorage: Failed to get all and clear data",a),[2,{tags:[],counters:[],histogramStats:[],events:[]}];case 5:return[2]}})})},e.prototype.getAllFromStore=function(e,t){return new Promise(function(r,n){var i=e.objectStore(t).getAll();i.onsuccess=function(){return r(i.result)},i.onerror=function(){return n(new Error("Failed to get all from ".concat(t)))}})},e}()}}),Sr=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/diagnostics/uncaught-sdk-errors.js"(){Ne(),ze(),Jt=function(){var e=de();if(!e)return[];var t=e.__AMPLITUDE_SCRIPT_URL__;return Array.isArray(t)?t:"string"==typeof t?[t]:[]},Qt=function(e){var r=de();if(r&&"function"==typeof r.addEventListener){var n=function(r){e.recordEvent("sdk.error.uncaught",t({type:r.type,message:r.message,filename:r.filename,error_name:r.errorName,stack:r.stack},r.metadata))};r.addEventListener("error",function(e){var t=e.error instanceof Error?e.error:void 0,r=null==t?void 0:t.stack,i=Xt({filename:e.filename,stack:r});i&&n({type:"error",message:e.message,stack:r,filename:e.filename,errorName:null==t?void 0:t.name,metadata:{colno:e.colno,lineno:e.lineno,isTrusted:e.isTrusted,matchReason:i}})},!0),r.addEventListener("unhandledrejection",function(e){var t,r=e.reason instanceof Error?e.reason:void 0,i=null==r?void 0:r.stack,o=Yt(i),s=Xt({filename:o,stack:i});s&&n({type:"unhandledrejection",message:null!==(t=null==r?void 0:r.message)&&void 0!==t?t:Zt(e.reason),stack:i,filename:o,errorName:null==r?void 0:r.name,metadata:{isTrusted:e.isTrusted,matchReason:s}})},!0)}},Xt=function(e){var t,r,n=Jt();if(0!==n.length)try{for(var i=y(n),o=i.next();!o.done;o=i.next()){var s=o.value;if(e.filename&&e.filename.includes(s))return"filename";if(e.stack&&e.stack.includes(s))return"stack"}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}},Yt=function(e){if(e){var t=e.match(/(https?:\/\/\S+?)(?=[)\s]|$)/);return t?t[1]:void 0}},Zt=function(e){if("string"==typeof e)return e;try{return JSON.stringify(e)}catch(e){return"[object Object]"}}}}),kr=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/diagnostics/diagnostics-client.js"(){Ne(),wr(),ze(),fr(),Sr(),er=3e5,tr=1e4,rr=function(){function e(e,r,n,i){void 0===n&&(n="US"),this.inMemoryTags={},this.inMemoryCounters={},this.inMemoryHistograms={},this.inMemoryEvents=[],this.saveTimer=null,this.flushTimer=null,this.apiKey=e,this.logger=r,this.serverUrl="US"===n?"https://diagnostics.prod.us-west-2.amplitude.com/v1/capture":"https://diagnostics.prod.eu-central-1.amplitude.com/v1/capture",this.logger.debug("DiagnosticsClient: Initializing with options",JSON.stringify(i,null,2)),this.config=t({enabled:!0,sampleRate:0},i),this.startTimestamp=Date.now(),this.shouldTrack=Lt(this.startTimestamp,this.config.sampleRate)&&this.config.enabled,Gt.isSupported()?this.storage=new Gt(e,r):this.logger.debug("DiagnosticsClient: IndexedDB is not supported"),this.initializeFlushInterval(),this.shouldTrack&&(this.increment("sdk.diagnostics.sampled.in.and.enabled"),Qt(this))}return e.prototype.isStorageAndTrackEnabled=function(){return Boolean(this.storage)&&Boolean(this.shouldTrack)},e.prototype.setTag=function(e,t){this.isStorageAndTrackEnabled()&&(Object.keys(this.inMemoryTags).length>=tr?this.logger.debug("DiagnosticsClient: Early return setTags as reaching memory limit"):(this.inMemoryTags[e]=t,this.startTimersIfNeeded()))},e.prototype.increment=function(e,t){void 0===t&&(t=1),this.isStorageAndTrackEnabled()&&(Object.keys(this.inMemoryCounters).length>=tr?this.logger.debug("DiagnosticsClient: Early return increment as reaching memory limit"):(this.inMemoryCounters[e]=(this.inMemoryCounters[e]||0)+t,this.startTimersIfNeeded()))},e.prototype.recordHistogram=function(e,t){if(this.isStorageAndTrackEnabled())if(Object.keys(this.inMemoryHistograms).length>=tr)this.logger.debug("DiagnosticsClient: Early return recordHistogram as reaching memory limit");else{var r=this.inMemoryHistograms[e];r?(r.count+=1,r.min=Math.min(r.min,t),r.max=Math.max(r.max,t),r.sum+=t):this.inMemoryHistograms[e]={count:1,min:t,max:t,sum:t},this.startTimersIfNeeded()}},e.prototype.recordEvent=function(e,t){this.isStorageAndTrackEnabled()&&(this.inMemoryEvents.length>=10?this.logger.debug("DiagnosticsClient: Early return recordEvent as reaching memory limit"):(this.inMemoryEvents.push({event_name:e,time:Date.now(),event_properties:t}),this.startTimersIfNeeded()))},e.prototype.startTimersIfNeeded=function(){var e=this;this.saveTimer||(this.saveTimer=setTimeout(function(){e.saveAllDataToStorage().catch(function(t){e.logger.debug("DiagnosticsClient: Failed to save all data to storage",t)}).finally(function(){e.saveTimer=null})},1e3)),this.flushTimer||(this.flushTimer=setTimeout(function(){e._flush().catch(function(t){e.logger.debug("DiagnosticsClient: Failed to flush",t)}).finally(function(){e.flushTimer=null})},er))},e.prototype.saveAllDataToStorage=function(){return v(this,void 0,void 0,function(){var e,r,n,i;return m(this,function(o){switch(o.label){case 0:return this.storage?(e=t({},this.inMemoryTags),r=t({},this.inMemoryCounters),n=t({},this.inMemoryHistograms),i=w([],b(this.inMemoryEvents),!1),this.inMemoryEvents=[],this.inMemoryTags={},this.inMemoryCounters={},this.inMemoryHistograms={},[4,Promise.all([this.storage.setTags(e),this.storage.incrementCounters(r),this.storage.setHistogramStats(n),this.storage.addEventRecords(i)])]):[2];case 1:return o.sent(),[2]}})})},e.prototype._flush=function(){return v(this,void 0,void 0,function(){var e,t,r,n,i,o,s,a,l,u;return m(this,function(c){switch(c.label){case 0:return this.storage?[4,this.saveAllDataToStorage()]:[2];case 1:return c.sent(),this.saveTimer=null,this.flushTimer=null,[4,this.storage.getAllAndClear()];case 2:return e=c.sent(),t=e.tags,r=e.counters,n=e.histogramStats,i=e.events,this.storage.setLastFlushTimestamp(Date.now()),o={},t.forEach(function(e){o[e.key]=e.value}),s={},r.forEach(function(e){s[e.key]=e.value}),a={},n.forEach(function(e){a[e.key]={count:e.count,min:e.min,max:e.max,avg:Math.round(e.sum/e.count*100)/100}}),l=i.map(function(e){return{event_name:e.event_name,time:e.time,event_properties:e.event_properties}}),0===Object.keys(s).length&&0===Object.keys(a).length&&0===l.length?[2]:(u={tags:o,histogram:a,counters:s,events:l},this.fetch(u),[2])}})})},e.prototype.fetch=function(e){return v(this,void 0,void 0,function(){var t;return m(this,function(r){switch(r.label){case 0:if(r.trys.push([0,2,,3]),!de())throw new Error("DiagnosticsClient: Fetch is not supported");return[4,fetch(this.serverUrl,{method:"POST",headers:{"X-ApiKey":this.apiKey,"Content-Type":"application/json"},body:JSON.stringify(e)})];case 1:return r.sent().ok?(this.logger.debug("DiagnosticsClient: Successfully sent diagnostics data"),[3,3]):(this.logger.debug("DiagnosticsClient: Failed to send diagnostics data."),[2]);case 2:return t=r.sent(),this.logger.debug("DiagnosticsClient: Failed to send diagnostics data. ",t),[3,3];case 3:return[2]}})})},e.prototype.initializeFlushInterval=function(){return v(this,void 0,void 0,function(){var e,t,r;return m(this,function(n){switch(n.label){case 0:return this.storage?(e=Date.now(),[4,this.storage.getLastFlushTimestamp()]):[2];case 1:return-1===(t=n.sent()||-1)?(this.storage.setLastFlushTimestamp(e),this._setFlushTimer(er),[2]):(r=e-t)>=er?(this._flush(),[2]):(this._setFlushTimer(er-r),[2])}})})},e.prototype._setFlushTimer=function(e){var t=this;this.flushTimer=setTimeout(function(){t._flush().catch(function(e){t.logger.debug("DiagnosticsClient: Failed to flush",e)}).finally(function(){t.flushTimer=null})},e)},e.prototype._setSampleRate=function(e){this.logger.debug("DiagnosticsClient: Setting sample rate to",e),this.config.sampleRate=e,this.shouldTrack=Lt(this.startTimestamp,this.config.sampleRate)&&this.config.enabled,this.logger.debug("DiagnosticsClient: Should track is",this.shouldTrack)},e}()}}),xr=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/transports/base.js"(){Be(),lt(),nr=function(){function e(){}return e.prototype.send=function(e,t,r){return Promise.resolve(null)},e.prototype.buildResponse=function(e){var t,r,n,i,o,s,a,l,u,c,d,h,p,f,g,v,m,y,b,w,S,k;if("object"!=typeof e)return null;var x=e.code||0,E=this.buildStatus(x);switch(E){case ue.Success:return{status:E,statusCode:x,body:{eventsIngested:null!==(t=e.events_ingested)&&void 0!==t?t:0,payloadSizeBytes:null!==(r=e.payload_size_bytes)&&void 0!==r?r:0,serverUploadTime:null!==(n=e.server_upload_time)&&void 0!==n?n:0}};case ue.Invalid:return{status:E,statusCode:x,body:{error:null!==(i=e.error)&&void 0!==i?i:"",missingField:null!==(o=e.missing_field)&&void 0!==o?o:"",eventsWithInvalidFields:null!==(s=e.events_with_invalid_fields)&&void 0!==s?s:{},eventsWithMissingFields:null!==(a=e.events_with_missing_fields)&&void 0!==a?a:{},eventsWithInvalidIdLengths:null!==(l=e.events_with_invalid_id_lengths)&&void 0!==l?l:{},epsThreshold:null!==(u=e.eps_threshold)&&void 0!==u?u:0,exceededDailyQuotaDevices:null!==(c=e.exceeded_daily_quota_devices)&&void 0!==c?c:{},silencedDevices:null!==(d=e.silenced_devices)&&void 0!==d?d:[],silencedEvents:null!==(h=e.silenced_events)&&void 0!==h?h:[],throttledDevices:null!==(p=e.throttled_devices)&&void 0!==p?p:{},throttledEvents:null!==(f=e.throttled_events)&&void 0!==f?f:[]}};case ue.PayloadTooLarge:return{status:E,statusCode:x,body:{error:null!==(g=e.error)&&void 0!==g?g:""}};case ue.RateLimit:return{status:E,statusCode:x,body:{error:null!==(v=e.error)&&void 0!==v?v:"",epsThreshold:null!==(m=e.eps_threshold)&&void 0!==m?m:0,throttledDevices:null!==(y=e.throttled_devices)&&void 0!==y?y:{},throttledUsers:null!==(b=e.throttled_users)&&void 0!==b?b:{},exceededDailyQuotaDevices:null!==(w=e.exceeded_daily_quota_devices)&&void 0!==w?w:{},exceededDailyQuotaUsers:null!==(S=e.exceeded_daily_quota_users)&&void 0!==S?S:{},throttledEvents:null!==(k=e.throttled_events)&&void 0!==k?k:[]}};case ue.Timeout:default:return{status:E,statusCode:x}}},e.prototype.buildStatus=function(e){return Ze(e)?ue.Success:429===e?ue.RateLimit:413===e?ue.PayloadTooLarge:408===e?ue.Timeout:e>=400&&e<500?ue.Invalid:e>=500?ue.Failed:ue.Unknown},e}()}}),Er=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/transports/fetch.js"(){Ne(),xr(),ir=function(e){function r(t){void 0===t&&(t={});var r=e.call(this)||this;return r.customHeaders=t,r}return f(r,e),r.prototype.send=function(e,r){return v(this,void 0,void 0,function(){var n,i,o;return m(this,function(s){switch(s.label){case 0:if("undefined"==typeof fetch)throw new Error("FetchTransport is not supported");return n={headers:t({"Content-Type":"application/json",Accept:"*/*"},this.customHeaders),body:JSON.stringify(r),method:"POST"},[4,fetch(e,n)];case 1:return[4,(i=s.sent()).text()];case 2:o=s.sent();try{return[2,this.buildResponse(JSON.parse(o))]}catch(e){return[2,this.buildResponse({code:i.status})]}return[2]}})})},r}(nr)}});function Cr(){return"undefined"!=typeof CompressionStream}function Ir(e){return v(this,void 0,void 0,function(){var t,r;return m(this,function(n){switch(n.label){case 0:if(void 0===(t=CompressionStream))return[2,void 0];n.label=1;case 1:return n.trys.push([1,3,,4]),r=new Blob([e]).stream().pipeThrough(new t("gzip")),[4,new Response(r).arrayBuffer()];case 2:return[2,n.sent()];case 3:return n.sent(),[2,void 0];case 4:return[2]}})})}var Or,Tr,Ar,Rr,Pr,_r,Mr,Nr,Lr,Dr=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/transports/gzip.js"(){Ne(),or=2048}}),Ur=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/remote-config/remote-config-localstorage.js"(){Or=function(){function e(e,t){this.key="AMP_remote_config_".concat(e.substring(0,10)),this.logger=t}return e.prototype.fetchConfig=function(){var e=null,t={remoteConfig:null,lastFetch:new Date};try{e=localStorage.getItem(this.key)}catch(e){return this.logger.debug("Remote config localstorage failed to access: ",e),Promise.resolve(t)}if(null===e)return this.logger.debug("Remote config localstorage gets null because the key does not exist"),Promise.resolve(t);try{var r=JSON.parse(e);return this.logger.debug("Remote config localstorage parsed successfully: ".concat(JSON.stringify(r))),Promise.resolve({remoteConfig:r.remoteConfig,lastFetch:new Date(r.lastFetch)})}catch(e){return this.logger.debug("Remote config localstorage failed to parse: ",e),localStorage.removeItem(this.key),Promise.resolve(t)}},e.prototype.setConfig=function(e){try{return localStorage.setItem(this.key,JSON.stringify(e)),this.logger.debug("Remote config localstorage set successfully."),Promise.resolve(!0)}catch(e){this.logger.debug("Remote config localstorage failed to set: ",e)}return Promise.resolve(!1)},e}()}}),Fr=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/remote-config/remote-config.js"(){Ne(),Ur(),We(),Tr={INVALID_API_KEY:401,FORBIDDEN:403,RATE_LIMIT:429},Ar=function(){function e(e,t,r,n){void 0===r&&(r="US"),this.callbackInfos=[],this.lastSuccessfulFetch=null,this.fetchPromise=null,this.isLastFetchInvalidApiKey=!1,this.apiKey=e,this.serverUrl=n||("US"===r?"https://sr-client-cfg.amplitude.com/config":"https://sr-client-cfg.eu.amplitude.com/config"),this.logger=t,this.storage=new Or(e,t)}return e.prototype.subscribe=function(e,t,r){var n=fe(),i={id:n,key:e,deliveryMode:t,callback:r};return this.callbackInfos.push(i),"all"===t?this.subscribeAll(i):this.subscribeWaitForRemote(i,t.timeout),n},e.prototype.unsubscribe=function(e){var t=this.callbackInfos.findIndex(function(t){return t.id===e});return-1===t?(this.logger.debug("Remote config client unsubscribe failed because callback with id ".concat(e," doesn't exist.")),!1):(this.callbackInfos.splice(t,1),this.logger.debug("Remote config client unsubscribe succeeded removing callback with id ".concat(e,".")),!0)},e.prototype.updateConfigs=function(){return v(this,void 0,void 0,function(){var e,t=this;return m(this,function(r){switch(r.label){case 0:return this.lastSuccessfulFetch&&Date.now()-this.lastSuccessfulFetch<3e5?(this.logger.debug("Remote config client skipping updateConfigs: Too recent"),[2]):[4,this.getOrCreateFetchPromise()];case 1:return e=r.sent(),this.storage.setConfig(e),this.callbackInfos.forEach(function(r){t.sendCallback(r,e,"remote")}),[2]}})})},e.prototype.getOrCreateFetchPromise=function(){var e=this;return this.fetchPromise?this.fetchPromise:this.isLastFetchInvalidApiKey?(this.logger.debug("Remote config client skipping fetch: Invalid API key"),this.fetchPromise=Promise.resolve({remoteConfig:null,lastFetch:new Date}).finally(function(){e.fetchPromise=null}),this.fetchPromise):(this.fetchPromise=this.fetch().then(function(t){return null!==t.remoteConfig&&(e.lastSuccessfulFetch=Date.now()),t}).finally(function(){e.fetchPromise=null}),this.fetchPromise)},e.prototype.subscribeAll=function(e){return v(this,void 0,void 0,function(){var t,r,n,i=this;return m(this,function(o){switch(o.label){case 0:return t=this.getOrCreateFetchPromise().then(function(t){i.logger.debug("Remote config client subscription all mode fetched from remote: ".concat(JSON.stringify(t))),i.sendCallback(e,t,"remote"),i.storage.setConfig(t)}),r=this.storage.fetchConfig().then(function(e){return e}),[4,Promise.race([t,r])];case 1:return void 0!==(n=o.sent())&&(this.logger.debug("Remote config client subscription all mode fetched from cache: ".concat(JSON.stringify(n))),null!==n.remoteConfig?this.sendCallback(e,n,"cache"):this.logger.debug("Remote config client skips sending callback because cache is empty (first time user).")),[4,t];case 2:return o.sent(),[2]}})})},e.prototype.subscribeWaitForRemote=function(e,t){return v(this,void 0,void 0,function(){var r,n;return m(this,function(i){switch(i.label){case 0:r=new Promise(function(e,r){setTimeout(function(){r("Timeout exceeded")},t)}),i.label=1;case 1:return i.trys.push([1,3,,5]),[4,Promise.race([this.getOrCreateFetchPromise(),r])];case 2:return n=i.sent(),this.logger.debug("Remote config client subscription wait for remote mode returns from remote."),this.sendCallback(e,n,"remote"),this.storage.setConfig(n),[3,5];case 3:return i.sent(),this.logger.debug("Remote config client subscription wait for remote mode exceeded timeout. Try to fetch from cache."),[4,this.storage.fetchConfig()];case 4:return null!==(n=i.sent()).remoteConfig?(this.logger.debug("Remote config client subscription wait for remote mode returns a cached copy."),this.sendCallback(e,n,"cache")):(this.logger.debug("Remote config client subscription wait for remote mode failed to fetch cache."),this.sendCallback(e,n,"remote")),[3,5];case 5:return[2]}})})},e.prototype.sendCallback=function(e,t,r){var n;e.lastCallback=new Date,n=e.key?e.key.split(".").reduce(function(e,t){return null===e?e:t in e?e[t]:null},t.remoteConfig):t.remoteConfig,e.callback(n,r,t.lastFetch)},e.prototype.fetch=function(e,t){return void 0===e&&(e=3),void 0===t&&(t=1e3),v(this,void 0,void 0,function(){var r,n,i,o,s,a,l=this;return m(this,function(u){switch(u.label){case 0:r=t/e,n={remoteConfig:null,lastFetch:new Date},i=function(n){var i,s,a,u,c,d;return m(this,function(h){switch(h.label){case 0:i=!0,s=new AbortController,a=setTimeout(function(){return s.abort()},t),h.label=1;case 1:return h.trys.push([1,7,8,9]),[4,fetch(o.getUrlParams(),{method:"GET",headers:{Accept:"*/*"},signal:s.signal})];case 2:return(u=h.sent()).ok?[3,4]:[4,u.text()];case 3:return c=h.sent(),o.logger.debug("Remote config client fetch with retry time ".concat(e," failed with ").concat(u.status,": ").concat(c)),u.status===Tr.INVALID_API_KEY||u.status===Tr.FORBIDDEN?(o.logger.error("Remote config client fetch failed with ".concat(u.status,". Invalid API key; future fetches will be skipped.")),o.isLastFetchInvalidApiKey=!0,i=!1):u.status>=400&&u.status<500&&u.status!==Tr.RATE_LIMIT&&(i=!1),[3,6];case 4:return[4,u.json()];case 5:return[2,{value:{remoteConfig:h.sent(),lastFetch:new Date}}];case 6:return[3,9];case 7:return(d=h.sent())instanceof Error&&"AbortError"===d.name?o.logger.debug("Remote config client fetch with retry time ".concat(e," timed out after ").concat(t,"ms")):o.logger.debug("Remote config client fetch with retry time ".concat(e," is rejected because: "),d),[3,9];case 8:return clearTimeout(a),[7];case 9:return i?n<e-1?[4,new Promise(function(e){return setTimeout(e,l.getJitterDelay(r))})]:[3,11]:[2,"break"];case 10:h.sent(),h.label=11;case 11:return[2]}})},o=this,s=0,u.label=1;case 1:return s<e?[5,i(s)]:[3,4];case 2:if("object"==typeof(a=u.sent()))return[2,a.value];if("break"===a)return[3,4];u.label=3;case 3:return s++,[3,1];case 4:return[2,n]}})})},e.prototype.getJitterDelay=function(e){return Math.floor(Math.random()*e)},e.prototype.getUrlParams=function(){var t=encodeURIComponent(this.apiKey),r=new URLSearchParams;return r.append("config_group",e.CONFIG_GROUP),"".concat(this.serverUrl,"/").concat(t,"?").concat(r.toString())},e.CONFIG_GROUP="browser",e}()}});function jr(e,t){var r,n=(r=e,!!Pr&&"function"==typeof Pr[r]&&(Mr[r]||(Mr[r]=Pr[r],Pr[r]=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{if(_r[r]&&!Nr){Nr=!0;var n=_r[r];n&&n.forEach(function(t){try{t(r,e)}catch(e){}})}}catch(e){}return Nr=!1,Mr[r].apply(Pr,e)}),!0));if(!n)return new Error("Console override failed");_r[e]?_r[e].push(t):_r[e]=[t]}function Br(e){var t,r;try{for(var n=y(Object.values(_r)),i=n.next();!i.done;i=n.next())for(var o=i.value,s=o.length-1;s>=0;s--)if(o[s]===e){o.splice(s,1);break}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}}function qr(){var e,t;try{for(var r=y(Object.entries(Mr)),n=r.next();!n.done;n=r.next()){var i=b(n.value,2),o=i[0],s=i[1];s&&(Pr[o]=s)}}catch(t){e={error:t}}finally{try{n&&!n.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}Mr={},_r={}}var zr,Wr,Vr,$r,Hr,Kr,Gr,Jr,Qr,Xr,Yr,Zr,en,tn=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/observers/console.js"(){Ne(),ze(),Rr=de(),Pr=null==Rr?void 0:Rr.console,_r={},Mr={},Nr=!1,Lr={addListener:jr,removeListener:Br,_restoreConsole:qr}}}),rn=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/types/server-zone.js"(){var e;(e=zr||(zr={})).US="US",e.EU="EU",e.STAGING="STAGING"}}),nn=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/types/offline.js"(){Wr=null}}),on=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/types/element-interactions.js"(){Vr=["a","button","input","select","textarea","label","video","audio",'[contenteditable="true" i]',"[data-amp-default-track]",".amp-default-track"],$r="data-amp-track-",Hr=["div","span","h1","h2","h3","h4","h5","h6"],Kr=150}}),sn=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/types/frustration-interactions.js"(){Ne(),Gr=w(['input[type="button"]','input[type="submit"]','input[type="reset"]','input[type="image"]','input[type="file"]'],b(["a","button",'[role="button"]','[role="link"]','[role="menuitem"]','[role="menuitemcheckbox"]','[role="menuitemradio"]','[role="option"]','[role="tab"]','[role="treeitem"]','[contenteditable="true" i]']),!1),Jr=Gr,Qr=Gr,Xr=["*"],Yr=1e3,Zr=4,en=50}});function an(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e||null==e}function ln(e,t,r){e&&un({json:e,allowlist:t.map(cn),excludelist:r.map(cn),ancestors:[]})}function un(e){var t,r,n=e.json,i=e.targetObject,o=e.allowlist,s=e.excludelist,a=e.ancestors,l=e.parentObject,u=e.targetKey;i||(i=n);var c=Object.keys(i);try{for(var d=y(c),h=d.next();!h.done;h=d.next()){var p=h.value,f=w(w([],b(a),!1),[p],!1);an(i[p])?hn(f,o)&&!hn(f,s)||delete i[p]:un({json:n,targetObject:i[p],allowlist:o,excludelist:s,ancestors:f,parentObject:i,targetKey:p})}}catch(e){t={error:e}}finally{try{h&&!h.done&&(r=d.return)&&r.call(d)}finally{if(t)throw t.error}}0===Object.keys(i).length&&l&&u&&delete l[u]}function cn(e){return e.startsWith("/")&&(e=e.slice(1)),e.split("/").map(function(e){return e.replace(/~0/g,"~").replace(/~1/g,"/")})}function dn(e,t,r,n){if(void 0===r&&(r=0),void 0===n&&(n=0),n===t.length)return r===e.length;if(r===e.length){for(;n<t.length&&"**"===t[n];)n++;return n===t.length}var i=t[n];if("**"===i){if(n+1===t.length)return!0;for(var o=r;o<=e.length;o++)if(dn(e,t,o,n+1))return!0;return!1}return("*"===i||i===e[r])&&dn(e,t,r+1,n+1)}function hn(e,t){return t.some(function(t){return dn(e,t)})}var pn,fn,gn,vn,mn,yn,bn,wn,Sn=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/utils/json-query.js"(){Ne()}});function kn(e,t){var r,n,i,o=de(),s=null==o?void 0:o.TextEncoder;if(s){var a;if("string"==typeof e)a=e,i=(new s).encode(a).length;else if(e instanceof Blob)i=(a=e).size;else if(e instanceof URLSearchParams)a=e,i=(new s).encode(a.toString()).length;else if(ArrayBuffer.isView(e))i=(a=e).byteLength;else if(e instanceof ArrayBuffer)i=(a=e).byteLength;else if(e instanceof FormData){var l=e,u=0,c=0;try{for(var d=y(l.entries()),h=d.next();!h.done;h=d.next()){var p=b(h.value,2),f=p[0],g=p[1];if(u+=f.length,"string"==typeof g)u+=(new s).encode(g).length;else{if(!(g instanceof Blob))return;u+=g.size}if(++c>=t)return}}catch(e){r={error:e}}finally{try{h&&!h.done&&(n=d.return)&&n.call(d)}finally{if(r)throw r.error}}i=u}else if(e instanceof ReadableStream)return void(a=e);return i}}function xn(e,t,r){if(!e)return null;try{var n=JSON.parse(e);return ln(n,t,r),n}catch(e){return null}}var En,Cn,In,On=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/network-request-event.js"(){var e;Ne(),ze(),Sn(),De(),pn=function(){function e(e){this.request=e}return e.prototype.headers=function(e){var t,r;void 0===e&&(e=[]);var n=this.request.headers,i={};if(Array.isArray(n))n.forEach(function(e){var t=b(e,2),r=t[0],n=t[1];i[r]=n});else if(n instanceof Headers)n.forEach(function(e,t){i[t]=e});else if("object"==typeof n&&null!==n)try{for(var o=y(Object.entries(n)),s=o.next();!s.done;s=o.next()){var a=b(s.value,2),l=a[0],u=a[1];i[l]=u}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return bn(i,{allow:e})},Object.defineProperty(e.prototype,"bodySize",{get:function(){if("number"==typeof this._bodySize)return this._bodySize;var e=de();if(null==e?void 0:e.TextEncoder){var t=this.request.body;return this._bodySize=kn(t,100),this._bodySize}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"method",{get:function(){return this.request.method},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"body",{get:function(){return"string"==typeof this.request.body?this.request.body:null},enumerable:!1,configurable:!0}),e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),v(this,void 0,void 0,function(){return m(this,function(r){return 0===e.length?[2,null]:[2,xn(this.body,e,t)]})})},e}(),fn=function(){function e(e,t){this.bodyRaw=e,this.requestHeaders=t}return e.prototype.headers=function(e){return void 0===e&&(e=[]),bn(this.requestHeaders,{allow:e})},Object.defineProperty(e.prototype,"bodySize",{get:function(){return kn(this.bodyRaw,100)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"body",{get:function(){return"string"==typeof this.bodyRaw?this.bodyRaw:null},enumerable:!1,configurable:!0}),e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),v(this,void 0,void 0,function(){return m(this,function(r){return 0===e.length?[2,null]:[2,xn(this.body,e,t)]})})},e}(),gn=function(){function e(e){this.response=e}return e.prototype.headers=function(e){var t;if(void 0===e&&(e=[]),this.response.headers instanceof Headers){var r=this.response.headers,n={};return null===(t=null==r?void 0:r.forEach)||void 0===t||t.call(r,function(e,t){n[t]=e}),bn(n,{allow:e})}},Object.defineProperty(e.prototype,"bodySize",{get:function(){var e,t;if(void 0!==this._bodySize)return this._bodySize;var r=null===(t=null===(e=this.response.headers)||void 0===e?void 0:e.get)||void 0===t?void 0:t.call(e,"content-length"),n=r?parseInt(r,10):void 0;return this._bodySize=n,n},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this.response.status},enumerable:!1,configurable:!0}),e.prototype.text=function(){return v(this,void 0,void 0,function(){var e,t;return m(this,function(r){switch(r.label){case 0:this.clonedResponse||(this.clonedResponse=this.response.clone()),r.label=1;case 1:return r.trys.push([1,3,,4]),e=this.clonedResponse.text(),t=new Promise(function(e){return setTimeout(function(){return e(null)},500)}),[4,Promise.race([e,t])];case 2:return[2,r.sent()];case 3:return r.sent(),[2,null];case 4:return[2]}})})},e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),v(this,void 0,void 0,function(){return m(this,function(r){switch(r.label){case 0:return 0===e.length?[2,null]:[4,this.text()];case 1:return[2,xn(r.sent(),e,t)]}})})},e}(),vn=function(){function e(e,t,r,n){this.statusCode=e,this.headersString=t,this.size=r,this.getJson=n}return Object.defineProperty(e.prototype,"bodySize",{get:function(){return this.size},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this.statusCode},enumerable:!1,configurable:!0}),e.prototype.headers=function(e){var t,r;if(void 0===e&&(e=[]),!this.headersString)return{};var n={},i=this.headersString.split("\r\n");try{for(var o=y(i),s=o.next();!s.done;s=o.next()){var a=b(s.value.split(": "),2),l=a[0],u=a[1];l&&u&&(n[l]=u)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return bn(n,{allow:e})},e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),v(this,void 0,void 0,function(){var r;return m(this,function(n){return 0===e.length?[2,null]:(r=this.getJson())?(ln(r,e,t),[2,r]):[2,null]})})},e}(),(e=mn||(mn={})).REDACT="redact",e.REMOVE="remove",yn="[REDACTED]",bn=function(e,t){var r,n,i=t.allow,o=void 0===i?[]:i,s=t.strategy,a=void 0===s?mn.REMOVE:s,l=w([],b(Q),!1),u={},c=function(t){var r=t.toLowerCase();l.find(function(e){return e.toLowerCase()===r})?a===mn.REDACT&&(u[t]=yn):o.find(function(e){return e.toLowerCase()===r})?u[t]=e[t]:a===mn.REDACT&&(u[t]=yn)};try{for(var d=y(Object.keys(e)),h=d.next();!h.done;h=d.next()){c(h.value)}}catch(e){r={error:e}}finally{try{h&&!h.done&&(n=d.return)&&n.call(d)}finally{if(r)throw r.error}}return u},wn=function(){function e(e,t,r,n,i,o,s,a,l,u,c){void 0===s&&(s=0),this.type=e,this.method=t,this.timestamp=r,this.startTime=n,this.url=i,this.requestWrapper=o,this.status=s,this.duration=a,this.responseWrapper=l,this.error=u,this.endTime=c}return e.prototype.toSerializable=function(){var e,t,r,n,i={type:this.type,method:this.method,url:this.url,timestamp:this.timestamp,status:this.status,duration:this.duration,error:this.error,startTime:this.startTime,endTime:this.endTime,requestHeaders:null===(e=this.requestWrapper)||void 0===e?void 0:e.headers(w([],b(J),!1)),requestBodySize:null===(t=this.requestWrapper)||void 0===t?void 0:t.bodySize,responseHeaders:null===(r=this.responseWrapper)||void 0===r?void 0:r.headers(w([],b(J),!1)),responseBodySize:null===(n=this.responseWrapper)||void 0===n?void 0:n.bodySize};return Object.fromEntries(Object.entries(i).filter(function(e){var t=b(e,2);t[0];return void 0!==t[1]}))},e}()}});function Tn(e){try{e()}catch(e){}}var An,Rn,Pn,_n,Mn,Nn,Ln,Dn,Un,Fn=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/observers/network.js"(){Ne(),ze(),We(),On(),En=function(){return function(e,t){void 0===t&&(t=fe()),this.callback=e,this.id=t}}(),Cn=function(){function e(t){this.eventCallbacks=new Map,this.isObserving=!1,this.logger=t;var r=de();e.isSupported()&&(this.globalScope=r)}return e.isSupported=function(){var e=de();return!!e&&!!e.fetch},e.prototype.subscribe=function(e,t){var r,n,i,o,s,a,l,u,c,d;if(this.logger||(this.logger=t),this.eventCallbacks.set(e.id,e),!this.isObserving){var h=null===(i=null===(n=null===(r=this.globalScope)||void 0===r?void 0:r.XMLHttpRequest)||void 0===n?void 0:n.prototype)||void 0===i?void 0:i.open,p=null===(a=null===(s=null===(o=this.globalScope)||void 0===o?void 0:o.XMLHttpRequest)||void 0===s?void 0:s.prototype)||void 0===a?void 0:a.send,f=null===(c=null===(u=null===(l=this.globalScope)||void 0===l?void 0:l.XMLHttpRequest)||void 0===u?void 0:u.prototype)||void 0===c?void 0:c.setRequestHeader;h&&p&&f&&this.observeXhr(h,p,f);var g=null===(d=this.globalScope)||void 0===d?void 0:d.fetch;g&&this.observeFetch(g),this.isObserving=!0}},e.prototype.unsubscribe=function(e){this.eventCallbacks.delete(e.id)},e.prototype.triggerEventCallbacks=function(e){var t=this;this.eventCallbacks.forEach(function(r){try{r.callback(e)}catch(e){Tn(function(){var r;null===(r=t.logger)||void 0===r||r.debug("an unexpected error occurred while triggering event callbacks",e)})}})},e.prototype.handleNetworkRequestEvent=function(e,t,r,n,i,o,s){var a;if(void 0!==o&&void 0!==s){var l,u,c,d="GET";if(!function(e){return"object"==typeof e&&null!==e&&"url"in e&&"method"in e}(t)?l=null===(a=null==t?void 0:t.toString)||void 0===a?void 0:a.call(t):(l=t.url,d=t.method),l)try{var h=new URL(l);l="".concat(h.protocol,"//").concat(h.host).concat(h.pathname).concat(h.search).concat(h.hash)}catch(e){}d=(null==r?void 0:r.method)||d,n&&(u=n.status),i&&(c={name:i.name||"UnknownError",message:i.message||"An unknown error occurred"},u=0);var p=Math.floor(performance.now()-s),f=Math.floor(o+p),g=new wn(e,d,o,o,l,r,u,p,n,c,f);this.triggerEventCallbacks(g)}},e.prototype.getTimestamps=function(){var e,t;return{startTime:null===(e=Date.now)||void 0===e?void 0:e.call(Date),durationStart:null===(t=null===performance||void 0===performance?void 0:performance.now)||void 0===t?void 0:t.call(performance)}},e.prototype.observeFetch=function(e){var t=this;this.globalScope&&e&&(this.globalScope.fetch=function(r,n){return v(t,void 0,void 0,function(){var t,i,o,s,a=this;return m(this,function(l){switch(l.label){case 0:try{t=this.getTimestamps()}catch(e){Tn(function(){var t;return null===(t=a.logger)||void 0===t?void 0:t.debug("an unexpected error occurred while retrieving timestamps",e)})}l.label=1;case 1:return l.trys.push([1,3,,4]),[4,e(r,n)];case 2:return i=l.sent(),[3,4];case 3:return s=l.sent(),o=s,[3,4];case 4:try{this.handleNetworkRequestEvent("fetch",r,n?new pn(n):void 0,i?new gn(i):void 0,o,null==t?void 0:t.startTime,null==t?void 0:t.durationStart)}catch(e){Tn(function(){var t;return null===(t=a.logger)||void 0===t?void 0:t.debug("an unexpected error occurred while handling fetch",e)})}if(i)return[2,i];throw o}})})})},e.createXhrJsonParser=function(e,t){return function(){var r;try{if("json"===e.responseType){if(null===(r=t.globalScope)||void 0===r?void 0:r.structuredClone)return t.globalScope.structuredClone(e.response)}else if(["text",""].includes(e.responseType))return JSON.parse(e.responseText)}catch(r){return r instanceof Error&&"InvalidStateError"===r.name&&Tn(function(){var r;return null===(r=t.logger)||void 0===r?void 0:r.debug("unexpected error when retrieving responseText. responseType='".concat(e.responseType,"'"))}),null}return null}},e.prototype.observeXhr=function(r,n,i){if(this.globalScope&&r&&n){var o=this.globalScope.XMLHttpRequest.prototype,s=this;o.open=function(){for(var e,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var o=b(n,2),a=o[0],l=o[1];try{this.$$AmplitudeAnalyticsEvent=t({method:a,url:null===(e=null==l?void 0:l.toString)||void 0===e?void 0:e.call(l),headers:{}},s.getTimestamps())}catch(e){Tn(function(){var t;return null===(t=s.logger)||void 0===t?void 0:t.debug("an unexpected error occurred while calling xhr open",e)})}return r.apply(this,n)},o.send=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var i=this,o=e.createXhrJsonParser(this,s),a=t[0],l=i.$$AmplitudeAnalyticsEvent;return i.$$AmplitudeAnalyticsEvent&&i.addEventListener("loadend",function(){try{var e=i.getAllResponseHeaders(),t=i.getResponseHeader("content-length"),r=new vn(i.status,e,t?parseInt(t,10):void 0,o),n=i.$$AmplitudeAnalyticsEvent.headers,u=new fn(a,n);l.status=i.status,s.handleNetworkRequestEvent("xhr",{url:l.url,method:l.method},u,r,void 0,l.startTime,l.durationStart)}catch(e){Tn(function(){var t;return null===(t=s.logger)||void 0===t?void 0:t.debug("an unexpected error occurred while handling xhr send",e)})}}),n.apply(i,t)},o.setRequestHeader=function(e,t){try{var r=this.$$AmplitudeAnalyticsEvent;r&&(r.headers[e]=t)}catch(e){Tn(function(){var t;return null===(t=s.logger)||void 0===t?void 0:t.debug("an unexpected error occurred while calling xhr setRequestHeader",e)})}i.apply(this,[e,t])}}},e}(),In=new Cn}}),jn=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/campaign/campaign-parser.js"(){Ne(),hr(),De(),An=function(){function e(){}return e.prototype.parse=function(){return v(this,void 0,void 0,function(){return m(this,function(e){return[2,t(t(t(t({},G),this.getUtmParam()),this.getReferrer()),this.getClickIds())]})})},e.prototype.getUtmParam=function(){var e=Rt();return{utm_campaign:e[P],utm_content:e[_],utm_id:e[M],utm_medium:e[N],utm_source:e[L],utm_term:e[D]}},e.prototype.getReferrer=function(){var e,t,r={referrer:void 0,referring_domain:void 0};try{r.referrer=document.referrer||void 0,r.referring_domain=null!==(t=null===(e=r.referrer)||void 0===e?void 0:e.split("/")[2])&&void 0!==t?t:void 0}catch(e){}return r},e.prototype.getClickIds=function(){var e,t=Rt();return(e={})[U]=t[U],e[F]=t[F],e[j]=t[j],e[B]=t[B],e[q]=t[q],e[z]=t[z],e[W]=t[W],e[V]=t[V],e[$]=t[$],e[H]=t[H],e[K]=t[K],e},e}()}}),Bn=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/plugins/helpers.js"(){Ne(),Rn="data-amp-mask",Pn="*****",_n=/\b(?:\d[ -]*?){13,16}\b/,Mn=/(\d{3}-?\d{2}-?\d{4})/g,Nn=/[^\s@]+@[^\s@.]+\.[^\s@]+/g,Ln=function(e,t){var r,n;if(void 0===t&&(t=[]),"string"!=typeof e)return"";var i=e;i=(i=(i=i.replace(_n,Pn)).replace(Mn,Pn)).replace(Nn,Pn);try{for(var o=y(t),s=o.next();!s.done;s=o.next()){var a=s.value;try{i=i.replace(a,Pn)}catch(e){}}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return i},Dn=function(e){if("undefined"==typeof document||!document.title)return"";var t=document.querySelector("title");return t&&t.hasAttribute(Rn)?Pn:e?e(document.title):document.title}}}),qn=u({"../../../../node_modules/zen-observable/lib/Observable.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Observable=void 0;var t=e=>Boolean(Symbol[e]),r=e=>t(e)?Symbol[e]:"@@"+e,n=r("iterator"),i=r("observable"),o=r("species");function s(e,t){let r=e[t];if(null!=r){if("function"!=typeof r)throw new TypeError(r+" is not a function");return r}}function a(e){let t=e.constructor;return void 0!==t&&(t=t[o],null===t&&(t=void 0)),void 0!==t?t:g}function l(e){l.log?l.log(e):setTimeout(()=>{throw e})}function u(e){Promise.resolve().then(()=>{try{e()}catch(e){l(e)}})}function c(e){let t=e._cleanup;if(void 0!==t&&(e._cleanup=void 0,t))try{if("function"==typeof t)t();else{let e=s(t,"unsubscribe");e&&e.call(t)}}catch(e){l(e)}}function d(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function h(e,t,r){e._state="running";let n=e._observer;try{let i=s(n,t);switch(t){case"next":i&&i.call(n,r);break;case"error":if(d(e),!i)throw r;i.call(n,r);break;case"complete":d(e),i&&i.call(n)}}catch(e){l(e)}"closed"===e._state?c(e):"running"===e._state&&(e._state="ready")}function p(e,t,r){if("closed"!==e._state){if("buffering"!==e._state)return"ready"!==e._state?(e._state="buffering",e._queue=[{type:t,value:r}],void u(()=>function(e){let t=e._queue;if(t){e._queue=void 0,e._state="ready";for(let r=0;r<t.length&&(h(e,t[r].type,t[r].value),"closed"!==e._state);++r);}}(e))):void h(e,t,r);e._queue.push({type:t,value:r})}}var f=class{constructor(e,t){this._cleanup=void 0,this._observer=e,this._queue=void 0,this._state="initializing";let r=this,n={get closed(){return"closed"===r._state},next(e){p(r,"next",e)},error(e){p(r,"error",e)},complete(){p(r,"complete")}};try{this._cleanup=t.call(void 0,n)}catch(e){n.error(e)}"initializing"===this._state&&(this._state="ready")}get closed(){return"closed"===this._state}unsubscribe(){"closed"!==this._state&&(d(this),c(this))}},g=class e{constructor(t){if(!(this instanceof e))throw new TypeError("Observable cannot be called as a function");if("function"!=typeof t)throw new TypeError("Observable initializer must be a function");this._subscriber=t}subscribe(e){return"object"==typeof e&&null!==e||(e={next:e,error:arguments[1],complete:arguments[2]}),new f(e,this._subscriber)}forEach(e){return new Promise((t,r)=>{if("function"!=typeof e)return void r(new TypeError(e+" is not a function"));function n(){i.unsubscribe(),t()}let i=this.subscribe({next(t){try{e(t,n)}catch(e){r(e),i.unsubscribe()}},error:r,complete:t})})}map(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(a(this))(t=>this.subscribe({next(r){try{r=e(r)}catch(e){return t.error(e)}t.next(r)},error(e){t.error(e)},complete(){t.complete()}}))}filter(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(a(this))(t=>this.subscribe({next(r){try{if(!e(r))return}catch(e){return t.error(e)}t.next(r)},error(e){t.error(e)},complete(){t.complete()}}))}reduce(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");let t=a(this),r=arguments.length>1,n=!1,i=arguments[1];return new t(t=>this.subscribe({next(o){let s=!n;if(n=!0,!s||r)try{i=e(i,o)}catch(e){return t.error(e)}else i=o},error(e){t.error(e)},complete(){if(!n&&!r)return t.error(new TypeError("Cannot reduce an empty sequence"));t.next(i),t.complete()}}))}async all(){let e=[];return await this.forEach(t=>e.push(t)),e}concat(...e){let t=a(this);return new t(r=>{let n,i=0;return function o(s){n=s.subscribe({next(e){r.next(e)},error(e){r.error(e)},complete(){i===e.length?(n=void 0,r.complete()):o(t.from(e[i++]))}})}(this),()=>{n&&(n.unsubscribe(),n=void 0)}})}flatMap(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");let t=a(this);return new t(r=>{let n=[],i=this.subscribe({next(i){if(e)try{i=e(i)}catch(e){return r.error(e)}let s=t.from(i).subscribe({next(e){r.next(e)},error(e){r.error(e)},complete(){let e=n.indexOf(s);e>=0&&n.splice(e,1),o()}});n.push(s)},error(e){r.error(e)},complete(){o()}});function o(){i.closed&&0===n.length&&r.complete()}return()=>{n.forEach(e=>e.unsubscribe()),i.unsubscribe()}})}[i](){return this}static from(r){let o="function"==typeof this?this:e;if(null==r)throw new TypeError(r+" is not an object");let a=s(r,i);if(a){let e=a.call(r);if(Object(e)!==e)throw new TypeError(e+" is not an object");return function(e){return e instanceof g}(e)&&e.constructor===o?e:new o(t=>e.subscribe(t))}if(t("iterator")&&(a=s(r,n),a))return new o(e=>{u(()=>{if(!e.closed){for(let t of a.call(r))if(e.next(t),e.closed)return;e.complete()}})});if(Array.isArray(r))return new o(e=>{u(()=>{if(!e.closed){for(let t=0;t<r.length;++t)if(e.next(r[t]),e.closed)return;e.complete()}})});throw new TypeError(r+" is not observable")}static of(...t){return new("function"==typeof this?this:e)(e=>{u(()=>{if(!e.closed){for(let r=0;r<t.length;++r)if(e.next(t[r]),e.closed)return;e.complete()}})})}static get[o](){return this}};e.Observable=g,Object.defineProperty(g,Symbol("extensions"),{value:{symbol:i,hostReportError:l},configurable:!0})}}),zn=u({"../../../../node_modules/zen-observable/index.js"(e,t){t.exports=qn().Observable}});function Wn(e,t){return new Un.default(function(r){e.subscribe({next:function(e){t(e).then(function(e){return r.next(e)}).catch(function(e){return r.error(e)})},error:function(e){r.error(e)},complete:function(){r.complete()}})})}function Vn(e,t){return new Un.default(function(r){var n=!1,i=new Set,o=function(){var e,t;n=!0;try{for(var r=y(i),o=r.next();!o.done;o=r.next()){var s=o.value;try{s.unsubscribe()}catch(e){}}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}i.clear()},s=function(e){var t=e.subscribe({next:function(e){n||r.next(e)},error:function(e){n||(n=!0,r.error(e),o())},complete:function(){i.delete(t),n||0!==i.size||(r.complete(),o(),n=!0)}});i.add(t)};return s(e),s(t),o})}function $n(e){var t=new Set,r=null;function n(){null==r||r.unsubscribe(),r=null,t.clear()}return new Un.default(function(i){return t.add(i),null===r&&(r=e.subscribe({next:function(e){var r,n,i;try{for(var o=y(t),s=o.next();!s.done;s=o.next()){var a=s.value;null===(i=a.next)||void 0===i||i.call(a,e)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}},error:function(e){var r,i,o;try{for(var s=y(t),a=s.next();!a.done;a=s.next()){var l=a.value;null===(o=l.error)||void 0===o||o.call(l,e)}}catch(e){r={error:e}}finally{try{a&&!a.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}n()},complete:function(){var e,r,i;try{for(var o=y(t),s=o.next();!s.done;s=o.next()){var a=s.value;null===(i=a.complete)||void 0===i||i.call(a)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}n()}})),function(){t.delete(i),0===t.size&&r&&(r.unsubscribe(),r=null)}})}var Hn,Kn,Gn,Jn,Qn,Xn,Yn=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/utils/observable.js"(){Ne(),Un=h(zn())}}),Zn=u({"../../../../node_modules/safe-json-stringify/index.js"(e,t){var r=Object.prototype.hasOwnProperty;function n(e){return"[Throws: "+(e?e.message:"?")+"]"}function i(e){var t=[];return function e(i){if(null===i||"object"!=typeof i)return i;if(-1!==t.indexOf(i))return"[Circular]";if(t.push(i),"function"==typeof i.toJSON)try{var o=e(i.toJSON());return t.pop(),o}catch(e){return n(e)}if(Array.isArray(i)){var s=i.map(e);return t.pop(),s}var a=Object.keys(i).reduce(function(t,o){return t[o]=e(function(e,t){if(r.call(e,t))try{return e[t]}catch(e){return n(e)}return e[t]}(i,o)),t},{});return t.pop(),a}(e)}t.exports=function(e,t,r){return JSON.stringify(i(e),t,r)},t.exports.ensureProperties=i}}),ei=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/utils/safe-stringify.js"(){Hn=h(Zn()),Kn=Hn.default||Hn}}),ti=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/messenger/constants.js"(){Jn={US:Gn="https://app.amplitude.com",EU:"https://app.eu.amplitude.com",STAGING:"https://apps.stag2.amplitude.com"},Qn="https://cdn.amplitude.com/libs/background-capture-1.0.1.js.gz"}});var ri,ni,ii,oi,si=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/messenger/utils.js"(){Xn=function(e){return document.querySelector('script[src="'.concat(CSS.escape(e),'"]'))?Promise.resolve({status:!0}):new Promise(function(t,r){var n;try{var i=document.createElement("script");i.type="text/javascript",i.async=!0,i.src=e,i.addEventListener("load",function(){t({status:!0})},{once:!0}),i.addEventListener("error",function(){r({status:!1,message:"Failed to load the script ".concat(e)})}),null===(n=document.head)||void 0===n||n.appendChild(i)}catch(e){r(e)}})}}});function ai(e){var t,r=de(),n=null==r?void 0:r[ii];if("object"==typeof(t=n)&&null!==t&&ni in t&&!0===t[ni])return n;var i=new oi(e);return r&&(r[ii]=i),i}var li,ui=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/messenger/base-window-messenger.js"(){Ne(),ze(),ti(),si(),ni="__AMPLITUDE_MESSENGER_INSTANCE__",ii="__AMPLITUDE_MESSENGER__",oi=function(){function e(e){var t=(void 0===e?{}:e).origin,r=void 0===t?Gn:t;this[ri]=!0,this.isSetup=!1,this.messageHandler=null,this.requestCallbacks={},this.actionHandlers=new Map,this.pendingMessages=new Map,this.scriptLoadPromises=new Map,this.endpoint=r}return e.prototype.notify=function(e){var t,r,n,i;null===(r=null===(t=this.logger)||void 0===t?void 0:t.debug)||void 0===r||r.call(t,"Message sent: ",JSON.stringify(e)),null===(i=null===(n=window.opener)||void 0===n?void 0:n.postMessage)||void 0===i||i.call(n,e,this.endpoint)},e.prototype.sendRequest=function(e,t,r){var n=this;void 0===r&&(r={timeout:15e3});var i="".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9)),o={id:i,action:e,args:t};return new Promise(function(t,s){n.requestCallbacks[i]={resolve:t,reject:s},n.notify(o),r.timeout>0&&setTimeout(function(){s(new Error("".concat(e," timed out (id: ").concat(i,")"))),delete n.requestCallbacks[i]},r.timeout)})},e.prototype.handleResponse=function(e){var t;this.requestCallbacks[e.id]?(this.requestCallbacks[e.id].resolve(e.responseData),delete this.requestCallbacks[e.id]):null===(t=this.logger)||void 0===t||t.warn("No callback found for request id: ".concat(e.id))},e.prototype.registerActionHandler=function(e,t){var r,n,i,o;this.actionHandlers.has(e)&&(null===(o=null===(i=this.logger)||void 0===i?void 0:i.warn)||void 0===o||o.call(i,"Overwriting existing action handler for: ".concat(e))),this.actionHandlers.set(e,t);var s=this.pendingMessages.get(e);if(s){this.pendingMessages.delete(e);try{for(var a=y(s),l=a.next();!l.done;l=a.next()){t(l.value)}}catch(e){r={error:e}}finally{try{l&&!l.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}}},e.prototype.loadScriptOnce=function(e){return v(this,void 0,void 0,function(){var t,r,n;return m(this,function(i){switch(i.label){case 0:if(t=this.scriptLoadPromises.get(e))return[2,t];r=Xn(e).then(function(){}),this.scriptLoadPromises.set(e,r),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,r];case 2:return i.sent(),[3,4];case 3:throw n=i.sent(),this.scriptLoadPromises.delete(e),n;case 4:return[2]}})})},e.prototype.setup=function(e){var t,r,n=this,i=void 0===e?{}:e,o=i.logger,s=i.endpoint;o&&(this.logger=o),s&&this.endpoint===Gn&&(this.endpoint=s),this.isSetup||(this.isSetup=!0,null===(r=null===(t=this.logger)||void 0===t?void 0:t.debug)||void 0===r||r.call(t,"Setting up messenger"),this.messageHandler=function(e){var t,r,i,o,s;if(null===(r=null===(t=n.logger)||void 0===t?void 0:t.debug)||void 0===r||r.call(t,"Message received: ",JSON.stringify(e)),n.endpoint===e.origin){var a=e.data,l=null==a?void 0:a.action;if(l)if("id"in a&&a.id)null===(o=null===(i=n.logger)||void 0===i?void 0:i.debug)||void 0===o||o.call(i,"Received Response to previous request: ",JSON.stringify(e)),n.handleResponse(a);else{if("ping"===l)return void n.notify({action:"pong"});var u=n.actionHandlers.get(l);if(u)u(a.data);else{var c=null!==(s=n.pendingMessages.get(l))&&void 0!==s?s:[];c.push(a.data),n.pendingMessages.set(l,c)}}}},window.addEventListener("message",this.messageHandler),this.notify({action:"page-loaded"}))},e.prototype.destroy=function(){this.messageHandler&&(window.removeEventListener("message",this.messageHandler),this.messageHandler=null),this.isSetup=!1,this.actionHandlers.clear(),this.pendingMessages.clear(),this.requestCallbacks={},this.scriptLoadPromises.clear();var e=de();(null==e?void 0:e[ii])===this&&delete e[ii]},e}(),ri=ni}});function ci(e,t){var r,n=e;if(!0!==n[li]){n[li]=!0;var i=null!==(r=null==t?void 0:t.scriptUrl)&&void 0!==r?r:Qn,o=null,s=function(t,r){var n,i;"background-capture-complete"===t&&(null===(i=null===(n=e.logger)||void 0===n?void 0:n.debug)||void 0===i||i.call(n,"Background capture complete"),e.notify({action:"background-capture-complete",data:r}))};e.registerActionHandler("initialize-background-capture",function(){var t,r;null===(r=null===(t=e.logger)||void 0===t?void 0:t.debug)||void 0===r||r.call(t,"Initializing background capture (external script)");var n=new URL(i,e.endpoint).toString();e.loadScriptOnce(n).then(function(){var t,r,n;null===(r=null===(t=e.logger)||void 0===t?void 0:t.debug)||void 0===r||r.call(t,"Background capture script loaded (external)"),o=null===(n=null===window||void 0===window?void 0:window.amplitudeBackgroundCapture)||void 0===n?void 0:n.call(window,{messenger:e,onBackgroundCapture:s}),e.notify({action:"background-capture-loaded"})}).catch(function(){var t;null===(t=e.logger)||void 0===t||t.warn("Failed to initialize background capture")})}),e.registerActionHandler("close-background-capture",function(){var e;null===(e=null==o?void 0:o.close)||void 0===e||e.call(o),o=null})}}var di,hi=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/messenger/background-capture.js"(){ti(),li="__AMPLITUDE_BACKGROUND_CAPTURE__"}}),pi=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/types/config/browser-config.js"(){di={always:"always",ifEmptyCampaign:"ifEmptyCampaign"}}});var fi,gi,vi,mi,yi,bi,wi,Si,ki,xi,Ei,Ci,Ii,Oi,Ti,Ai,Ri=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/utils/environment.js"(){ze()}}),Pi=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/index.js"(){Ke(),Fe(),Ge(),bt(),lr(),Ye(),Xe(),ze(),ar(),ur(),cr(),dr(),hr(),He(),ut(),We(),$e(),pr(),fr(),gr(),vr(),mr(),yr(),br(),kr(),xr(),Er(),Dr(),Fr(),Qe(),De(),tn(),Le(),rn(),nn(),on(),sn(),Be(),Fn(),De(),De(),jn(),Bn(),Yn(),ei(),ui(),hi(),ti(),pi(),Ri()}});function _i(e){wi=e(wi)}function Mi(e){return(vi||(vi=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(Si(this),t),Li(this.request)}:function(...t){return Li(e.apply(Si(this),t))}}function Ni(e){return"function"==typeof e?Mi(e):(e instanceof IDBTransaction&&function(e){if(mi.has(e))return;const t=new Promise((t,r)=>{const n=()=>{e.removeEventListener("complete",i),e.removeEventListener("error",o),e.removeEventListener("abort",o)},i=()=>{t(),n()},o=()=>{r(e.error||new DOMException("AbortError","AbortError")),n()};e.addEventListener("complete",i),e.addEventListener("error",o),e.addEventListener("abort",o)});mi.set(e,t)}(e),fi(e,gi||(gi=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,wi):e)}function Li(e){if(e instanceof IDBRequest)return function(e){const t=new Promise((t,r)=>{const n=()=>{e.removeEventListener("success",i),e.removeEventListener("error",o)},i=()=>{t(Li(e.result)),n()},o=()=>{r(e.error),n()};e.addEventListener("success",i),e.addEventListener("error",o)});return bi.set(t,e),t}(e);if(yi.has(e))return yi.get(e);const t=Ni(e);return t!==e&&(yi.set(e,t),bi.set(t,e)),t}function Di(e,t,{blocked:r,upgrade:n,blocking:i,terminated:o}={}){const s=indexedDB.open(e,t),a=Li(s);return n&&s.addEventListener("upgradeneeded",e=>{n(Li(s.result),e.oldVersion,e.newVersion,Li(s.transaction),e)}),r&&s.addEventListener("blocked",e=>r(e.oldVersion,e.newVersion,e)),a.then(e=>{o&&e.addEventListener("close",()=>o()),i&&e.addEventListener("versionchange",e=>i(e.oldVersion,e.newVersion,e))}).catch(()=>{}),a}function Ui(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(Ei.get(t))return Ei.get(t);const r=t.replace(/FromIndex$/,""),n=t!==r,i=xi.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!i&&!ki.includes(r))return;const o=async function(e,...t){const o=this.transaction(e,i?"readwrite":"readonly");let s=o.store;return n&&(s=s.index(t.shift())),(await Promise.all([s[r](...t),i&&o.done]))[0]};return Ei.set(t,o),o}async function*Fi(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;const r=new Proxy(t,Ai);for(Ti.set(r,t),bi.set(r,Si(t));t;)yield r,t=await(Oi.get(r)||t.continue()),Oi.delete(r)}function ji(e,t){return t===Symbol.asyncIterator&&fi(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===t&&fi(e,[IDBIndex,IDBObjectStore])}var Bi,qi,zi,Wi,Vi,$i,Hi,Ki,Gi,Ji,Qi,Xi,Yi,Zi,eo,to,ro,no,io,oo,so,ao,lo,uo,co,ho,po,fo,go,vo,mo,yo,bo,wo,So,ko,xo,Eo,Co,Io,Oo,To,Ao,Ro,Po,_o,Mo,No,Lo,Do,Uo,Fo,jo,Bo,qo,zo,Wo,Vo=l({"../../../../node_modules/idb/build/index.js"(){fi=(e,t)=>t.some(t=>e instanceof t),mi=new WeakMap,yi=new WeakMap,bi=new WeakMap,wi={get(e,t,r){if(e instanceof IDBTransaction){if("done"===t)return mi.get(e);if("store"===t)return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return Li(e[t])},set:(e,t,r)=>(e[t]=r,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e},Si=e=>bi.get(e),ki=["get","getKey","getAll","getAllKeys","count"],xi=["put","add","delete","clear"],Ei=new Map,_i(e=>({...e,get:(t,r,n)=>Ui(t,r)||e.get(t,r,n),has:(t,r)=>!!Ui(t,r)||e.has(t,r)})),Ci=["continue","continuePrimaryKey","advance"],Ii={},Oi=new WeakMap,Ti=new WeakMap,Ai={get(e,t){if(!Ci.includes(t))return e[t];let r=Ii[t];return r||(r=Ii[t]=function(...e){Oi.set(this,Ti.get(this)[t](...e))}),r}},_i(e=>({...e,get:(t,r,n)=>ji(t,r)?Fi:e.get(t,r,n),has:(t,r)=>ji(t,r)||e.has(t,r)}))}});function $o(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})}function Ho(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(l){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}function Ko(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}var Go,Jo,Qo,Xo,Yo=l({"../../../../node_modules/@amplitude/targeting/node_modules/@amplitude/experiment-core/dist/experiment-core.esm.js"(){Bi=function(e,t){return(Bi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},qi=function(){return qi=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},qi.apply(this,arguments)},zi={IS:"is",IS_NOT:"is not",CONTAINS:"contains",DOES_NOT_CONTAIN:"does not contain",LESS_THAN:"less",LESS_THAN_EQUALS:"less or equal",GREATER_THAN:"greater",GREATER_THAN_EQUALS:"greater or equal",VERSION_LESS_THAN:"version less",VERSION_LESS_THAN_EQUALS:"version less or equal",VERSION_GREATER_THAN:"version greater",VERSION_GREATER_THAN_EQUALS:"version greater or equal",SET_IS:"set is",SET_IS_NOT:"set is not",SET_CONTAINS:"set contains",SET_DOES_NOT_CONTAIN:"set does not contain",SET_CONTAINS_ANY:"set contains any",SET_DOES_NOT_CONTAIN_ANY:"set does not contain any",REGEX_MATCH:"regex match",REGEX_DOES_NOT_MATCH:"regex does not match"},Wi=function(e){for(var t=[],r=0,n=0;n<e.length;n++){var i=e.charCodeAt(n);i<128?t[r++]=i:i<2048?(t[r++]=i>>6|192,t[r++]=63&i|128):55296==(64512&i)&&n+1<e.length&&56320==(64512&e.charCodeAt(n+1))?(i=65536+((1023&i)<<10)+(1023&e.charCodeAt(++n)),t[r++]=i>>18|240,t[r++]=i>>12&63|128,t[r++]=i>>6&63|128,t[r++]=63&i|128):(t[r++]=i>>12|224,t[r++]=i>>6&63|128,t[r++]=63&i|128)}return Uint8Array.from(t)},Vi=-862048943,$i=461845907,Hi=function(e,t){void 0===t&&(t=0);for(var r=Wi(e),n=r.length,i=n>>2,o=t,s=0;s<i;s++){var a=Qi(r,s<<2);o=Ki(a,o)}var l=i<<2,u=0;switch(n-l){case 3:u^=r[l+2]<<16,u^=r[l+1]<<8,u^=r[l],u=Math.imul(u,Vi),u=Ji(u,15),o^=u=Math.imul(u,$i);break;case 2:u^=r[l+1]<<8,u^=r[l],u=Math.imul(u,Vi),u=Ji(u,15),o^=u=Math.imul(u,$i);break;case 1:u^=r[l],u=Math.imul(u,Vi),u=Ji(u,15),o^=u=Math.imul(u,$i)}return Gi(o^=n)>>>0},Ki=function(e,t){var r=e,n=t;return r=Math.imul(r,Vi),r=Ji(r,15),r=Math.imul(r,$i),n=Ji(n^=r,13),(n=Math.imul(n,5))+-430675100|0},Gi=function(e){var t=e;return t^=t>>>16,t=Math.imul(t,-2048144789),t^=t>>>13,t=Math.imul(t,-1028477387),t^=t>>>16},Ji=function(e,t,r){return void 0===r&&(r=32),t>r&&(t%=r),(e<<t|(e&4294967295<<r-t>>>0)>>>0>>>r-t>>>0)>>>0},Qi=function(e,t){void 0===t&&(t=0);var r=e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3];return Xi(r)},Xi=function(e){return(-16777216&e)>>>24|(16711680&e)>>>8|(65280&e)<<8|(255&e)<<24},Yi=function(e,t){var r,n;if(t&&0!==t.length){try{for(var i=Ko(t),o=i.next();!o.done;o=i.next()){var s=o.value;if(!s||!e||"object"!=typeof e)return;e=e[s]}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return e||void 0}},Zi="^".concat("(\\d+)\\.(\\d+)","(\\.").concat("(\\d+)").concat("(-(([-\\w]+\\.?)*))?",")?$"),eo=function(){function e(e,t,r,n){void 0===n&&(n=void 0),this.major=e,this.minor=t,this.patch=r,this.preRelease=n}return e.parse=function(t){if(t){var r=new RegExp(Zi).exec(t);if(r){var n=Number(r[1]),i=Number(r[2]);if(!isNaN(n)&&!isNaN(i))return new e(n,i,Number(r[4])||0,r[5]||void 0)}}},e.prototype.compareTo=function(e){return this.major>e.major?1:this.major<e.major?-1:this.minor>e.minor?1:this.minor<e.minor?-1:this.patch>e.patch?1:this.patch<e.patch||this.preRelease&&!e.preRelease?-1:!this.preRelease&&e.preRelease?1:this.preRelease&&e.preRelease?this.preRelease>e.preRelease?1:this.preRelease<e.preRelease?-1:0:0},e}(),to=function(){function e(){}return e.prototype.evaluate=function(e,t){var r,n,i={},o={context:e,result:i};try{for(var s=Ko(t),a=s.next();!a.done;a=s.next()){var l=a.value,u=this.evaluateFlag(o,l);u&&(i[l.key]=u)}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return i},e.prototype.evaluateFlag=function(e,t){var r,n,i;try{for(var o=Ko(t.segments),s=o.next();!s.done;s=o.next()){var a=s.value;if(i=this.evaluateSegment(e,t,a)){var l=qi(qi(qi({},t.metadata),a.metadata),i.metadata);i=qi(qi({},i),{metadata:l});break}}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return i},e.prototype.evaluateSegment=function(e,t,r){var n,i,o,s;if(!r.conditions)return void 0!==(u=this.bucket(e,r))?t.variants[u]:void 0;try{for(var a=Ko(r.conditions),l=a.next();!l.done;l=a.next()){var u,c=l.value,d=!0;try{for(var h=(o=void 0,Ko(c)),p=h.next();!p.done;p=h.next()){var f=p.value;if(!(d=this.matchCondition(e,f)))break}}catch(e){o={error:e}}finally{try{p&&!p.done&&(s=h.return)&&s.call(h)}finally{if(o)throw o.error}}if(d)return void 0!==(u=this.bucket(e,r))?t.variants[u]:void 0}}catch(e){n={error:e}}finally{try{l&&!l.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}},e.prototype.matchCondition=function(e,t){var r=Yi(e,t.selector);if(r){if(this.isSetOperator(t.op)){var n=this.coerceStringArray(r);return!!n&&this.matchSet(n,t.op,t.values)}var i=this.coerceString(r);return void 0!==i&&this.matchString(i,t.op,t.values)}return this.matchNull(t.op,t.values)},e.prototype.getHash=function(e){return Hi(e)},e.prototype.bucket=function(e,t){var r,n,i,o;if(!t.bucket)return t.variant;var s=this.coerceString(Yi(e,t.bucket.selector));if(!s||0===s.length)return t.variant;var a="".concat(t.bucket.salt,"/").concat(s),l=this.getHash(a),u=l%100,c=Math.floor(l/100);try{for(var d=Ko(t.bucket.allocations),h=d.next();!h.done;h=d.next()){var p=h.value,f=p.range[0],g=p.range[1];if(u>=f&&u<g)try{for(var v=(i=void 0,Ko(p.distributions)),m=v.next();!m.done;m=v.next()){var y=m.value,b=y.range[0],w=y.range[1];if(c>=b&&c<w)return y.variant}}catch(e){i={error:e}}finally{try{m&&!m.done&&(o=v.return)&&o.call(v)}finally{if(i)throw i.error}}}}catch(e){r={error:e}}finally{try{h&&!h.done&&(n=d.return)&&n.call(d)}finally{if(r)throw r.error}}return t.variant},e.prototype.matchNull=function(e,t){var r=this.containsNone(t);switch(e){case zi.IS:case zi.CONTAINS:case zi.LESS_THAN:case zi.LESS_THAN_EQUALS:case zi.GREATER_THAN:case zi.GREATER_THAN_EQUALS:case zi.VERSION_LESS_THAN:case zi.VERSION_LESS_THAN_EQUALS:case zi.VERSION_GREATER_THAN:case zi.VERSION_GREATER_THAN_EQUALS:case zi.SET_IS:case zi.SET_CONTAINS:case zi.SET_CONTAINS_ANY:return r;case zi.IS_NOT:case zi.DOES_NOT_CONTAIN:case zi.SET_DOES_NOT_CONTAIN:case zi.SET_DOES_NOT_CONTAIN_ANY:return!r;default:return!1}},e.prototype.matchSet=function(e,t,r){switch(t){case zi.SET_IS:return this.setEquals(e,r);case zi.SET_IS_NOT:return!this.setEquals(e,r);case zi.SET_CONTAINS:return this.matchesSetContainsAll(e,r);case zi.SET_DOES_NOT_CONTAIN:return!this.matchesSetContainsAll(e,r);case zi.SET_CONTAINS_ANY:return this.matchesSetContainsAny(e,r);case zi.SET_DOES_NOT_CONTAIN_ANY:return!this.matchesSetContainsAny(e,r);default:return!1}},e.prototype.matchString=function(e,t,r){var n=this;switch(t){case zi.IS:return this.matchesIs(e,r);case zi.IS_NOT:return!this.matchesIs(e,r);case zi.CONTAINS:return this.matchesContains(e,r);case zi.DOES_NOT_CONTAIN:return!this.matchesContains(e,r);case zi.LESS_THAN:case zi.LESS_THAN_EQUALS:case zi.GREATER_THAN:case zi.GREATER_THAN_EQUALS:return this.matchesComparable(e,t,r,function(e){return n.parseNumber(e)},this.comparator);case zi.VERSION_LESS_THAN:case zi.VERSION_LESS_THAN_EQUALS:case zi.VERSION_GREATER_THAN:case zi.VERSION_GREATER_THAN_EQUALS:return this.matchesComparable(e,t,r,function(e){return eo.parse(e)},this.versionComparator);case zi.REGEX_MATCH:return this.matchesRegex(e,r);case zi.REGEX_DOES_NOT_MATCH:return!this.matchesRegex(e,r);default:return!1}},e.prototype.matchesIs=function(e,t){if(this.containsBooleans(t)){var r=e.toLowerCase();if("true"===r||"false"===r)return t.some(function(e){return e.toLowerCase()===r})}return t.some(function(t){return e===t})},e.prototype.matchesContains=function(e,t){var r,n;try{for(var i=Ko(t),o=i.next();!o.done;o=i.next()){var s=o.value;if(e.toLowerCase().includes(s.toLowerCase()))return!0}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return!1},e.prototype.matchesComparable=function(e,t,r,n,i){var o=this,s=n(e),a=r.map(function(e){return n(e)}).filter(function(e){return void 0!==e});return void 0===s||0===a.length?r.some(function(r){return o.comparator(e,t,r)}):a.some(function(e){return i(s,t,e)})},e.prototype.comparator=function(e,t,r){switch(t){case zi.LESS_THAN:case zi.VERSION_LESS_THAN:return e<r;case zi.LESS_THAN_EQUALS:case zi.VERSION_LESS_THAN_EQUALS:return e<=r;case zi.GREATER_THAN:case zi.VERSION_GREATER_THAN:return e>r;case zi.GREATER_THAN_EQUALS:case zi.VERSION_GREATER_THAN_EQUALS:return e>=r;default:return!1}},e.prototype.versionComparator=function(e,t,r){var n=e.compareTo(r);switch(t){case zi.LESS_THAN:case zi.VERSION_LESS_THAN:return n<0;case zi.LESS_THAN_EQUALS:case zi.VERSION_LESS_THAN_EQUALS:return n<=0;case zi.GREATER_THAN:case zi.VERSION_GREATER_THAN:return n>0;case zi.GREATER_THAN_EQUALS:case zi.VERSION_GREATER_THAN_EQUALS:return n>=0;default:return!1}},e.prototype.matchesRegex=function(e,t){return t.some(function(t){return Boolean(new RegExp(t).exec(e))})},e.prototype.containsNone=function(e){return e.some(function(e){return"(none)"===e})},e.prototype.containsBooleans=function(e){return e.some(function(e){switch(e.toLowerCase()){case"true":case"false":return!0;default:return!1}})},e.prototype.parseNumber=function(e){var t;return null!==(t=Number(e))&&void 0!==t?t:void 0},e.prototype.coerceString=function(e){if(e)return"object"==typeof e?JSON.stringify(e):String(e)},e.prototype.coerceStringArray=function(e){var t=this;if(Array.isArray(e))return e.map(function(e){return t.coerceString(e)}).filter(Boolean);var r=String(e);try{var n=JSON.parse(r);return Array.isArray(n)?e.map(function(e){return t.coerceString(e)}).filter(Boolean):void 0}catch(e){return}},e.prototype.isSetOperator=function(e){switch(e){case zi.SET_IS:case zi.SET_IS_NOT:case zi.SET_CONTAINS:case zi.SET_DOES_NOT_CONTAIN:case zi.SET_CONTAINS_ANY:case zi.SET_DOES_NOT_CONTAIN_ANY:return!0;default:return!1}},e.prototype.setEquals=function(e,t){var r=new Set(e),n=new Set(t);return r.size===n.size&&function(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}([],function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}(n),!1).every(function(e){return r.has(e)})},e.prototype.matchesSetContainsAll=function(e,t){var r,n;if(e.length<t.length)return!1;try{for(var i=Ko(t),o=i.next();!o.done;o=i.next()){var s=o.value;if(!this.matchesIs(s,e))return!1}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return!0},e.prototype.matchesSetContainsAny=function(e,t){var r,n;try{for(var i=Ko(t),o=i.next();!o.done;o=i.next()){var s=o.value;if(this.matchesIs(s,e))return!0}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return!1},e}(),no=ro="3.7.5",io="function"==typeof atob,oo="function"==typeof btoa,so="function"==typeof Buffer,ao="function"==typeof TextDecoder?new TextDecoder:void 0,lo="function"==typeof TextEncoder?new TextEncoder:void 0,uo=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),co=(e=>{let t={};return e.forEach((e,r)=>t[e]=r),t})(uo),ho=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,po=String.fromCharCode.bind(String),fo="function"==typeof Uint8Array.from?Uint8Array.from.bind(Uint8Array):e=>new Uint8Array(Array.prototype.slice.call(e,0)),go=e=>e.replace(/=/g,"").replace(/[+\/]/g,e=>"+"==e?"-":"_"),vo=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),mo=e=>{let t,r,n,i,o="";const s=e.length%3;for(let s=0;s<e.length;){if((r=e.charCodeAt(s++))>255||(n=e.charCodeAt(s++))>255||(i=e.charCodeAt(s++))>255)throw new TypeError("invalid character found");t=r<<16|n<<8|i,o+=uo[t>>18&63]+uo[t>>12&63]+uo[t>>6&63]+uo[63&t]}return s?o.slice(0,s-3)+"===".substring(s):o},bo=so?e=>Buffer.from(e).toString("base64"):e=>{let t=[];for(let r=0,n=e.length;r<n;r+=4096)t.push(po.apply(null,e.subarray(r,r+4096)));return yo(t.join(""))},So=e=>{if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?po(192|t>>>6)+po(128|63&t):po(224|t>>>12&15)+po(128|t>>>6&63)+po(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return po(240|t>>>18&7)+po(128|t>>>12&63)+po(128|t>>>6&63)+po(128|63&t)},ko=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,Eo=so?e=>Buffer.from(e,"utf8").toString("base64"):lo?e=>bo(lo.encode(e)):e=>yo(xo(e)),Io=e=>Co(e,!0),Oo=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,To=e=>{switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return po((t>>>10)+55296)+po(56320+(1023&t));case 3:return po((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return po((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},Ro=e=>{if(e=e.replace(/\s+/g,""),!ho.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(3&e.length));let t,r,n,i="";for(let o=0;o<e.length;)t=co[e.charAt(o++)]<<18|co[e.charAt(o++)]<<12|(r=co[e.charAt(o++)])<<6|(n=co[e.charAt(o++)]),i+=64===r?po(t>>16&255):64===n?po(t>>16&255,t>>8&255):po(t>>16&255,t>>8&255,255&t);return i},_o=so?e=>fo(Buffer.from(e,"base64")):e=>fo(Po(e).split("").map(e=>e.charCodeAt(0))),Mo=e=>_o(Lo(e)),No=so?e=>Buffer.from(e,"base64").toString("utf8"):ao?e=>ao.decode(_o(e)):e=>Ao(Po(e)),Lo=e=>vo(e.replace(/[-_]/g,e=>"-"==e?"+":"/")),Uo=e=>({value:e,enumerable:!1,writable:!0,configurable:!0}),Fo=function(){const e=(e,t)=>Object.defineProperty(String.prototype,e,Uo(t));e("fromBase64",function(){return Do(this)}),e("toBase64",function(e){return Co(this,e)}),e("toBase64URI",function(){return Co(this,!0)}),e("toBase64URL",function(){return Co(this,!0)}),e("toUint8Array",function(){return Mo(this)})},jo=function(){const e=(e,t)=>Object.defineProperty(Uint8Array.prototype,e,Uo(t));e("toBase64",function(e){return wo(this,e)}),e("toBase64URI",function(){return wo(this,!0)}),e("toBase64URL",function(){return wo(this,!0)})},Bo=()=>{Fo(),jo()},qo={version:ro,VERSION:no,atob:Po=io?e=>atob(vo(e)):so?e=>Buffer.from(e,"base64").toString("binary"):Ro,atobPolyfill:Ro,btoa:yo=oo?e=>btoa(e):so?e=>Buffer.from(e,"binary").toString("base64"):mo,btoaPolyfill:mo,fromBase64:Do=e=>No(Lo(e)),toBase64:Co=(e,t=!1)=>t?go(Eo(e)):Eo(e),encode:Co,encodeURI:Io,encodeURL:Io,utob:xo=e=>e.replace(ko,So),btou:Ao=e=>e.replace(Oo,To),decode:Do,isValid:e=>{if("string"!=typeof e)return!1;const t=e.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(t)||!/[^\s0-9a-zA-Z\-_]/.test(t)},fromUint8Array:wo=(e,t=!1)=>t?go(bo(e)):bo(e),toUint8Array:Mo,extendString:Fo,extendUint8Array:jo,extendBuiltins:Bo},zo=function(e){function t(r,n){var i=e.call(this,n)||this;return i.statusCode=r,Object.setPrototypeOf(i,t.prototype),i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Bi(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}(t,e),t}(Error),function(){function e(e,t,r){this.deploymentKey=e,this.serverUrl=t,this.httpClient=r}return e.prototype.getVariants=function(e,t){return $o(this,void 0,void 0,function(){var r,n,i;return Ho(this,function(o){switch(o.label){case 0:return r=qo.encodeURL(JSON.stringify(e)),n={Authorization:"Api-Key ".concat(this.deploymentKey),"X-Amp-Exp-User":r},(null==t?void 0:t.flagKeys)&&(n["X-Amp-Exp-Flag-Keys"]=qo.encodeURL(JSON.stringify(t.flagKeys))),(null==t?void 0:t.trackingOption)&&(n["X-Amp-Exp-Track"]=t.trackingOption),[4,this.httpClient.request({requestUrl:"".concat(this.serverUrl,"/sdk/v2/vardata?v=0"),method:"GET",headers:n,timeoutMillis:null==t?void 0:t.timeoutMillis})];case 1:if(200!=(i=o.sent()).status)throw new zo(i.status,"Fetch error response: status=".concat(i.status));return[2,JSON.parse(i.body)]}})})},e}(),function(){function e(e,t,r){this.deploymentKey=e,this.serverUrl=t,this.httpClient=r}return e.prototype.getFlags=function(e){return $o(this,void 0,void 0,function(){var t,r;return Ho(this,function(n){switch(n.label){case 0:return t={Authorization:"Api-Key ".concat(this.deploymentKey)},(null==e?void 0:e.libraryName)&&(null==e?void 0:e.libraryVersion)&&(t["X-Amp-Exp-Library"]="".concat(e.libraryName,"/").concat(e.libraryVersion)),[4,this.httpClient.request({requestUrl:"".concat(this.serverUrl,"/sdk/v2/flags"),method:"GET",headers:t,timeoutMillis:null==e?void 0:e.timeoutMillis})];case 1:if(200!=(r=n.sent()).status)throw Error("Flags error response: status=".concat(r.status));return[2,JSON.parse(r.body).reduce(function(e,t){return e[t.key]=t,e},{})]}})})},e}(),Wo="undefined"!=typeof globalThis?globalThis:global||self,function(){function e(e,t){this.poller=void 0,this.action=e,this.ms=t}return e.prototype.start=function(){this.poller||(this.poller=Wo.setInterval(this.action,this.ms),this.action())},e.prototype.stop=function(){this.poller&&(Wo.clearInterval(this.poller),this.poller=void 0)},e}()}}),Zo=l({"../../../../node_modules/@amplitude/targeting/lib/esm/targeting-idb-store.js"(){Ne(),Vo(),Go=new(function(){return function(){var e=this;this.dbs={},this.createStore=function(t){return v(e,void 0,void 0,function(){return m(this,function(e){switch(e.label){case 0:return[4,Di(t,1,{upgrade:function(e){e.objectStoreNames.contains("eventTypesForSession")||e.createObjectStore("eventTypesForSession",{keyPath:"sessionId"})}})];case 1:return[2,e.sent()]}})})},this.openOrCreateDB=function(t){return v(e,void 0,void 0,function(){var e,r;return m(this,function(n){switch(n.label){case 0:return this.dbs&&this.dbs[t]?[2,this.dbs[t]]:(e="".concat(t.substring(0,10),"_amp_targeting"),[4,this.createStore(e)]);case 1:return r=n.sent(),this.dbs[t]=r,[2,r]}})})},this.updateEventListForSession=function(r){var n=r.sessionId,i=r.eventType,o=r.eventTime,s=r.loggerProvider,a=r.tx;return v(e,void 0,void 0,function(){var e,r,l,u,c,d,h;return m(this,function(p){switch(p.label){case 0:return p.trys.push([0,3,,4]),[4,a.store.get(n)];case 1:return e=p.sent(),r=e?e.eventTypes:{},l=r[i]||{},u=t(t({},r),((d={})[i]=t(t({},l),((h={})[o]={event_type:i},h)),d)),[4,a.store.put({sessionId:n,eventTypes:u})];case 2:return p.sent(),[2,u];case 3:return c=p.sent(),s.warn("Failed to store events for targeting ".concat(n,": ").concat(c)),[3,4];case 4:return[2,void 0]}})})},this.deleteOldSessionEventTypes=function(t){var r=t.currentSessionId,n=t.loggerProvider,i=t.tx;return v(e,void 0,void 0,function(){var e,t,o,s,a;return m(this,function(l){switch(l.label){case 0:return l.trys.push([0,6,,7]),[4,i.store.getAll()];case 1:e=l.sent(),t=0,l.label=2;case 2:return t<e.length?(o=e[t],s=Date.now()-o.sessionId,o.sessionId!==r&&s>1728e5?[4,i.store.delete(o.sessionId)]:[3,4]):[3,5];case 3:l.sent(),l.label=4;case 4:return t++,[3,2];case 5:return[3,7];case 6:return a=l.sent(),n.warn("Failed to clear old session events for targeting: ".concat(a)),[3,7];case 7:return[2]}})})},this.storeEventTypeForSession=function(t){var r=t.loggerProvider,n=t.sessionId,i=t.eventType,o=t.eventTime,s=t.apiKey;return v(e,void 0,void 0,function(){var e,t,a,l;return m(this,function(u){switch(u.label){case 0:return u.trys.push([0,5,,6]),[4,this.openOrCreateDB(s)];case 1:return e=u.sent(),(t=e.transaction("eventTypesForSession","readwrite"))?[4,this.updateEventListForSession({sessionId:n,tx:t,loggerProvider:r,eventType:i,eventTime:o})]:[2];case 2:return a=u.sent(),[4,this.deleteOldSessionEventTypes({currentSessionId:n,tx:t,loggerProvider:r})];case 3:return u.sent(),[4,t.done];case 4:return u.sent(),[2,a];case 5:return l=u.sent(),r.warn("Failed to store events for targeting ".concat(n,": ").concat(l)),[3,6];case 6:return[2,void 0]}})})}}}())}}),es=l({"../../../../node_modules/@amplitude/targeting/lib/esm/targeting.js"(){Ne(),Yo(),Zo(),Jo=function(){return function(){var e=this;this.evaluateTargeting=function(t){var r=t.apiKey,n=t.loggerProvider,i=t.event,o=t.sessionId,s=t.userProperties,a=t.deviceId,l=t.flag;return v(e,void 0,void 0,function(){var e,t,u,c;return m(this,function(d){switch(d.label){case 0:return i&&i.time?[4,Go.storeEventTypeForSession({loggerProvider:n,apiKey:r,sessionId:o,eventType:i.event_type,eventTime:i.time})]:[3,2];case 1:return t=d.sent(),[3,3];case 2:t=void 0,d.label=3;case 3:return u=(e=t)&&new Set(Object.keys(e)),c={session_id:o,event:i,event_types:u&&Array.from(u),user:{device_id:a,user_properties:s}},[2,this.evaluationEngine.evaluate(c,[l])]}})})},this.evaluationEngine=new to}}()}}),ts=l({"../../../../node_modules/@amplitude/targeting/lib/esm/targeting-factory.js"(){es(),Qo=function(){var e=new Jo;return{evaluateTargeting:e.evaluateTargeting.bind(e)}}()}}),rs={};c(rs,{evaluateTargeting:()=>Xo});var ns,is,os=l({"../../../../node_modules/@amplitude/targeting/lib/esm/index.js"(){ts(),Xo=Qo.evaluateTargeting}}),ss={};c(ss,{compressionScript:()=>ns,trackDestinationScript:()=>is});var as,ls,us,cs,ds,hs,ps,fs,gs,vs,ms,ys,bs,ws,Ss,ks,xs,Es,Cs,Is,Os,Ts,As,Rs,Ps,_s,Ms,Ns,Ls,Ds,Us,Fs,js,Bs,qs,zs,Ws,Vs,$s,Hs,Ks,Gs,Js,Qs,Xs,Ys,Zs,ea,ta,ra,na,ia,oa,sa,aa,la,ua,ca,da,ha,pa,fa,ga,va,ma,ya,ba,wa,Sa,ka,xa,Ea,Ca,Ia,Oa,Ta,Aa,Ra,Pa,_a,Ma,Na,La,Da,Ua,Fa,ja,Ba,qa,za,Wa,Va,$a,Ha,Ka,Ga,Ja,Qa,Xa,Ya,Za,el,tl,rl,nl,il,ol,sl,al,ll,ul,cl,dl,hl,pl,fl,gl,vl,ml,yl,bl,wl,Sl,kl,xl,El,Cl,Il,Ol,Tl,Al,Rl,Pl,_l,Ml,Nl,Ll,Dl,Ul,Fl,jl,Bl,ql,zl,Wl,Vl,$l,Hl,Kl,Gl,Jl,Ql,Xl,Yl,Zl,eu,tu,ru,nu,iu,ou,su,au,lu,uu,cu,du,hu,pu,fu,gu=l({"../../../../node_modules/@amplitude/session-replay-browser/lib/esm/worker/index.js"(){ns='var WebWorker=function(e){"use strict";onmessage=function(e){var s="string"==typeof e.data?JSON.parse(e.data):e.data,t=s.event,a=s.sessionId,n=t.type,r=t.timestamp,i=t.delay,o=t.data,d=null!=i?JSON.stringify({type:n,timestamp:r,delay:i,data:o}):JSON.stringify({type:n,timestamp:r,data:o});postMessage({compressedEvent:d,sessionId:a})};var s=onmessage;return e.compressionOnMessage=s,Object.defineProperty(e,"__esModule",{value:!0}),e}({});\n',is='var WebWorker=function(e){"use strict";var t,r=function(){return r=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var s in t=arguments[r])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},r.apply(this,arguments)};function n(e,t,r,n){return new(r||(r=Promise))(function(s,a){function o(e){try{c(n.next(e))}catch(e){a(e)}}function i(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(o,i)}c((n=n.apply(e,t||[])).next())})}function s(e,t){var r,n,s,a={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return o.next=i(0),o.throw=i(1),o.return=i(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function i(i){return function(c){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,i[0]&&(a=0)),a;)try{if(r=1,n&&(s=2&i[0]?n.return:i[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,i[1])).done)return s;switch(n=0,s&&(i=[2&i[0],s.value]),i[0]){case 0:case 1:s=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(s=a.trys,(s=s.length>0&&s[s.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!s||i[1]>s[0]&&i[1]<s[3])){a.label=i[1];break}if(6===i[0]&&a.label<s[1]){a.label=s[1],s=i;break}if(s&&a.label<s[2]){a.label=s[2],a.ops.push(i);break}s[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=s=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}"function"==typeof SuppressedError&&SuppressedError,function(e){e.US="US",e.EU="EU",e.STAGING="STAGING"}(t||(t={})),t.US;var a,o=/payload.*exceed/i;!function(e){e.GET_SR_PROPS="get-sr-props",e.DEBUG_INFO="debug-info",e.FETCH_REQUEST="fetch-request",e.METADATA="metadata",e.TARGETING_DECISION="targeting-decision",e.REPLAY_GATE_DECISION="replay-gate-decision"}(a||(a={}));var i="Network error occurred, event batch rejected";function c(e,t){return n(this,void 0,void 0,function(){var r,a,o,i,c,u,l,d,p,f,h,v,y,g,b=this;return s(this,function(m){switch(m.label){case 0:return m.trys.push([0,4,,5]),r=t.CompressionStream,a=new r("gzip"),o=a.writable.getWriter(),i=a.readable.getReader(),c=[],u=n(b,void 0,void 0,function(){var e,t,r;return s(this,function(n){switch(n.label){case 0:return[4,i.read()];case 1:if(e=n.sent(),t=e.done,r=e.value,t)return[3,3];c.push(r),n.label=2;case 2:return[3,0];case 3:return[2]}})}),[4,o.write((new TextEncoder).encode(e))];case 1:return m.sent(),[4,o.close()];case 2:return m.sent(),[4,u];case 3:m.sent(),l=c.reduce(function(e,t){return e+t.length},0),d=new Uint8Array(l),p=0;try{for(f=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(c),h=f.next();!h.done;h=f.next())v=h.value,d.set(v,p),p+=v.length}catch(e){y={error:e}}finally{try{h&&!h.done&&(g=f.return)&&g.call(f)}finally{if(y)throw y.error}}return[2,d];case 4:return m.sent(),[2,null];case 5:return[2]}})})}function u(e,t){var a,u,l,d,p,f,h;return n(this,void 0,void 0,function(){var n,v,y,g,b,m,S,w,T,E,R,k;return s(this,function(s){switch(s.label){case 0:return s.trys.push([0,10,,11]),"CompressionStream"in self?[4,c(e,self)]:[3,2];case 1:return v=s.sent(),[3,3];case 2:v=null,s.label=3;case 3:return n=v,y="".concat(null!==(u=null===(a=t.version)||void 0===a?void 0:a.type)&&void 0!==u?u:"standalone","/").concat(null!==(d=null===(l=t.version)||void 0===l?void 0:l.version)&&void 0!==d?d:t.sdkVersion),g=new URLSearchParams({device_id:t.deviceId,session_id:"".concat(t.sessionId),type:t.eventType}),b="".concat((x=t.serverZone,C=t.trackServerUrl,C||("STAGING"===x?"https://api-sr.stag2.amplitude.com/sessions/v2/track":"EU"===x?"https://api-sr.eu.amplitude.com/sessions/v2/track":"https://api-sr.amplitude.com/sessions/v2/track")),"?").concat(g.toString()),m=r({"Content-Type":"application/json",Accept:"*/*",Authorization:"Bearer ".concat(t.apiKey),"X-Client-Version":t.sdkVersion,"X-Client-Library":y,"X-Client-Url":t.currentUrl.substring(0,1e3),"X-Client-Sample-Rate":"".concat(t.sampleRate),"X-Sampling-Hash-Alg":"xxhash32"},n?{"Content-Encoding":"gzip"}:{}),S=n?n.byteLength:new Blob([e]).size,[4,fetch(b,{method:"POST",headers:m,body:null!=n?n:e,keepalive:S<=65536})];case 4:if(null===(w=s.sent()))return[2,{shouldRetry:!1,success:!1,message:"Unexpected error occurred"}];if(w.status>=200&&w.status<300)return T=Math.round(new Blob(t.events).size/1024),E=null!==(h=null===(f=null===(p=w.headers)||void 0===p?void 0:p.get)||void 0===f?void 0:f.call(p,"X-Session-Replay-Event-Skipped"))&&void 0!==h?h:null,[2,{shouldRetry:!1,success:!0,message:"Session replay event batch tracked successfully for session id ".concat(t.sessionId,", size of events: ").concat(T," KB"),skipCode:E}];if(413!==w.status)return[3,9];R="",s.label=5;case 5:return s.trys.push([5,7,,8]),[4,w.text()];case 6:return R=s.sent(),[3,8];case 7:return s.sent(),[3,8];case 8:return[2,{shouldRetry:!1,success:!1,message:i,payloadTooLarge:!0,isWaf:o.test(R)}];case 9:return w.status>=500||408===w.status||429===w.status||499===w.status?[2,{shouldRetry:!0,success:!1,message:"HTTP ".concat(w.status)}]:[2,{shouldRetry:!1,success:!1,message:i}];case 10:return k=s.sent(),[2,{shouldRetry:!1,success:!1,message:String(k)}];case 11:return[2]}var x,C})})}function l(e,t,r,a){var o;return n(this,void 0,void 0,function(){var n,i,c;return s(this,function(s){switch(s.label){case 0:n=1,s.label=1;case 1:return[4,u(t,r)];case 2:return(i=s.sent()).success?(postMessage({type:"log",id:e,message:i.message}),postMessage({type:"complete",id:e,skipCode:null!==(o=i.skipCode)&&void 0!==o?o:null}),[2]):i.payloadTooLarge&&a?(postMessage({type:"payload_too_large",id:e,isWaf:!0===i.isWaf}),[2]):a&&i.shouldRetry&&n<r.flushMaxRetries?[4,new Promise(function(e){return setTimeout(e,Math.random()*n*1e3)})]:[3,4];case 3:return s.sent(),n++,[3,5];case 4:return c=n>=r.flushMaxRetries?"Session replay event batch rejected due to exceeded retry count":i.message,postMessage({type:"warn",id:e,message:c}),postMessage({type:"complete",id:e}),[2];case 5:return[3,1];case 6:return[2]}})})}onmessage=function(e){return n(void 0,void 0,void 0,function(){var t,r,n,a,o,i,c;return s(this,function(s){switch(s.label){case 0:return t=e.data,r=t.type,n=t.id,a=t.payload,o=t.context,i=t.useRetry,"send"!==r?[3,2]:(c=JSON.stringify(a),[4,l(n,c,o,i)]);case 1:s.sent(),s.label=2;case 2:return[2]}})})};var d=onmessage;return e.trackDestinationOnMessage=d,Object.defineProperty(e,"__esModule",{value:!0}),e}({});\n'}}),vu={};function mu(e){if(bs[e])return bs[e];const t=function(e){var t,r;const n=null==(r=null==(t=null==globalThis?void 0:globalThis.Zone)?void 0:t.__symbol__)?void 0:r.call(t,e);return n&&globalThis[n]?globalThis[n]:void 0}(e)||globalThis[e],r=t.prototype,n=e in ms?ms[e]:void 0,i=Boolean(n&&n.every(e=>{var t,n;return Boolean(null==(n=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:n.toString().includes("[native code]"))})),o=e in ys?ys[e]:void 0,s=Boolean(o&&o.every(e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))}));if(i&&s)return bs[e]=t.prototype,t.prototype;try{const n=document.createElement("iframe");document.body.appendChild(n);const i=n.contentWindow;if(!i)return t.prototype;const o=i[e].prototype;return document.body.removeChild(n),o?bs[e]=o:r}catch(e){return r}}function yu(e,t,r){var n;const i=`${e}.${String(r)}`;if(ws[i])return ws[i].call(t);const o=mu(e),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(ws[i]=s,s.call(t)):t[r]}function bu(e,t,r){const n=`${e}.${String(r)}`;if(Ss[n])return Ss[n].bind(t);const i=mu(e)[r];return"function"!=typeof i?t[r]:(Ss[n]=i,i.bind(t))}function wu(e){return yu("Node",e,"childNodes")}function Su(e){return yu("Node",e,"parentNode")}function ku(e){return yu("Node",e,"parentElement")}function xu(e){return yu("Node",e,"textContent")}function Eu(e,t){return bu("Node",e,"contains")(t)}function Cu(e){return bu("Node",e,"getRootNode")()}function Iu(e){return e&&"host"in e?yu("ShadowRoot",e,"host"):null}function Ou(e){return e.styleSheets}function Tu(e){return e&&"shadowRoot"in e?yu("Element",e,"shadowRoot"):null}function Au(e,t){return yu("Element",e,"querySelector")(t)}function Ru(e,t){return yu("Element",e,"querySelectorAll")(t)}function Pu(){return mu("MutationObserver").constructor}function _u(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&_u(ks.parentNode(e),t,r);for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!!r&&_u(ks.parentNode(e),t,r)}function Mu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Nu(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if("function"==typeof t){var r=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}),r}function Lu(){if(Is)return Cs.exports;Is=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e}};return Cs.exports=t(),Cs.exports.createColors=t,Cs.exports}function Du(){if(Ps)return Rs;Ps=1;let e=Lu(),t=As;class r extends Error{constructor(e,t,n,i,o,s){super(e),this.name="CssSyntaxError",this.reason=e,o&&(this.file=o),i&&(this.source=i),s&&(this.plugin=s),void 0!==t&&void 0!==n&&("number"==typeof t?(this.line=t,this.column=n):(this.line=t.line,this.column=t.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,r)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(r){if(!this.source)return"";let n=this.source;null==r&&(r=e.isColorSupported),t&&r&&(n=t(n));let i,o,s=n.split(/\r?\n/),a=Math.max(this.line-3,0),l=Math.min(this.line+2,s.length),u=String(l).length;if(r){let{bold:t,gray:r,red:n}=e.createColors(!0);i=e=>t(n(e)),o=e=>r(e)}else i=o=e=>e;return s.slice(a,l).map((e,t)=>{let r=a+1+t,n=" "+(" "+r).slice(-u)+" | ";if(r===this.line){let t=o(n.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return i(">")+o(n)+e+"\n "+t+i("^")}return" "+o(n)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}return Rs=r,r.default=r,Rs}function Uu(){return Ms||(Ms=1,_s.isClean=Symbol("isClean"),_s.my=Symbol("my")),_s}function Fu(){if(Ls)return Ns;Ls=1;const e={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};class t{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name,n=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?r+=e.raws.afterName:n&&(r+=" "),e.nodes)this.block(e,r+n);else{let i=(e.raws.between||"")+(t?";":"");this.builder(r+n+i,e)}}beforeAfter(e,t){let r;r="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let n=e.parent,i=0;for(;n&&"root"!==n.type;)i+=1,n=n.parent;if(r.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<i;e++)r+=t}return r}block(e,t){let r,n=this.raw(e,"between","beforeOpen");this.builder(t+n+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),r=this.raw(e,"after")):r=this.raw(e,"after","emptyBody"),r&&this.builder(r),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let r=this.raw(e,"semicolon");for(let n=0;n<e.nodes.length;n++){let i=e.nodes[n],o=this.raw(i,"before");o&&this.builder(o),this.stringify(i,t!==n||r)}}comment(e){let t=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)}decl(e,t){let r=this.raw(e,"between","colon"),n=e.prop+r+this.rawValue(e,"value");e.important&&(n+=e.raws.important||" !important"),t&&(n+=";"),this.builder(n,e)}document(e){this.body(e)}raw(t,r,n){let i;if(n||(n=r),r&&(i=t.raws[r],void 0!==i))return i;let o=t.parent;if("before"===n){if(!o||"root"===o.type&&o.first===t)return"";if(o&&"document"===o.type)return""}if(!o)return e[n];let s=t.root();if(s.rawCache||(s.rawCache={}),void 0!==s.rawCache[n])return s.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(t,n);{let e="raw"+((a=n)[0].toUpperCase()+a.slice(1));this[e]?i=this[e](s,t):s.walk(e=>{if(i=e.raws[r],void 0!==i)return!1})}var a;return void 0===i&&(i=e[n]),s.rawCache[n]=i,i}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let r;return e.walkComments(e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),void 0===r?r=this.raw(t,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(e,t){let r;return e.walkDecls(e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),void 0===r?r=this.raw(t,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(e){let t;return e.walk(r=>{if(r.nodes&&(r.parent!==e||e.first!==r)&&void 0!==r.raws.before)return t=r.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(r=>{let n=r.parent;if(n&&n!==e&&n.parent&&n.parent===e&&void 0!==r.raws.before){let e=r.raws.before.split("\n");return t=e[e.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){let r=e[t],n=e.raws[t];return n&&n.value===r?n.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}}return Ns=t,t.default=t,Ns}function ju(){if(Us)return Ds;Us=1;let e=Fu();function t(t,r){new e(r).stringify(t)}return Ds=t,t.default=t,Ds}function Bu(){if(js)return Fs;js=1;let{isClean:e,my:t}=Uu(),r=Du(),n=Fu(),i=ju();function o(e,t){let r=new e.constructor;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if("proxyCache"===n)continue;let i=e[n],s=typeof i;"parent"===n&&"object"===s?t&&(r[n]=t):"source"===n?r[n]=i:Array.isArray(i)?r[n]=i.map(e=>o(e,r)):("object"===s&&null!==i&&(i=o(i)),r[n]=i)}return r}class s{constructor(r={}){this.raws={},this[e]=!1,this[t]=!0;for(let e in r)if("nodes"===e){this.nodes=[];for(let t of r[e])"function"==typeof t.clone?this.append(t.clone()):this.append(t)}else this[e]=r[e]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=o(this);for(let r in e)t[r]=e[r];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:r,start:n}=this.rangeBy(t);return this.source.input.error(e,{column:n.column,line:n.line},{column:r.column,line:r.line},t)}return new r(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markDirty(){if(this[e]){this[e]=!1;let t=this;for(;t=t.parent;)t[e]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){let n=(t=this.toString()).indexOf(e.word);-1!==n&&(r=this.positionInside(n,t))}return r}positionInside(e,t){let r=t||this.toString(),n=this.source.start.column,i=this.source.start.line;for(let t=0;t<e;t++)"\n"===r[t]?(n=1,i+=1):n+=1;return{column:n,line:i}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let n=this.toString(),i=n.indexOf(e.word);-1!==i&&(t=this.positionInside(i,n),r=this.positionInside(i+e.word.length,n))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return(new n).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let n of e)n===this?r=!0:r?(this.parent.insertAfter(t,n),t=n):this.parent.insertBefore(t,n);r||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let r={},n=null==t;t=t||new Map;let i=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let n=this[e];if(Array.isArray(n))r[e]=n.map(e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e);else if("object"==typeof n&&n.toJSON)r[e]=n.toJSON(null,t);else if("source"===e){let o=t.get(n.input);null==o&&(o=i,t.set(n.input,i),i++),r[e]={end:n.end,inputId:o,start:n.start}}else r[e]=n}return n&&(r.inputs=[...t.keys()].map(e=>e.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=i){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){let n={node:this};for(let e in r)n[e]=r[e];return e.warn(t,n)}get proxyOf(){return this}}return Fs=s,s.default=s,Fs}function qu(){if(qs)return Bs;qs=1;let e=Bu();class t extends e{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}}return Bs=t,t.default=t,Bs}function zu(){if(Ws)return zs;Ws=1;return zs={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(r=t)=>{let n="",i=r;for(;i--;)n+=e[Math.random()*e.length|0];return n}}}function Wu(){if($s)return Vs;$s=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=As,{existsSync:r,readFileSync:n}=As,{dirname:i,join:o}=As;class s{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,n=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=i(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new e(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t;let r=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+r)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let r=e.lastIndexOf(t.pop()),n=e.indexOf("*/",r);r>-1&&n>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,n)))}loadFile(e){if(this.root=i(e),r(e))return this.mapFile=e,n(e,"utf-8").toString().trim()}loadMap(r,n){if(!1===n)return!1;if(n){if("string"==typeof n)return n;if("function"!=typeof n){if(n instanceof e)return t.fromSourceMap(n).toString();if(n instanceof t)return n.toString();if(this.isMap(n))return JSON.stringify(n);throw new Error("Unsupported previous source map format: "+n.toString())}{let e=n(r);if(e){let t=this.loadFile(e);if(!t)throw new Error("Unable to load previous source map: "+e.toString());return t}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let e=this.annotation;return r&&(e=o(i(r),e)),this.loadFile(e)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return Vs=s,s.default=s,Vs}function Vu(){if(Ks)return Hs;Ks=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=As,{fileURLToPath:r,pathToFileURL:n}=As,{isAbsolute:i,resolve:o}=As,{nanoid:s}=zu(),a=As,l=Du(),u=Wu(),c=Symbol("fromOffsetCache"),d=Boolean(e&&t),h=Boolean(o&&i);class p{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||""===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!h||/^\w+:\/\//.test(t.from)||i(t.from)?this.file=t.from:this.file=o(t.from)),h&&d){let e=new u(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+s(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,i={}){let o,s,a;if(t&&"object"==typeof t){let e=t,n=r;if("number"==typeof e.offset){let n=this.fromOffset(e.offset);t=n.line,r=n.col}else t=e.line,r=e.column;if("number"==typeof n.offset){let e=this.fromOffset(n.offset);s=e.line,a=e.col}else s=n.line,a=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let u=this.origin(t,r,s,a);return o=u?new l(e,void 0===u.endLine?u.line:{column:u.column,line:u.line},void 0===u.endLine?u.column:{column:u.endColumn,line:u.endLine},u.source,u.file,i.plugin):new l(e,void 0===s?t:{column:r,line:t},void 0===s?r:{column:a,line:s},this.css,this.file,i.plugin),o.input={column:r,endColumn:a,endLine:s,line:t,source:this.css},this.file&&(n&&(o.input.url=n(this.file).toString()),o.input.file=this.file),o}fromOffset(e){let t,r;if(this[c])r=this[c];else{let e=this.css.split("\n");r=new Array(e.length);let t=0;for(let n=0,i=e.length;n<i;n++)r[n]=t,t+=e[n].length+1;this[c]=r}t=r[r.length-1];let n=0;if(e>=t)n=r.length-1;else{let t,i=r.length-2;for(;n<i;)if(t=n+(i-n>>1),e<r[t])i=t-1;else{if(!(e>=r[t+1])){n=t;break}n=t+1}}return{col:e-r[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:o(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,o,s){if(!this.map)return!1;let a,l,u=this.map.consumer(),c=u.originalPositionFor({column:t,line:e});if(!c.source)return!1;"number"==typeof o&&(a=u.originalPositionFor({column:s,line:o})),l=i(c.source)?n(c.source):new URL(c.source,this.map.consumer().sourceRoot||n(this.map.mapFile));let d={column:c.column,endColumn:a&&a.column,endLine:a&&a.line,line:c.line,url:l.toString()};if("file:"===l.protocol){if(!r)throw new Error("file: protocol is not available in this PostCSS build");d.file=r(l)}let h=u.sourceContentFor(c.source);return h&&(d.source=h),d}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}}return Hs=p,p.default=p,a&&a.registerInput&&a.registerInput(p),Hs}function $u(){if(Js)return Gs;Js=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=As,{dirname:r,relative:n,resolve:i,sep:o}=As,{pathToFileURL:s}=As,a=Vu(),l=Boolean(e&&t),u=Boolean(r&&i&&n&&o);return Gs=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let t of this.previous()){let n,i=this.toUrl(this.path(t.file)),o=t.root||r(t.file);!1===this.mapOpts.sourcesContent?(n=new e(t.text),n.sourcesContent&&(n.sourcesContent=null)):n=t.consumer(),this.map.applySourceMap(n,i,this.toUrl(this.path(o)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),u&&l&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=t.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0});let e,r,n=1,i=1,o="<no source>",s={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(t,a,l)=>{if(this.css+=t,a&&"end"!==l&&(s.generated.line=n,s.generated.column=i-1,a.source&&a.source.start?(s.source=this.sourcePath(a),s.original.line=a.source.start.line,s.original.column=a.source.start.column-1,this.map.addMapping(s)):(s.source=o,s.original.line=1,s.original.column=0,this.map.addMapping(s))),e=t.match(/\n/g),e?(n+=e.length,r=t.lastIndexOf("\n"),i=t.length-r):i+=t.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(s.source=this.sourcePath(a),s.original.line=a.source.end.line,s.original.column=a.source.end.column-1,s.generated.line=n,s.generated.column=i-2,this.map.addMapping(s)):(s.source=o,s.original.line=1,s.original.column=0,s.generated.line=n,s.generated.column=i-1,this.map.addMapping(s)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let o=this.opts.to?r(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(o=r(i(o,this.mapOpts.annotation)));let s=n(o,e);return this.memoizedPaths.set(e,s),s}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new a(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let r=t.source.input.from;if(r&&!e[r]){e[r]=!0;let n=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(n,t.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(s){let t=s(e).toString();return this.memoizedFileURLs.set(e,t),t}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;"\\"===o&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}}}function Hu(){if(Xs)return Qs;Xs=1;let e=Bu();class t extends e{constructor(e){super(e),this.type="comment"}}return Qs=t,t.default=t,Qs}function Ku(){if(Zs)return Ys;Zs=1;let e,t,r,n,{isClean:i,my:o}=Uu(),s=qu(),a=Hu(),l=Bu();function u(e){return e.map(e=>(e.nodes&&(e.nodes=u(e.nodes)),delete e.source,e))}function c(e){if(e[i]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)c(t)}class d extends l{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,r,n=this.getIterator();for(;this.indexes[n]<this.proxyOf.nodes.length&&(t=this.indexes[n],r=e(this.proxyOf.nodes[t],t),!1!==r);)this.indexes[n]+=1;return delete this.indexes[n],r}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...r)=>e[t](...r.map(e=>"function"==typeof e?(t,r)=>e(t.toProxy(),r):e)):"every"===t||"some"===t?r=>e[t]((e,...t)=>r(e.toProxy(),...t)):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map(e=>e.toProxy()):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let r,n=this.index(e),i=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let e of i)this.proxyOf.nodes.splice(n+1,0,e);for(let e in this.indexes)r=this.indexes[e],n<r&&(this.indexes[e]=r+i.length);return this.markDirty(),this}insertBefore(e,t){let r,n=this.index(e),i=0===n&&"prepend",o=this.normalize(t,this.proxyOf.nodes[n],i).reverse();n=this.index(e);for(let e of o)this.proxyOf.nodes.splice(n,0,e);for(let e in this.indexes)r=this.indexes[e],n<=r&&(this.indexes[e]=r+o.length);return this.markDirty(),this}normalize(n,l){if("string"==typeof n)n=u(e(n).nodes);else if(void 0===n)n=[];else if(Array.isArray(n)){n=n.slice(0);for(let e of n)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===n.type&&"document"!==this.type){n=n.nodes.slice(0);for(let e of n)e.parent&&e.parent.removeChild(e,"ignore")}else if(n.type)n=[n];else if(n.prop){if(void 0===n.value)throw new Error("Value field is missed in node creation");"string"!=typeof n.value&&(n.value=String(n.value)),n=[new s(n)]}else if(n.selector)n=[new t(n)];else if(n.name)n=[new r(n)];else{if(!n.text)throw new Error("Unknown node type in node creation");n=[new a(n)]}return n.map(e=>(e[o]||d.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[i]&&c(e),void 0===e.raws.before&&l&&void 0!==l.raws.before&&(e.raws.before=l.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls(n=>{t.props&&!t.props.includes(n.prop)||t.fast&&!n.value.includes(t.fast)||(n.value=n.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,r)=>{let n;try{n=e(t,r)}catch(e){throw t.addToError(e)}return!1!==n&&t.walk&&(n=t.walk(e)),n})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("atrule"===r.type&&e.test(r.name))return t(r,n)}):this.walk((r,n)=>{if("atrule"===r.type&&r.name===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("atrule"===e.type)return t(e,r)}))}walkComments(e){return this.walk((t,r)=>{if("comment"===t.type)return e(t,r)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("decl"===r.type&&e.test(r.prop))return t(r,n)}):this.walk((r,n)=>{if("decl"===r.type&&r.prop===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("decl"===e.type)return t(e,r)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("rule"===r.type&&e.test(r.selector))return t(r,n)}):this.walk((r,n)=>{if("rule"===r.type&&r.selector===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("rule"===e.type)return t(e,r)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}return d.registerParse=t=>{e=t},d.registerRule=e=>{t=e},d.registerAtRule=e=>{r=e},d.registerRoot=e=>{n=e},Ys=d,d.default=d,d.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,r.prototype):"rule"===e.type?Object.setPrototypeOf(e,t.prototype):"decl"===e.type?Object.setPrototypeOf(e,s.prototype):"comment"===e.type?Object.setPrototypeOf(e,a.prototype):"root"===e.type&&Object.setPrototypeOf(e,n.prototype),e[o]=!0,e.nodes&&e.nodes.forEach(e=>{d.rebuild(e)})},Ys}function Gu(){if(ta)return ea;ta=1;let e,t,r=Ku();class n extends r{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(r={}){return new e(new t,this,r).stringify()}}return n.registerLazyResult=t=>{e=t},n.registerProcessor=e=>{t=e},ea=n,n.default=n,ea}function Ju(){if(na)return ra;na=1;let e={};return ra=function(t){e[t]||(e[t]=!0,"undefined"!=typeof console&&console.warn&&console.warn(t))}}function Qu(){if(oa)return ia;oa=1;class e{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}return ia=e,e.default=e,ia}function Xu(){if(aa)return sa;aa=1;let e=Qu();class t{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(t,r={}){r.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(r.plugin=this.lastPlugin.postcssPlugin);let n=new e(t,r);return this.messages.push(n),n}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}}return sa=t,t.default=t,sa}function Yu(){if(da)return ca;da=1;let e=Ku();class t extends e{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}}return ca=t,t.default=t,e.registerAtRule(t),ca}function Zu(){if(pa)return ha;pa=1;let e,t,r=Ku();class n extends r{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){let n=super.normalize(e);if(t)if("prepend"===r)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of n)e.raws.before=t.raws.before;return n}removeChild(e,t){let r=this.index(e);return!t&&0===r&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(r={}){return new e(new t,this,r).stringify()}}return n.registerLazyResult=t=>{e=t},n.registerProcessor=e=>{t=e},ha=n,n.default=n,r.registerRoot(n),ha}function ec(){if(ga)return fa;ga=1;let e={comma:t=>e.split(t,[","],!0),space:t=>e.split(t,[" ","\n","\t"]),split(e,t,r){let n=[],i="",o=!1,s=0,a=!1,l="",u=!1;for(let r of e)u?u=!1:"\\"===r?u=!0:a?r===l&&(a=!1):'"'===r||"'"===r?(a=!0,l=r):"("===r?s+=1:")"===r?s>0&&(s-=1):0===s&&t.includes(r)&&(o=!0),o?(""!==i&&n.push(i.trim()),i="",o=!1):i+=r;return(r||""!==i)&&n.push(i.trim()),n}};return fa=e,e.default=e,fa}function tc(){if(ma)return va;ma=1;let e=Ku(),t=ec();class r extends e{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return t.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}}return va=r,r.default=r,e.registerRule(r),va}function rc(){if(ba)return ya;ba=1;let e=qu(),t=function(){if(ua)return la;ua=1;const e="'".charCodeAt(0),t='"'.charCodeAt(0),r="\\".charCodeAt(0),n="/".charCodeAt(0),i="\n".charCodeAt(0),o=" ".charCodeAt(0),s="\f".charCodeAt(0),a="\t".charCodeAt(0),l="\r".charCodeAt(0),u="[".charCodeAt(0),c="]".charCodeAt(0),d="(".charCodeAt(0),h=")".charCodeAt(0),p="{".charCodeAt(0),f="}".charCodeAt(0),g=";".charCodeAt(0),v="*".charCodeAt(0),m=":".charCodeAt(0),y="@".charCodeAt(0),b=/[\t\n\f\r "#'()/;[\\\]{}]/g,w=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,S=/.[\r\n"'(/\\]/,k=/[\da-f]/i;return la=function(x,E={}){let C,I,O,T,A,R,P,_,M,N,L=x.css.valueOf(),D=E.ignoreErrors,U=L.length,F=0,j=[],B=[];function q(e){throw x.error("Unclosed "+e,F)}return{back:function(e){B.push(e)},endOfFile:function(){return 0===B.length&&F>=U},nextToken:function(x){if(B.length)return B.pop();if(F>=U)return;let E=!!x&&x.ignoreUnclosed;switch(C=L.charCodeAt(F),C){case i:case o:case a:case l:case s:I=F;do{I+=1,C=L.charCodeAt(I)}while(C===o||C===i||C===a||C===l||C===s);N=["space",L.slice(F,I)],F=I-1;break;case u:case c:case p:case f:case m:case g:case h:{let e=String.fromCharCode(C);N=[e,e,F];break}case d:if(_=j.length?j.pop()[1]:"",M=L.charCodeAt(F+1),"url"===_&&M!==e&&M!==t&&M!==o&&M!==i&&M!==a&&M!==s&&M!==l){I=F;do{if(R=!1,I=L.indexOf(")",I+1),-1===I){if(D||E){I=F;break}q("bracket")}for(P=I;L.charCodeAt(P-1)===r;)P-=1,R=!R}while(R);N=["brackets",L.slice(F,I+1),F,I],F=I}else I=L.indexOf(")",F+1),T=L.slice(F,I+1),-1===I||S.test(T)?N=["(","(",F]:(N=["brackets",T,F,I],F=I);break;case e:case t:O=C===e?"'":'"',I=F;do{if(R=!1,I=L.indexOf(O,I+1),-1===I){if(D||E){I=F+1;break}q("string")}for(P=I;L.charCodeAt(P-1)===r;)P-=1,R=!R}while(R);N=["string",L.slice(F,I+1),F,I],F=I;break;case y:b.lastIndex=F+1,b.test(L),I=0===b.lastIndex?L.length-1:b.lastIndex-2,N=["at-word",L.slice(F,I+1),F,I],F=I;break;case r:for(I=F,A=!0;L.charCodeAt(I+1)===r;)I+=1,A=!A;if(C=L.charCodeAt(I+1),A&&C!==n&&C!==o&&C!==i&&C!==a&&C!==l&&C!==s&&(I+=1,k.test(L.charAt(I)))){for(;k.test(L.charAt(I+1));)I+=1;L.charCodeAt(I+1)===o&&(I+=1)}N=["word",L.slice(F,I+1),F,I],F=I;break;default:C===n&&L.charCodeAt(F+1)===v?(I=L.indexOf("*/",F+2)+1,0===I&&(D||E?I=L.length:q("comment")),N=["comment",L.slice(F,I+1),F,I],F=I):(w.lastIndex=F+1,w.test(L),I=0===w.lastIndex?L.length-1:w.lastIndex-2,N=["word",L.slice(F,I+1),F,I],j.push(N),F=I)}return F++,N},position:function(){return F}}}}(),r=Hu(),n=Yu(),i=Zu(),o=tc();const s={empty:!0,space:!0};return ya=class{constructor(e){this.input=e,this.root=new i,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,r,i,o=new n;o.name=e[1].slice(1),""===o.name&&this.unnamedAtrule(o,e),this.init(o,e[2]);let s=!1,a=!1,l=[],u=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?u.push("("===t?")":"]"):"{"===t&&u.length>0?u.push("}"):t===u[u.length-1]&&u.pop(),0===u.length){if(";"===t){o.source.end=this.getPosition(e[2]),o.source.end.offset++,this.semicolon=!0;break}if("{"===t){a=!0;break}if("}"===t){if(l.length>0){for(i=l.length-1,r=l[i];r&&"space"===r[0];)r=l[--i];r&&(o.source.end=this.getPosition(r[3]||r[2]),o.source.end.offset++)}this.end(e);break}l.push(e)}else l.push(e);if(this.tokenizer.endOfFile()){s=!0;break}}o.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(o.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(o,"params",l),s&&(e=l[l.length-1],o.source.end=this.getPosition(e[3]||e[2]),o.source.end.offset++,this.spaces=o.raws.between,o.raws.between="")):(o.raws.afterName="",o.params=""),a&&(o.nodes=[],this.current=o)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let r,n=0;for(let i=t-1;i>=0&&(r=e[i],"space"===r[0]||(n+=1,2!==n));i--);throw this.input.error("Missed semicolon","word"===r[0]?r[3]+1:r[2])}colon(e){let t,r,n,i=0;for(let[o,s]of e.entries()){if(t=s,r=t[0],"("===r&&(i+=1),")"===r&&(i-=1),0===i&&":"===r){if(n){if("word"===n[0]&&"progid"===n[1])continue;return o}this.doubleColon(t)}n=t}return!1}comment(e){let t=new r;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=t(this.input)}decl(t,r){let n=new e;this.init(n,t[0][2]);let i,o=t[t.length-1];for(";"===o[0]&&(this.semicolon=!0,t.pop()),n.source.end=this.getPosition(o[3]||o[2]||function(e){for(let t=e.length-1;t>=0;t--){let r=e[t],n=r[3]||r[2];if(n)return n}}(t)),n.source.end.offset++;"word"!==t[0][0];)1===t.length&&this.unknownWord(t),n.raws.before+=t.shift()[1];for(n.source.start=this.getPosition(t[0][2]),n.prop="";t.length;){let e=t[0][0];if(":"===e||"space"===e||"comment"===e)break;n.prop+=t.shift()[1]}for(n.raws.between="";t.length;){if(i=t.shift(),":"===i[0]){n.raws.between+=i[1];break}"word"===i[0]&&/\w/.test(i[1])&&this.unknownWord([i]),n.raws.between+=i[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let s,a=[];for(;t.length&&(s=t[0][0],"space"===s||"comment"===s);)a.push(t.shift());this.precheckMissedSemicolon(t);for(let e=t.length-1;e>=0;e--){if(i=t[e],"!important"===i[1].toLowerCase()){n.important=!0;let r=this.stringFrom(t,e);r=this.spacesFromEnd(t)+r," !important"!==r&&(n.raws.important=r);break}if("important"===i[1].toLowerCase()){let r=t.slice(0),i="";for(let t=e;t>0;t--){let e=r[t][0];if(0===i.trim().indexOf("!")&&"space"!==e)break;i=r.pop()[1]+i}0===i.trim().indexOf("!")&&(n.important=!0,n.raws.important=i,t=r)}if("space"!==i[0]&&"comment"!==i[0])break}t.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(n,"value",a.concat(t),r),n.value.includes(":")&&!r&&this.checkMissedSemicolon(t)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new o;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,r=null,n=!1,i=null,o=[],s=e[1].startsWith("--"),a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)i||(i=l),o.push("("===r?")":"]");else if(s&&n&&"{"===r)i||(i=l),o.push("}");else if(0===o.length){if(";"===r){if(n)return void this.decl(a,s);break}if("{"===r)return void this.rule(a);if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}":"===r&&(n=!0)}else r===o[o.length-1]&&(o.pop(),0===o.length&&(i=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(i),t&&n){if(!s)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,s)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,r,n){let i,o,a,l,u=r.length,c="",d=!0;for(let e=0;e<u;e+=1)i=r[e],o=i[0],"space"!==o||e!==u-1||n?"comment"===o?(l=r[e-1]?r[e-1][0]:"empty",a=r[e+1]?r[e+1][0]:"empty",s[l]||s[a]||","===c.slice(-1)?d=!1:c+=i[1]):c+=i[1]:d=!1;if(!d){let n=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:n,value:c}}e[t]=c}rule(e){e.pop();let t=new o;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let n=t;n<e.length;n++)r+=e[n][1];return e.splice(t,e.length-t),r}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}}}function nc(){if(Sa)return wa;Sa=1;let e=Ku(),t=rc(),r=Vu();function n(e,n){let i=new r(e,n),o=new t(i);try{o.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&n&&n.from&&(/\.scss$/i.test(n.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(n.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(n.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return o.root}return wa=n,n.default=n,e.registerParse(n),wa}function ic(){if(xa)return ka;xa=1;let{isClean:e,my:t}=Uu(),r=$u(),n=ju(),i=Ku(),o=Gu(),s=Ju(),a=Xu(),l=nc(),u=Zu();const c={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},d={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},h={Once:!0,postcssPlugin:!0,prepare:!0};function p(e){return"object"==typeof e&&"function"==typeof e.then}function f(e){let t=!1,r=c[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[r,r+"-"+t,0,r+"Exit",r+"Exit-"+t]:t?[r,r+"-"+t,r+"Exit",r+"Exit-"+t]:e.append?[r,0,r+"Exit"]:[r,r+"Exit"]}function g(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:f(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function v(t){return t[e]=!1,t.nodes&&t.nodes.forEach(e=>v(e)),t}let m={};class y{constructor(e,r,n){let o;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof y||r instanceof a)o=v(r.root),r.map&&(void 0===n.map&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=r.map);else{let e=l;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{o=e(r,n)}catch(e){this.processed=!0,this.error=e}o&&!o[t]&&i.rebuild(o)}else o=v(r);this.result=new a(e,o,n),this.helpers={...m,postcss:m,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let r=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(r.postcssVersion&&"production"!==process.env.NODE_ENV){let e=r.postcssPlugin,t=r.postcssVersion,n=this.result.processor.version,i=t.split("."),o=n.split(".");(i[0]!==o[0]||parseInt(i[1])>parseInt(o[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+n+", but "+e+" uses "+t+". Perhaps this is the source of the error below.")}}else e.plugin=r.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,r)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,r])};for(let t of this.plugins)if("object"==typeof t)for(let r in t){if(!d[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!h[r])if("object"==typeof t[r])for(let n in t[r])e(t,"*"===n?r:r+"-"+n.toLowerCase(),t[r][n]);else"function"==typeof t[r]&&e(t,r,t[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],r=this.runOnRoot(t);if(p(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];){t[e]=!0;let r=[g(t)];for(;r.length>0;){let e=this.visitTick(r);if(p(e))try{await e}catch(e){let t=r[r.length-1].node;throw this.handleError(e,t)}}}if(this.listeners.OnceExit)for(let[e,r]of this.listeners.OnceExit){this.result.lastPlugin=e;try{if("document"===t.type){let e=t.nodes.map(e=>r(e,this.helpers));await Promise.all(e)}else await r(t,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return p(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=n;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let i=new r(t,this.result.root,this.result.opts).generate();return this.result.css=i[0],this.result.map=i[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins){if(p(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];)t[e]=!0,this.walkSync(t);if(this.listeners.OnceExit)if("document"===t.type)for(let e of t.nodes)this.visitSync(this.listeners.OnceExit,e);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||s("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[r,n]of e){let e;this.result.lastPlugin=r;try{e=n(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(p(e))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:n,visitors:i}=r;if("root"!==n.type&&"document"!==n.type&&!n.parent)return void t.pop();if(i.length>0&&r.visitorIndex<i.length){let[e,t]=i[r.visitorIndex];r.visitorIndex+=1,r.visitorIndex===i.length&&(r.visitors=[],r.visitorIndex=0),this.result.lastPlugin=e;try{return t(n.toProxy(),this.helpers)}catch(e){throw this.handleError(e,n)}}if(0!==r.iterator){let i,o=r.iterator;for(;i=n.nodes[n.indexes[o]];)if(n.indexes[o]+=1,!i[e])return i[e]=!0,void t.push(g(i));r.iterator=0,delete n.indexes[o]}let o=r.events;for(;r.eventIndex<o.length;){let t=o[r.eventIndex];if(r.eventIndex+=1,0===t)return void(n.nodes&&n.nodes.length&&(n[e]=!0,r.iterator=n.getIterator()));if(this.listeners[t])return void(r.visitors=this.listeners[t])}t.pop()}walkSync(t){t[e]=!0;let r=f(t);for(let n of r)if(0===n)t.nodes&&t.each(t=>{t[e]||this.walkSync(t)});else{let e=this.listeners[n];if(e&&this.visitSync(e,t.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}}return y.registerPostcss=e=>{m=e},ka=y,y.default=y,u.registerLazyResult(y),o.registerLazyResult(y),ka}function oc(){if(Oa)return Ia;Oa=1;let e=function(){if(Ca)return Ea;Ca=1;let e=$u(),t=ju(),r=Ju(),n=nc();const i=Xu();class o{constructor(r,n,o){let s;n=n.toString(),this.stringified=!1,this._processor=r,this._css=n,this._opts=o,this._map=void 0;let a=t;this.result=new i(this._processor,s,this._opts),this.result.css=n;let l=this;Object.defineProperty(this.result,"root",{get:()=>l.root});let u=new e(a,s,this._opts,n);if(u.isMap()){let[e,t]=u.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else u.clearAnnotation(),this.result.css=u.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this._opts||r("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=n;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}}return Ea=o,o.default=o,Ea}(),t=ic(),r=Gu(),n=Zu();class i{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(r,n={}){return this.plugins.length||n.parser||n.stringifier||n.syntax?new t(this,r,n):new e(this,r,n)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}return Ia=i,i.default=i,n.registerProcessor(i),r.registerProcessor(i),Ia}function sc(){if(Pa)return Ra;Pa=1;let e=Du(),t=qu(),r=ic(),n=Ku(),i=oc(),o=ju(),s=function(){if(Aa)return Ta;Aa=1;let e=qu(),t=Wu(),r=Hu(),n=Yu(),i=Vu(),o=Zu(),s=tc();function a(l,u){if(Array.isArray(l))return l.map(e=>a(e));let{inputs:c,...d}=l;if(c){u=[];for(let e of c){let r={...e,__proto__:i.prototype};r.map&&(r.map={...r.map,__proto__:t.prototype}),u.push(r)}}if(d.nodes&&(d.nodes=l.nodes.map(e=>a(e,u))),d.source){let{inputId:e,...t}=d.source;d.source=t,null!=e&&(d.source.input=u[e])}if("root"===d.type)return new o(d);if("decl"===d.type)return new e(d);if("rule"===d.type)return new s(d);if("comment"===d.type)return new r(d);if("atrule"===d.type)return new n(d);throw new Error("Unknown node type: "+l.type)}return Ta=a,a.default=a,Ta}(),a=Gu(),l=Qu(),u=Hu(),c=Yu(),d=Xu(),h=Vu(),p=nc(),f=ec(),g=tc(),v=Zu(),m=Bu();function y(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new i(e)}return y.plugin=function(e,t){let r,n=!1;function o(...r){console&&console.warn&&!n&&(n=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let o=t(...r);return o.postcssPlugin=e,o.postcssVersion=(new i).version,o}return Object.defineProperty(o,"postcss",{get:()=>(r||(r=o()),r)}),o.process=function(e,t,r){return y([o(r)]).process(e,t)},o},y.stringify=o,y.parse=p,y.fromJSON=s,y.list=f,y.comment=e=>new u(e),y.atRule=e=>new c(e),y.decl=e=>new t(e),y.rule=e=>new g(e),y.root=e=>new v(e),y.document=e=>new a(e),y.CssSyntaxError=e,y.Declaration=t,y.Container=n,y.Processor=i,y.Document=a,y.Comment=u,y.Warning=l,y.AtRule=c,y.Result=d,y.Input=h,y.Rule=g,y.Root=v,y.Node=m,r.registerPostcss(y),Ra=y,y.default=y,Ra}function ac(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function lc(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if("function"==typeof t){var r=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}),r}function uc(){if(Fa)return Ua.exports;Fa=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e}};return Ua.exports=t(),Ua.exports.createColors=t,Ua.exports}function cc(){if(Wa)return za;Wa=1;let e=uc(),t=qa;class r extends Error{constructor(e,t,n,i,o,s){super(e),this.name="CssSyntaxError",this.reason=e,o&&(this.file=o),i&&(this.source=i),s&&(this.plugin=s),void 0!==t&&void 0!==n&&("number"==typeof t?(this.line=t,this.column=n):(this.line=t.line,this.column=t.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,r)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(r){if(!this.source)return"";let n=this.source;null==r&&(r=e.isColorSupported),t&&r&&(n=t(n));let i,o,s=n.split(/\r?\n/),a=Math.max(this.line-3,0),l=Math.min(this.line+2,s.length),u=String(l).length;if(r){let{bold:t,gray:r,red:n}=e.createColors(!0);i=e=>t(n(e)),o=e=>r(e)}else i=o=e=>e;return s.slice(a,l).map((e,t)=>{let r=a+1+t,n=" "+(" "+r).slice(-u)+" | ";if(r===this.line){let t=o(n.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return i(">")+o(n)+e+"\n "+t+i("^")}return" "+o(n)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}return za=r,r.default=r,za}function dc(){return $a||($a=1,Va.isClean=Symbol("isClean"),Va.my=Symbol("my")),Va}function hc(){if(Ka)return Ha;Ka=1;const e={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};class t{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name,n=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?r+=e.raws.afterName:n&&(r+=" "),e.nodes)this.block(e,r+n);else{let i=(e.raws.between||"")+(t?";":"");this.builder(r+n+i,e)}}beforeAfter(e,t){let r;r="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let n=e.parent,i=0;for(;n&&"root"!==n.type;)i+=1,n=n.parent;if(r.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<i;e++)r+=t}return r}block(e,t){let r,n=this.raw(e,"between","beforeOpen");this.builder(t+n+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),r=this.raw(e,"after")):r=this.raw(e,"after","emptyBody"),r&&this.builder(r),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let r=this.raw(e,"semicolon");for(let n=0;n<e.nodes.length;n++){let i=e.nodes[n],o=this.raw(i,"before");o&&this.builder(o),this.stringify(i,t!==n||r)}}comment(e){let t=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)}decl(e,t){let r=this.raw(e,"between","colon"),n=e.prop+r+this.rawValue(e,"value");e.important&&(n+=e.raws.important||" !important"),t&&(n+=";"),this.builder(n,e)}document(e){this.body(e)}raw(t,r,n){let i;if(n||(n=r),r&&(i=t.raws[r],void 0!==i))return i;let o=t.parent;if("before"===n){if(!o||"root"===o.type&&o.first===t)return"";if(o&&"document"===o.type)return""}if(!o)return e[n];let s=t.root();if(s.rawCache||(s.rawCache={}),void 0!==s.rawCache[n])return s.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(t,n);{let e="raw"+((a=n)[0].toUpperCase()+a.slice(1));this[e]?i=this[e](s,t):s.walk(e=>{if(i=e.raws[r],void 0!==i)return!1})}var a;return void 0===i&&(i=e[n]),s.rawCache[n]=i,i}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let r;return e.walkComments(e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),void 0===r?r=this.raw(t,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(e,t){let r;return e.walkDecls(e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),void 0===r?r=this.raw(t,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(e){let t;return e.walk(r=>{if(r.nodes&&(r.parent!==e||e.first!==r)&&void 0!==r.raws.before)return t=r.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(r=>{let n=r.parent;if(n&&n!==e&&n.parent&&n.parent===e&&void 0!==r.raws.before){let e=r.raws.before.split("\n");return t=e[e.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){let r=e[t],n=e.raws[t];return n&&n.value===r?n.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}}return Ha=t,t.default=t,Ha}function pc(){if(Ja)return Ga;Ja=1;let e=hc();function t(t,r){new e(r).stringify(t)}return Ga=t,t.default=t,Ga}function fc(){if(Xa)return Qa;Xa=1;let{isClean:e,my:t}=dc(),r=cc(),n=hc(),i=pc();function o(e,t){let r=new e.constructor;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if("proxyCache"===n)continue;let i=e[n],s=typeof i;"parent"===n&&"object"===s?t&&(r[n]=t):"source"===n?r[n]=i:Array.isArray(i)?r[n]=i.map(e=>o(e,r)):("object"===s&&null!==i&&(i=o(i)),r[n]=i)}return r}class s{constructor(r={}){this.raws={},this[e]=!1,this[t]=!0;for(let e in r)if("nodes"===e){this.nodes=[];for(let t of r[e])"function"==typeof t.clone?this.append(t.clone()):this.append(t)}else this[e]=r[e]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=o(this);for(let r in e)t[r]=e[r];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:r,start:n}=this.rangeBy(t);return this.source.input.error(e,{column:n.column,line:n.line},{column:r.column,line:r.line},t)}return new r(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markDirty(){if(this[e]){this[e]=!1;let t=this;for(;t=t.parent;)t[e]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){let n=(t=this.toString()).indexOf(e.word);-1!==n&&(r=this.positionInside(n,t))}return r}positionInside(e,t){let r=t||this.toString(),n=this.source.start.column,i=this.source.start.line;for(let t=0;t<e;t++)"\n"===r[t]?(n=1,i+=1):n+=1;return{column:n,line:i}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let n=this.toString(),i=n.indexOf(e.word);-1!==i&&(t=this.positionInside(i,n),r=this.positionInside(i+e.word.length,n))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return(new n).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let n of e)n===this?r=!0:r?(this.parent.insertAfter(t,n),t=n):this.parent.insertBefore(t,n);r||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let r={},n=null==t;t=t||new Map;let i=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let n=this[e];if(Array.isArray(n))r[e]=n.map(e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e);else if("object"==typeof n&&n.toJSON)r[e]=n.toJSON(null,t);else if("source"===e){let o=t.get(n.input);null==o&&(o=i,t.set(n.input,i),i++),r[e]={end:n.end,inputId:o,start:n.start}}else r[e]=n}return n&&(r.inputs=[...t.keys()].map(e=>e.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=i){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){let n={node:this};for(let e in r)n[e]=r[e];return e.warn(t,n)}get proxyOf(){return this}}return Qa=s,s.default=s,Qa}function gc(){if(Za)return Ya;Za=1;let e=fc();class t extends e{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}}return Ya=t,t.default=t,Ya}function vc(){if(tl)return el;tl=1;return el={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(r=t)=>{let n="",i=r;for(;i--;)n+=e[Math.random()*e.length|0];return n}}}function mc(){if(nl)return rl;nl=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=qa,{existsSync:r,readFileSync:n}=qa,{dirname:i,join:o}=qa;class s{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,n=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=i(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new e(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t;let r=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+r)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let r=e.lastIndexOf(t.pop()),n=e.indexOf("*/",r);r>-1&&n>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,n)))}loadFile(e){if(this.root=i(e),r(e))return this.mapFile=e,n(e,"utf-8").toString().trim()}loadMap(r,n){if(!1===n)return!1;if(n){if("string"==typeof n)return n;if("function"!=typeof n){if(n instanceof e)return t.fromSourceMap(n).toString();if(n instanceof t)return n.toString();if(this.isMap(n))return JSON.stringify(n);throw new Error("Unsupported previous source map format: "+n.toString())}{let e=n(r);if(e){let t=this.loadFile(e);if(!t)throw new Error("Unable to load previous source map: "+e.toString());return t}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let e=this.annotation;return r&&(e=o(i(r),e)),this.loadFile(e)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return rl=s,s.default=s,rl}function yc(){if(ol)return il;ol=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=qa,{fileURLToPath:r,pathToFileURL:n}=qa,{isAbsolute:i,resolve:o}=qa,{nanoid:s}=vc(),a=qa,l=cc(),u=mc(),c=Symbol("fromOffsetCache"),d=Boolean(e&&t),h=Boolean(o&&i);class p{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||""===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!h||/^\w+:\/\//.test(t.from)||i(t.from)?this.file=t.from:this.file=o(t.from)),h&&d){let e=new u(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+s(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,i={}){let o,s,a;if(t&&"object"==typeof t){let e=t,n=r;if("number"==typeof e.offset){let n=this.fromOffset(e.offset);t=n.line,r=n.col}else t=e.line,r=e.column;if("number"==typeof n.offset){let e=this.fromOffset(n.offset);s=e.line,a=e.col}else s=n.line,a=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let u=this.origin(t,r,s,a);return o=u?new l(e,void 0===u.endLine?u.line:{column:u.column,line:u.line},void 0===u.endLine?u.column:{column:u.endColumn,line:u.endLine},u.source,u.file,i.plugin):new l(e,void 0===s?t:{column:r,line:t},void 0===s?r:{column:a,line:s},this.css,this.file,i.plugin),o.input={column:r,endColumn:a,endLine:s,line:t,source:this.css},this.file&&(n&&(o.input.url=n(this.file).toString()),o.input.file=this.file),o}fromOffset(e){let t,r;if(this[c])r=this[c];else{let e=this.css.split("\n");r=new Array(e.length);let t=0;for(let n=0,i=e.length;n<i;n++)r[n]=t,t+=e[n].length+1;this[c]=r}t=r[r.length-1];let n=0;if(e>=t)n=r.length-1;else{let t,i=r.length-2;for(;n<i;)if(t=n+(i-n>>1),e<r[t])i=t-1;else{if(!(e>=r[t+1])){n=t;break}n=t+1}}return{col:e-r[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:o(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,o,s){if(!this.map)return!1;let a,l,u=this.map.consumer(),c=u.originalPositionFor({column:t,line:e});if(!c.source)return!1;"number"==typeof o&&(a=u.originalPositionFor({column:s,line:o})),l=i(c.source)?n(c.source):new URL(c.source,this.map.consumer().sourceRoot||n(this.map.mapFile));let d={column:c.column,endColumn:a&&a.column,endLine:a&&a.line,line:c.line,url:l.toString()};if("file:"===l.protocol){if(!r)throw new Error("file: protocol is not available in this PostCSS build");d.file=r(l)}let h=u.sourceContentFor(c.source);return h&&(d.source=h),d}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}}return il=p,p.default=p,a&&a.registerInput&&a.registerInput(p),il}function bc(){if(al)return sl;al=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=qa,{dirname:r,relative:n,resolve:i,sep:o}=qa,{pathToFileURL:s}=qa,a=yc(),l=Boolean(e&&t),u=Boolean(r&&i&&n&&o);return sl=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let t of this.previous()){let n,i=this.toUrl(this.path(t.file)),o=t.root||r(t.file);!1===this.mapOpts.sourcesContent?(n=new e(t.text),n.sourcesContent&&(n.sourcesContent=null)):n=t.consumer(),this.map.applySourceMap(n,i,this.toUrl(this.path(o)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),u&&l&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=t.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0});let e,r,n=1,i=1,o="<no source>",s={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(t,a,l)=>{if(this.css+=t,a&&"end"!==l&&(s.generated.line=n,s.generated.column=i-1,a.source&&a.source.start?(s.source=this.sourcePath(a),s.original.line=a.source.start.line,s.original.column=a.source.start.column-1,this.map.addMapping(s)):(s.source=o,s.original.line=1,s.original.column=0,this.map.addMapping(s))),e=t.match(/\n/g),e?(n+=e.length,r=t.lastIndexOf("\n"),i=t.length-r):i+=t.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(s.source=this.sourcePath(a),s.original.line=a.source.end.line,s.original.column=a.source.end.column-1,s.generated.line=n,s.generated.column=i-2,this.map.addMapping(s)):(s.source=o,s.original.line=1,s.original.column=0,s.generated.line=n,s.generated.column=i-1,this.map.addMapping(s)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let o=this.opts.to?r(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(o=r(i(o,this.mapOpts.annotation)));let s=n(o,e);return this.memoizedPaths.set(e,s),s}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new a(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let r=t.source.input.from;if(r&&!e[r]){e[r]=!0;let n=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(n,t.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(s){let t=s(e).toString();return this.memoizedFileURLs.set(e,t),t}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;"\\"===o&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}}}function wc(){if(ul)return ll;ul=1;let e=fc();class t extends e{constructor(e){super(e),this.type="comment"}}return ll=t,t.default=t,ll}function Sc(){if(dl)return cl;dl=1;let e,t,r,n,{isClean:i,my:o}=dc(),s=gc(),a=wc(),l=fc();function u(e){return e.map(e=>(e.nodes&&(e.nodes=u(e.nodes)),delete e.source,e))}function c(e){if(e[i]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)c(t)}class d extends l{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,r,n=this.getIterator();for(;this.indexes[n]<this.proxyOf.nodes.length&&(t=this.indexes[n],r=e(this.proxyOf.nodes[t],t),!1!==r);)this.indexes[n]+=1;return delete this.indexes[n],r}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...r)=>e[t](...r.map(e=>"function"==typeof e?(t,r)=>e(t.toProxy(),r):e)):"every"===t||"some"===t?r=>e[t]((e,...t)=>r(e.toProxy(),...t)):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map(e=>e.toProxy()):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let r,n=this.index(e),i=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let e of i)this.proxyOf.nodes.splice(n+1,0,e);for(let e in this.indexes)r=this.indexes[e],n<r&&(this.indexes[e]=r+i.length);return this.markDirty(),this}insertBefore(e,t){let r,n=this.index(e),i=0===n&&"prepend",o=this.normalize(t,this.proxyOf.nodes[n],i).reverse();n=this.index(e);for(let e of o)this.proxyOf.nodes.splice(n,0,e);for(let e in this.indexes)r=this.indexes[e],n<=r&&(this.indexes[e]=r+o.length);return this.markDirty(),this}normalize(n,l){if("string"==typeof n)n=u(e(n).nodes);else if(void 0===n)n=[];else if(Array.isArray(n)){n=n.slice(0);for(let e of n)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===n.type&&"document"!==this.type){n=n.nodes.slice(0);for(let e of n)e.parent&&e.parent.removeChild(e,"ignore")}else if(n.type)n=[n];else if(n.prop){if(void 0===n.value)throw new Error("Value field is missed in node creation");"string"!=typeof n.value&&(n.value=String(n.value)),n=[new s(n)]}else if(n.selector)n=[new t(n)];else if(n.name)n=[new r(n)];else{if(!n.text)throw new Error("Unknown node type in node creation");n=[new a(n)]}return n.map(e=>(e[o]||d.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[i]&&c(e),void 0===e.raws.before&&l&&void 0!==l.raws.before&&(e.raws.before=l.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls(n=>{t.props&&!t.props.includes(n.prop)||t.fast&&!n.value.includes(t.fast)||(n.value=n.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,r)=>{let n;try{n=e(t,r)}catch(e){throw t.addToError(e)}return!1!==n&&t.walk&&(n=t.walk(e)),n})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("atrule"===r.type&&e.test(r.name))return t(r,n)}):this.walk((r,n)=>{if("atrule"===r.type&&r.name===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("atrule"===e.type)return t(e,r)}))}walkComments(e){return this.walk((t,r)=>{if("comment"===t.type)return e(t,r)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("decl"===r.type&&e.test(r.prop))return t(r,n)}):this.walk((r,n)=>{if("decl"===r.type&&r.prop===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("decl"===e.type)return t(e,r)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("rule"===r.type&&e.test(r.selector))return t(r,n)}):this.walk((r,n)=>{if("rule"===r.type&&r.selector===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("rule"===e.type)return t(e,r)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}return d.registerParse=t=>{e=t},d.registerRule=e=>{t=e},d.registerAtRule=e=>{r=e},d.registerRoot=e=>{n=e},cl=d,d.default=d,d.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,r.prototype):"rule"===e.type?Object.setPrototypeOf(e,t.prototype):"decl"===e.type?Object.setPrototypeOf(e,s.prototype):"comment"===e.type?Object.setPrototypeOf(e,a.prototype):"root"===e.type&&Object.setPrototypeOf(e,n.prototype),e[o]=!0,e.nodes&&e.nodes.forEach(e=>{d.rebuild(e)})},cl}function kc(){if(pl)return hl;pl=1;let e,t,r=Sc();class n extends r{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(r={}){return new e(new t,this,r).stringify()}}return n.registerLazyResult=t=>{e=t},n.registerProcessor=e=>{t=e},hl=n,n.default=n,hl}function xc(){if(gl)return fl;gl=1;let e={};return fl=function(t){e[t]||(e[t]=!0,"undefined"!=typeof console&&console.warn&&console.warn(t))}}function Ec(){if(ml)return vl;ml=1;class e{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}return vl=e,e.default=e,vl}function Cc(){if(bl)return yl;bl=1;let e=Ec();class t{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(t,r={}){r.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(r.plugin=this.lastPlugin.postcssPlugin);let n=new e(t,r);return this.messages.push(n),n}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}}return yl=t,t.default=t,yl}function Ic(){if(xl)return kl;xl=1;let e=Sc();class t extends e{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}}return kl=t,t.default=t,e.registerAtRule(t),kl}function Oc(){if(Cl)return El;Cl=1;let e,t,r=Sc();class n extends r{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){let n=super.normalize(e);if(t)if("prepend"===r)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of n)e.raws.before=t.raws.before;return n}removeChild(e,t){let r=this.index(e);return!t&&0===r&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(r={}){return new e(new t,this,r).stringify()}}return n.registerLazyResult=t=>{e=t},n.registerProcessor=e=>{t=e},El=n,n.default=n,r.registerRoot(n),El}function Tc(){if(Ol)return Il;Ol=1;let e={comma:t=>e.split(t,[","],!0),space:t=>e.split(t,[" ","\n","\t"]),split(e,t,r){let n=[],i="",o=!1,s=0,a=!1,l="",u=!1;for(let r of e)u?u=!1:"\\"===r?u=!0:a?r===l&&(a=!1):'"'===r||"'"===r?(a=!0,l=r):"("===r?s+=1:")"===r?s>0&&(s-=1):0===s&&t.includes(r)&&(o=!0),o?(""!==i&&n.push(i.trim()),i="",o=!1):i+=r;return(r||""!==i)&&n.push(i.trim()),n}};return Il=e,e.default=e,Il}function Ac(){if(Al)return Tl;Al=1;let e=Sc(),t=Tc();class r extends e{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return t.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}}return Tl=r,r.default=r,e.registerRule(r),Tl}function Rc(){if(Pl)return Rl;Pl=1;let e=gc(),t=function(){if(Sl)return wl;Sl=1;const e="'".charCodeAt(0),t='"'.charCodeAt(0),r="\\".charCodeAt(0),n="/".charCodeAt(0),i="\n".charCodeAt(0),o=" ".charCodeAt(0),s="\f".charCodeAt(0),a="\t".charCodeAt(0),l="\r".charCodeAt(0),u="[".charCodeAt(0),c="]".charCodeAt(0),d="(".charCodeAt(0),h=")".charCodeAt(0),p="{".charCodeAt(0),f="}".charCodeAt(0),g=";".charCodeAt(0),v="*".charCodeAt(0),m=":".charCodeAt(0),y="@".charCodeAt(0),b=/[\t\n\f\r "#'()/;[\\\]{}]/g,w=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,S=/.[\r\n"'(/\\]/,k=/[\da-f]/i;return wl=function(x,E={}){let C,I,O,T,A,R,P,_,M,N,L=x.css.valueOf(),D=E.ignoreErrors,U=L.length,F=0,j=[],B=[];function q(e){throw x.error("Unclosed "+e,F)}return{back:function(e){B.push(e)},endOfFile:function(){return 0===B.length&&F>=U},nextToken:function(x){if(B.length)return B.pop();if(F>=U)return;let E=!!x&&x.ignoreUnclosed;switch(C=L.charCodeAt(F),C){case i:case o:case a:case l:case s:I=F;do{I+=1,C=L.charCodeAt(I)}while(C===o||C===i||C===a||C===l||C===s);N=["space",L.slice(F,I)],F=I-1;break;case u:case c:case p:case f:case m:case g:case h:{let e=String.fromCharCode(C);N=[e,e,F];break}case d:if(_=j.length?j.pop()[1]:"",M=L.charCodeAt(F+1),"url"===_&&M!==e&&M!==t&&M!==o&&M!==i&&M!==a&&M!==s&&M!==l){I=F;do{if(R=!1,I=L.indexOf(")",I+1),-1===I){if(D||E){I=F;break}q("bracket")}for(P=I;L.charCodeAt(P-1)===r;)P-=1,R=!R}while(R);N=["brackets",L.slice(F,I+1),F,I],F=I}else I=L.indexOf(")",F+1),T=L.slice(F,I+1),-1===I||S.test(T)?N=["(","(",F]:(N=["brackets",T,F,I],F=I);break;case e:case t:O=C===e?"'":'"',I=F;do{if(R=!1,I=L.indexOf(O,I+1),-1===I){if(D||E){I=F+1;break}q("string")}for(P=I;L.charCodeAt(P-1)===r;)P-=1,R=!R}while(R);N=["string",L.slice(F,I+1),F,I],F=I;break;case y:b.lastIndex=F+1,b.test(L),I=0===b.lastIndex?L.length-1:b.lastIndex-2,N=["at-word",L.slice(F,I+1),F,I],F=I;break;case r:for(I=F,A=!0;L.charCodeAt(I+1)===r;)I+=1,A=!A;if(C=L.charCodeAt(I+1),A&&C!==n&&C!==o&&C!==i&&C!==a&&C!==l&&C!==s&&(I+=1,k.test(L.charAt(I)))){for(;k.test(L.charAt(I+1));)I+=1;L.charCodeAt(I+1)===o&&(I+=1)}N=["word",L.slice(F,I+1),F,I],F=I;break;default:C===n&&L.charCodeAt(F+1)===v?(I=L.indexOf("*/",F+2)+1,0===I&&(D||E?I=L.length:q("comment")),N=["comment",L.slice(F,I+1),F,I],F=I):(w.lastIndex=F+1,w.test(L),I=0===w.lastIndex?L.length-1:w.lastIndex-2,N=["word",L.slice(F,I+1),F,I],j.push(N),F=I)}return F++,N},position:function(){return F}}}}(),r=wc(),n=Ic(),i=Oc(),o=Ac();const s={empty:!0,space:!0};return Rl=class{constructor(e){this.input=e,this.root=new i,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,r,i,o=new n;o.name=e[1].slice(1),""===o.name&&this.unnamedAtrule(o,e),this.init(o,e[2]);let s=!1,a=!1,l=[],u=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?u.push("("===t?")":"]"):"{"===t&&u.length>0?u.push("}"):t===u[u.length-1]&&u.pop(),0===u.length){if(";"===t){o.source.end=this.getPosition(e[2]),o.source.end.offset++,this.semicolon=!0;break}if("{"===t){a=!0;break}if("}"===t){if(l.length>0){for(i=l.length-1,r=l[i];r&&"space"===r[0];)r=l[--i];r&&(o.source.end=this.getPosition(r[3]||r[2]),o.source.end.offset++)}this.end(e);break}l.push(e)}else l.push(e);if(this.tokenizer.endOfFile()){s=!0;break}}o.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(o.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(o,"params",l),s&&(e=l[l.length-1],o.source.end=this.getPosition(e[3]||e[2]),o.source.end.offset++,this.spaces=o.raws.between,o.raws.between="")):(o.raws.afterName="",o.params=""),a&&(o.nodes=[],this.current=o)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let r,n=0;for(let i=t-1;i>=0&&(r=e[i],"space"===r[0]||(n+=1,2!==n));i--);throw this.input.error("Missed semicolon","word"===r[0]?r[3]+1:r[2])}colon(e){let t,r,n,i=0;for(let[o,s]of e.entries()){if(t=s,r=t[0],"("===r&&(i+=1),")"===r&&(i-=1),0===i&&":"===r){if(n){if("word"===n[0]&&"progid"===n[1])continue;return o}this.doubleColon(t)}n=t}return!1}comment(e){let t=new r;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=t(this.input)}decl(t,r){let n=new e;this.init(n,t[0][2]);let i,o=t[t.length-1];for(";"===o[0]&&(this.semicolon=!0,t.pop()),n.source.end=this.getPosition(o[3]||o[2]||function(e){for(let t=e.length-1;t>=0;t--){let r=e[t],n=r[3]||r[2];if(n)return n}}(t)),n.source.end.offset++;"word"!==t[0][0];)1===t.length&&this.unknownWord(t),n.raws.before+=t.shift()[1];for(n.source.start=this.getPosition(t[0][2]),n.prop="";t.length;){let e=t[0][0];if(":"===e||"space"===e||"comment"===e)break;n.prop+=t.shift()[1]}for(n.raws.between="";t.length;){if(i=t.shift(),":"===i[0]){n.raws.between+=i[1];break}"word"===i[0]&&/\w/.test(i[1])&&this.unknownWord([i]),n.raws.between+=i[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let s,a=[];for(;t.length&&(s=t[0][0],"space"===s||"comment"===s);)a.push(t.shift());this.precheckMissedSemicolon(t);for(let e=t.length-1;e>=0;e--){if(i=t[e],"!important"===i[1].toLowerCase()){n.important=!0;let r=this.stringFrom(t,e);r=this.spacesFromEnd(t)+r," !important"!==r&&(n.raws.important=r);break}if("important"===i[1].toLowerCase()){let r=t.slice(0),i="";for(let t=e;t>0;t--){let e=r[t][0];if(0===i.trim().indexOf("!")&&"space"!==e)break;i=r.pop()[1]+i}0===i.trim().indexOf("!")&&(n.important=!0,n.raws.important=i,t=r)}if("space"!==i[0]&&"comment"!==i[0])break}t.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(n,"value",a.concat(t),r),n.value.includes(":")&&!r&&this.checkMissedSemicolon(t)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new o;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,r=null,n=!1,i=null,o=[],s=e[1].startsWith("--"),a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)i||(i=l),o.push("("===r?")":"]");else if(s&&n&&"{"===r)i||(i=l),o.push("}");else if(0===o.length){if(";"===r){if(n)return void this.decl(a,s);break}if("{"===r)return void this.rule(a);if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}":"===r&&(n=!0)}else r===o[o.length-1]&&(o.pop(),0===o.length&&(i=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(i),t&&n){if(!s)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,s)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,r,n){let i,o,a,l,u=r.length,c="",d=!0;for(let e=0;e<u;e+=1)i=r[e],o=i[0],"space"!==o||e!==u-1||n?"comment"===o?(l=r[e-1]?r[e-1][0]:"empty",a=r[e+1]?r[e+1][0]:"empty",s[l]||s[a]||","===c.slice(-1)?d=!1:c+=i[1]):c+=i[1]:d=!1;if(!d){let n=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:n,value:c}}e[t]=c}rule(e){e.pop();let t=new o;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let n=t;n<e.length;n++)r+=e[n][1];return e.splice(t,e.length-t),r}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}}}function Pc(){if(Ml)return _l;Ml=1;let e=Sc(),t=Rc(),r=yc();function n(e,n){let i=new r(e,n),o=new t(i);try{o.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&n&&n.from&&(/\.scss$/i.test(n.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(n.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(n.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return o.root}return _l=n,n.default=n,e.registerParse(n),_l}function _c(){if(Ll)return Nl;Ll=1;let{isClean:e,my:t}=dc(),r=bc(),n=pc(),i=Sc(),o=kc(),s=xc(),a=Cc(),l=Pc(),u=Oc();const c={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},d={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},h={Once:!0,postcssPlugin:!0,prepare:!0};function p(e){return"object"==typeof e&&"function"==typeof e.then}function f(e){let t=!1,r=c[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[r,r+"-"+t,0,r+"Exit",r+"Exit-"+t]:t?[r,r+"-"+t,r+"Exit",r+"Exit-"+t]:e.append?[r,0,r+"Exit"]:[r,r+"Exit"]}function g(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:f(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function v(t){return t[e]=!1,t.nodes&&t.nodes.forEach(e=>v(e)),t}let m={};class y{constructor(e,r,n){let o;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof y||r instanceof a)o=v(r.root),r.map&&(void 0===n.map&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=r.map);else{let e=l;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{o=e(r,n)}catch(e){this.processed=!0,this.error=e}o&&!o[t]&&i.rebuild(o)}else o=v(r);this.result=new a(e,o,n),this.helpers={...m,postcss:m,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let r=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(r.postcssVersion&&"production"!==process.env.NODE_ENV){let e=r.postcssPlugin,t=r.postcssVersion,n=this.result.processor.version,i=t.split("."),o=n.split(".");(i[0]!==o[0]||parseInt(i[1])>parseInt(o[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+n+", but "+e+" uses "+t+". Perhaps this is the source of the error below.")}}else e.plugin=r.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,r)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,r])};for(let t of this.plugins)if("object"==typeof t)for(let r in t){if(!d[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!h[r])if("object"==typeof t[r])for(let n in t[r])e(t,"*"===n?r:r+"-"+n.toLowerCase(),t[r][n]);else"function"==typeof t[r]&&e(t,r,t[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],r=this.runOnRoot(t);if(p(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];){t[e]=!0;let r=[g(t)];for(;r.length>0;){let e=this.visitTick(r);if(p(e))try{await e}catch(e){let t=r[r.length-1].node;throw this.handleError(e,t)}}}if(this.listeners.OnceExit)for(let[e,r]of this.listeners.OnceExit){this.result.lastPlugin=e;try{if("document"===t.type){let e=t.nodes.map(e=>r(e,this.helpers));await Promise.all(e)}else await r(t,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return p(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=n;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let i=new r(t,this.result.root,this.result.opts).generate();return this.result.css=i[0],this.result.map=i[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins){if(p(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];)t[e]=!0,this.walkSync(t);if(this.listeners.OnceExit)if("document"===t.type)for(let e of t.nodes)this.visitSync(this.listeners.OnceExit,e);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||s("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[r,n]of e){let e;this.result.lastPlugin=r;try{e=n(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(p(e))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:n,visitors:i}=r;if("root"!==n.type&&"document"!==n.type&&!n.parent)return void t.pop();if(i.length>0&&r.visitorIndex<i.length){let[e,t]=i[r.visitorIndex];r.visitorIndex+=1,r.visitorIndex===i.length&&(r.visitors=[],r.visitorIndex=0),this.result.lastPlugin=e;try{return t(n.toProxy(),this.helpers)}catch(e){throw this.handleError(e,n)}}if(0!==r.iterator){let i,o=r.iterator;for(;i=n.nodes[n.indexes[o]];)if(n.indexes[o]+=1,!i[e])return i[e]=!0,void t.push(g(i));r.iterator=0,delete n.indexes[o]}let o=r.events;for(;r.eventIndex<o.length;){let t=o[r.eventIndex];if(r.eventIndex+=1,0===t)return void(n.nodes&&n.nodes.length&&(n[e]=!0,r.iterator=n.getIterator()));if(this.listeners[t])return void(r.visitors=this.listeners[t])}t.pop()}walkSync(t){t[e]=!0;let r=f(t);for(let n of r)if(0===n)t.nodes&&t.each(t=>{t[e]||this.walkSync(t)});else{let e=this.listeners[n];if(e&&this.visitSync(e,t.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}}return y.registerPostcss=e=>{m=e},Nl=y,y.default=y,u.registerLazyResult(y),o.registerLazyResult(y),Nl}function Mc(){if(jl)return Fl;jl=1;let e=function(){if(Ul)return Dl;Ul=1;let e=bc(),t=pc(),r=xc(),n=Pc();const i=Cc();class o{constructor(r,n,o){let s;n=n.toString(),this.stringified=!1,this._processor=r,this._css=n,this._opts=o,this._map=void 0;let a=t;this.result=new i(this._processor,s,this._opts),this.result.css=n;let l=this;Object.defineProperty(this.result,"root",{get:()=>l.root});let u=new e(a,s,this._opts,n);if(u.isMap()){let[e,t]=u.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else u.clearAnnotation(),this.result.css=u.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this._opts||r("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=n;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}}return Dl=o,o.default=o,Dl}(),t=_c(),r=kc(),n=Oc();class i{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(r,n={}){return this.plugins.length||n.parser||n.stringifier||n.syntax?new t(this,r,n):new e(this,r,n)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}return Fl=i,i.default=i,n.registerProcessor(i),r.registerProcessor(i),Fl}function Nc(){if(Wl)return zl;Wl=1;let e=cc(),t=gc(),r=_c(),n=Sc(),i=Mc(),o=pc(),s=function(){if(ql)return Bl;ql=1;let e=gc(),t=mc(),r=wc(),n=Ic(),i=yc(),o=Oc(),s=Ac();function a(l,u){if(Array.isArray(l))return l.map(e=>a(e));let{inputs:c,...d}=l;if(c){u=[];for(let e of c){let r={...e,__proto__:i.prototype};r.map&&(r.map={...r.map,__proto__:t.prototype}),u.push(r)}}if(d.nodes&&(d.nodes=l.nodes.map(e=>a(e,u))),d.source){let{inputId:e,...t}=d.source;d.source=t,null!=e&&(d.source.input=u[e])}if("root"===d.type)return new o(d);if("decl"===d.type)return new e(d);if("rule"===d.type)return new s(d);if("comment"===d.type)return new r(d);if("atrule"===d.type)return new n(d);throw new Error("Unknown node type: "+l.type)}return Bl=a,a.default=a,Bl}(),a=kc(),l=Ec(),u=wc(),c=Ic(),d=Cc(),h=yc(),p=Pc(),f=Tc(),g=Ac(),v=Oc(),m=fc();function y(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new i(e)}return y.plugin=function(e,t){let r,n=!1;function o(...r){console&&console.warn&&!n&&(n=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let o=t(...r);return o.postcssPlugin=e,o.postcssVersion=(new i).version,o}return Object.defineProperty(o,"postcss",{get:()=>(r||(r=o()),r)}),o.process=function(e,t,r){return y([o(r)]).process(e,t)},o},y.stringify=o,y.parse=p,y.fromJSON=s,y.list=f,y.comment=e=>new u(e),y.atRule=e=>new c(e),y.decl=e=>new t(e),y.rule=e=>new g(e),y.root=e=>new v(e),y.document=e=>new a(e),y.CssSyntaxError=e,y.Declaration=t,y.Container=n,y.Processor=i,y.Document=a,y.Comment=u,y.Warning=l,y.AtRule=c,y.Result=d,y.Input=h,y.Rule=g,y.Root=v,y.Node=m,r.registerPostcss(y),zl=y,y.default=y,zl}function Lc(e){if(Jl[e])return Jl[e];const t=function(e){var t,r;const n=null==(r=null==(t=null==globalThis?void 0:globalThis.Zone)?void 0:t.__symbol__)?void 0:r.call(t,e);return n&&globalThis[n]?globalThis[n]:void 0}(e)||globalThis[e],r=t.prototype,n=e in Kl?Kl[e]:void 0,i=Boolean(n&&n.every(e=>{var t,n;return Boolean(null==(n=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:n.toString().includes("[native code]"))})),o=e in Gl?Gl[e]:void 0,s=Boolean(o&&o.every(e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))}));if(i&&s)return Jl[e]=t.prototype,t.prototype;try{const n=document.createElement("iframe");document.body.appendChild(n);const i=n.contentWindow;if(!i)return t.prototype;const o=i[e].prototype;return document.body.removeChild(n),o?Jl[e]=o:r}catch(e){return r}}function Dc(e,t,r){var n;const i=`${e}.${String(r)}`;if(Ql[i])return Ql[i].call(t);const o=Lc(e),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(Ql[i]=s,s.call(t)):t[r]}function Uc(e,t,r){const n=`${e}.${String(r)}`;if(Xl[n])return Xl[n].bind(t);const i=Lc(e)[r];return"function"!=typeof i?t[r]:(Xl[n]=i,i.bind(t))}function Fc(e){return Dc("Node",e,"childNodes")}function jc(e){return Dc("Node",e,"parentNode")}function Bc(e){return Dc("Node",e,"parentElement")}function qc(e){return Dc("Node",e,"textContent")}function zc(e,t){return Uc("Node",e,"contains")(t)}function Wc(e){return Uc("Node",e,"getRootNode")()}function Vc(e){return e&&"host"in e?Dc("ShadowRoot",e,"host"):null}function $c(e){return e.styleSheets}function Hc(e){return e&&"shadowRoot"in e?Dc("Element",e,"shadowRoot"):null}function Kc(e,t){return Dc("Element",e,"querySelector")(t)}function Gc(e,t){return Dc("Element",e,"querySelectorAll")(t)}function Jc(){return Lc("MutationObserver").constructor}function Qc(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}function Xc(e,t,r={}){let n=null,i=0;return function(...o){const s=Date.now();i||!1!==r.leading||(i=s);const a=t-(s-i),l=this;a<=0||a>t?(n&&(clearTimeout(n),n=null),i=s,e.apply(l,o)):n||!1===r.trailing||(n=setTimeout(()=>{i=!1===r.leading?0:Date.now(),n=null,e.apply(l,o)},a))}}function Yc(e,t,r,n,i=window){const o=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,n?r:{set(e){setTimeout(()=>{r.set.call(this,e)},0),o&&o.set&&o.set.call(this,e)}}),()=>Yc(e,t,o||{},!0)}function Zc(e,t,r){try{if(!(t in e))return()=>{};const n=e[t],i=r(n);return"function"==typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=i,()=>{e[t]=n}}catch(e){return()=>{}}}function ed(e){var t,r,n,i;const o=e.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(t=Yl.parentElement(o.body))?void 0:t.scrollLeft)||(null==(r=null==o?void 0:o.body)?void 0:r.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(n=Yl.parentElement(o.body))?void 0:n.scrollTop)||(null==(i=null==o?void 0:o.body)?void 0:i.scrollTop)||0}}function td(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function rd(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function nd(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:Yl.parentElement(e)}function id(e,t,r,n){if(!e)return!1;const i=nd(e);if(!i)return!1;try{if("string"==typeof t){if(i.classList.contains(t))return!0;if(n&&null!==i.closest("."+t))return!0}else if(_u(i,t,n))return!0}catch(e){}if(r){if(i.matches(r))return!0;if(n&&null!==i.closest(r))return!0}return!1}function od(e,t){return-1!==t.getId(e)}function sd(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||t.getId(e)===Es}function ad(e,t){if(function(e){const t=e&&"host"in e&&"mode"in e&&ks.host(e)||null;return Boolean(t&&"shadowRoot"in t&&ks.shadowRoot(t)===e)}(e))return!1;const r=t.getId(e);if(!t.has(r))return!0;const n=Yl.parentNode(e);return(!n||n.nodeType!==e.DOCUMENT_NODE)&&(!n||ad(n,t))}function ld(e){return Boolean(e.changedTouches)}function ud(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}function cd(e){const t={},r=(e,r)=>{const n={value:e,parent:r,children:[]};return t[e.node.id]=n,n},n=[];for(const i of e){const{nextId:e,parentId:o}=i;if(e&&e in t){const o=t[e];if(o.parent){const e=o.parent.children.indexOf(o);o.parent.children.splice(e,0,r(i,o.parent))}else{const e=n.indexOf(o);n.splice(e,0,r(i,null))}continue}if(o in t){const e=t[o];e.children.push(r(i,e));continue}n.push(r(i,null))}return n}function dd(e,t){t(e.value);for(let r=e.children.length-1;r>=0;r--)dd(e.children[r],t)}function hd(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function pd(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function fd(e,t){var r,n;const i=null==(n=null==(r=e.ownerDocument)?void 0:r.defaultView)?void 0:n.frameElement;if(!i||i===t)return{x:0,y:0,relativeScale:1,absoluteScale:1};const o=i.getBoundingClientRect(),s=fd(i,t),a=o.height/i.clientHeight;return{x:o.x*s.relativeScale+s.x,y:o.y*s.relativeScale+s.y,relativeScale:a,absoluteScale:s.absoluteScale*a}}function gd(e){return!!e&&(e instanceof Hl&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(Yl.shadowRoot(e)))}function vd(e,t){const r=e[t[0]];return 1===t.length?r:vd(r.cssRules[t[1]].cssRules,t.slice(2))}function md(e){const t=[...e],r=t.pop();return{positions:t,index:r}}function yd(e){const t=new Set,r=[];for(let n=e.length;n--;){const i=e[n];t.has(i.id)||(r.push(i),t.add(i.id))}return r}function bd(e){var t;let r=null;return"getRootNode"in e&&(null==(t=Yl.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&Yl.host(Yl.getRootNode(e))&&(r=Yl.host(Yl.getRootNode(e))),r}function wd(e){let t,r=e;for(;t=bd(r);)r=t;return r}function Sd(e){const t=e.ownerDocument;if(!t)return!1;const r=wd(e);return Yl.contains(t,r)}function kd(e){const t=e.ownerDocument;return!!t&&(Yl.contains(t,e)||Sd(e))}function xd(e){if(!e||!e.outerHTML)return"";let t="";for(;e.parentElement;){let r=e.localName;if(!r)break;r=r.toLowerCase();const n=e.parentElement,i=[];if(n.children&&n.children.length>0)for(let e=0;e<n.children.length;e++){const t=n.children[e];t.localName&&t.localName.toLowerCase&&t.localName.toLowerCase()===r&&i.push(t)}i.length>1&&(r+=`:eq(${i.indexOf(e)})`),t=r+(t?">"+t:""),e=n}return t}function Ed(e){return"[object Object]"===Object.prototype.toString.call(e)}function Cd(e,t){if(0===t)return!0;const r=Object.keys(e);for(const n of r)if(Ed(e[n])&&Cd(e[n],t-1))return!0;return!1}function Id(e,t){const r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,t);const n=[],i=[];return JSON.stringify(e,function(e,t){if(n.length>0){const r=n.indexOf(this);~r?n.splice(r+1):n.push(this),~r?i.splice(r,1/0,e):i.push(e),~n.indexOf(t)&&(t=n[0]===t?"[Circular ~]":"[Circular ~."+i.slice(0,n.indexOf(t)).join(".")+"]")}else n.push(t);if(null===t)return t;if(void 0===t)return"undefined";if(function(e){if(Ed(e)&&Object.keys(e).length>r.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(Ed(e)&&Cd(e,r.depthOfLimit))return!0;return!1}(t))return function(e){let t=e.toString();r.stringLengthLimit&&t.length>r.stringLengthLimit&&(t=`${t.slice(0,r.stringLengthLimit)}...`);return t}(t);if("bigint"==typeof t)return t.toString()+"n";if(t instanceof Event){const e={};for(const r in t){const n=t[r];Array.isArray(n)?e[r]=xd(n.length?n[0]:null):e[r]=n}return e}return t instanceof Node?t instanceof HTMLElement?t?t.outerHTML:"":t.nodeName:t instanceof Error?t.stack?t.stack+"\nEnd of stack for Error object":t.name+": "+t.message:t})}function Od(e,t,r){const n=r?Object.assign({},hu,r):hu,i=n.logger;if(!i)return()=>{};let o;o="string"==typeof i?t[i]:i;let s=0,a=!1;const l=[];if(n.level.includes("error")){const r=t=>{const r=t.message,i=t.error,o=du.parse(i).map(e=>e.toString()),s=[Id(r,n.stringifyOptions)];e({level:"error",trace:o,payload:s})};t.addEventListener("error",r),l.push(()=>{t.removeEventListener("error",r)});const i=t=>{let r,i;t.reason instanceof Error?(r=t.reason,i=[Id(`Uncaught (in promise) ${r.name}: ${r.message}`,n.stringifyOptions)]):(r=new Error,i=[Id("Uncaught (in promise)",n.stringifyOptions),Id(t.reason,n.stringifyOptions)]);const o=du.parse(r).map(e=>e.toString());e({level:"error",trace:o,payload:i})};t.addEventListener("unhandledrejection",i),l.push(()=>{t.removeEventListener("unhandledrejection",i)})}for(const e of n.level)l.push(u(o,e));return()=>{l.forEach(e=>e())};function u(t,r){return t[r]?nu.patch(t,r,t=>(...i)=>{if(t.apply(this,i),!("assert"===r&&i[0]||a)){a=!0;try{const t=du.parse(new Error).map(e=>e.toString()).splice(1),o=("assert"===r?i.slice(1):i).map(e=>Id(e,n.stringifyOptions));s++,s<n.lengthThreshold?e({level:r,trace:t,payload:o}):s===n.lengthThreshold&&e({level:"warn",trace:[],payload:[Id("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...i)}finally{a=!1}}}):()=>{}}}c(vu,{PLUGIN_NAME:()=>pu,getRecordConsolePlugin:()=>fu});var Td,Ad,Rd,Pd,_d,Md,Nd,Ld,Dd,Ud,Fd,jd,Bd,qd,zd,Wd,Vd,$d,Hd,Kd,Gd,Jd,Qd,Xd,Yd,Zd,eh,th,rh,nh,ih,oh,sh,ah,lh,uh,ch,dh,hh,ph,fh,gh,vh,mh,yh,bh,wh,Sh,kh,xh,Eh,Ch,Ih,Oh,Th,Ah,Rh,Ph,_h,Mh,Nh,Lh,Dh,Uh,Fh,jh,Bh,qh,zh,Wh,Vh,$h,Hh,Kh,Gh,Jh,Qh,Xh,Yh,Zh,ep,tp,rp,np,ip,op,sp,ap,lp,up,cp,dp,hp,pp,fp,gp,vp,mp,yp,bp,wp,Sp,kp,xp,Ep,Cp,Ip,Op,Tp,Ap,Rp,Pp,_p,Mp,Np,Lp,Dp,Up,Fp,jp,Bp,qp,zp,Wp,Vp,$p,Hp,Kp,Gp,Jp,Qp,Xp,Yp,Zp,ef,tf,rf,nf,of,sf,af,lf,uf,cf,df,hf,pf,ff,gf,vf,mf,yf,bf,wf,Sf,kf,xf,Ef,Cf,If,Of,Tf,Af,Rf,Pf,_f,Mf,Nf,Lf,Df,Uf,Ff,jf,Bf,qf,zf,Wf,Vf,$f,Hf,Kf,Gf,Jf,Qf,Xf,Yf,Zf,eg,tg,rg,ng,ig,og,sg,ag,lg,ug,cg,dg,hg,pg,fg,gg,vg,mg,yg,bg,wg,Sg,kg=l({"../../../../node_modules/@amplitude/rrweb-plugin-console-record/dist/rrweb-plugin-console-record.js"(){for((as=Object.defineProperty,ls=(e,t,r)=>t in e?as(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,us=(e,t,r)=>ls(e,"symbol"!=typeof t?t+"":t,r),cs=Object.defineProperty,ds=(e,t,r)=>t in e?cs(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,hs=(e,t,r)=>ds(e,"symbol"!=typeof t?t+"":t,r),fs=Object.defineProperty,gs=(e,t,r)=>t in e?fs(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,vs=(e,t,r)=>gs(e,"symbol"!=typeof t?t+"":t,r),ms={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},ys={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},bs={},ws={},Ss={},ks={childNodes:wu,parentNode:Su,parentElement:ku,textContent:xu,contains:Eu,getRootNode:Cu,host:Iu,styleSheets:Ou,shadowRoot:Tu,querySelector:Au,querySelectorAll:Ru,mutationObserver:Pu},xs=class{constructor(){vs(this,"idNodeMap",new Map),vs(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;const r=null==(t=this.getMeta(e))?void 0:t.id;return null!=r?r:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(e=>this.removeNodeFromMap(e))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)}replace(e,t){const r=this.getNode(e);if(r){const e=this.nodeMetaMap.get(r);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}},Es=-2,Cs={exports:{}},Os={},Ts=Object.freeze(Object.defineProperty({__proto__:null,default:Os},Symbol.toStringTag,{value:"Module"})),As=Nu(Ts),_s={},_a=sc(),(Ma=Mu(_a)).stringify,Ma.fromJSON,Ma.plugin,Ma.parse,Ma.list,Ma.document,Ma.comment,Ma.atRule,Ma.rule,Ma.decl,Ma.root,Ma.CssSyntaxError,Ma.Declaration,Ma.Container,Ma.Processor,Ma.Document,Ma.Comment,Ma.Warning,Ma.AtRule,Ma.Result,Ma.Input,Ma.Rule,Ma.Root,Ma.Node,Na=Object.defineProperty,La=(e,t,r)=>t in e?Na(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Da=(e,t,r)=>La(e,"symbol"!=typeof t?t+"":t,r),Ua={exports:{}},ja={},Ba=Object.freeze(Object.defineProperty({__proto__:null,default:ja},Symbol.toStringTag,{value:"Module"})),qa=lc(Ba),Va={},Vl=Nc(),($l=ac(Vl)).stringify,$l.fromJSON,$l.plugin,$l.parse,$l.list,$l.document,$l.comment,$l.atRule,$l.rule,$l.decl,$l.root,$l.CssSyntaxError,$l.Declaration,$l.Container,$l.Processor,$l.Document,$l.Comment,$l.Warning,$l.AtRule,$l.Result,$l.Input,$l.Rule,$l.Root,$l.Node,Hl=class e{constructor(...e){Da(this,"parentElement",null),Da(this,"parentNode",null),Da(this,"ownerDocument"),Da(this,"firstChild",null),Da(this,"lastChild",null),Da(this,"previousSibling",null),Da(this,"nextSibling",null),Da(this,"ELEMENT_NODE",1),Da(this,"TEXT_NODE",3),Da(this,"nodeType"),Da(this,"nodeName"),Da(this,"RRNodeType")}get childNodes(){const e=[];let t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(t){if(!(t instanceof e))return!1;if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}},Kl={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Gl={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Jl={},Ql={},Xl={},Yl={childNodes:Fc,parentNode:jc,parentElement:Bc,textContent:qc,contains:zc,getRootNode:Wc,host:Vc,styleSheets:$c,shadowRoot:Hc,querySelector:Kc,querySelectorAll:Gc,mutationObserver:Jc},Zl="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.",eu={map:{},getId:()=>(console.error(Zl),-1),getNode:()=>(console.error(Zl),null),removeNodeFromMap(){console.error(Zl)},has:()=>(console.error(Zl),!1),reset(){console.error(Zl)}},"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(eu=new Proxy(eu,{get:(e,t,r)=>("map"===t&&console.error(Zl),Reflect.get(e,t,r))})),tu=Date.now,/[1-9][0-9]{12}/.test(Date.now().toString())||(tu=()=>(new Date).getTime()),ru=class{constructor(){hs(this,"id",1),hs(this,"styleIDMap",new WeakMap),hs(this,"idStyleMap",new Map)}getId(e){var t;return null!=(t=this.styleIDMap.get(e))?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let r;return r=void 0===t?this.id++:t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}},nu=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:ru,get _mirror(){return eu},closestElementOfNode:nd,getBaseDimension:fd,getNestedRule:vd,getPositionsAndIndex:md,getRootShadowHost:wd,getShadowHost:bd,getWindowHeight:td,getWindowScroll:ed,getWindowWidth:rd,hasShadowRoot:gd,hookSetter:Yc,inDom:kd,isAncestorRemoved:ad,isBlocked:id,isIgnored:sd,isSerialized:od,isSerializedIframe:hd,isSerializedStylesheet:pd,iterateResolveTree:dd,legacy_isTouchEvent:ld,get nowTimestamp(){return tu},on:Qc,patch:Zc,polyfill:ud,queueToResolveTrees:cd,shadowHostInDom:Sd,throttle:Xc,uniqueTextMutations:yd},Symbol.toStringTag,{value:"Module"})),iu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ou="undefined"==typeof Uint8Array?[]:new Uint8Array(256),rg=0);rg<64;rg++)ou[iu.charCodeAt(rg)]=rg;"undefined"!=typeof self&&self.Blob&&new Blob(['(function() {\n "use strict";\n var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);\n for (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n var encode = function(arraybuffer) {\n var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = "";\n for (i2 = 0; i2 < len; i2 += 3) {\n base64 += chars[bytes[i2] >> 2];\n base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];\n base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];\n base64 += chars[bytes[i2 + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + "=";\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + "==";\n }\n return base64;\n };\n const lastBlobMap = /* @__PURE__ */ new Map();\n const transparentBlobMap = /* @__PURE__ */ new Map();\n async function getTransparentBlobFor(width, height, dataURLOptions) {\n const id = `${width}-${height}`;\n if ("OffscreenCanvas" in globalThis) {\n if (transparentBlobMap.has(id)) return transparentBlobMap.get(id);\n const offscreen = new OffscreenCanvas(width, height);\n offscreen.getContext("2d");\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n transparentBlobMap.set(id, base64);\n return base64;\n } else {\n return "";\n }\n }\n const worker = self;\n worker.onmessage = async function(e) {\n if ("OffscreenCanvas" in globalThis) {\n const { id, bitmap, width, height, dataURLOptions } = e.data;\n const transparentBase64 = getTransparentBlobFor(\n width,\n height,\n dataURLOptions\n );\n const offscreen = new OffscreenCanvas(width, height);\n const ctx = offscreen.getContext("2d");\n ctx.drawImage(bitmap, 0, 0);\n bitmap.close();\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const type = blob.type;\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n if (!lastBlobMap.has(id) && await transparentBase64 === base64) {\n lastBlobMap.set(id, base64);\n return worker.postMessage({ id });\n }\n if (lastBlobMap.get(id) === base64) return worker.postMessage({ id });\n worker.postMessage({\n id,\n type,\n base64,\n width,\n height\n });\n lastBlobMap.set(id, base64);\n } else {\n return worker.postMessage({ id: e.data.id });\n }\n };\n})();\n//# sourceMappingURL=image-bitmap-data-url-worker-IJpC7g_b.js.map\n'],{type:"text/javascript;charset=utf-8"});try{if(2!==Array.from([1],e=>2*e)[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(ps=e.contentWindow)?void 0:ps.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}var e;new xs,(e=su||(su={}))[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped",au=class{constructor(e){us(this,"fileName"),us(this,"functionName"),us(this,"lineNumber"),us(this,"columnNumber"),this.fileName=e.fileName||"",this.functionName=e.functionName||"",this.lineNumber=e.lineNumber,this.columnNumber=e.columnNumber}toString(){const e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?`${this.functionName} (${this.fileName}:${e}:${t})`:`${this.fileName}:${e}:${t}`}},lu=/(^|@)\S+:\d+/,uu=/^\s*at .*(\S+:\d+|\(native\))/m,cu=/^(eval@)?(\[native code])?$/,du={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(uu)?this.parseV8OrIE(e):e.stack?this.parseFFOrSafari(e):(console.warn("[console-record-plugin]: Failed to parse error object:",e),[]):[]},extractLocation:function(e){if(-1===e.indexOf(":"))return[e];const t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error(`Cannot parse given url: ${e}`);return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function(e){return e.stack.split("\n").filter(function(e){return!!e.match(uu)},this).map(function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));let t=e.replace(/^\s+/,"").replace(/\(eval code/g,"(");const r=t.match(/ (\((.+):(\d+):(\d+)\)$)/);t=r?t.replace(r[0],""):t;const n=t.split(/\s+/).slice(1),i=this.extractLocation(r?r[1]:n.pop()),o=n.join(" ")||void 0,s=["eval","<anonymous>"].indexOf(i[0])>-1?void 0:i[0];return new au({functionName:o,fileName:s,lineNumber:i[1],columnNumber:i[2]})},this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter(function(e){return!e.match(cu)},this).map(function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new au({functionName:e});{const t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),n=r&&r[1]?r[1]:void 0,i=this.extractLocation(e.replace(t,""));return new au({functionName:n,fileName:i[0],lineNumber:i[1],columnNumber:i[2]})}},this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){const t=/Line (\d+).*script (?:in )?(\S+)/i,r=e.message.split("\n"),n=[];for(let e=2,i=r.length;e<i;e+=2){const i=t.exec(r[e]);i&&n.push(new au({fileName:i[2],lineNumber:parseFloat(i[1])}))}return n},parseOpera10:function(e){const t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=e.stacktrace.split("\n"),n=[];for(let e=0,i=r.length;e<i;e+=2){const i=t.exec(r[e]);i&&n.push(new au({functionName:i[3]||void 0,fileName:i[2],lineNumber:parseFloat(i[1])}))}return n},parseOpera11:function(e){return e.stack.split("\n").filter(function(e){return!!e.match(lu)&&!e.match(/^Error created at/)},this).map(function(e){const t=e.split("@"),r=this.extractLocation(t.pop()),n=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new au({functionName:n,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})},this)}},hu={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"},pu="rrweb/console@1",fu=e=>({name:pu,observer:Od,options:e})}}),xg={};function Eg(e){if(Fd[e])return Fd[e];const t=function(e){var t,r;const n=null==(r=null==(t=null==globalThis?void 0:globalThis.Zone)?void 0:t.__symbol__)?void 0:r.call(t,e);return n&&globalThis[n]?globalThis[n]:void 0}(e)||globalThis[e],r=t.prototype,n=e in Dd?Dd[e]:void 0,i=Boolean(n&&n.every(e=>{var t,n;return Boolean(null==(n=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:n.toString().includes("[native code]"))})),o=e in Ud?Ud[e]:void 0,s=Boolean(o&&o.every(e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))}));if(i&&s)return Fd[e]=t.prototype,t.prototype;try{const n=document.createElement("iframe");document.body.appendChild(n);const i=n.contentWindow;if(!i)return t.prototype;const o=i[e].prototype;return document.body.removeChild(n),o?Fd[e]=o:r}catch(e){return r}}function Cg(e,t,r){var n;const i=`${e}.${String(r)}`;if(jd[i])return jd[i].call(t);const o=Eg(e),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(jd[i]=s,s.call(t)):t[r]}function Ig(e,t,r){const n=`${e}.${String(r)}`;if(Bd[n])return Bd[n].bind(t);const i=Eg(e)[r];return"function"!=typeof i?t[r]:(Bd[n]=i,i.bind(t))}function Og(e){return Cg("Node",e,"childNodes")}function Tg(e){return Cg("Node",e,"parentNode")}function Ag(e){return Cg("Node",e,"parentElement")}function Rg(e){return Cg("Node",e,"textContent")}function Pg(e,t){return Ig("Node",e,"contains")(t)}function _g(e){return Ig("Node",e,"getRootNode")()}function Mg(e){return e&&"host"in e?Cg("ShadowRoot",e,"host"):null}function Ng(e){return e.styleSheets}function Lg(e){return e&&"shadowRoot"in e?Cg("Element",e,"shadowRoot"):null}function Dg(e,t){return Cg("Element",e,"querySelector")(t)}function Ug(e,t){return Cg("Element",e,"querySelectorAll")(t)}function Fg(){return Eg("MutationObserver").constructor}function jg(e){return e.nodeType===e.ELEMENT_NODE}function Bg(e){const t=e&&"host"in e&&"mode"in e&&qd.host(e)||null;return Boolean(t&&"shadowRoot"in t&&qd.shadowRoot(t)===e)}function qg(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function zg(e){try{const r=e.rules||e.cssRules;if(!r)return null;let n=e.href;!n&&e.ownerNode&&e.ownerNode.ownerDocument&&(n=e.ownerNode.ownerDocument.location.href);const i=Array.from(r,e=>Wg(e,n)).join("");return(t=i).includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t}catch(e){return null}var t}function Wg(e,t){if(function(e){return"styleSheet"in e}(e)){let t;try{t=zg(e.styleSheet)||function(e){const{cssText:t}=e;if(t.split('"').length<3)return t;const r=["@import",`url(${JSON.stringify(e.href)})`];return""===e.layerName?r.push("layer"):e.layerName&&r.push(`layer(${e.layerName})`),e.supportsText&&r.push(`supports(${e.supportsText})`),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}(e)}catch(r){t=e.cssText}return e.styleSheet.href?Gg(t,e.styleSheet.href):t}{let r=e.cssText;return function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":")&&(r=function(e){const t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}(r)),t?Gg(r,t):r}}function Vg({element:e,maskInputOptions:t,tagName:r,type:n,value:i,maskInputFn:o}){let s=i||"";const a=n&&$g(n);return(t[r.toLowerCase()]||a&&t[a])&&(s=o?o(s,e):"*".repeat(s.length)),s}function $g(e){return e.toLowerCase()}function Hg(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?$g(t):null}function Kg(e,t){var r;let n;try{n=new URL(e,null!=t?t:window.location.href)}catch(e){return null}const i=n.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!=(r=null==i?void 0:i[1])?r:null}function Gg(e,t){return(e||"").replace(Vd,(e,r,n,i,o,s)=>{const a=n||o||s,l=r||i||"";if(!a)return e;if($d.test(a)||Hd.test(a))return`url(${l}${a}${l})`;if(Kd.test(a))return`url(${l}${a}${l})`;if("/"===a[0])return`url(${l}${function(e){let t="";return t=e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0],t=t.split("?")[0],t}(t)+a}${l})`;const u=t.split("/"),c=a.split("/");u.pop();for(const e of c)"."!==e&&(".."===e?u.pop():u.push(e));return`url(${l}${u.join("/")}${l})`})}function Jg(e,t=!1){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function Qg(e,t){return function(e,t,r=!1){const n=Array.from(t.childNodes),i=[];let o=0;if(n.length>1&&e&&"string"==typeof e){let t=Jg(e,r);const s=t.length/e.length;for(let a=1;a<n.length;a++)if(n[a].textContent&&"string"==typeof n[a].textContent){const l=Jg(n[a].textContent,r),u=100;let c=3;for(;c<l.length&&(l[c].match(/[a-zA-Z0-9]/)||-1!==l.indexOf(l.substring(0,c),1));c++);for(;c<l.length;c++){let d=l.substring(0,c),h=t.split(d),p=-1;if(2===h.length)p=h[0].length;else if(h.length>2&&""===h[0]&&""!==n[a-1].textContent)p=t.indexOf(d,1);else if(1===h.length){if(d=d.substring(0,d.length-1),h=t.split(d),h.length<=1)return i.push(e),i;c=u+1}else c===l.length-1&&(p=t.indexOf(d));if(h.length>=2&&c>u){const e=n[a-1].textContent;if(e&&"string"==typeof e){const r=Jg(e).length;p=t.indexOf(d,r)}-1===p&&(p=h[0].length)}if(-1!==p){let a=Math.floor(p/s);for(;a>0&&a<e.length;){if(o+=1,o>50*n.length)return i.push(e),i;const l=Jg(e.substring(0,a),r);if(l.length===p){i.push(e.substring(0,a)),e=e.substring(a),t=t.substring(p);break}l.length<p?a+=Math.max(1,Math.floor((p-l.length)/s)):a-=Math.max(1,Math.floor((l.length-p)*s))}break}}}}return i.push(e),i}(e,t).join("/* rr_split */")}function Xg(){return Jd++}function Yg(e,t){return t&&""!==t.trim()?ev(e,t):t}function Zg(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function ev(e,t){let r=rh.get(e);if(r||(r=e.createElement("a"),rh.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function tv(e,t,r,n){return n?"src"===r||"href"===r&&("use"!==t||"#"!==n[0])||"xlink:href"===r&&"#"!==n[0]?Yg(e,n):"background"!==r||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===r?function(e,t){if(""===t.trim())return t;let r=0;function n(e){let n;const i=e.exec(t.substring(r));return i?(n=i[0],r+=n.length,n):""}const i=[];for(;n(th),!(r>=t.length);){let o=n(eh);if(","===o.slice(-1))o=Yg(e,o.substring(0,o.length-1)),i.push(o);else{let n="";o=Yg(e,o);let s=!1;for(;;){const e=t.charAt(r);if(""===e){i.push((o+n).trim());break}if(s)")"===e&&(s=!1);else{if(","===e){r+=1,i.push((o+n).trim());break}"("===e&&(s=!0)}n+=e,r+=1}}}return i.join(", ")}(e,n):"style"===r?Gg(n,ev(e)):"object"===t&&"data"===r?Yg(e,n):n:Yg(e,n):n}function rv(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function nv(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&nv(qd.parentNode(e),t,r);for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!!r&&nv(qd.parentNode(e),t,r)}function iv(e,t,r,n){let i;if(jg(e)){if(i=e,!qd.childNodes(i).length)return!1}else{if(null===qd.parentElement(e))return!1;i=qd.parentElement(e)}try{if("string"==typeof t){if(n){if(i.closest(`.${t}`))return!0}else if(i.classList.contains(t))return!0}else if(nv(i,t,n))return!0;if(r)if(n){if(i.closest(r))return!0}else if(i.matches(r))return!0}catch(e){}return!1}function ov(e,t){const{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:s,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:u,maskInputFn:c,maskAttributeFn:d,dataURLOptions:h={},inlineImages:p,recordCanvas:f,keepIframeSrcFn:g,newlyAddedElement:v=!1,cssCaptured:m=!1,applyBackgroundColorToBlockedElements:y=!1}=t,b=function(e,t){if(!t.hasNode(e))return;const r=t.getId(e);return 1===r?void 0:r}(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:Ld.Document,childNodes:[],compatMode:e.compatMode}:{type:Ld.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:Ld.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:b};case e.ELEMENT_NODE:return function(e,t){const{doc:r,blockClass:n,blockSelector:i,inlineStylesheet:o,maskInputOptions:s={},maskInputFn:a,maskAttributeFn:l,dataURLOptions:u={},inlineImages:c,recordCanvas:d,keepIframeSrcFn:h,newlyAddedElement:p=!1,rootId:f,applyBackgroundColorToBlockedElements:g=!1}=t,v=function(e,t,r){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}if(r)return e.matches(r)}catch(e){}return!1}(e,n,i),m=function(e){if(e instanceof HTMLFormElement)return"form";const t=$g(e.tagName);return Qd.test(t)?"div":t}(e);let y={};const b=e.attributes.length;for(let t=0;t<b;t++){const n=e.attributes[t];if(!rv(m,n.name,n.value)){const t=tv(r,m,$g(n.name),n.value);if(l&&null!==t){const r=l(n.name,t,e);null!==r&&(y[n.name]=r)}else y[n.name]=t}}if("link"===m&&o){const t=Array.from(r.styleSheets).find(t=>t.href===e.href);let n=null;t&&(n=zg(t)),n&&(delete y.rel,delete y.href,y._cssText=n)}if("style"===m&&e.sheet){let t=zg(e.sheet);t&&(e.childNodes.length>1&&(t=Qg(t,e)),y._cssText=t)}if("input"===m||"textarea"===m||"select"===m){const t=e.value,r=e.checked;"radio"!==y.type&&"checkbox"!==y.type&&"submit"!==y.type&&"button"!==y.type&&t?y.value=Vg({element:e,type:Hg(e),tagName:m,value:t,maskInputOptions:s,maskInputFn:a}):r&&(y.checked=r)}"option"===m&&(e.selected&&!s.select?y.selected=!0:delete y.selected);"dialog"===m&&e.open&&(y.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal");if("canvas"===m&&d)if("2d"===e.__context)(function(e){const t=e.getContext("2d");if(!t)return!0;for(let r=0;r<e.width;r+=50)for(let n=0;n<e.height;n+=50){const i=t.getImageData,o=Wd in i?i[Wd]:i;if(new Uint32Array(o.call(t,r,n,Math.min(50,e.width-r),Math.min(50,e.height-n)).data.buffer).some(e=>0!==e))return!1}return!0})(e)||(y.rr_dataURL=e.toDataURL(u.type,u.quality));else if(!("__context"in e)){const t=e.toDataURL(u.type,u.quality),n=r.createElement("canvas");n.width=e.width,n.height=e.height;t!==n.toDataURL(u.type,u.quality)&&(y.rr_dataURL=t)}if("img"===m&&c){Yd||(Yd=r.createElement("canvas"),Zd=Yd.getContext("2d"));const t=e,n=t.currentSrc||t.getAttribute("src")||"<unknown-src>",i=t.crossOrigin,o=()=>{t.removeEventListener("load",o);try{Yd.width=t.naturalWidth,Yd.height=t.naturalHeight,Zd.drawImage(t,0,0),y.rr_dataURL=Yd.toDataURL(u.type,u.quality)}catch(e){if("anonymous"!==t.crossOrigin)return t.crossOrigin="anonymous",void(t.complete&&0!==t.naturalWidth?o():t.addEventListener("load",o));console.warn(`Cannot inline img src=${n}! Error: ${e}`)}"anonymous"===t.crossOrigin&&(i?y.crossOrigin=i:t.removeAttribute("crossorigin"))};t.complete&&0!==t.naturalWidth?o():t.addEventListener("load",o)}if("audio"===m||"video"===m){const t=y;t.rr_mediaState=e.paused?"paused":"played",t.rr_mediaCurrentTime=e.currentTime,t.rr_mediaPlaybackRate=e.playbackRate,t.rr_mediaMuted=e.muted,t.rr_mediaLoop=e.loop,t.rr_mediaVolume=e.volume}p||(e.scrollLeft&&(y.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(y.rr_scrollTop=e.scrollTop));if(v){const{width:t,height:r}=e.getBoundingClientRect();y={class:y.class,rr_width:`${t}px`,rr_height:`${r}px`,...g?{rr_background_color:Gd}:{}}}"iframe"!==m||h(y.src)||(e.contentDocument||(y.rr_src=y.src),delete y.src);let w;try{customElements.get(m)&&(w=!0)}catch(e){}return{type:Ld.Element,tagName:m,attributes:y,childNodes:[],isSVG:Zg(e)||void 0,needBlock:v,rootId:f,isCustom:w}}(e,{doc:r,blockClass:i,blockSelector:o,inlineStylesheet:a,maskInputOptions:l,maskInputFn:c,maskAttributeFn:d,dataURLOptions:h,inlineImages:p,recordCanvas:f,keepIframeSrcFn:g,newlyAddedElement:v,rootId:b,applyBackgroundColorToBlockedElements:y});case e.TEXT_NODE:return function(e,t){const{needsMask:r,maskTextFn:n,rootId:i,cssCaptured:o}=t,s=qd.parentNode(e),a=s&&s.tagName;let l="";const u="STYLE"===a||void 0,c="SCRIPT"===a||void 0;c?l="SCRIPT_PLACEHOLDER":o||(l=qd.textContent(e),u&&l&&(l=Gg(l,ev(t.doc))));!u&&!c&&l&&r&&(l=n?n(l,qd.parentElement(e)):l.replace(/[\S]/g,"*"));return{type:Ld.Text,textContent:l||"",rootId:i}}(e,{doc:r,needsMask:s,maskTextFn:u,rootId:b,cssCaptured:m});case e.CDATA_SECTION_NODE:return{type:Ld.CDATA,textContent:"",rootId:b};case e.COMMENT_NODE:return{type:Ld.Comment,textContent:qd.textContent(e)||"",rootId:b};default:return!1}}function sv(e){return null==e?"":e.toLowerCase()}function av(e,t,r){return Array.from(e).map(e=>{const n=t(e);let i=[];if(!r.has(n)){r.add(n);try{i=Array.from(e.cssRules,(t,r)=>({rule:Wg(t,e.href),index:r}))}catch(e){if(!(e instanceof DOMException&&"SecurityError"===e.name))throw e}}return{styleId:n,rules:i}})}function lv(e,t){var r,n,i;const{doc:o,mirror:s,blockClass:a,blockSelector:l,maskTextClass:u,maskTextSelector:c,skipChild:d=!1,inlineStylesheet:h=!0,maskInputOptions:p={},maskTextFn:f,maskInputFn:g,maskAttributeFn:v,slimDOMOptions:m,dataURLOptions:y={},inlineImages:b=!1,recordCanvas:w=!1,onSerialize:S,onAdoptedStyleSheet:k,onIframeLoad:x,iframeLoadTimeout:E=5e3,onStylesheetLoad:C,stylesheetLoadTimeout:I=5e3,keepIframeSrcFn:O=()=>!1,newlyAddedElement:T=!1,cssCaptured:A=!1,applyBackgroundColorToBlockedElements:R=!1}=t,P=null!=(r=t._emittedStyleIds)?r:new Set;let{needsMask:_}=t,{preserveWhiteSpace:M=!0}=t;if(!_){_=iv(e,u,c,void 0===_)}const N=ov(e,{doc:o,mirror:s,blockClass:a,blockSelector:l,needsMask:_,inlineStylesheet:h,maskInputOptions:p,maskTextFn:f,maskInputFn:g,maskAttributeFn:v,dataURLOptions:y,inlineImages:b,recordCanvas:w,keepIframeSrcFn:O,newlyAddedElement:T,cssCaptured:A,applyBackgroundColorToBlockedElements:R});if(!N)return console.warn(e,"not serialized"),null;let L;L=s.hasNode(e)?s.getId(e):function(e,t){if(t.comment&&e.type===Ld.Comment)return!0;if(e.type===Ld.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel||"modulepreload"===e.attributes.rel)&&"script"===e.attributes.as||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===Kg(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(sv(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===sv(e.attributes.name)||"icon"===sv(e.attributes.rel)||"apple-touch-icon"===sv(e.attributes.rel)||"shortcut icon"===sv(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&sv(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(sv(e.attributes.property).match(/^(og|twitter|fb):/)||sv(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===sv(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===sv(e.attributes.name)||"googlebot"===sv(e.attributes.name)||"bingbot"===sv(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===sv(e.attributes.name)||"generator"===sv(e.attributes.name)||"framework"===sv(e.attributes.name)||"publisher"===sv(e.attributes.name)||"progid"===sv(e.attributes.name)||sv(e.attributes.property).match(/^article:/)||sv(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===sv(e.attributes.name)||"yandex-verification"===sv(e.attributes.name)||"csrf-token"===sv(e.attributes.name)||"p:domain_verify"===sv(e.attributes.name)||"verify-v1"===sv(e.attributes.name)||"verification"===sv(e.attributes.name)||"shopify-checkout-api-token"===sv(e.attributes.name)))return!0}}return!1}(N,m)||!M&&N.type===Ld.Text&&!N.textContent.replace(/^\s+|\s+$/gm,"").length?Xd:Xg();const D=Object.assign(N,{id:L});if(s.add(e,D),L===Xd)return null;S&&S(e);let U=!d;if(D.type===Ld.Element){U=U&&!D.needBlock,delete D.needBlock;const t=qd.shadowRoot(e);t&&qg(t)&&(D.isShadowHost=!0,k&&(null==(n=t.adoptedStyleSheets)?void 0:n.length)&&(D.adoptedStyleSheets=av(t.adoptedStyleSheets,k,P)))}if(D.type===Ld.Document&&k){const t=e;(null==(i=t.adoptedStyleSheets)?void 0:i.length)&&(D.adoptedStyleSheets=av(t.adoptedStyleSheets,k,P))}if((D.type===Ld.Document||D.type===Ld.Element)&&U){m.headWhitespace&&D.type===Ld.Element&&"head"===D.tagName&&(M=!1);const t={doc:o,mirror:s,blockClass:a,blockSelector:l,needsMask:_,maskTextClass:u,maskTextSelector:c,skipChild:d,inlineStylesheet:h,maskInputOptions:p,maskTextFn:f,maskInputFn:g,maskAttributeFn:v,slimDOMOptions:m,dataURLOptions:y,inlineImages:b,recordCanvas:w,preserveWhiteSpace:M,onSerialize:S,onAdoptedStyleSheet:k,_emittedStyleIds:P,onIframeLoad:x,iframeLoadTimeout:E,onStylesheetLoad:C,stylesheetLoadTimeout:I,keepIframeSrcFn:O,cssCaptured:!1,applyBackgroundColorToBlockedElements:R};if(D.type===Ld.Element&&"textarea"===D.tagName&&void 0!==D.attributes.value);else{D.type===Ld.Element&&void 0!==D.attributes._cssText&&"string"==typeof D.attributes._cssText&&(t.cssCaptured=!0);for(const r of Array.from(qd.childNodes(e))){const e=lv(r,t);e&&D.childNodes.push(e)}}let r=null;if(jg(e)&&(r=qd.shadowRoot(e)))for(const e of Array.from(qd.childNodes(r))){const n=lv(e,t);n&&(qg(r)&&(n.isShadow=!0),D.childNodes.push(n))}}const F=qd.parentNode(e);return F&&Bg(F)&&qg(F)&&(D.isShadow=!0),D.type===Ld.Element&&"iframe"===D.tagName&&function(e,t,r){const n=e.contentWindow;if(!n)return;let i,o=!1;try{i=n.document.readyState}catch(e){return}if("complete"!==i){const n=setTimeout(()=>{o||(t(),o=!0)},r);return void e.addEventListener("load",()=>{clearTimeout(n),o=!0,t()})}const s="about:blank";if(n.location.href!==s||e.src===s||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}(e,()=>{const t=e.contentDocument;if(t&&x){const r=lv(t,{doc:t,mirror:s,blockClass:a,blockSelector:l,needsMask:_,maskTextClass:u,maskTextSelector:c,skipChild:!1,inlineStylesheet:h,maskInputOptions:p,maskTextFn:f,maskInputFn:g,maskAttributeFn:v,slimDOMOptions:m,dataURLOptions:y,inlineImages:b,recordCanvas:w,preserveWhiteSpace:M,onSerialize:S,onAdoptedStyleSheet:k,onIframeLoad:x,iframeLoadTimeout:E,onStylesheetLoad:C,stylesheetLoadTimeout:I,keepIframeSrcFn:O});r&&x(e,r)}},E),D.type===Ld.Element&&"link"===D.tagName&&"string"==typeof D.attributes.rel&&("stylesheet"===D.attributes.rel||"preload"===D.attributes.rel&&"string"==typeof D.attributes.href&&"css"===Kg(D.attributes.href))&&function(e,t,r){let n,i=!1;try{n=e.sheet}catch(e){return}if(n)return;const o=setTimeout(()=>{i||(t(),i=!0)},r);e.addEventListener("load",()=>{clearTimeout(o),i=!0,t()})}(e,()=>{if(C){const t=lv(e,{doc:o,mirror:s,blockClass:a,blockSelector:l,needsMask:_,maskTextClass:u,maskTextSelector:c,skipChild:!1,inlineStylesheet:h,maskInputOptions:p,maskTextFn:f,maskInputFn:g,maskAttributeFn:v,slimDOMOptions:m,dataURLOptions:y,inlineImages:b,recordCanvas:w,preserveWhiteSpace:M,onSerialize:S,onIframeLoad:x,iframeLoadTimeout:E,onStylesheetLoad:C,stylesheetLoadTimeout:I,keepIframeSrcFn:O});t&&C(e,t)}},I),D}function uv(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function cv(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if("function"==typeof t){var r=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}),r}function dv(){if(ih)return nh.exports;ih=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e}};return nh.exports=t(),nh.exports.createColors=t,nh.exports}function hv(){if(uh)return lh;uh=1;let e=dv(),t=ah;class r extends Error{constructor(e,t,n,i,o,s){super(e),this.name="CssSyntaxError",this.reason=e,o&&(this.file=o),i&&(this.source=i),s&&(this.plugin=s),void 0!==t&&void 0!==n&&("number"==typeof t?(this.line=t,this.column=n):(this.line=t.line,this.column=t.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,r)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(r){if(!this.source)return"";let n=this.source;null==r&&(r=e.isColorSupported),t&&r&&(n=t(n));let i,o,s=n.split(/\r?\n/),a=Math.max(this.line-3,0),l=Math.min(this.line+2,s.length),u=String(l).length;if(r){let{bold:t,gray:r,red:n}=e.createColors(!0);i=e=>t(n(e)),o=e=>r(e)}else i=o=e=>e;return s.slice(a,l).map((e,t)=>{let r=a+1+t,n=" "+(" "+r).slice(-u)+" | ";if(r===this.line){let t=o(n.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return i(">")+o(n)+e+"\n "+t+i("^")}return" "+o(n)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}return lh=r,r.default=r,lh}function pv(){return dh||(dh=1,ch.isClean=Symbol("isClean"),ch.my=Symbol("my")),ch}function fv(){if(ph)return hh;ph=1;const e={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};class t{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name,n=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?r+=e.raws.afterName:n&&(r+=" "),e.nodes)this.block(e,r+n);else{let i=(e.raws.between||"")+(t?";":"");this.builder(r+n+i,e)}}beforeAfter(e,t){let r;r="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let n=e.parent,i=0;for(;n&&"root"!==n.type;)i+=1,n=n.parent;if(r.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<i;e++)r+=t}return r}block(e,t){let r,n=this.raw(e,"between","beforeOpen");this.builder(t+n+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),r=this.raw(e,"after")):r=this.raw(e,"after","emptyBody"),r&&this.builder(r),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let r=this.raw(e,"semicolon");for(let n=0;n<e.nodes.length;n++){let i=e.nodes[n],o=this.raw(i,"before");o&&this.builder(o),this.stringify(i,t!==n||r)}}comment(e){let t=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)}decl(e,t){let r=this.raw(e,"between","colon"),n=e.prop+r+this.rawValue(e,"value");e.important&&(n+=e.raws.important||" !important"),t&&(n+=";"),this.builder(n,e)}document(e){this.body(e)}raw(t,r,n){let i;if(n||(n=r),r&&(i=t.raws[r],void 0!==i))return i;let o=t.parent;if("before"===n){if(!o||"root"===o.type&&o.first===t)return"";if(o&&"document"===o.type)return""}if(!o)return e[n];let s=t.root();if(s.rawCache||(s.rawCache={}),void 0!==s.rawCache[n])return s.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(t,n);{let e="raw"+((a=n)[0].toUpperCase()+a.slice(1));this[e]?i=this[e](s,t):s.walk(e=>{if(i=e.raws[r],void 0!==i)return!1})}var a;return void 0===i&&(i=e[n]),s.rawCache[n]=i,i}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let r;return e.walkComments(e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),void 0===r?r=this.raw(t,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(e,t){let r;return e.walkDecls(e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),void 0===r?r=this.raw(t,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(e){let t;return e.walk(r=>{if(r.nodes&&(r.parent!==e||e.first!==r)&&void 0!==r.raws.before)return t=r.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(r=>{let n=r.parent;if(n&&n!==e&&n.parent&&n.parent===e&&void 0!==r.raws.before){let e=r.raws.before.split("\n");return t=e[e.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){let r=e[t],n=e.raws[t];return n&&n.value===r?n.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}}return hh=t,t.default=t,hh}function gv(){if(gh)return fh;gh=1;let e=fv();function t(t,r){new e(r).stringify(t)}return fh=t,t.default=t,fh}function vv(){if(mh)return vh;mh=1;let{isClean:e,my:t}=pv(),r=hv(),n=fv(),i=gv();function o(e,t){let r=new e.constructor;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if("proxyCache"===n)continue;let i=e[n],s=typeof i;"parent"===n&&"object"===s?t&&(r[n]=t):"source"===n?r[n]=i:Array.isArray(i)?r[n]=i.map(e=>o(e,r)):("object"===s&&null!==i&&(i=o(i)),r[n]=i)}return r}class s{constructor(r={}){this.raws={},this[e]=!1,this[t]=!0;for(let e in r)if("nodes"===e){this.nodes=[];for(let t of r[e])"function"==typeof t.clone?this.append(t.clone()):this.append(t)}else this[e]=r[e]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=o(this);for(let r in e)t[r]=e[r];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:r,start:n}=this.rangeBy(t);return this.source.input.error(e,{column:n.column,line:n.line},{column:r.column,line:r.line},t)}return new r(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markDirty(){if(this[e]){this[e]=!1;let t=this;for(;t=t.parent;)t[e]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){let n=(t=this.toString()).indexOf(e.word);-1!==n&&(r=this.positionInside(n,t))}return r}positionInside(e,t){let r=t||this.toString(),n=this.source.start.column,i=this.source.start.line;for(let t=0;t<e;t++)"\n"===r[t]?(n=1,i+=1):n+=1;return{column:n,line:i}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let n=this.toString(),i=n.indexOf(e.word);-1!==i&&(t=this.positionInside(i,n),r=this.positionInside(i+e.word.length,n))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return(new n).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let n of e)n===this?r=!0:r?(this.parent.insertAfter(t,n),t=n):this.parent.insertBefore(t,n);r||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let r={},n=null==t;t=t||new Map;let i=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let n=this[e];if(Array.isArray(n))r[e]=n.map(e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e);else if("object"==typeof n&&n.toJSON)r[e]=n.toJSON(null,t);else if("source"===e){let o=t.get(n.input);null==o&&(o=i,t.set(n.input,i),i++),r[e]={end:n.end,inputId:o,start:n.start}}else r[e]=n}return n&&(r.inputs=[...t.keys()].map(e=>e.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=i){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){let n={node:this};for(let e in r)n[e]=r[e];return e.warn(t,n)}get proxyOf(){return this}}return vh=s,s.default=s,vh}function mv(){if(bh)return yh;bh=1;let e=vv();class t extends e{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}}return yh=t,t.default=t,yh}function yv(){if(Sh)return wh;Sh=1;return wh={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(r=t)=>{let n="",i=r;for(;i--;)n+=e[Math.random()*e.length|0];return n}}}function bv(){if(xh)return kh;xh=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=ah,{existsSync:r,readFileSync:n}=ah,{dirname:i,join:o}=ah;class s{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,n=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=i(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new e(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t;let r=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+r)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let r=e.lastIndexOf(t.pop()),n=e.indexOf("*/",r);r>-1&&n>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,n)))}loadFile(e){if(this.root=i(e),r(e))return this.mapFile=e,n(e,"utf-8").toString().trim()}loadMap(r,n){if(!1===n)return!1;if(n){if("string"==typeof n)return n;if("function"!=typeof n){if(n instanceof e)return t.fromSourceMap(n).toString();if(n instanceof t)return n.toString();if(this.isMap(n))return JSON.stringify(n);throw new Error("Unsupported previous source map format: "+n.toString())}{let e=n(r);if(e){let t=this.loadFile(e);if(!t)throw new Error("Unable to load previous source map: "+e.toString());return t}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let e=this.annotation;return r&&(e=o(i(r),e)),this.loadFile(e)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return kh=s,s.default=s,kh}function wv(){if(Ch)return Eh;Ch=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=ah,{fileURLToPath:r,pathToFileURL:n}=ah,{isAbsolute:i,resolve:o}=ah,{nanoid:s}=yv(),a=ah,l=hv(),u=bv(),c=Symbol("fromOffsetCache"),d=Boolean(e&&t),h=Boolean(o&&i);class p{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||""===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!h||/^\w+:\/\//.test(t.from)||i(t.from)?this.file=t.from:this.file=o(t.from)),h&&d){let e=new u(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+s(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,i={}){let o,s,a;if(t&&"object"==typeof t){let e=t,n=r;if("number"==typeof e.offset){let n=this.fromOffset(e.offset);t=n.line,r=n.col}else t=e.line,r=e.column;if("number"==typeof n.offset){let e=this.fromOffset(n.offset);s=e.line,a=e.col}else s=n.line,a=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let u=this.origin(t,r,s,a);return o=u?new l(e,void 0===u.endLine?u.line:{column:u.column,line:u.line},void 0===u.endLine?u.column:{column:u.endColumn,line:u.endLine},u.source,u.file,i.plugin):new l(e,void 0===s?t:{column:r,line:t},void 0===s?r:{column:a,line:s},this.css,this.file,i.plugin),o.input={column:r,endColumn:a,endLine:s,line:t,source:this.css},this.file&&(n&&(o.input.url=n(this.file).toString()),o.input.file=this.file),o}fromOffset(e){let t,r;if(this[c])r=this[c];else{let e=this.css.split("\n");r=new Array(e.length);let t=0;for(let n=0,i=e.length;n<i;n++)r[n]=t,t+=e[n].length+1;this[c]=r}t=r[r.length-1];let n=0;if(e>=t)n=r.length-1;else{let t,i=r.length-2;for(;n<i;)if(t=n+(i-n>>1),e<r[t])i=t-1;else{if(!(e>=r[t+1])){n=t;break}n=t+1}}return{col:e-r[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:o(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,o,s){if(!this.map)return!1;let a,l,u=this.map.consumer(),c=u.originalPositionFor({column:t,line:e});if(!c.source)return!1;"number"==typeof o&&(a=u.originalPositionFor({column:s,line:o})),l=i(c.source)?n(c.source):new URL(c.source,this.map.consumer().sourceRoot||n(this.map.mapFile));let d={column:c.column,endColumn:a&&a.column,endLine:a&&a.line,line:c.line,url:l.toString()};if("file:"===l.protocol){if(!r)throw new Error("file: protocol is not available in this PostCSS build");d.file=r(l)}let h=u.sourceContentFor(c.source);return h&&(d.source=h),d}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}}return Eh=p,p.default=p,a&&a.registerInput&&a.registerInput(p),Eh}function Sv(){if(Oh)return Ih;Oh=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=ah,{dirname:r,relative:n,resolve:i,sep:o}=ah,{pathToFileURL:s}=ah,a=wv(),l=Boolean(e&&t),u=Boolean(r&&i&&n&&o);return Ih=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let t of this.previous()){let n,i=this.toUrl(this.path(t.file)),o=t.root||r(t.file);!1===this.mapOpts.sourcesContent?(n=new e(t.text),n.sourcesContent&&(n.sourcesContent=null)):n=t.consumer(),this.map.applySourceMap(n,i,this.toUrl(this.path(o)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),u&&l&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=t.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0});let e,r,n=1,i=1,o="<no source>",s={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(t,a,l)=>{if(this.css+=t,a&&"end"!==l&&(s.generated.line=n,s.generated.column=i-1,a.source&&a.source.start?(s.source=this.sourcePath(a),s.original.line=a.source.start.line,s.original.column=a.source.start.column-1,this.map.addMapping(s)):(s.source=o,s.original.line=1,s.original.column=0,this.map.addMapping(s))),e=t.match(/\n/g),e?(n+=e.length,r=t.lastIndexOf("\n"),i=t.length-r):i+=t.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(s.source=this.sourcePath(a),s.original.line=a.source.end.line,s.original.column=a.source.end.column-1,s.generated.line=n,s.generated.column=i-2,this.map.addMapping(s)):(s.source=o,s.original.line=1,s.original.column=0,s.generated.line=n,s.generated.column=i-1,this.map.addMapping(s)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let o=this.opts.to?r(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(o=r(i(o,this.mapOpts.annotation)));let s=n(o,e);return this.memoizedPaths.set(e,s),s}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new a(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let r=t.source.input.from;if(r&&!e[r]){e[r]=!0;let n=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(n,t.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(s){let t=s(e).toString();return this.memoizedFileURLs.set(e,t),t}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;"\\"===o&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}}}function kv(){if(Ah)return Th;Ah=1;let e=vv();class t extends e{constructor(e){super(e),this.type="comment"}}return Th=t,t.default=t,Th}function xv(){if(Ph)return Rh;Ph=1;let e,t,r,n,{isClean:i,my:o}=pv(),s=mv(),a=kv(),l=vv();function u(e){return e.map(e=>(e.nodes&&(e.nodes=u(e.nodes)),delete e.source,e))}function c(e){if(e[i]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)c(t)}class d extends l{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,r,n=this.getIterator();for(;this.indexes[n]<this.proxyOf.nodes.length&&(t=this.indexes[n],r=e(this.proxyOf.nodes[t],t),!1!==r);)this.indexes[n]+=1;return delete this.indexes[n],r}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...r)=>e[t](...r.map(e=>"function"==typeof e?(t,r)=>e(t.toProxy(),r):e)):"every"===t||"some"===t?r=>e[t]((e,...t)=>r(e.toProxy(),...t)):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map(e=>e.toProxy()):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let r,n=this.index(e),i=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let e of i)this.proxyOf.nodes.splice(n+1,0,e);for(let e in this.indexes)r=this.indexes[e],n<r&&(this.indexes[e]=r+i.length);return this.markDirty(),this}insertBefore(e,t){let r,n=this.index(e),i=0===n&&"prepend",o=this.normalize(t,this.proxyOf.nodes[n],i).reverse();n=this.index(e);for(let e of o)this.proxyOf.nodes.splice(n,0,e);for(let e in this.indexes)r=this.indexes[e],n<=r&&(this.indexes[e]=r+o.length);return this.markDirty(),this}normalize(n,l){if("string"==typeof n)n=u(e(n).nodes);else if(void 0===n)n=[];else if(Array.isArray(n)){n=n.slice(0);for(let e of n)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===n.type&&"document"!==this.type){n=n.nodes.slice(0);for(let e of n)e.parent&&e.parent.removeChild(e,"ignore")}else if(n.type)n=[n];else if(n.prop){if(void 0===n.value)throw new Error("Value field is missed in node creation");"string"!=typeof n.value&&(n.value=String(n.value)),n=[new s(n)]}else if(n.selector)n=[new t(n)];else if(n.name)n=[new r(n)];else{if(!n.text)throw new Error("Unknown node type in node creation");n=[new a(n)]}return n.map(e=>(e[o]||d.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[i]&&c(e),void 0===e.raws.before&&l&&void 0!==l.raws.before&&(e.raws.before=l.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls(n=>{t.props&&!t.props.includes(n.prop)||t.fast&&!n.value.includes(t.fast)||(n.value=n.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,r)=>{let n;try{n=e(t,r)}catch(e){throw t.addToError(e)}return!1!==n&&t.walk&&(n=t.walk(e)),n})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("atrule"===r.type&&e.test(r.name))return t(r,n)}):this.walk((r,n)=>{if("atrule"===r.type&&r.name===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("atrule"===e.type)return t(e,r)}))}walkComments(e){return this.walk((t,r)=>{if("comment"===t.type)return e(t,r)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("decl"===r.type&&e.test(r.prop))return t(r,n)}):this.walk((r,n)=>{if("decl"===r.type&&r.prop===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("decl"===e.type)return t(e,r)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("rule"===r.type&&e.test(r.selector))return t(r,n)}):this.walk((r,n)=>{if("rule"===r.type&&r.selector===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("rule"===e.type)return t(e,r)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}return d.registerParse=t=>{e=t},d.registerRule=e=>{t=e},d.registerAtRule=e=>{r=e},d.registerRoot=e=>{n=e},Rh=d,d.default=d,d.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,r.prototype):"rule"===e.type?Object.setPrototypeOf(e,t.prototype):"decl"===e.type?Object.setPrototypeOf(e,s.prototype):"comment"===e.type?Object.setPrototypeOf(e,a.prototype):"root"===e.type&&Object.setPrototypeOf(e,n.prototype),e[o]=!0,e.nodes&&e.nodes.forEach(e=>{d.rebuild(e)})},Rh}function Ev(){if(Mh)return _h;Mh=1;let e,t,r=xv();class n extends r{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(r={}){return new e(new t,this,r).stringify()}}return n.registerLazyResult=t=>{e=t},n.registerProcessor=e=>{t=e},_h=n,n.default=n,_h}function Cv(){if(Lh)return Nh;Lh=1;let e={};return Nh=function(t){e[t]||(e[t]=!0,"undefined"!=typeof console&&console.warn&&console.warn(t))}}function Iv(){if(Uh)return Dh;Uh=1;class e{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}return Dh=e,e.default=e,Dh}function Ov(){if(jh)return Fh;jh=1;let e=Iv();class t{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(t,r={}){r.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(r.plugin=this.lastPlugin.postcssPlugin);let n=new e(t,r);return this.messages.push(n),n}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}}return Fh=t,t.default=t,Fh}function Tv(){if(Wh)return zh;Wh=1;let e=xv();class t extends e{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}}return zh=t,t.default=t,e.registerAtRule(t),zh}function Av(){if($h)return Vh;$h=1;let e,t,r=xv();class n extends r{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){let n=super.normalize(e);if(t)if("prepend"===r)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of n)e.raws.before=t.raws.before;return n}removeChild(e,t){let r=this.index(e);return!t&&0===r&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(r={}){return new e(new t,this,r).stringify()}}return n.registerLazyResult=t=>{e=t},n.registerProcessor=e=>{t=e},Vh=n,n.default=n,r.registerRoot(n),Vh}function Rv(){if(Kh)return Hh;Kh=1;let e={comma:t=>e.split(t,[","],!0),space:t=>e.split(t,[" ","\n","\t"]),split(e,t,r){let n=[],i="",o=!1,s=0,a=!1,l="",u=!1;for(let r of e)u?u=!1:"\\"===r?u=!0:a?r===l&&(a=!1):'"'===r||"'"===r?(a=!0,l=r):"("===r?s+=1:")"===r?s>0&&(s-=1):0===s&&t.includes(r)&&(o=!0),o?(""!==i&&n.push(i.trim()),i="",o=!1):i+=r;return(r||""!==i)&&n.push(i.trim()),n}};return Hh=e,e.default=e,Hh}function Pv(){if(Jh)return Gh;Jh=1;let e=xv(),t=Rv();class r extends e{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return t.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}}return Gh=r,r.default=r,e.registerRule(r),Gh}function _v(){if(Xh)return Qh;Xh=1;let e=mv(),t=function(){if(qh)return Bh;qh=1;const e="'".charCodeAt(0),t='"'.charCodeAt(0),r="\\".charCodeAt(0),n="/".charCodeAt(0),i="\n".charCodeAt(0),o=" ".charCodeAt(0),s="\f".charCodeAt(0),a="\t".charCodeAt(0),l="\r".charCodeAt(0),u="[".charCodeAt(0),c="]".charCodeAt(0),d="(".charCodeAt(0),h=")".charCodeAt(0),p="{".charCodeAt(0),f="}".charCodeAt(0),g=";".charCodeAt(0),v="*".charCodeAt(0),m=":".charCodeAt(0),y="@".charCodeAt(0),b=/[\t\n\f\r "#'()/;[\\\]{}]/g,w=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,S=/.[\r\n"'(/\\]/,k=/[\da-f]/i;return Bh=function(x,E={}){let C,I,O,T,A,R,P,_,M,N,L=x.css.valueOf(),D=E.ignoreErrors,U=L.length,F=0,j=[],B=[];function q(e){throw x.error("Unclosed "+e,F)}return{back:function(e){B.push(e)},endOfFile:function(){return 0===B.length&&F>=U},nextToken:function(x){if(B.length)return B.pop();if(F>=U)return;let E=!!x&&x.ignoreUnclosed;switch(C=L.charCodeAt(F),C){case i:case o:case a:case l:case s:I=F;do{I+=1,C=L.charCodeAt(I)}while(C===o||C===i||C===a||C===l||C===s);N=["space",L.slice(F,I)],F=I-1;break;case u:case c:case p:case f:case m:case g:case h:{let e=String.fromCharCode(C);N=[e,e,F];break}case d:if(_=j.length?j.pop()[1]:"",M=L.charCodeAt(F+1),"url"===_&&M!==e&&M!==t&&M!==o&&M!==i&&M!==a&&M!==s&&M!==l){I=F;do{if(R=!1,I=L.indexOf(")",I+1),-1===I){if(D||E){I=F;break}q("bracket")}for(P=I;L.charCodeAt(P-1)===r;)P-=1,R=!R}while(R);N=["brackets",L.slice(F,I+1),F,I],F=I}else I=L.indexOf(")",F+1),T=L.slice(F,I+1),-1===I||S.test(T)?N=["(","(",F]:(N=["brackets",T,F,I],F=I);break;case e:case t:O=C===e?"'":'"',I=F;do{if(R=!1,I=L.indexOf(O,I+1),-1===I){if(D||E){I=F+1;break}q("string")}for(P=I;L.charCodeAt(P-1)===r;)P-=1,R=!R}while(R);N=["string",L.slice(F,I+1),F,I],F=I;break;case y:b.lastIndex=F+1,b.test(L),I=0===b.lastIndex?L.length-1:b.lastIndex-2,N=["at-word",L.slice(F,I+1),F,I],F=I;break;case r:for(I=F,A=!0;L.charCodeAt(I+1)===r;)I+=1,A=!A;if(C=L.charCodeAt(I+1),A&&C!==n&&C!==o&&C!==i&&C!==a&&C!==l&&C!==s&&(I+=1,k.test(L.charAt(I)))){for(;k.test(L.charAt(I+1));)I+=1;L.charCodeAt(I+1)===o&&(I+=1)}N=["word",L.slice(F,I+1),F,I],F=I;break;default:C===n&&L.charCodeAt(F+1)===v?(I=L.indexOf("*/",F+2)+1,0===I&&(D||E?I=L.length:q("comment")),N=["comment",L.slice(F,I+1),F,I],F=I):(w.lastIndex=F+1,w.test(L),I=0===w.lastIndex?L.length-1:w.lastIndex-2,N=["word",L.slice(F,I+1),F,I],j.push(N),F=I)}return F++,N},position:function(){return F}}}}(),r=kv(),n=Tv(),i=Av(),o=Pv();const s={empty:!0,space:!0};return Qh=class{constructor(e){this.input=e,this.root=new i,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,r,i,o=new n;o.name=e[1].slice(1),""===o.name&&this.unnamedAtrule(o,e),this.init(o,e[2]);let s=!1,a=!1,l=[],u=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?u.push("("===t?")":"]"):"{"===t&&u.length>0?u.push("}"):t===u[u.length-1]&&u.pop(),0===u.length){if(";"===t){o.source.end=this.getPosition(e[2]),o.source.end.offset++,this.semicolon=!0;break}if("{"===t){a=!0;break}if("}"===t){if(l.length>0){for(i=l.length-1,r=l[i];r&&"space"===r[0];)r=l[--i];r&&(o.source.end=this.getPosition(r[3]||r[2]),o.source.end.offset++)}this.end(e);break}l.push(e)}else l.push(e);if(this.tokenizer.endOfFile()){s=!0;break}}o.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(o.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(o,"params",l),s&&(e=l[l.length-1],o.source.end=this.getPosition(e[3]||e[2]),o.source.end.offset++,this.spaces=o.raws.between,o.raws.between="")):(o.raws.afterName="",o.params=""),a&&(o.nodes=[],this.current=o)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let r,n=0;for(let i=t-1;i>=0&&(r=e[i],"space"===r[0]||(n+=1,2!==n));i--);throw this.input.error("Missed semicolon","word"===r[0]?r[3]+1:r[2])}colon(e){let t,r,n,i=0;for(let[o,s]of e.entries()){if(t=s,r=t[0],"("===r&&(i+=1),")"===r&&(i-=1),0===i&&":"===r){if(n){if("word"===n[0]&&"progid"===n[1])continue;return o}this.doubleColon(t)}n=t}return!1}comment(e){let t=new r;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=t(this.input)}decl(t,r){let n=new e;this.init(n,t[0][2]);let i,o=t[t.length-1];for(";"===o[0]&&(this.semicolon=!0,t.pop()),n.source.end=this.getPosition(o[3]||o[2]||function(e){for(let t=e.length-1;t>=0;t--){let r=e[t],n=r[3]||r[2];if(n)return n}}(t)),n.source.end.offset++;"word"!==t[0][0];)1===t.length&&this.unknownWord(t),n.raws.before+=t.shift()[1];for(n.source.start=this.getPosition(t[0][2]),n.prop="";t.length;){let e=t[0][0];if(":"===e||"space"===e||"comment"===e)break;n.prop+=t.shift()[1]}for(n.raws.between="";t.length;){if(i=t.shift(),":"===i[0]){n.raws.between+=i[1];break}"word"===i[0]&&/\w/.test(i[1])&&this.unknownWord([i]),n.raws.between+=i[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let s,a=[];for(;t.length&&(s=t[0][0],"space"===s||"comment"===s);)a.push(t.shift());this.precheckMissedSemicolon(t);for(let e=t.length-1;e>=0;e--){if(i=t[e],"!important"===i[1].toLowerCase()){n.important=!0;let r=this.stringFrom(t,e);r=this.spacesFromEnd(t)+r," !important"!==r&&(n.raws.important=r);break}if("important"===i[1].toLowerCase()){let r=t.slice(0),i="";for(let t=e;t>0;t--){let e=r[t][0];if(0===i.trim().indexOf("!")&&"space"!==e)break;i=r.pop()[1]+i}0===i.trim().indexOf("!")&&(n.important=!0,n.raws.important=i,t=r)}if("space"!==i[0]&&"comment"!==i[0])break}t.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(n,"value",a.concat(t),r),n.value.includes(":")&&!r&&this.checkMissedSemicolon(t)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new o;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,r=null,n=!1,i=null,o=[],s=e[1].startsWith("--"),a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)i||(i=l),o.push("("===r?")":"]");else if(s&&n&&"{"===r)i||(i=l),o.push("}");else if(0===o.length){if(";"===r){if(n)return void this.decl(a,s);break}if("{"===r)return void this.rule(a);if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}":"===r&&(n=!0)}else r===o[o.length-1]&&(o.pop(),0===o.length&&(i=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(i),t&&n){if(!s)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,s)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,r,n){let i,o,a,l,u=r.length,c="",d=!0;for(let e=0;e<u;e+=1)i=r[e],o=i[0],"space"!==o||e!==u-1||n?"comment"===o?(l=r[e-1]?r[e-1][0]:"empty",a=r[e+1]?r[e+1][0]:"empty",s[l]||s[a]||","===c.slice(-1)?d=!1:c+=i[1]):c+=i[1]:d=!1;if(!d){let n=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:n,value:c}}e[t]=c}rule(e){e.pop();let t=new o;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let n=t;n<e.length;n++)r+=e[n][1];return e.splice(t,e.length-t),r}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}}}function Mv(){if(Zh)return Yh;Zh=1;let e=xv(),t=_v(),r=wv();function n(e,n){let i=new r(e,n),o=new t(i);try{o.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&n&&n.from&&(/\.scss$/i.test(n.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(n.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(n.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return o.root}return Yh=n,n.default=n,e.registerParse(n),Yh}function Nv(){if(tp)return ep;tp=1;let{isClean:e,my:t}=pv(),r=Sv(),n=gv(),i=xv(),o=Ev(),s=Cv(),a=Ov(),l=Mv(),u=Av();const c={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},d={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},h={Once:!0,postcssPlugin:!0,prepare:!0};function p(e){return"object"==typeof e&&"function"==typeof e.then}function f(e){let t=!1,r=c[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[r,r+"-"+t,0,r+"Exit",r+"Exit-"+t]:t?[r,r+"-"+t,r+"Exit",r+"Exit-"+t]:e.append?[r,0,r+"Exit"]:[r,r+"Exit"]}function g(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:f(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function v(t){return t[e]=!1,t.nodes&&t.nodes.forEach(e=>v(e)),t}let m={};class y{constructor(e,r,n){let o;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof y||r instanceof a)o=v(r.root),r.map&&(void 0===n.map&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=r.map);else{let e=l;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{o=e(r,n)}catch(e){this.processed=!0,this.error=e}o&&!o[t]&&i.rebuild(o)}else o=v(r);this.result=new a(e,o,n),this.helpers={...m,postcss:m,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let r=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(r.postcssVersion&&"production"!==process.env.NODE_ENV){let e=r.postcssPlugin,t=r.postcssVersion,n=this.result.processor.version,i=t.split("."),o=n.split(".");(i[0]!==o[0]||parseInt(i[1])>parseInt(o[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+n+", but "+e+" uses "+t+". Perhaps this is the source of the error below.")}}else e.plugin=r.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,r)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,r])};for(let t of this.plugins)if("object"==typeof t)for(let r in t){if(!d[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!h[r])if("object"==typeof t[r])for(let n in t[r])e(t,"*"===n?r:r+"-"+n.toLowerCase(),t[r][n]);else"function"==typeof t[r]&&e(t,r,t[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],r=this.runOnRoot(t);if(p(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];){t[e]=!0;let r=[g(t)];for(;r.length>0;){let e=this.visitTick(r);if(p(e))try{await e}catch(e){let t=r[r.length-1].node;throw this.handleError(e,t)}}}if(this.listeners.OnceExit)for(let[e,r]of this.listeners.OnceExit){this.result.lastPlugin=e;try{if("document"===t.type){let e=t.nodes.map(e=>r(e,this.helpers));await Promise.all(e)}else await r(t,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return p(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=n;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let i=new r(t,this.result.root,this.result.opts).generate();return this.result.css=i[0],this.result.map=i[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins){if(p(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];)t[e]=!0,this.walkSync(t);if(this.listeners.OnceExit)if("document"===t.type)for(let e of t.nodes)this.visitSync(this.listeners.OnceExit,e);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||s("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[r,n]of e){let e;this.result.lastPlugin=r;try{e=n(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(p(e))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:n,visitors:i}=r;if("root"!==n.type&&"document"!==n.type&&!n.parent)return void t.pop();if(i.length>0&&r.visitorIndex<i.length){let[e,t]=i[r.visitorIndex];r.visitorIndex+=1,r.visitorIndex===i.length&&(r.visitors=[],r.visitorIndex=0),this.result.lastPlugin=e;try{return t(n.toProxy(),this.helpers)}catch(e){throw this.handleError(e,n)}}if(0!==r.iterator){let i,o=r.iterator;for(;i=n.nodes[n.indexes[o]];)if(n.indexes[o]+=1,!i[e])return i[e]=!0,void t.push(g(i));r.iterator=0,delete n.indexes[o]}let o=r.events;for(;r.eventIndex<o.length;){let t=o[r.eventIndex];if(r.eventIndex+=1,0===t)return void(n.nodes&&n.nodes.length&&(n[e]=!0,r.iterator=n.getIterator()));if(this.listeners[t])return void(r.visitors=this.listeners[t])}t.pop()}walkSync(t){t[e]=!0;let r=f(t);for(let n of r)if(0===n)t.nodes&&t.each(t=>{t[e]||this.walkSync(t)});else{let e=this.listeners[n];if(e&&this.visitSync(e,t.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}}return y.registerPostcss=e=>{m=e},ep=y,y.default=y,u.registerLazyResult(y),o.registerLazyResult(y),ep}function Lv(){if(op)return ip;op=1;let e=function(){if(np)return rp;np=1;let e=Sv(),t=gv(),r=Cv(),n=Mv();const i=Ov();class o{constructor(r,n,o){let s;n=n.toString(),this.stringified=!1,this._processor=r,this._css=n,this._opts=o,this._map=void 0;let a=t;this.result=new i(this._processor,s,this._opts),this.result.css=n;let l=this;Object.defineProperty(this.result,"root",{get:()=>l.root});let u=new e(a,s,this._opts,n);if(u.isMap()){let[e,t]=u.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else u.clearAnnotation(),this.result.css=u.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this._opts||r("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=n;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}}return rp=o,o.default=o,rp}(),t=Nv(),r=Ev(),n=Av();class i{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(r,n={}){return this.plugins.length||n.parser||n.stringifier||n.syntax?new t(this,r,n):new e(this,r,n)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}return ip=i,i.default=i,n.registerProcessor(i),r.registerProcessor(i),ip}function Dv(){if(up)return lp;up=1;let e=hv(),t=mv(),r=Nv(),n=xv(),i=Lv(),o=gv(),s=function(){if(ap)return sp;ap=1;let e=mv(),t=bv(),r=kv(),n=Tv(),i=wv(),o=Av(),s=Pv();function a(l,u){if(Array.isArray(l))return l.map(e=>a(e));let{inputs:c,...d}=l;if(c){u=[];for(let e of c){let r={...e,__proto__:i.prototype};r.map&&(r.map={...r.map,__proto__:t.prototype}),u.push(r)}}if(d.nodes&&(d.nodes=l.nodes.map(e=>a(e,u))),d.source){let{inputId:e,...t}=d.source;d.source=t,null!=e&&(d.source.input=u[e])}if("root"===d.type)return new o(d);if("decl"===d.type)return new e(d);if("rule"===d.type)return new s(d);if("comment"===d.type)return new r(d);if("atrule"===d.type)return new n(d);throw new Error("Unknown node type: "+l.type)}return sp=a,a.default=a,sp}(),a=Ev(),l=Iv(),u=kv(),c=Tv(),d=Ov(),h=wv(),p=Mv(),f=Rv(),g=Pv(),v=Av(),m=vv();function y(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new i(e)}return y.plugin=function(e,t){let r,n=!1;function o(...r){console&&console.warn&&!n&&(n=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let o=t(...r);return o.postcssPlugin=e,o.postcssVersion=(new i).version,o}return Object.defineProperty(o,"postcss",{get:()=>(r||(r=o()),r)}),o.process=function(e,t,r){return y([o(r)]).process(e,t)},o},y.stringify=o,y.parse=p,y.fromJSON=s,y.list=f,y.comment=e=>new u(e),y.atRule=e=>new c(e),y.decl=e=>new t(e),y.rule=e=>new g(e),y.root=e=>new v(e),y.document=e=>new a(e),y.CssSyntaxError=e,y.Declaration=t,y.Container=n,y.Processor=i,y.Document=a,y.Comment=u,y.Warning=l,y.AtRule=c,y.Result=d,y.Input=h,y.Rule=g,y.Root=v,y.Node=m,r.registerPostcss(y),lp=y,y.default=y,lp}function Uv(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Fv(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if("function"==typeof t){var r=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}),r}function jv(){if(vp)return gp.exports;vp=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e}};return gp.exports=t(),gp.exports.createColors=t,gp.exports}function Bv(){if(Sp)return wp;Sp=1;let e=jv(),t=bp;class r extends Error{constructor(e,t,n,i,o,s){super(e),this.name="CssSyntaxError",this.reason=e,o&&(this.file=o),i&&(this.source=i),s&&(this.plugin=s),void 0!==t&&void 0!==n&&("number"==typeof t?(this.line=t,this.column=n):(this.line=t.line,this.column=t.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,r)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(r){if(!this.source)return"";let n=this.source;null==r&&(r=e.isColorSupported),t&&r&&(n=t(n));let i,o,s=n.split(/\r?\n/),a=Math.max(this.line-3,0),l=Math.min(this.line+2,s.length),u=String(l).length;if(r){let{bold:t,gray:r,red:n}=e.createColors(!0);i=e=>t(n(e)),o=e=>r(e)}else i=o=e=>e;return s.slice(a,l).map((e,t)=>{let r=a+1+t,n=" "+(" "+r).slice(-u)+" | ";if(r===this.line){let t=o(n.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return i(">")+o(n)+e+"\n "+t+i("^")}return" "+o(n)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}return wp=r,r.default=r,wp}function qv(){return xp||(xp=1,kp.isClean=Symbol("isClean"),kp.my=Symbol("my")),kp}function zv(){if(Cp)return Ep;Cp=1;const e={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};class t{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name,n=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?r+=e.raws.afterName:n&&(r+=" "),e.nodes)this.block(e,r+n);else{let i=(e.raws.between||"")+(t?";":"");this.builder(r+n+i,e)}}beforeAfter(e,t){let r;r="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let n=e.parent,i=0;for(;n&&"root"!==n.type;)i+=1,n=n.parent;if(r.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<i;e++)r+=t}return r}block(e,t){let r,n=this.raw(e,"between","beforeOpen");this.builder(t+n+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),r=this.raw(e,"after")):r=this.raw(e,"after","emptyBody"),r&&this.builder(r),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let r=this.raw(e,"semicolon");for(let n=0;n<e.nodes.length;n++){let i=e.nodes[n],o=this.raw(i,"before");o&&this.builder(o),this.stringify(i,t!==n||r)}}comment(e){let t=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)}decl(e,t){let r=this.raw(e,"between","colon"),n=e.prop+r+this.rawValue(e,"value");e.important&&(n+=e.raws.important||" !important"),t&&(n+=";"),this.builder(n,e)}document(e){this.body(e)}raw(t,r,n){let i;if(n||(n=r),r&&(i=t.raws[r],void 0!==i))return i;let o=t.parent;if("before"===n){if(!o||"root"===o.type&&o.first===t)return"";if(o&&"document"===o.type)return""}if(!o)return e[n];let s=t.root();if(s.rawCache||(s.rawCache={}),void 0!==s.rawCache[n])return s.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(t,n);{let e="raw"+((a=n)[0].toUpperCase()+a.slice(1));this[e]?i=this[e](s,t):s.walk(e=>{if(i=e.raws[r],void 0!==i)return!1})}var a;return void 0===i&&(i=e[n]),s.rawCache[n]=i,i}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let r;return e.walkComments(e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),void 0===r?r=this.raw(t,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(e,t){let r;return e.walkDecls(e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),void 0===r?r=this.raw(t,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(e){let t;return e.walk(r=>{if(r.nodes&&(r.parent!==e||e.first!==r)&&void 0!==r.raws.before)return t=r.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(r=>{let n=r.parent;if(n&&n!==e&&n.parent&&n.parent===e&&void 0!==r.raws.before){let e=r.raws.before.split("\n");return t=e[e.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){let r=e[t],n=e.raws[t];return n&&n.value===r?n.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}}return Ep=t,t.default=t,Ep}function Wv(){if(Op)return Ip;Op=1;let e=zv();function t(t,r){new e(r).stringify(t)}return Ip=t,t.default=t,Ip}function Vv(){if(Ap)return Tp;Ap=1;let{isClean:e,my:t}=qv(),r=Bv(),n=zv(),i=Wv();function o(e,t){let r=new e.constructor;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if("proxyCache"===n)continue;let i=e[n],s=typeof i;"parent"===n&&"object"===s?t&&(r[n]=t):"source"===n?r[n]=i:Array.isArray(i)?r[n]=i.map(e=>o(e,r)):("object"===s&&null!==i&&(i=o(i)),r[n]=i)}return r}class s{constructor(r={}){this.raws={},this[e]=!1,this[t]=!0;for(let e in r)if("nodes"===e){this.nodes=[];for(let t of r[e])"function"==typeof t.clone?this.append(t.clone()):this.append(t)}else this[e]=r[e]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=o(this);for(let r in e)t[r]=e[r];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:r,start:n}=this.rangeBy(t);return this.source.input.error(e,{column:n.column,line:n.line},{column:r.column,line:r.line},t)}return new r(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markDirty(){if(this[e]){this[e]=!1;let t=this;for(;t=t.parent;)t[e]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){let n=(t=this.toString()).indexOf(e.word);-1!==n&&(r=this.positionInside(n,t))}return r}positionInside(e,t){let r=t||this.toString(),n=this.source.start.column,i=this.source.start.line;for(let t=0;t<e;t++)"\n"===r[t]?(n=1,i+=1):n+=1;return{column:n,line:i}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let n=this.toString(),i=n.indexOf(e.word);-1!==i&&(t=this.positionInside(i,n),r=this.positionInside(i+e.word.length,n))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return(new n).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let n of e)n===this?r=!0:r?(this.parent.insertAfter(t,n),t=n):this.parent.insertBefore(t,n);r||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let r={},n=null==t;t=t||new Map;let i=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let n=this[e];if(Array.isArray(n))r[e]=n.map(e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e);else if("object"==typeof n&&n.toJSON)r[e]=n.toJSON(null,t);else if("source"===e){let o=t.get(n.input);null==o&&(o=i,t.set(n.input,i),i++),r[e]={end:n.end,inputId:o,start:n.start}}else r[e]=n}return n&&(r.inputs=[...t.keys()].map(e=>e.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=i){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){let n={node:this};for(let e in r)n[e]=r[e];return e.warn(t,n)}get proxyOf(){return this}}return Tp=s,s.default=s,Tp}function $v(){if(Pp)return Rp;Pp=1;let e=Vv();class t extends e{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}}return Rp=t,t.default=t,Rp}function Hv(){if(Mp)return _p;Mp=1;return _p={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(r=t)=>{let n="",i=r;for(;i--;)n+=e[Math.random()*e.length|0];return n}}}function Kv(){if(Lp)return Np;Lp=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=bp,{existsSync:r,readFileSync:n}=bp,{dirname:i,join:o}=bp;class s{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,n=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=i(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new e(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t;let r=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+r)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let r=e.lastIndexOf(t.pop()),n=e.indexOf("*/",r);r>-1&&n>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,n)))}loadFile(e){if(this.root=i(e),r(e))return this.mapFile=e,n(e,"utf-8").toString().trim()}loadMap(r,n){if(!1===n)return!1;if(n){if("string"==typeof n)return n;if("function"!=typeof n){if(n instanceof e)return t.fromSourceMap(n).toString();if(n instanceof t)return n.toString();if(this.isMap(n))return JSON.stringify(n);throw new Error("Unsupported previous source map format: "+n.toString())}{let e=n(r);if(e){let t=this.loadFile(e);if(!t)throw new Error("Unable to load previous source map: "+e.toString());return t}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let e=this.annotation;return r&&(e=o(i(r),e)),this.loadFile(e)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return Np=s,s.default=s,Np}function Gv(){if(Up)return Dp;Up=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=bp,{fileURLToPath:r,pathToFileURL:n}=bp,{isAbsolute:i,resolve:o}=bp,{nanoid:s}=Hv(),a=bp,l=Bv(),u=Kv(),c=Symbol("fromOffsetCache"),d=Boolean(e&&t),h=Boolean(o&&i);class p{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||""===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!h||/^\w+:\/\//.test(t.from)||i(t.from)?this.file=t.from:this.file=o(t.from)),h&&d){let e=new u(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+s(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,i={}){let o,s,a;if(t&&"object"==typeof t){let e=t,n=r;if("number"==typeof e.offset){let n=this.fromOffset(e.offset);t=n.line,r=n.col}else t=e.line,r=e.column;if("number"==typeof n.offset){let e=this.fromOffset(n.offset);s=e.line,a=e.col}else s=n.line,a=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let u=this.origin(t,r,s,a);return o=u?new l(e,void 0===u.endLine?u.line:{column:u.column,line:u.line},void 0===u.endLine?u.column:{column:u.endColumn,line:u.endLine},u.source,u.file,i.plugin):new l(e,void 0===s?t:{column:r,line:t},void 0===s?r:{column:a,line:s},this.css,this.file,i.plugin),o.input={column:r,endColumn:a,endLine:s,line:t,source:this.css},this.file&&(n&&(o.input.url=n(this.file).toString()),o.input.file=this.file),o}fromOffset(e){let t,r;if(this[c])r=this[c];else{let e=this.css.split("\n");r=new Array(e.length);let t=0;for(let n=0,i=e.length;n<i;n++)r[n]=t,t+=e[n].length+1;this[c]=r}t=r[r.length-1];let n=0;if(e>=t)n=r.length-1;else{let t,i=r.length-2;for(;n<i;)if(t=n+(i-n>>1),e<r[t])i=t-1;else{if(!(e>=r[t+1])){n=t;break}n=t+1}}return{col:e-r[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:o(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,o,s){if(!this.map)return!1;let a,l,u=this.map.consumer(),c=u.originalPositionFor({column:t,line:e});if(!c.source)return!1;"number"==typeof o&&(a=u.originalPositionFor({column:s,line:o})),l=i(c.source)?n(c.source):new URL(c.source,this.map.consumer().sourceRoot||n(this.map.mapFile));let d={column:c.column,endColumn:a&&a.column,endLine:a&&a.line,line:c.line,url:l.toString()};if("file:"===l.protocol){if(!r)throw new Error("file: protocol is not available in this PostCSS build");d.file=r(l)}let h=u.sourceContentFor(c.source);return h&&(d.source=h),d}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}}return Dp=p,p.default=p,a&&a.registerInput&&a.registerInput(p),Dp}function Jv(){if(jp)return Fp;jp=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=bp,{dirname:r,relative:n,resolve:i,sep:o}=bp,{pathToFileURL:s}=bp,a=Gv(),l=Boolean(e&&t),u=Boolean(r&&i&&n&&o);return Fp=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let t of this.previous()){let n,i=this.toUrl(this.path(t.file)),o=t.root||r(t.file);!1===this.mapOpts.sourcesContent?(n=new e(t.text),n.sourcesContent&&(n.sourcesContent=null)):n=t.consumer(),this.map.applySourceMap(n,i,this.toUrl(this.path(o)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),u&&l&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=t.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0});let e,r,n=1,i=1,o="<no source>",s={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(t,a,l)=>{if(this.css+=t,a&&"end"!==l&&(s.generated.line=n,s.generated.column=i-1,a.source&&a.source.start?(s.source=this.sourcePath(a),s.original.line=a.source.start.line,s.original.column=a.source.start.column-1,this.map.addMapping(s)):(s.source=o,s.original.line=1,s.original.column=0,this.map.addMapping(s))),e=t.match(/\n/g),e?(n+=e.length,r=t.lastIndexOf("\n"),i=t.length-r):i+=t.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(s.source=this.sourcePath(a),s.original.line=a.source.end.line,s.original.column=a.source.end.column-1,s.generated.line=n,s.generated.column=i-2,this.map.addMapping(s)):(s.source=o,s.original.line=1,s.original.column=0,s.generated.line=n,s.generated.column=i-1,this.map.addMapping(s)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let o=this.opts.to?r(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(o=r(i(o,this.mapOpts.annotation)));let s=n(o,e);return this.memoizedPaths.set(e,s),s}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new a(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let r=t.source.input.from;if(r&&!e[r]){e[r]=!0;let n=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(n,t.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(s){let t=s(e).toString();return this.memoizedFileURLs.set(e,t),t}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;"\\"===o&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}}}function Qv(){if(qp)return Bp;qp=1;let e=Vv();class t extends e{constructor(e){super(e),this.type="comment"}}return Bp=t,t.default=t,Bp}function Xv(){if(Wp)return zp;Wp=1;let e,t,r,n,{isClean:i,my:o}=qv(),s=$v(),a=Qv(),l=Vv();function u(e){return e.map(e=>(e.nodes&&(e.nodes=u(e.nodes)),delete e.source,e))}function c(e){if(e[i]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)c(t)}class d extends l{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,r,n=this.getIterator();for(;this.indexes[n]<this.proxyOf.nodes.length&&(t=this.indexes[n],r=e(this.proxyOf.nodes[t],t),!1!==r);)this.indexes[n]+=1;return delete this.indexes[n],r}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...r)=>e[t](...r.map(e=>"function"==typeof e?(t,r)=>e(t.toProxy(),r):e)):"every"===t||"some"===t?r=>e[t]((e,...t)=>r(e.toProxy(),...t)):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map(e=>e.toProxy()):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let r,n=this.index(e),i=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let e of i)this.proxyOf.nodes.splice(n+1,0,e);for(let e in this.indexes)r=this.indexes[e],n<r&&(this.indexes[e]=r+i.length);return this.markDirty(),this}insertBefore(e,t){let r,n=this.index(e),i=0===n&&"prepend",o=this.normalize(t,this.proxyOf.nodes[n],i).reverse();n=this.index(e);for(let e of o)this.proxyOf.nodes.splice(n,0,e);for(let e in this.indexes)r=this.indexes[e],n<=r&&(this.indexes[e]=r+o.length);return this.markDirty(),this}normalize(n,l){if("string"==typeof n)n=u(e(n).nodes);else if(void 0===n)n=[];else if(Array.isArray(n)){n=n.slice(0);for(let e of n)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===n.type&&"document"!==this.type){n=n.nodes.slice(0);for(let e of n)e.parent&&e.parent.removeChild(e,"ignore")}else if(n.type)n=[n];else if(n.prop){if(void 0===n.value)throw new Error("Value field is missed in node creation");"string"!=typeof n.value&&(n.value=String(n.value)),n=[new s(n)]}else if(n.selector)n=[new t(n)];else if(n.name)n=[new r(n)];else{if(!n.text)throw new Error("Unknown node type in node creation");n=[new a(n)]}return n.map(e=>(e[o]||d.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[i]&&c(e),void 0===e.raws.before&&l&&void 0!==l.raws.before&&(e.raws.before=l.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls(n=>{t.props&&!t.props.includes(n.prop)||t.fast&&!n.value.includes(t.fast)||(n.value=n.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,r)=>{let n;try{n=e(t,r)}catch(e){throw t.addToError(e)}return!1!==n&&t.walk&&(n=t.walk(e)),n})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("atrule"===r.type&&e.test(r.name))return t(r,n)}):this.walk((r,n)=>{if("atrule"===r.type&&r.name===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("atrule"===e.type)return t(e,r)}))}walkComments(e){return this.walk((t,r)=>{if("comment"===t.type)return e(t,r)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("decl"===r.type&&e.test(r.prop))return t(r,n)}):this.walk((r,n)=>{if("decl"===r.type&&r.prop===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("decl"===e.type)return t(e,r)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("rule"===r.type&&e.test(r.selector))return t(r,n)}):this.walk((r,n)=>{if("rule"===r.type&&r.selector===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("rule"===e.type)return t(e,r)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}return d.registerParse=t=>{e=t},d.registerRule=e=>{t=e},d.registerAtRule=e=>{r=e},d.registerRoot=e=>{n=e},zp=d,d.default=d,d.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,r.prototype):"rule"===e.type?Object.setPrototypeOf(e,t.prototype):"decl"===e.type?Object.setPrototypeOf(e,s.prototype):"comment"===e.type?Object.setPrototypeOf(e,a.prototype):"root"===e.type&&Object.setPrototypeOf(e,n.prototype),e[o]=!0,e.nodes&&e.nodes.forEach(e=>{d.rebuild(e)})},zp}function Yv(){if($p)return Vp;$p=1;let e,t,r=Xv();class n extends r{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(r={}){return new e(new t,this,r).stringify()}}return n.registerLazyResult=t=>{e=t},n.registerProcessor=e=>{t=e},Vp=n,n.default=n,Vp}function Zv(){if(Kp)return Hp;Kp=1;let e={};return Hp=function(t){e[t]||(e[t]=!0,"undefined"!=typeof console&&console.warn&&console.warn(t))}}function em(){if(Jp)return Gp;Jp=1;class e{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}return Gp=e,e.default=e,Gp}function tm(){if(Xp)return Qp;Xp=1;let e=em();class t{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(t,r={}){r.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(r.plugin=this.lastPlugin.postcssPlugin);let n=new e(t,r);return this.messages.push(n),n}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}}return Qp=t,t.default=t,Qp}function rm(){if(tf)return ef;tf=1;let e=Xv();class t extends e{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}}return ef=t,t.default=t,e.registerAtRule(t),ef}function nm(){if(nf)return rf;nf=1;let e,t,r=Xv();class n extends r{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){let n=super.normalize(e);if(t)if("prepend"===r)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of n)e.raws.before=t.raws.before;return n}removeChild(e,t){let r=this.index(e);return!t&&0===r&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(r={}){return new e(new t,this,r).stringify()}}return n.registerLazyResult=t=>{e=t},n.registerProcessor=e=>{t=e},rf=n,n.default=n,r.registerRoot(n),rf}function im(){if(sf)return of;sf=1;let e={comma:t=>e.split(t,[","],!0),space:t=>e.split(t,[" ","\n","\t"]),split(e,t,r){let n=[],i="",o=!1,s=0,a=!1,l="",u=!1;for(let r of e)u?u=!1:"\\"===r?u=!0:a?r===l&&(a=!1):'"'===r||"'"===r?(a=!0,l=r):"("===r?s+=1:")"===r?s>0&&(s-=1):0===s&&t.includes(r)&&(o=!0),o?(""!==i&&n.push(i.trim()),i="",o=!1):i+=r;return(r||""!==i)&&n.push(i.trim()),n}};return of=e,e.default=e,of}function om(){if(lf)return af;lf=1;let e=Xv(),t=im();class r extends e{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return t.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}}return af=r,r.default=r,e.registerRule(r),af}function sm(){if(cf)return uf;cf=1;let e=$v(),t=function(){if(Zp)return Yp;Zp=1;const e="'".charCodeAt(0),t='"'.charCodeAt(0),r="\\".charCodeAt(0),n="/".charCodeAt(0),i="\n".charCodeAt(0),o=" ".charCodeAt(0),s="\f".charCodeAt(0),a="\t".charCodeAt(0),l="\r".charCodeAt(0),u="[".charCodeAt(0),c="]".charCodeAt(0),d="(".charCodeAt(0),h=")".charCodeAt(0),p="{".charCodeAt(0),f="}".charCodeAt(0),g=";".charCodeAt(0),v="*".charCodeAt(0),m=":".charCodeAt(0),y="@".charCodeAt(0),b=/[\t\n\f\r "#'()/;[\\\]{}]/g,w=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,S=/.[\r\n"'(/\\]/,k=/[\da-f]/i;return Yp=function(x,E={}){let C,I,O,T,A,R,P,_,M,N,L=x.css.valueOf(),D=E.ignoreErrors,U=L.length,F=0,j=[],B=[];function q(e){throw x.error("Unclosed "+e,F)}return{back:function(e){B.push(e)},endOfFile:function(){return 0===B.length&&F>=U},nextToken:function(x){if(B.length)return B.pop();if(F>=U)return;let E=!!x&&x.ignoreUnclosed;switch(C=L.charCodeAt(F),C){case i:case o:case a:case l:case s:I=F;do{I+=1,C=L.charCodeAt(I)}while(C===o||C===i||C===a||C===l||C===s);N=["space",L.slice(F,I)],F=I-1;break;case u:case c:case p:case f:case m:case g:case h:{let e=String.fromCharCode(C);N=[e,e,F];break}case d:if(_=j.length?j.pop()[1]:"",M=L.charCodeAt(F+1),"url"===_&&M!==e&&M!==t&&M!==o&&M!==i&&M!==a&&M!==s&&M!==l){I=F;do{if(R=!1,I=L.indexOf(")",I+1),-1===I){if(D||E){I=F;break}q("bracket")}for(P=I;L.charCodeAt(P-1)===r;)P-=1,R=!R}while(R);N=["brackets",L.slice(F,I+1),F,I],F=I}else I=L.indexOf(")",F+1),T=L.slice(F,I+1),-1===I||S.test(T)?N=["(","(",F]:(N=["brackets",T,F,I],F=I);break;case e:case t:O=C===e?"'":'"',I=F;do{if(R=!1,I=L.indexOf(O,I+1),-1===I){if(D||E){I=F+1;break}q("string")}for(P=I;L.charCodeAt(P-1)===r;)P-=1,R=!R}while(R);N=["string",L.slice(F,I+1),F,I],F=I;break;case y:b.lastIndex=F+1,b.test(L),I=0===b.lastIndex?L.length-1:b.lastIndex-2,N=["at-word",L.slice(F,I+1),F,I],F=I;break;case r:for(I=F,A=!0;L.charCodeAt(I+1)===r;)I+=1,A=!A;if(C=L.charCodeAt(I+1),A&&C!==n&&C!==o&&C!==i&&C!==a&&C!==l&&C!==s&&(I+=1,k.test(L.charAt(I)))){for(;k.test(L.charAt(I+1));)I+=1;L.charCodeAt(I+1)===o&&(I+=1)}N=["word",L.slice(F,I+1),F,I],F=I;break;default:C===n&&L.charCodeAt(F+1)===v?(I=L.indexOf("*/",F+2)+1,0===I&&(D||E?I=L.length:q("comment")),N=["comment",L.slice(F,I+1),F,I],F=I):(w.lastIndex=F+1,w.test(L),I=0===w.lastIndex?L.length-1:w.lastIndex-2,N=["word",L.slice(F,I+1),F,I],j.push(N),F=I)}return F++,N},position:function(){return F}}}}(),r=Qv(),n=rm(),i=nm(),o=om();const s={empty:!0,space:!0};return uf=class{constructor(e){this.input=e,this.root=new i,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,r,i,o=new n;o.name=e[1].slice(1),""===o.name&&this.unnamedAtrule(o,e),this.init(o,e[2]);let s=!1,a=!1,l=[],u=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?u.push("("===t?")":"]"):"{"===t&&u.length>0?u.push("}"):t===u[u.length-1]&&u.pop(),0===u.length){if(";"===t){o.source.end=this.getPosition(e[2]),o.source.end.offset++,this.semicolon=!0;break}if("{"===t){a=!0;break}if("}"===t){if(l.length>0){for(i=l.length-1,r=l[i];r&&"space"===r[0];)r=l[--i];r&&(o.source.end=this.getPosition(r[3]||r[2]),o.source.end.offset++)}this.end(e);break}l.push(e)}else l.push(e);if(this.tokenizer.endOfFile()){s=!0;break}}o.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(o.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(o,"params",l),s&&(e=l[l.length-1],o.source.end=this.getPosition(e[3]||e[2]),o.source.end.offset++,this.spaces=o.raws.between,o.raws.between="")):(o.raws.afterName="",o.params=""),a&&(o.nodes=[],this.current=o)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let r,n=0;for(let i=t-1;i>=0&&(r=e[i],"space"===r[0]||(n+=1,2!==n));i--);throw this.input.error("Missed semicolon","word"===r[0]?r[3]+1:r[2])}colon(e){let t,r,n,i=0;for(let[o,s]of e.entries()){if(t=s,r=t[0],"("===r&&(i+=1),")"===r&&(i-=1),0===i&&":"===r){if(n){if("word"===n[0]&&"progid"===n[1])continue;return o}this.doubleColon(t)}n=t}return!1}comment(e){let t=new r;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=t(this.input)}decl(t,r){let n=new e;this.init(n,t[0][2]);let i,o=t[t.length-1];for(";"===o[0]&&(this.semicolon=!0,t.pop()),n.source.end=this.getPosition(o[3]||o[2]||function(e){for(let t=e.length-1;t>=0;t--){let r=e[t],n=r[3]||r[2];if(n)return n}}(t)),n.source.end.offset++;"word"!==t[0][0];)1===t.length&&this.unknownWord(t),n.raws.before+=t.shift()[1];for(n.source.start=this.getPosition(t[0][2]),n.prop="";t.length;){let e=t[0][0];if(":"===e||"space"===e||"comment"===e)break;n.prop+=t.shift()[1]}for(n.raws.between="";t.length;){if(i=t.shift(),":"===i[0]){n.raws.between+=i[1];break}"word"===i[0]&&/\w/.test(i[1])&&this.unknownWord([i]),n.raws.between+=i[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let s,a=[];for(;t.length&&(s=t[0][0],"space"===s||"comment"===s);)a.push(t.shift());this.precheckMissedSemicolon(t);for(let e=t.length-1;e>=0;e--){if(i=t[e],"!important"===i[1].toLowerCase()){n.important=!0;let r=this.stringFrom(t,e);r=this.spacesFromEnd(t)+r," !important"!==r&&(n.raws.important=r);break}if("important"===i[1].toLowerCase()){let r=t.slice(0),i="";for(let t=e;t>0;t--){let e=r[t][0];if(0===i.trim().indexOf("!")&&"space"!==e)break;i=r.pop()[1]+i}0===i.trim().indexOf("!")&&(n.important=!0,n.raws.important=i,t=r)}if("space"!==i[0]&&"comment"!==i[0])break}t.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(n,"value",a.concat(t),r),n.value.includes(":")&&!r&&this.checkMissedSemicolon(t)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new o;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,r=null,n=!1,i=null,o=[],s=e[1].startsWith("--"),a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)i||(i=l),o.push("("===r?")":"]");else if(s&&n&&"{"===r)i||(i=l),o.push("}");else if(0===o.length){if(";"===r){if(n)return void this.decl(a,s);break}if("{"===r)return void this.rule(a);if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}":"===r&&(n=!0)}else r===o[o.length-1]&&(o.pop(),0===o.length&&(i=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(i),t&&n){if(!s)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,s)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,r,n){let i,o,a,l,u=r.length,c="",d=!0;for(let e=0;e<u;e+=1)i=r[e],o=i[0],"space"!==o||e!==u-1||n?"comment"===o?(l=r[e-1]?r[e-1][0]:"empty",a=r[e+1]?r[e+1][0]:"empty",s[l]||s[a]||","===c.slice(-1)?d=!1:c+=i[1]):c+=i[1]:d=!1;if(!d){let n=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:n,value:c}}e[t]=c}rule(e){e.pop();let t=new o;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let n=t;n<e.length;n++)r+=e[n][1];return e.splice(t,e.length-t),r}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}}}function am(){if(hf)return df;hf=1;let e=Xv(),t=sm(),r=Gv();function n(e,n){let i=new r(e,n),o=new t(i);try{o.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&n&&n.from&&(/\.scss$/i.test(n.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(n.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(n.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return o.root}return df=n,n.default=n,e.registerParse(n),df}function lm(){if(ff)return pf;ff=1;let{isClean:e,my:t}=qv(),r=Jv(),n=Wv(),i=Xv(),o=Yv(),s=Zv(),a=tm(),l=am(),u=nm();const c={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},d={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},h={Once:!0,postcssPlugin:!0,prepare:!0};function p(e){return"object"==typeof e&&"function"==typeof e.then}function f(e){let t=!1,r=c[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[r,r+"-"+t,0,r+"Exit",r+"Exit-"+t]:t?[r,r+"-"+t,r+"Exit",r+"Exit-"+t]:e.append?[r,0,r+"Exit"]:[r,r+"Exit"]}function g(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:f(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function v(t){return t[e]=!1,t.nodes&&t.nodes.forEach(e=>v(e)),t}let m={};class y{constructor(e,r,n){let o;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof y||r instanceof a)o=v(r.root),r.map&&(void 0===n.map&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=r.map);else{let e=l;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{o=e(r,n)}catch(e){this.processed=!0,this.error=e}o&&!o[t]&&i.rebuild(o)}else o=v(r);this.result=new a(e,o,n),this.helpers={...m,postcss:m,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let r=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(r.postcssVersion&&"production"!==process.env.NODE_ENV){let e=r.postcssPlugin,t=r.postcssVersion,n=this.result.processor.version,i=t.split("."),o=n.split(".");(i[0]!==o[0]||parseInt(i[1])>parseInt(o[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+n+", but "+e+" uses "+t+". Perhaps this is the source of the error below.")}}else e.plugin=r.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,r)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,r])};for(let t of this.plugins)if("object"==typeof t)for(let r in t){if(!d[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!h[r])if("object"==typeof t[r])for(let n in t[r])e(t,"*"===n?r:r+"-"+n.toLowerCase(),t[r][n]);else"function"==typeof t[r]&&e(t,r,t[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],r=this.runOnRoot(t);if(p(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];){t[e]=!0;let r=[g(t)];for(;r.length>0;){let e=this.visitTick(r);if(p(e))try{await e}catch(e){let t=r[r.length-1].node;throw this.handleError(e,t)}}}if(this.listeners.OnceExit)for(let[e,r]of this.listeners.OnceExit){this.result.lastPlugin=e;try{if("document"===t.type){let e=t.nodes.map(e=>r(e,this.helpers));await Promise.all(e)}else await r(t,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return p(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=n;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let i=new r(t,this.result.root,this.result.opts).generate();return this.result.css=i[0],this.result.map=i[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins){if(p(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];)t[e]=!0,this.walkSync(t);if(this.listeners.OnceExit)if("document"===t.type)for(let e of t.nodes)this.visitSync(this.listeners.OnceExit,e);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||s("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[r,n]of e){let e;this.result.lastPlugin=r;try{e=n(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(p(e))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:n,visitors:i}=r;if("root"!==n.type&&"document"!==n.type&&!n.parent)return void t.pop();if(i.length>0&&r.visitorIndex<i.length){let[e,t]=i[r.visitorIndex];r.visitorIndex+=1,r.visitorIndex===i.length&&(r.visitors=[],r.visitorIndex=0),this.result.lastPlugin=e;try{return t(n.toProxy(),this.helpers)}catch(e){throw this.handleError(e,n)}}if(0!==r.iterator){let i,o=r.iterator;for(;i=n.nodes[n.indexes[o]];)if(n.indexes[o]+=1,!i[e])return i[e]=!0,void t.push(g(i));r.iterator=0,delete n.indexes[o]}let o=r.events;for(;r.eventIndex<o.length;){let t=o[r.eventIndex];if(r.eventIndex+=1,0===t)return void(n.nodes&&n.nodes.length&&(n[e]=!0,r.iterator=n.getIterator()));if(this.listeners[t])return void(r.visitors=this.listeners[t])}t.pop()}walkSync(t){t[e]=!0;let r=f(t);for(let n of r)if(0===n)t.nodes&&t.each(t=>{t[e]||this.walkSync(t)});else{let e=this.listeners[n];if(e&&this.visitSync(e,t.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}}return y.registerPostcss=e=>{m=e},pf=y,y.default=y,u.registerLazyResult(y),o.registerLazyResult(y),pf}function um(){if(yf)return mf;yf=1;let e=function(){if(vf)return gf;vf=1;let e=Jv(),t=Wv(),r=Zv(),n=am();const i=tm();class o{constructor(r,n,o){let s;n=n.toString(),this.stringified=!1,this._processor=r,this._css=n,this._opts=o,this._map=void 0;let a=t;this.result=new i(this._processor,s,this._opts),this.result.css=n;let l=this;Object.defineProperty(this.result,"root",{get:()=>l.root});let u=new e(a,s,this._opts,n);if(u.isMap()){let[e,t]=u.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else u.clearAnnotation(),this.result.css=u.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this._opts||r("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=n;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}}return gf=o,o.default=o,gf}(),t=lm(),r=Yv(),n=nm();class i{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(r,n={}){return this.plugins.length||n.parser||n.stringifier||n.syntax?new t(this,r,n):new e(this,r,n)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}return mf=i,i.default=i,n.registerProcessor(i),r.registerProcessor(i),mf}function cm(){if(kf)return Sf;kf=1;let e=Bv(),t=$v(),r=lm(),n=Xv(),i=um(),o=Wv(),s=function(){if(wf)return bf;wf=1;let e=$v(),t=Kv(),r=Qv(),n=rm(),i=Gv(),o=nm(),s=om();function a(l,u){if(Array.isArray(l))return l.map(e=>a(e));let{inputs:c,...d}=l;if(c){u=[];for(let e of c){let r={...e,__proto__:i.prototype};r.map&&(r.map={...r.map,__proto__:t.prototype}),u.push(r)}}if(d.nodes&&(d.nodes=l.nodes.map(e=>a(e,u))),d.source){let{inputId:e,...t}=d.source;d.source=t,null!=e&&(d.source.input=u[e])}if("root"===d.type)return new o(d);if("decl"===d.type)return new e(d);if("rule"===d.type)return new s(d);if("comment"===d.type)return new r(d);if("atrule"===d.type)return new n(d);throw new Error("Unknown node type: "+l.type)}return bf=a,a.default=a,bf}(),a=Yv(),l=em(),u=Qv(),c=rm(),d=tm(),h=Gv(),p=am(),f=im(),g=om(),v=nm(),m=Vv();function y(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new i(e)}return y.plugin=function(e,t){let r,n=!1;function o(...r){console&&console.warn&&!n&&(n=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let o=t(...r);return o.postcssPlugin=e,o.postcssVersion=(new i).version,o}return Object.defineProperty(o,"postcss",{get:()=>(r||(r=o()),r)}),o.process=function(e,t,r){return y([o(r)]).process(e,t)},o},y.stringify=o,y.parse=p,y.fromJSON=s,y.list=f,y.comment=e=>new u(e),y.atRule=e=>new c(e),y.decl=e=>new t(e),y.rule=e=>new g(e),y.root=e=>new v(e),y.document=e=>new a(e),y.CssSyntaxError=e,y.Declaration=t,y.Container=n,y.Processor=i,y.Document=a,y.Comment=u,y.Warning=l,y.AtRule=c,y.Result=d,y.Input=h,y.Rule=g,y.Root=v,y.Node=m,r.registerPostcss(y),Sf=y,y.default=y,Sf}function dm(e){if(Tf[e])return Tf[e];const t=function(e){var t,r;const n=null==(r=null==(t=null==globalThis?void 0:globalThis.Zone)?void 0:t.__symbol__)?void 0:r.call(t,e);return n&&globalThis[n]?globalThis[n]:void 0}(e)||globalThis[e],r=t.prototype,n=e in If?If[e]:void 0,i=Boolean(n&&n.every(e=>{var t,n;return Boolean(null==(n=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:n.toString().includes("[native code]"))})),o=e in Of?Of[e]:void 0,s=Boolean(o&&o.every(e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))}));if(i&&s)return Tf[e]=t.prototype,t.prototype;try{const n=document.createElement("iframe");document.body.appendChild(n);const i=n.contentWindow;if(!i)return t.prototype;const o=i[e].prototype;return document.body.removeChild(n),o?Tf[e]=o:r}catch(e){return r}}function hm(e,t,r){var n;const i=`${e}.${String(r)}`;if(Af[i])return Af[i].call(t);const o=dm(e),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(Af[i]=s,s.call(t)):t[r]}function pm(e,t,r){const n=`${e}.${String(r)}`;if(Rf[n])return Rf[n].bind(t);const i=dm(e)[r];return"function"!=typeof i?t[r]:(Rf[n]=i,i.bind(t))}function fm(e){return hm("Node",e,"childNodes")}function gm(e){return hm("Node",e,"parentNode")}function vm(e){return hm("Node",e,"parentElement")}function mm(e){return hm("Node",e,"textContent")}function ym(e,t){return pm("Node",e,"contains")(t)}function bm(e){return pm("Node",e,"getRootNode")()}function wm(e){return e&&"host"in e?hm("ShadowRoot",e,"host"):null}function Sm(e){return e.styleSheets}function km(e){return e&&"shadowRoot"in e?hm("Element",e,"shadowRoot"):null}function xm(e,t){return hm("Element",e,"querySelector")(t)}function Em(e,t){return hm("Element",e,"querySelectorAll")(t)}function Cm(){return dm("MutationObserver").constructor}function Im(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}function Om(e,t,r={}){let n=null,i=0;return function(...o){const s=Date.now();i||!1!==r.leading||(i=s);const a=t-(s-i),l=this;a<=0||a>t?(n&&(clearTimeout(n),n=null),i=s,e.apply(l,o)):n||!1===r.trailing||(n=setTimeout(()=>{i=!1===r.leading?0:Date.now(),n=null,e.apply(l,o)},a))}}function Tm(e,t,r,n,i=window){const o=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,n?r:{set(e){setTimeout(()=>{r.set.call(this,e)},0),o&&o.set&&o.set.call(this,e)}}),()=>Tm(e,t,o||{},!0)}function Am(e,t,r){try{if(!(t in e))return()=>{};const n=e[t],i=r(n);return"function"==typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=i,()=>{e[t]=n}}catch(e){return()=>{}}}function Rm(e){var t,r,n,i;const o=e.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(t=Pf.parentElement(o.body))?void 0:t.scrollLeft)||(null==(r=null==o?void 0:o.body)?void 0:r.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(n=Pf.parentElement(o.body))?void 0:n.scrollTop)||(null==(i=null==o?void 0:o.body)?void 0:i.scrollTop)||0}}function Pm(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function _m(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Mm(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:Pf.parentElement(e)}function Nm(e,t,r,n){if(!e)return!1;const i=Mm(e);if(!i)return!1;try{if("string"==typeof t){if(i.classList.contains(t))return!0;if(n&&null!==i.closest("."+t))return!0}else if(nv(i,t,n))return!0}catch(e){}if(r){if(i.matches(r))return!0;if(n&&null!==i.closest(r))return!0}return!1}function Lm(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||t.getId(e)===Xd}function Dm(e,t){if(Bg(e))return!1;const r=t.getId(e);if(!t.has(r))return!0;const n=Pf.parentNode(e);return(!n||n.nodeType!==e.DOCUMENT_NODE)&&(!n||Dm(n,t))}function Um(e){return Boolean(e.changedTouches)}function Fm(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function jm(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Bm(e){return!!e&&(e instanceof Cf&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(Pf.shadowRoot(e)))}function qm(e){var t;let r=null;return"getRootNode"in e&&(null==(t=Pf.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&Pf.host(Pf.getRootNode(e))&&(r=Pf.host(Pf.getRootNode(e))),r}function zm(e){const t=e.ownerDocument;if(!t)return!1;const r=function(e){let t,r=e;for(;t=qm(r);)r=t;return r}(e);return Pf.contains(t,r)}function Wm(e){const t=e.ownerDocument;return!!t&&(Pf.contains(t,e)||zm(e))}function Vm(e){return"__ln"in e}function $m(e,t){e.delete(t),Pf.childNodes(t).forEach(t=>$m(e,t))}function Hm(e,t,r){return 0!==e.size&&function(e,t){const r=Pf.parentNode(t);return!!r&&e.has(r)}(e,t)}function Km(e,t){return 0!==e.size&&Gm(e,t)}function Gm(e,t){const r=Pf.parentNode(t);return!!r&&(!!e.has(r)||Gm(e,r))}function Jm(e){return(...t)=>{try{return e(...t)}catch(e){try{e._external_=!0}catch(e){}throw e}}}function Qm(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch(e){}return e&&e.target}function Xm(e,t){const r=new $f;Gf.push(r),r.init(e);const n=new(Cm())(Kf(r.processMutations.bind(r)));return n.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),n}function Ym({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,blockSelector:i,sampling:o}){if(!1===o.mouseInteraction)return()=>{};const s=!0===o.mouseInteraction||void 0===o.mouseInteraction?{}:o.mouseInteraction,a=[];let l=null;return Object.keys(Ff).filter(e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==s[e]).forEach(o=>{let s=$g(o);const u=(t=>o=>{const s=Qm(o);if(Nm(s,n,i,!0))return;let a=null,u=t;if("pointerType"in o){switch(o.pointerType){case"mouse":a=jf.Mouse;break;case"touch":a=jf.Touch;break;case"pen":a=jf.Pen}a===jf.Touch?Ff[t]===Ff.MouseDown?u="TouchStart":Ff[t]===Ff.MouseUp&&(u="TouchEnd"):jf.Pen}else Um(o)&&(a=jf.Touch);null!==a?(l=a,(u.startsWith("Touch")&&a===jf.Touch||u.startsWith("Mouse")&&a===jf.Mouse)&&(a=null)):Ff[t]===Ff.Click&&(a=l,l=null);const c=Um(o)?o.changedTouches[0]:o;if(!c)return;const d=r.getId(s),{clientX:h,clientY:p}=c;Kf(e)({type:Ff[u],id:d,x:h,y:p,...null!==a&&{pointerType:a}})})(o);if(window.PointerEvent)switch(Ff[o]){case Ff.MouseDown:case Ff.MouseUp:s=s.replace("mouse","pointer");break;case Ff.TouchStart:case Ff.TouchEnd:return}a.push(Im(s,u,t))}),Kf(()=>{a.forEach(e=>e())})}function Zm({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:i,sampling:o}){return Im("scroll",Kf(Om(Kf(o=>{const s=Qm(o);if(!s||Nm(s,n,i,!0))return;const a=r.getId(s);if(s===t&&t.defaultView){const r=Rm(t.defaultView);e({id:a,x:r.left,y:r.top})}else e({id:a,x:s.scrollLeft,y:s.scrollTop})}),o.scroll||100)),t)}function ey(e){return function(e,t){if(iy("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||iy("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||iy("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||iy("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){const r=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(r)}else if(e.parentStyleSheet){const r=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(r)}return t}(e,[])}function ty(e,t,r){let n,i;return e?(e.ownerNode?n=t.getId(e.ownerNode):i=r.getId(e),{styleId:i,id:n}):{}}function ry({mirror:e,stylesheetManager:t},r){var n,i,o;let s=null;s="#document"===r.nodeName?e.getId(r):e.getId(Pf.host(r));const a="#document"===r.nodeName?null==(n=r.defaultView)?void 0:n.Document:null==(o=null==(i=r.ownerDocument)?void 0:i.defaultView)?void 0:o.ShadowRoot,l=(null==a?void 0:a.prototype)?Object.getOwnPropertyDescriptor(null==a?void 0:a.prototype,"adoptedStyleSheets"):void 0;return null!==s&&-1!==s&&a&&l?(Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var e;return null==(e=l.get)?void 0:e.call(this)},set(e){var r;const n=null==(r=l.set)?void 0:r.call(this,e);if(null!==s&&-1!==s)try{t.adoptStyleSheets(e,s)}catch(e){}return n}}),Kf(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})})):()=>{}}function ny(e,t={}){const r=e.doc.defaultView;if(!r)return()=>{};let n;!function(e,t){const{mutationCb:r,mousemoveCb:n,mouseInteractionCb:i,scrollCb:o,viewportResizeCb:s,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:u,styleDeclarationCb:c,canvasMutationCb:d,fontCb:h,selectionCb:p,customElementCb:f}=e;e.mutationCb=(...e)=>{t.mutation&&t.mutation(...e),r(...e)},e.mousemoveCb=(...e)=>{t.mousemove&&t.mousemove(...e),n(...e)},e.mouseInteractionCb=(...e)=>{t.mouseInteraction&&t.mouseInteraction(...e),i(...e)},e.scrollCb=(...e)=>{t.scroll&&t.scroll(...e),o(...e)},e.viewportResizeCb=(...e)=>{t.viewportResize&&t.viewportResize(...e),s(...e)},e.inputCb=(...e)=>{t.input&&t.input(...e),a(...e)},e.mediaInteractionCb=(...e)=>{t.mediaInteaction&&t.mediaInteaction(...e),l(...e)},e.styleSheetRuleCb=(...e)=>{t.styleSheetRule&&t.styleSheetRule(...e),u(...e)},e.styleDeclarationCb=(...e)=>{t.styleDeclaration&&t.styleDeclaration(...e),c(...e)},e.canvasMutationCb=(...e)=>{t.canvasMutation&&t.canvasMutation(...e),d(...e)},e.fontCb=(...e)=>{t.font&&t.font(...e),h(...e)},e.selectionCb=(...e)=>{t.selection&&t.selection(...e),p(...e)},e.customElementCb=(...e)=>{t.customElement&&t.customElement(...e),f(...e)}}(e,t),e.recordDOM&&(n=Xm(e,e.doc));const i=function({mousemoveCb:e,sampling:t,doc:r,mirror:n}){if(!1===t.mousemove)return()=>{};const i="number"==typeof t.mousemove?t.mousemove:50,o="number"==typeof t.mousemoveCallback?t.mousemoveCallback:500;let s,a=[];const l=Om(Kf(t=>{const r=Date.now()-s;e(a.map(e=>(e.timeOffset-=r,e)),t),a=[],s=null}),o),u=Kf(Om(Kf(e=>{const t=Qm(e),{clientX:r,clientY:i}=Um(e)?e.changedTouches[0]:e;s||(s=Nf()),a.push({x:r,y:i,id:n.getId(t),timeOffset:Nf()-s}),l("undefined"!=typeof DragEvent&&e instanceof DragEvent?Uf.Drag:e instanceof MouseEvent?Uf.MouseMove:Uf.TouchMove)}),i,{trailing:!1})),c=[Im("mousemove",u,r),Im("touchmove",u,r),Im("drag",u,r)];return Kf(()=>{c.forEach(e=>e())})}(e),o=Ym(e),s=Zm(e),a=function({viewportResizeCb:e},{win:t}){let r=-1,n=-1;return Im("resize",Kf(Om(Kf(()=>{const t=Pm(),i=_m();r===t&&n===i||(e({width:Number(i),height:Number(t)}),r=t,n=i)}),200)),t)}(e,{win:r}),l=function({inputCb:e,doc:t,mirror:r,blockClass:n,blockSelector:i,ignoreClass:o,ignoreSelector:s,maskInputOptions:a,maskInputFn:l,sampling:u,userTriggeredOnInput:c}){function d(e){let r=Qm(e);const u=e.isTrusted,d=r&&r.tagName;if(r&&"OPTION"===d&&(r=Pf.parentElement(r)),!r||!d||Jf.indexOf(d)<0||Nm(r,n,i,!0))return;if(r.classList.contains(o)||s&&r.matches(s))return;let p=r.value,f=!1;const g=Hg(r)||"";"radio"===g||"checkbox"===g?f=r.checked:(a[d.toLowerCase()]||a[g])&&(p=Vg({element:r,maskInputOptions:a,tagName:d,type:g,value:p,maskInputFn:l})),h(r,c?{text:p,isChecked:f,userTriggered:u}:{text:p,isChecked:f});const v=r.name;"radio"===g&&v&&f&&t.querySelectorAll(`input[type="radio"][name="${v}"]`).forEach(e=>{if(e!==r){const t=e.value;h(e,c?{text:t,isChecked:!f,userTriggered:!1}:{text:t,isChecked:!f})}})}function h(t,n){const i=Qf.get(t);if(!i||i.text!==n.text||i.isChecked!==n.isChecked){Qf.set(t,n);const i=r.getId(t);Kf(e)({...n,id:i})}}const p=("last"===u.input?["change"]:["input","change"]).map(e=>Im(e,Kf(d),t)),f=t.defaultView;if(!f)return()=>{p.forEach(e=>e())};const g=f.Object.getOwnPropertyDescriptor(f.HTMLInputElement.prototype,"value"),v=[[f.HTMLInputElement.prototype,"value"],[f.HTMLInputElement.prototype,"checked"],[f.HTMLSelectElement.prototype,"value"],[f.HTMLTextAreaElement.prototype,"value"],[f.HTMLSelectElement.prototype,"selectedIndex"],[f.HTMLOptionElement.prototype,"selected"]];return g&&g.set&&p.push(...v.map(e=>Tm(e[0],e[1],{set(){Kf(d)({target:this,isTrusted:!1})}},!1,f))),Kf(()=>{p.forEach(e=>e())})}(e),u=function({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:i,doc:o}){const s=Kf(o=>Om(Kf(i=>{const s=Qm(i);if(!s||Nm(s,t,r,!0))return;const{currentTime:a,volume:l,muted:u,playbackRate:c,loop:d}=s;e({type:o,id:n.getId(s),currentTime:a,volume:l,muted:u,playbackRate:c,loop:d})}),i.media||500)),a=[Im("play",s(qf.Play),o),Im("pause",s(qf.Pause),o),Im("seeked",s(qf.Seeked),o),Im("volumechange",s(qf.VolumeChange),o),Im("ratechange",s(qf.RateChange),o)];return Kf(()=>{a.forEach(e=>e())})}(e);let c=()=>{},d=()=>{},h=()=>{},p=()=>{};e.recordDOM&&(c=function({styleSheetRuleCb:e,mirror:t,stylesheetManager:r},{win:n}){if(!n.CSSStyleSheet||!n.CSSStyleSheet.prototype)return()=>{};const i=n.CSSStyleSheet.prototype.insertRule;n.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:Kf((n,i,o)=>{const[s,a]=o,{id:l,styleId:u}=ty(i,t,r.styleMirror);return(l&&-1!==l||u&&-1!==u)&&e({id:l,styleId:u,adds:[{rule:s,index:a}]}),Jm(()=>n.apply(i,o))()})}),n.CSSStyleSheet.prototype.addRule=function(e,t,r=this.cssRules.length){const i=`${e} { ${t} }`;return n.CSSStyleSheet.prototype.insertRule.apply(this,[i,r])};const o=n.CSSStyleSheet.prototype.deleteRule;let s,a;n.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:Kf((n,i,o)=>{const[s]=o,{id:a,styleId:l}=ty(i,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:s}]}),Jm(()=>n.apply(i,o))()})}),n.CSSStyleSheet.prototype.removeRule=function(e){return n.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},n.CSSStyleSheet.prototype.replace&&(s=n.CSSStyleSheet.prototype.replace,n.CSSStyleSheet.prototype.replace=new Proxy(s,{apply:Kf((n,i,o)=>{const[s]=o,{id:a,styleId:l}=ty(i,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,replace:s}),n.apply(i,o)})})),n.CSSStyleSheet.prototype.replaceSync&&(a=n.CSSStyleSheet.prototype.replaceSync,n.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:Kf((n,i,o)=>{const[s]=o,{id:a,styleId:l}=ty(i,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,replaceSync:s}),n.apply(i,o)})}));const l={};oy("CSSGroupingRule")?l.CSSGroupingRule=n.CSSGroupingRule:(oy("CSSMediaRule")&&(l.CSSMediaRule=n.CSSMediaRule),oy("CSSConditionRule")&&(l.CSSConditionRule=n.CSSConditionRule),oy("CSSSupportsRule")&&(l.CSSSupportsRule=n.CSSSupportsRule));const u={};return Object.entries(l).forEach(([n,i])=>{u[n]={insertRule:i.prototype.insertRule,deleteRule:i.prototype.deleteRule},i.prototype.insertRule=new Proxy(u[n].insertRule,{apply:Kf((n,i,o)=>{const[s,a]=o,{id:l,styleId:u}=ty(i.parentStyleSheet,t,r.styleMirror);return(l&&-1!==l||u&&-1!==u)&&e({id:l,styleId:u,adds:[{rule:s,index:[...ey(i),a||0]}]}),n.apply(i,o)})}),i.prototype.deleteRule=new Proxy(u[n].deleteRule,{apply:Kf((n,i,o)=>{const[s]=o,{id:a,styleId:l}=ty(i.parentStyleSheet,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:[...ey(i),s]}]}),n.apply(i,o)})})}),Kf(()=>{n.CSSStyleSheet.prototype.insertRule=i,n.CSSStyleSheet.prototype.deleteRule=o,s&&(n.CSSStyleSheet.prototype.replace=s),a&&(n.CSSStyleSheet.prototype.replaceSync=a),Object.entries(l).forEach(([e,t])=>{t.prototype.insertRule=u[e].insertRule,t.prototype.deleteRule=u[e].deleteRule})})}(e,{win:r}),d=ry(e,e.doc),h=function({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:r,stylesheetManager:n},{win:i}){const o=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:Kf((i,s,a)=>{var l;const[u,c,d]=a;if(r.has(u))return o.apply(s,[u,c,d]);const{id:h,styleId:p}=ty(null==(l=s.parentRule)?void 0:l.parentStyleSheet,t,n.styleMirror);return(h&&-1!==h||p&&-1!==p)&&e({id:h,styleId:p,set:{property:u,value:c,priority:d},index:ey(s.parentRule)}),i.apply(s,a)})});const s=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(s,{apply:Kf((i,o,a)=>{var l;const[u]=a;if(r.has(u))return s.apply(o,[u]);const{id:c,styleId:d}=ty(null==(l=o.parentRule)?void 0:l.parentStyleSheet,t,n.styleMirror);return(c&&-1!==c||d&&-1!==d)&&e({id:c,styleId:d,remove:{property:u},index:ey(o.parentRule)}),i.apply(o,a)})}),Kf(()=>{i.CSSStyleDeclaration.prototype.setProperty=o,i.CSSStyleDeclaration.prototype.removeProperty=s})}(e,{win:r}),e.collectFonts&&(p=function({fontCb:e,doc:t}){const r=t.defaultView;if(!r)return()=>{};const n=[],i=new WeakMap,o=r.FontFace;r.FontFace=function(e,t,r){const n=new o(e,t,r);return i.set(n,{family:e,buffer:"string"!=typeof t,descriptors:r,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),n};const s=Am(t.fonts,"add",function(t){return function(r){return setTimeout(Kf(()=>{const t=i.get(r);t&&(e(t),i.delete(r))}),0),t.apply(this,[r])}});return n.push(()=>{r.FontFace=o}),n.push(s),Kf(()=>{n.forEach(e=>e())})}(e)));const f=function(e){const{doc:t,mirror:r,blockClass:n,blockSelector:i,selectionCb:o}=e;let s=!0;const a=Kf(()=>{const e=t.getSelection();if(!e||s&&(null==e?void 0:e.isCollapsed))return;s=e.isCollapsed||!1;const a=[],l=e.rangeCount||0;for(let t=0;t<l;t++){const o=e.getRangeAt(t),{startContainer:s,startOffset:l,endContainer:u,endOffset:c}=o;Nm(s,n,i,!0)||Nm(u,n,i,!0)||a.push({start:r.getId(s),startOffset:l,end:r.getId(u),endOffset:c})}o({ranges:a})});return a(),Im("selectionchange",a)}(e),g=function({doc:e,customElementCb:t}){const r=e.defaultView;return r&&r.customElements?Am(r.customElements,"define",function(e){return function(r,n,i){try{t({define:{name:r}})}catch(e){console.warn(`Custom element callback failed for ${r}`)}return e.apply(this,[r,n,i])}}):()=>{}}(e),v=[];for(const t of e.plugins)v.push(t.observer(t.callback,r,t.options));return Kf(()=>{Gf.forEach(e=>e.reset()),null==n||n.disconnect(),i(),o(),s(),a(),l(),u(),c(),d(),h(),p(),f(),g(),v.forEach(e=>e())})}function iy(e){return void 0!==window[e]}function oy(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}function sy(e,t,r){if(e instanceof Array)return e.map(e=>sy(e,t,r));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray){return{rr_type:e.constructor.name,args:[Object.values(e)]}}if(e instanceof ArrayBuffer){return{rr_type:e.constructor.name,base64:ng(e)}}if(e instanceof DataView){return{rr_type:e.constructor.name,args:[sy(e.buffer,t,r),e.byteOffset,e.byteLength]}}if(e instanceof HTMLImageElement){const t=e.constructor.name,{src:r}=e;return{rr_type:t,src:r}}if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}if(e instanceof ImageData){return{rr_type:e.constructor.name,args:[sy(e.data,t,r),e.width,e.height]}}if(ag(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:og(e,t,r)}}return e}function ay(e,t,r,n){const i=[];try{const o=Am(e.HTMLCanvasElement.prototype,"getContext",function(e){return function(i,...o){if(!Nm(this,t,r,!0)){const e=function(e){return"experimental-webgl"===e?"webgl":e}(i);if("__context"in this||(this.__context=e),n&&["webgl","webgl2"].includes(e))if(o[0]&&"object"==typeof o[0]){const e=o[0];e.preserveDrawingBuffer||(e.preserveDrawingBuffer=!0)}else o.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[i,...o])}});i.push(o)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{i.forEach(e=>e())}}function ly(e,t,r,n,i,o){const s=[],a=Object.getOwnPropertyNames(e);for(const l of a)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))try{if("function"!=typeof e[l])continue;const a=Am(e,l,function(e){return function(...s){const a=e.apply(this,s);if(og(a,o,this),"tagName"in this.canvas&&!Nm(this.canvas,n,i,!0)){const e=sg(s,o,this),n={type:t,property:l,args:e};r(this.canvas,n)}return a}});s.push(a)}catch(n){const i=Tm(e,l,{set(e){r(this.canvas,{type:t,property:l,args:[e],setter:!0})}});s.push(i)}return s}function uy(e){let t;try{if(t=ug&&(self.URL||self.webkitURL).createObjectURL(ug),!t)throw"";const r=new Worker(t,{name:null==e?void 0:e.name});return r.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),r}catch(t){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(lg),{name:null==e?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}function cy(e={}){const{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:i="rr-block",blockSelector:o=null,ignoreClass:s="rr-ignore",ignoreSelector:a=null,maskTextClass:l="rr-mask",maskTextSelector:u=null,inlineStylesheet:c=!0,maskAllInputs:d,maskInputOptions:h,slimDOMOptions:p,maskInputFn:f,maskTextFn:g,maskAttributeFn:v,hooks:m,packFn:y,sampling:b={},dataURLOptions:w={},mousemoveWait:S,recordDOM:k=!0,recordCanvas:x=!1,recordCrossOriginIframes:E=!1,recordAfter:C=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:I=!1,collectFonts:O=!1,inlineImages:T=!1,captureAdoptedStyleSheets:A=!0,plugins:R,keepIframeSrcFn:P=()=>!1,ignoreCSSAttributes:_=new Set([]),errorHandler:M,applyBackgroundColorToBlockedElements:N=!1}=e;Hf=M;const L=!E||window.parent===window;let D=!1;if(!L)try{window.parent.document&&(D=!1)}catch(e){D=!0}if(L&&!t)throw new Error("emit function is required");if(!L&&!D)return()=>{};void 0!==S&&void 0===b.mousemove&&(b.mousemove=S),mg.reset();const U=!0===d?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==h?h:{password:!0},F=!0===p||"all"===p?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===p,headMetaDescKeywords:"all"===p,headTitleMutations:"all"===p}:p||{};let j;!function(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}();let B=0;const q=e=>{for(const t of R||[])t.eventProcessor&&(e=t.eventProcessor(e));return y&&!D&&(e=y(e)),e};pg=(e,i)=>{var o;const s=e;if(s.timestamp=Nf(),!(null==(o=Gf[0])?void 0:o.isFrozen())||s.type===Df.FullSnapshot||s.type===Df.IncrementalSnapshot&&s.data.source===Uf.Mutation||Gf.forEach(e=>e.unfreeze()),L)null==t||t(q(s),i);else if(D){const e={type:"rrweb",event:q(s),origin:window.location.origin,isCheckout:i};window.parent.postMessage(e,"*")}if(s.type===Df.FullSnapshot)j=s,B=0;else if(s.type===Df.IncrementalSnapshot){if(s.data.source===Uf.Mutation&&s.data.isAttachIframe)return;B++;const e=n&&B>=n,t=r&&s.timestamp-j.timestamp>r;(e||t)&&fg(!0)}};const z=e=>{pg({type:Df.IncrementalSnapshot,data:{source:Uf.Mutation,...e}})},W=e=>pg({type:Df.IncrementalSnapshot,data:{source:Uf.Scroll,...e}}),V=e=>pg({type:Df.IncrementalSnapshot,data:{source:Uf.CanvasMutation,...e}}),$=new dg({mutationCb:z,adoptedStyleSheetCb:e=>pg({type:Df.IncrementalSnapshot,data:{source:Uf.AdoptedStyleSheet,...e}})}),H=new Yf({mirror:mg,mutationCb:z,stylesheetManager:$,recordCrossOriginIframes:E,wrappedEmit:pg});for(const e of R||[])e.getMirror&&e.getMirror({nodeMirror:mg,crossOriginIframeMirror:H.crossOriginIframeMirror,crossOriginIframeStyleMirror:H.crossOriginIframeStyleMirror});const K=new hg;gg=new cg({recordCanvas:x,mutationCb:V,win:window,blockClass:i,blockSelector:o,mirror:mg,sampling:b.canvas,dataURLOptions:w});const G=new Zf({mutationCb:z,scrollCb:W,bypassOptions:{blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:u,inlineStylesheet:c,maskInputOptions:U,dataURLOptions:w,maskTextFn:g,maskInputFn:f,maskAttributeFn:v,recordCanvas:x,inlineImages:T,sampling:b,slimDOMOptions:F,iframeManager:H,stylesheetManager:$,canvasManager:gg,keepIframeSrcFn:P,processedNodeManager:K},mirror:mg});fg=(e=!1)=>{if(!k)return;pg({type:Df.Meta,data:{href:window.location.href,width:_m(),height:Pm()}},e),$.reset(),G.init(),Gf.forEach(e=>e.lock());const t=function(e,t){const{mirror:r=new zd,blockClass:n="rr-block",blockSelector:i=null,maskTextClass:o="rr-mask",maskTextSelector:s=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:u=!1,maskAllInputs:c=!1,maskTextFn:d,maskInputFn:h,maskAttributeFn:p,slimDOM:f=!1,dataURLOptions:g,preserveWhiteSpace:v,onSerialize:m,onAdoptedStyleSheet:y,onIframeLoad:b,iframeLoadTimeout:w,onStylesheetLoad:S,stylesheetLoadTimeout:k,keepIframeSrcFn:x=()=>!1,applyBackgroundColorToBlockedElements:E=!1}=t||{};return lv(e,{doc:e,mirror:r,blockClass:n,blockSelector:i,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:a,maskInputOptions:!0===c?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===c?{password:!0}:c,maskTextFn:d,maskInputFn:h,maskAttributeFn:p,slimDOMOptions:!0===f||"all"===f?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===f,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===f?{}:f,dataURLOptions:g,inlineImages:l,recordCanvas:u,preserveWhiteSpace:v,onSerialize:m,onAdoptedStyleSheet:y,onIframeLoad:b,iframeLoadTimeout:w,onStylesheetLoad:S,stylesheetLoadTimeout:k,keepIframeSrcFn:x,newlyAddedElement:!1,applyBackgroundColorToBlockedElements:E})}(document,{mirror:mg,blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:u,inlineStylesheet:c,maskAllInputs:U,maskTextFn:g,maskInputFn:f,maskAttributeFn:v,slimDOM:F,dataURLOptions:w,recordCanvas:x,inlineImages:T,applyBackgroundColorToBlockedElements:N,onSerialize:e=>{Fm(e,mg)&&H.addIframe(e),jm(e,mg)&&$.trackLinkElement(e),Bm(e)&&G.addShadowRoot(Pf.shadowRoot(e),document)},onAdoptedStyleSheet:A?e=>$.styleMirror.add(e):void 0,onIframeLoad:(e,t)=>{H.attachIframe(e,t),G.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{$.attachLinkElement(e,t)},keepIframeSrcFn:P});if(!t)return console.warn("Failed to snapshot the document");pg({type:Df.FullSnapshot,data:{node:t,initialOffset:Rm(window)}},e),Gf.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&$.adoptStyleSheets(document.adoptedStyleSheets,mg.getId(document))};try{const e=[],t=e=>{var t;return Kf(ny)({mutationCb:z,mousemoveCb:(e,t)=>pg({type:Df.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>pg({type:Df.IncrementalSnapshot,data:{source:Uf.MouseInteraction,...e}}),scrollCb:W,viewportResizeCb:e=>pg({type:Df.IncrementalSnapshot,data:{source:Uf.ViewportResize,...e}}),inputCb:e=>pg({type:Df.IncrementalSnapshot,data:{source:Uf.Input,...e}}),mediaInteractionCb:e=>pg({type:Df.IncrementalSnapshot,data:{source:Uf.MediaInteraction,...e}}),styleSheetRuleCb:e=>pg({type:Df.IncrementalSnapshot,data:{source:Uf.StyleSheetRule,...e}}),styleDeclarationCb:e=>pg({type:Df.IncrementalSnapshot,data:{source:Uf.StyleDeclaration,...e}}),canvasMutationCb:V,fontCb:e=>pg({type:Df.IncrementalSnapshot,data:{source:Uf.Font,...e}}),selectionCb:e=>{pg({type:Df.IncrementalSnapshot,data:{source:Uf.Selection,...e}})},customElementCb:e=>{pg({type:Df.IncrementalSnapshot,data:{source:Uf.CustomElement,...e}})},blockClass:i,ignoreClass:s,ignoreSelector:a,maskTextClass:l,maskTextSelector:u,maskInputOptions:U,inlineStylesheet:c,sampling:b,recordDOM:k,recordCanvas:x,inlineImages:T,userTriggeredOnInput:I,collectFonts:O,doc:e,maskInputFn:f,maskTextFn:g,maskAttributeFn:v,keepIframeSrcFn:P,blockSelector:o,slimDOMOptions:F,dataURLOptions:w,mirror:mg,iframeManager:H,stylesheetManager:$,shadowDomManager:G,processedNodeManager:K,canvasManager:gg,ignoreCSSAttributes:_,plugins:(null==(t=null==R?void 0:R.filter(e=>e.observer))?void 0:t.map(e=>({observer:e.observer,options:e.options,callback:t=>pg({type:Df.Plugin,data:{plugin:e.name,payload:t}})})))||[]},m)};H.addLoadListener(r=>{try{e.push(t(r.contentDocument))}catch(e){console.warn(e)}});const r=()=>{fg(),e.push(t(document)),vg=!0};return"interactive"===document.readyState||"complete"===document.readyState?r():(e.push(Im("DOMContentLoaded",()=>{pg({type:Df.DomContentLoaded,data:{}}),"DOMContentLoaded"===C&&r()})),e.push(Im("load",()=>{pg({type:Df.Load,data:{}}),"load"===C&&r()},window))),()=>{e.forEach(e=>e()),K.destroy(),vg=!1,Hf=void 0}}catch(e){console.warn(e)}}c(xg,{record:()=>cy});var dy,hy,py=l({"../../../../node_modules/@amplitude/rrweb-record/dist/rrweb-record.js"(){for((Td=Object.defineProperty,Ad=(e,t,r)=>t in e?Td(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Rd=(e,t,r)=>Ad(e,"symbol"!=typeof t?t+"":t,r),_d=Object.defineProperty,Md=(e,t,r)=>t in e?_d(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Nd=(e,t,r)=>Md(e,"symbol"!=typeof t?t+"":t,r),Ld=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(Ld||{}),Dd={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Ud={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Fd={},jd={},Bd={},qd={childNodes:Og,parentNode:Tg,parentElement:Ag,textContent:Rg,contains:Pg,getRootNode:_g,host:Mg,styleSheets:Ng,shadowRoot:Lg,querySelector:Dg,querySelectorAll:Ug,mutationObserver:Fg},zd=class{constructor(){Nd(this,"idNodeMap",new Map),Nd(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;const r=null==(t=this.getMeta(e))?void 0:t.id;return null!=r?r:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(e=>this.removeNodeFromMap(e))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)}replace(e,t){const r=this.getNode(e);if(r){const e=this.nodeMetaMap.get(r);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}},Wd="__rrweb_original__",Vd=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,$d=/^(?:[a-z+]+:)?\/\//i,Hd=/^www\..*/i,Kd=/^(data:)([^,]*),(.*)/i,Gd="lightgrey",Jd=1,Qd=new RegExp("[^a-z0-9-_:]"),Xd=-2,eh=/^[^ \t\n\r\u000c]+/,th=/^[, \t\n\r\u000c]+/,rh=new WeakMap,nh={exports:{}},oh={},sh=Object.freeze(Object.defineProperty({__proto__:null,default:oh},Symbol.toStringTag,{value:"Module"})),ah=cv(sh),ch={},cp=Dv(),(dp=uv(cp)).stringify,dp.fromJSON,dp.plugin,dp.parse,dp.list,dp.document,dp.comment,dp.atRule,dp.rule,dp.decl,dp.root,dp.CssSyntaxError,dp.Declaration,dp.Container,dp.Processor,dp.Document,dp.Comment,dp.Warning,dp.AtRule,dp.Result,dp.Input,dp.Rule,dp.Root,dp.Node,hp=Object.defineProperty,pp=(e,t,r)=>t in e?hp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,fp=(e,t,r)=>pp(e,"symbol"!=typeof t?t+"":t,r),gp={exports:{}},mp={},yp=Object.freeze(Object.defineProperty({__proto__:null,default:mp},Symbol.toStringTag,{value:"Module"})),bp=Fv(yp),kp={},xf=cm(),(Ef=Uv(xf)).stringify,Ef.fromJSON,Ef.plugin,Ef.parse,Ef.list,Ef.document,Ef.comment,Ef.atRule,Ef.rule,Ef.decl,Ef.root,Ef.CssSyntaxError,Ef.Declaration,Ef.Container,Ef.Processor,Ef.Document,Ef.Comment,Ef.Warning,Ef.AtRule,Ef.Result,Ef.Input,Ef.Rule,Ef.Root,Ef.Node,Cf=class e{constructor(...e){fp(this,"parentElement",null),fp(this,"parentNode",null),fp(this,"ownerDocument"),fp(this,"firstChild",null),fp(this,"lastChild",null),fp(this,"previousSibling",null),fp(this,"nextSibling",null),fp(this,"ELEMENT_NODE",1),fp(this,"TEXT_NODE",3),fp(this,"nodeType"),fp(this,"nodeName"),fp(this,"RRNodeType")}get childNodes(){const e=[];let t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(t){if(!(t instanceof e))return!1;if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}},If={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Of={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Tf={},Af={},Rf={},Pf={childNodes:fm,parentNode:gm,parentElement:vm,textContent:mm,contains:ym,getRootNode:bm,host:wm,styleSheets:Sm,shadowRoot:km,querySelector:xm,querySelectorAll:Em,mutationObserver:Cm},_f="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.",Mf={map:{},getId:()=>(console.error(_f),-1),getNode:()=>(console.error(_f),null),removeNodeFromMap(){console.error(_f)},has:()=>(console.error(_f),!1),reset(){console.error(_f)}},"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Mf=new Proxy(Mf,{get:(e,t,r)=>("map"===t&&console.error(_f),Reflect.get(e,t,r))})),Nf=Date.now,/[1-9][0-9]{12}/.test(Date.now().toString())||(Nf=()=>(new Date).getTime()),Lf=class{constructor(){Rd(this,"id",1),Rd(this,"styleIDMap",new WeakMap),Rd(this,"idStyleMap",new Map)}getId(e){var t;return null!=(t=this.styleIDMap.get(e))?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let r;return r=void 0===t?this.id++:t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}},Df=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(Df||{}),Uf=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(Uf||{}),Ff=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(Ff||{}),jf=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(jf||{}),Bf=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Bf||{}),qf=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(qf||{}),zf=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(zf||{}),Wf=class{constructor(){Rd(this,"length",0),Rd(this,"head",null),Rd(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let r=0;r<e;r++)t=(null==t?void 0:t.next)||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&Vm(e.previousSibling)){const r=e.previousSibling.__ln.next;t.next=r,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,r&&(r.previous=t)}else if(e.nextSibling&&Vm(e.nextSibling)&&e.nextSibling.__ln.previous){const r=e.nextSibling.__ln.previous;t.previous=r,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,r&&(r.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;null===t.next&&(this.tail=t),this.length++}removeNode(e){const t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}},Vf=(e,t)=>`${e}@${t}`,$f=class{constructor(){Rd(this,"frozen",!1),Rd(this,"locked",!1),Rd(this,"texts",[]),Rd(this,"attributes",[]),Rd(this,"attributeMap",new WeakMap),Rd(this,"removes",[]),Rd(this,"mapRemoves",[]),Rd(this,"movedMap",{}),Rd(this,"addedSet",new Set),Rd(this,"movedSet",new Set),Rd(this,"droppedSet",new Set),Rd(this,"removesSubTreeCache",new Set),Rd(this,"mutationCb"),Rd(this,"blockClass"),Rd(this,"blockSelector"),Rd(this,"maskTextClass"),Rd(this,"maskTextSelector"),Rd(this,"inlineStylesheet"),Rd(this,"maskInputOptions"),Rd(this,"maskTextFn"),Rd(this,"maskInputFn"),Rd(this,"maskAttributeFn"),Rd(this,"keepIframeSrcFn"),Rd(this,"recordCanvas"),Rd(this,"inlineImages"),Rd(this,"slimDOMOptions"),Rd(this,"dataURLOptions"),Rd(this,"doc"),Rd(this,"mirror"),Rd(this,"iframeManager"),Rd(this,"stylesheetManager"),Rd(this,"shadowDomManager"),Rd(this,"canvasManager"),Rd(this,"processedNodeManager"),Rd(this,"unattachedDoc"),Rd(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),Rd(this,"emit",()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,r=new Wf,n=e=>{let t=e,r=Xd;for(;r===Xd;)t=t&&t.nextSibling,r=t&&this.mirror.getId(t);return r},i=i=>{const o=Pf.parentNode(i);if(!o||!Wm(i))return;let s=!1;if(i.nodeType===Node.TEXT_NODE){const e=o.tagName;if("TEXTAREA"===e)return;"STYLE"===e&&this.addedSet.has(o)&&(s=!0)}const a=Bg(o)?this.mirror.getId(qm(i)):this.mirror.getId(o),l=n(i);if(-1===a||-1===l)return r.addNode(i);const u=lv(i,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:e=>{Fm(e,this.mirror)&&this.iframeManager.addIframe(e),jm(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Bm(i)&&this.shadowDomManager.addShadowRoot(Pf.shadowRoot(i),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)},cssCaptured:s});u&&(e.push({parentId:a,nextId:l,node:u}),t.add(u.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const e of this.movedSet)Hm(this.removesSubTreeCache,e,this.mirror)&&!this.movedSet.has(Pf.parentNode(e))||i(e);for(const e of this.addedSet)Km(this.droppedSet,e)||Hm(this.removesSubTreeCache,e,this.mirror)?Km(this.movedSet,e)?i(e):this.droppedSet.add(e):i(e);let o=null;for(;r.length;){let e=null;if(o){const t=this.mirror.getId(Pf.parentNode(o.value)),r=n(o.value);-1!==t&&-1!==r&&(e=o)}if(!e){let t=r.tail;for(;t;){const r=t;if(t=t.previous,r){const t=this.mirror.getId(Pf.parentNode(r.value));if(-1===n(r.value))continue;if(-1!==t){e=r;break}{const t=r.value,n=Pf.parentNode(t);if(n&&n.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const t=Pf.host(n);if(-1!==this.mirror.getId(t)){e=r;break}}}}}}if(!e){for(;r.head;)r.removeNode(r.head.value);break}o=e.previous,r.removeNode(e.value),i(e.value)}const s={texts:this.texts.map(e=>{const t=e.node,r=Pf.parentNode(t);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{id:this.mirror.getId(t),value:e.value}}).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),attributes:this.attributes.map(e=>{const{attributes:t}=e;if("string"==typeof t.style){const r=JSON.stringify(e.styleDiff),n=JSON.stringify(e._unchangedStyles);r.length<t.style.length&&(r+n).split("var(").length===t.style.split("var(").length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}}).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),removes:this.removes,adds:e};(s.texts.length||s.attributes.length||s.removes.length||s.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(s))}),Rd(this,"genTextAreaValueMutation",e=>{let t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t));const r=Array.from(Pf.childNodes(e),e=>Pf.textContent(e)||"").join("");t.attributes.value=Vg({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:Hg(e),value:r,maskInputFn:this.maskInputFn})}),Rd(this,"processMutation",e=>{if(!Lm(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=Pf.textContent(e.target);Nm(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:iv(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,Mm(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const t=e.target;let r=e.attributeName,n=e.target.getAttribute(r);if("value"===r){const e=Hg(t);n=Vg({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:e,value:n,maskInputFn:this.maskInputFn})}if(Nm(e.target,this.blockClass,this.blockSelector,!1)||n===e.oldValue)return;let i=this.attributeMap.get(e.target);if("IFRAME"===t.tagName&&"src"===r&&!this.keepIframeSrcFn(n)){if(t.contentDocument)return;r="rr_src"}if(i||(i={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(i),this.attributeMap.set(e.target,i)),"type"===r&&"INPUT"===t.tagName&&"password"===(e.oldValue||"").toLowerCase()&&t.setAttribute("data-rr-is-password","true"),!rv(t.tagName,r)){if(i.attributes[r]=tv(this.doc,$g(t.tagName),$g(r),n),this.maskAttributeFn&&"string"==typeof i.attributes[r]){const e=this.maskAttributeFn(r,i.attributes[r],t);null!==e?i.attributes[r]=e:delete i.attributes[r]}if("style"===r){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(e){this.unattachedDoc=this.doc}const r=this.unattachedDoc.createElement("span");e.oldValue&&r.setAttribute("style",e.oldValue);for(const e of Array.from(t.style)){const n=t.style.getPropertyValue(e),o=t.style.getPropertyPriority(e);n!==r.style.getPropertyValue(e)||o!==r.style.getPropertyPriority(e)?i.styleDiff[e]=""===o?n:[n,o]:i._unchangedStyles[e]=[n,o]}for(const e of Array.from(r.style))""===t.style.getPropertyValue(e)&&(i.styleDiff[e]=!1)}else"open"===r&&"DIALOG"===t.tagName&&(t.matches("dialog:modal")?i.attributes.rr_open_mode="modal":i.attributes.rr_open_mode="non-modal")}break}case"childList":if(Nm(e.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===e.target.tagName)return void this.genTextAreaValueMutation(e.target);e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{const r=this.mirror.getId(t),n=Bg(e.target)?this.mirror.getId(Pf.host(e.target)):this.mirror.getId(e.target);Nm(e.target,this.blockClass,this.blockSelector,!1)||Lm(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?($m(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||Dm(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Vf(r,n)]?$m(this.movedSet,t):(this.removes.push({parentId:n,id:r,isShadow:!(!Bg(e.target)||!qg(e.target))||void 0}),function(e,t){const r=[e];for(;r.length;){const e=r.pop();t.has(e)||(t.add(e),Pf.childNodes(e).forEach(e=>r.push(e)))}}(t,this.removesSubTreeCache))),this.mapRemoves.push(t))})}}),Rd(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(Lm(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let r=null;t&&this.mirror.hasNode(t)&&(r=this.mirror.getId(t)),r&&-1!==r&&(this.movedMap[Vf(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Nm(e,this.blockClass,this.blockSelector,!1)||(Pf.childNodes(e).forEach(e=>this.genAdds(e)),Bm(e)&&Pf.childNodes(Pf.shadowRoot(e)).forEach(t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)}))}})}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","maskAttributeFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(t=>{this[t]=e[t]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}},Kf=e=>{if(!Hf)return e;return(...t)=>{try{return e(...t)}catch(e){if(Hf&&!0===Hf(e))return;throw e}}},Gf=[],Jf=["INPUT","TEXTAREA","SELECT"],Qf=new WeakMap,Xf=class{constructor(e){Rd(this,"iframeIdToRemoteIdMap",new WeakMap),Rd(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,n){const i=r||this.getIdToRemoteIdMap(e),o=n||this.getRemoteIdToIdMap(e);let s=i.get(t);return s||(s=this.generateIdFn(),i.set(t,s),o.set(s,t)),s}getIds(e,t){const r=this.getIdToRemoteIdMap(e),n=this.getRemoteIdToIdMap(e);return t.map(t=>this.getId(e,t,r,n))}getRemoteId(e,t,r){const n=r||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;const i=n.get(t);return i||-1}getRemoteIds(e,t){const r=this.getRemoteIdToIdMap(e);return t.map(t=>this.getRemoteId(e,t,r))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}},Yf=class{constructor(e){Rd(this,"iframes",new WeakMap),Rd(this,"crossOriginIframeMap",new WeakMap),Rd(this,"crossOriginIframeMirror",new Xf(Xg)),Rd(this,"crossOriginIframeStyleMirror"),Rd(this,"crossOriginIframeRootIdMap",new WeakMap),Rd(this,"mirror"),Rd(this,"mutationCb"),Rd(this,"wrappedEmit"),Rd(this,"loadListener"),Rd(this,"stylesheetManager"),Rd(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Xf(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var r,n;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(r=e.contentWindow)||r.addEventListener("message",this.handleMessage.bind(this))),null==(n=this.loadListener)||n.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){const t=e;if("rrweb"!==t.data.type||t.origin!==t.data.origin)return;if(!e.source)return;const r=this.crossOriginIframeMap.get(e.source);if(!r)return;const n=this.transformCrossOriginEvent(r,t.data.event);n&&this.wrappedEmit(n,t.data.isCheckout)}transformCrossOriginEvent(e,t){var r;switch(t.type){case Df.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);const r=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,r),this.patchRootIdOnNode(t.data.node,r),{timestamp:t.timestamp,type:Df.IncrementalSnapshot,data:{source:Uf.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case Df.Meta:case Df.Load:case Df.DomContentLoaded:return!1;case Df.Plugin:return t;case Df.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case Df.IncrementalSnapshot:switch(t.data.source){case Uf.Mutation:return t.data.adds.forEach(t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);const r=this.crossOriginIframeRootIdMap.get(e);r&&this.patchRootIdOnNode(t.node,r)}),t.data.removes.forEach(t=>{this.replaceIds(t,e,["parentId","id"])}),t.data.attributes.forEach(t=>{this.replaceIds(t,e,["id"])}),t.data.texts.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case Uf.Drag:case Uf.TouchMove:case Uf.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case Uf.ViewportResize:return!1;case Uf.MediaInteraction:case Uf.MouseInteraction:case Uf.Scroll:case Uf.CanvasMutation:case Uf.Input:return this.replaceIds(t.data,e,["id"]),t;case Uf.StyleSheetRule:case Uf.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case Uf.Font:return t;case Uf.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,["start","end"])}),t;case Uf.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null==(r=t.data.styles)||r.forEach(t=>{this.replaceStyleIds(t,e,["styleId"])}),t}}return!1}replace(e,t,r,n){for(const i of n)(Array.isArray(t[i])||"number"==typeof t[i])&&(Array.isArray(t[i])?t[i]=e.getIds(r,t[i]):t[i]=e.getId(r,t[i]));return t}replaceIds(e,t,r){return this.replace(this.crossOriginIframeMirror,e,t,r)}replaceStyleIds(e,t,r){return this.replace(this.crossOriginIframeStyleMirror,e,t,r)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(e=>{this.replaceIdOnNode(e,t)})}patchRootIdOnNode(e,t){e.type===zf.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(e=>{this.patchRootIdOnNode(e,t)})}},Zf=class{constructor(e){Rd(this,"shadowDoms",new WeakSet),Rd(this,"mutationCb"),Rd(this,"scrollCb"),Rd(this,"bypassOptions"),Rd(this,"mirror"),Rd(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(!qg(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const r=Xm({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(Zm({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),setTimeout(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(Pf.host(e))),this.restoreHandlers.push(ry({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){const r=this;this.restoreHandlers.push(Am(e.prototype,"attachShadow",function(e){return function(n){const i=e.call(this,n),o=Pf.shadowRoot(this);return o&&Wm(this)&&r.addShadowRoot(o,t),i}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch(e){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}},eg="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",tg="undefined"==typeof Uint8Array?[]:new Uint8Array(256),rg=0);rg<64;rg++)tg[eg.charCodeAt(rg)]=rg;ng=function(e){var t,r=new Uint8Array(e),n=r.length,i="";for(t=0;t<n;t+=3)i+=eg[r[t]>>2],i+=eg[(3&r[t])<<4|r[t+1]>>4],i+=eg[(15&r[t+1])<<2|r[t+2]>>6],i+=eg[63&r[t+2]];return n%3==2?i=i.substring(0,i.length-1)+"=":n%3==1&&(i=i.substring(0,i.length-2)+"=="),i},ig=new Map,og=(e,t,r)=>{if(!e||!ag(e,t)&&"object"!=typeof e)return;const n=function(e,t){let r=ig.get(e);return r||(r=new Map,ig.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}(r,e.constructor.name);let i=n.indexOf(e);return-1===i&&(i=n.length,n.push(e)),i},sg=(e,t,r)=>e.map(e=>sy(e,t,r)),ag=(e,t)=>{const r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(e=>"function"==typeof t[e]);return Boolean(r.find(r=>e instanceof t[r]))},lg='(function() {\n "use strict";\n var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);\n for (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n var encode = function(arraybuffer) {\n var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = "";\n for (i2 = 0; i2 < len; i2 += 3) {\n base64 += chars[bytes[i2] >> 2];\n base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];\n base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];\n base64 += chars[bytes[i2 + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + "=";\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + "==";\n }\n return base64;\n };\n const lastBlobMap = /* @__PURE__ */ new Map();\n const transparentBlobMap = /* @__PURE__ */ new Map();\n async function getTransparentBlobFor(width, height, dataURLOptions) {\n const id = `${width}-${height}`;\n if ("OffscreenCanvas" in globalThis) {\n if (transparentBlobMap.has(id)) return transparentBlobMap.get(id);\n const offscreen = new OffscreenCanvas(width, height);\n offscreen.getContext("2d");\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n transparentBlobMap.set(id, base64);\n return base64;\n } else {\n return "";\n }\n }\n const worker = self;\n worker.onmessage = async function(e) {\n if ("OffscreenCanvas" in globalThis) {\n const { id, bitmap, width, height, dataURLOptions } = e.data;\n const transparentBase64 = getTransparentBlobFor(\n width,\n height,\n dataURLOptions\n );\n const offscreen = new OffscreenCanvas(width, height);\n const ctx = offscreen.getContext("2d");\n ctx.drawImage(bitmap, 0, 0);\n bitmap.close();\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const type = blob.type;\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n if (!lastBlobMap.has(id) && await transparentBase64 === base64) {\n lastBlobMap.set(id, base64);\n return worker.postMessage({ id });\n }\n if (lastBlobMap.get(id) === base64) return worker.postMessage({ id });\n worker.postMessage({\n id,\n type,\n base64,\n width,\n height\n });\n lastBlobMap.set(id, base64);\n } else {\n return worker.postMessage({ id: e.data.id });\n }\n };\n})();\n//# sourceMappingURL=image-bitmap-data-url-worker-IJpC7g_b.js.map\n',ug="undefined"!=typeof self&&self.Blob&&new Blob([lg],{type:"text/javascript;charset=utf-8"}),cg=class{constructor(e){Rd(this,"pendingCanvasMutations",new Map),Rd(this,"rafStamps",{latestId:0,invokeId:null}),Rd(this,"mirror"),Rd(this,"mutationCb"),Rd(this,"resetObservers"),Rd(this,"frozen",!1),Rd(this,"locked",!1),Rd(this,"processMutation",(e,t)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)});const{sampling:t="all",win:r,blockClass:n,blockSelector:i,recordCanvas:o,dataURLOptions:s}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,o&&"all"===t&&this.initCanvasMutationObserver(r,n,i),o&&"number"==typeof t&&this.initCanvasFPSObserver(t,r,n,i,{dataURLOptions:s})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,t,r,n,i){const o=ay(t,r,n,!0),s=new Map,a=new uy;a.onmessage=e=>{const{id:t}=e.data;if(s.set(t,!1),!("base64"in e.data))return;const{base64:r,type:n,width:i,height:o}=e.data;this.mutationCb({id:t,type:Bf["2D"],commands:[{property:"clearRect",args:[0,0,i,o]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:n}]},0,0]}]})};const l=1e3/e;let u,c=0;const d=e=>{c&&e-c<l||(c=e,(()=>{const e=[];return t.document.querySelectorAll("canvas").forEach(t=>{Nm(t,r,n,!0)||e.push(t)}),e})().forEach(async e=>{var t;const r=this.mirror.getId(e);if(s.get(r))return;if(0===e.width||0===e.height)return;if(s.set(r,!0),["webgl","webgl2"].includes(e.__context)){const r=e.getContext(e.__context);!1===(null==(t=null==r?void 0:r.getContextAttributes())?void 0:t.preserveDrawingBuffer)&&r.clear(r.COLOR_BUFFER_BIT)}const n=await createImageBitmap(e);a.postMessage({id:r,bitmap:n,width:e.width,height:e.height,dataURLOptions:i.dataURLOptions},[n])})),u=requestAnimationFrame(d)};u=requestAnimationFrame(d),this.resetObservers=()=>{o(),cancelAnimationFrame(u)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const n=ay(e,t,r,!1),i=function(e,t,r,n){const i=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const s of o)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[s])continue;const o=Am(t.CanvasRenderingContext2D.prototype,s,function(i){return function(...o){return Nm(this.canvas,r,n,!0)||setTimeout(()=>{const r=sg(o,t,this);e(this.canvas,{type:Bf["2D"],property:s,args:r})},0),i.apply(this,o)}});i.push(o)}catch(r){const n=Tm(t.CanvasRenderingContext2D.prototype,s,{set(t){e(this.canvas,{type:Bf["2D"],property:s,args:[t],setter:!0})}});i.push(n)}return()=>{i.forEach(e=>e())}}(this.processMutation.bind(this),e,t,r),o=function(e,t,r,n){const i=[];return i.push(...ly(t.WebGLRenderingContext.prototype,Bf.WebGL,e,r,n,t)),void 0!==t.WebGL2RenderingContext&&i.push(...ly(t.WebGL2RenderingContext.prototype,Bf.WebGL2,e,r,n,t)),()=>{i.forEach(e=>e())}}(this.processMutation.bind(this),e,t,r);this.resetObservers=()=>{n(),i(),o()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{const r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const r=this.pendingCanvasMutations.get(e);if(!r||-1===t)return;const n=r.map(e=>{const{type:t,...r}=e;return r}),{type:i}=r[0];this.mutationCb({id:t,type:i,commands:n}),this.pendingCanvasMutations.delete(e)}},dg=class{constructor(e){Rd(this,"trackedLinkElements",new WeakSet),Rd(this,"mutationCb"),Rd(this,"adoptedStyleSheetCb"),Rd(this,"styleMirror",new Lf),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(0===e.length)return;const r={id:t,styleIds:[]},n=[];for(const t of e){let e;if(this.styleMirror.has(t))e=this.styleMirror.getId(t);else{e=this.styleMirror.add(t);let r=[];try{r=Array.from(t.cssRules,(e,r)=>({rule:Wg(e,t.href),index:r}))}catch(e){if(!(e instanceof DOMException&&"SecurityError"===e.name))throw e}n.push({styleId:e,rules:r})}r.styleIds.push(e)}n.length>0&&(r.styles=n),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}},hg=class{constructor(){Rd(this,"nodeMap",new WeakMap),Rd(this,"active",!1)}inOtherBuffer(e,t){const r=this.nodeMap.get(e);return r&&Array.from(r).some(e=>e!==t)}add(e,t){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}},vg=!1;try{if(2!==Array.from([1],e=>2*e)[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(Pd=e.contentWindow)?void 0:Pd.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}var e;mg=new zd,cy.addCustomEvent=(e,t)=>{if(!vg)throw new Error("please add custom event after start recording");pg({type:Df.Custom,data:{tag:e,payload:t}})},cy.freezePage=()=>{Gf.forEach(e=>e.freeze())},cy.takeFullSnapshot=e=>{if(!vg)throw new Error("please take full snapshot after start recording");fg(e)},cy.mirror=mg,(e=yg||(yg={}))[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped",({addCustomEvent:bg}=cy),({freezePage:wg}=cy),({takeFullSnapshot:Sg}=cy)}}),fy={};function gy(e,t){if(new Blob([e]).size<=t)return{value:e,truncated:!1};for(var r=0,n=Math.min(e.length,t);r<n;){var i=Math.ceil((r+n)/2);new Blob([e.slice(0,i)]).size<=t?r=i:n=i-1}return r>0&&e.charCodeAt(r-1)>=55296&&e.charCodeAt(r-1)<=56319&&(r-=1),{value:e.slice(0,r),truncated:!0}}c(fy,{NetworkObservers:()=>hy});var vy=l({"../../../../node_modules/@amplitude/session-replay-browser/lib/esm/observers.js"(){Ne(),Pi(),dy=["image/","audio/","video/","application/octet-stream","font/"],hy=function(){function e(){this.fetchObserver=null}return e.prototype.start=function(e,t){this.eventCallback=e,this.networkConfig=t,this.observeFetch()},e.prototype.stop=function(){var e;null===(e=this.fetchObserver)||void 0===e||e.call(this),this.fetchObserver=null,this.eventCallback=void 0,this.networkConfig=void 0},e.prototype.notifyEvent=function(e){var t;null===(t=this.eventCallback)||void 0===t||t.call(this,e)},e.prototype.observeFetch=function(){var e=this,t=de();if(t){var r=t.fetch;r&&(t.fetch=function(t,n){return v(e,void 0,void 0,function(){var e,i,o,s,a,l,u,c,d,h,p,f,g=this;return m(this,function(v){switch(v.label){case 0:e=Date.now(),i={timestamp:e,type:"fetch",method:(null==n?void 0:n.method)||"GET",url:t.toString(),requestHeaders:null==n?void 0:n.headers},(null==(o=null===(p=this.networkConfig)||void 0===p?void 0:p.body)?void 0:o.request)&&void 0!==(s=function(e){if(null!=e){if("string"==typeof e)return e;if(e instanceof URLSearchParams)return e.toString();if(e instanceof FormData){var t=[];return e.forEach(function(e,r){t.push("".concat(r,"=").concat("string"==typeof e?e:"[File]"))}),t.join("&")}}}(null==n?void 0:n.body))&&(a=null!==(f=o.maxBodySizeBytes)&&void 0!==f?f:10240,i.requestBody=gy(s,a).value),v.label=1;case 1:return v.trys.push([1,3,,4]),[4,r(t,n)];case 2:return l=v.sent(),d=Date.now(),i.status=l.status,i.duration=d-e,u={},l.headers.forEach(function(e,t){u[t]=e}),i.responseHeaders=u,(null==o?void 0:o.response)?!function(e){return!!e&&dy.some(function(t){return e.toLowerCase().startsWith(t)})}(u["content-type"]||null)?l.clone().text().then(function(e){var t,r=gy(e,null!==(t=o.maxBodySizeBytes)&&void 0!==t?t:10240),n=r.value,s=r.truncated;i.responseBody=n,i.responseBodyStatus=s?"truncated":"captured",g.notifyEvent(i)},function(){i.responseBodyStatus="error",g.notifyEvent(i)}):(i.responseBodyStatus="skipped_binary",this.notifyEvent(i)):this.notifyEvent(i),[2,l];case 3:throw c=v.sent(),d=Date.now(),i.duration=d-e,h=c,i.error={name:h.name||"UnknownError",message:h.message||"An unknown error occurred"},this.notifyEvent(i),c;case 4:return[2]}})})},this.fetchObserver=function(){t.fetch=r})}},e}()}}),my=u({"../../../../node_modules/@amplitude/ua-parser-js/src/ua-parser.js"(e,t){!function(r,n){var i="function",o="undefined",s="object",a="string",l="model",u="name",c="type",d="vendor",h="version",p="architecture",f="console",g="mobile",v="tablet",m="smarttv",y="wearable",b="embedded",w="Amazon",S="Apple",k="ASUS",x="BlackBerry",E="Browser",C="Chrome",I="Firefox",O="Google",T="Huawei",A="LG",R="Microsoft",P="Motorola",_="Opera",M="Samsung",N="Sharp",L="Sony",D="Xiaomi",U="Zebra",F="Facebook",j=function(e){for(var t={},r=0;r<e.length;r++)t[e[r].toUpperCase()]=e[r];return t},B=function(e,t){return typeof e===a&&-1!==q(t).indexOf(q(e))},q=function(e){return e.toLowerCase()},z=function(e,t){if(typeof e===a)return e=e.replace(/^\s\s*/,""),typeof t===o?e:e.substring(0,350)},W=function(e,t){for(var r,o,a,l,u,c,d=0;d<t.length&&!u;){var h=t[d],p=t[d+1];for(r=o=0;r<h.length&&!u;)if(u=h[r++].exec(e))for(a=0;a<p.length;a++)c=u[++o],typeof(l=p[a])===s&&l.length>0?2===l.length?typeof l[1]==i?this[l[0]]=l[1].call(this,c):this[l[0]]=l[1]:3===l.length?typeof l[1]!==i||l[1].exec&&l[1].test?this[l[0]]=c?c.replace(l[1],l[2]):n:this[l[0]]=c?l[1].call(this,c,l[2]):n:4===l.length&&(this[l[0]]=c?l[3].call(this,c.replace(l[1],l[2])):n):this[l]=c||n;d+=2}},V=function(e,t){for(var r in t)if(typeof t[r]===s&&t[r].length>0){for(var i=0;i<t[r].length;i++)if(B(t[r][i],e))return"?"===r?n:r}else if(B(t[r],e))return"?"===r?n:r;return e},$={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},H={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[h,[u,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[h,[u,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[u,h],[/opios[\/ ]+([\w\.]+)/i],[h,[u,_+" Mini"]],[/\bopr\/([\w\.]+)/i],[h,[u,_]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[u,h],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[h,[u,"UC"+E]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[h,[u,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[h,[u,"WeChat"]],[/konqueror\/([\w\.]+)/i],[h,[u,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[h,[u,"IE"]],[/yabrowser\/([\w\.]+)/i],[h,[u,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[u,/(.+)/,"$1 Secure "+E],h],[/\bfocus\/([\w\.]+)/i],[h,[u,I+" Focus"]],[/\bopt\/([\w\.]+)/i],[h,[u,_+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[h,[u,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[h,[u,"Dolphin"]],[/coast\/([\w\.]+)/i],[h,[u,_+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[h,[u,"MIUI "+E]],[/fxios\/([-\w\.]+)/i],[h,[u,I]],[/\bqihu|(qi?ho?o?|360)browser/i],[[u,"360 "+E]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[u,/(.+)/,"$1 "+E],h],[/(comodo_dragon)\/([\w\.]+)/i],[[u,/_/g," "],h],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[u,h],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[u],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[u,F],h],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[u,h],[/\bgsa\/([\w\.]+) .*safari\//i],[h,[u,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[h,[u,C+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[u,C+" WebView"],h],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[h,[u,"Android "+E]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[u,h],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[h,[u,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[h,u],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[u,[h,V,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[u,h],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[u,"Netscape"],h],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[h,[u,I+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[u,h],[/(cobalt)\/([\w\.]+)/i],[u,[h,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[p,"amd64"]],[/(ia32(?=;))/i],[[p,q]],[/((?:i[346]|x)86)[;\)]/i],[[p,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[p,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[p,"armhf"]],[/windows (ce|mobile); ppc;/i],[[p,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[p,/ower/,"",q]],[/(sun4\w)[;\)]/i],[[p,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[p,q]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[l,[d,M],[c,v]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[l,[d,M],[c,g]],[/((ipod|iphone)\d+,\d+)/i],[l,[d,S],[c,g]],[/(ipad\d+,\d+)/i],[l,[d,S],[c,v]],[/\((ip(?:hone|od)[\w ]*);/i],[l,[d,S],[c,g]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[l,[d,S],[c,v]],[/(macintosh);/i],[l,[d,S]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[l,[d,T],[c,v]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[l,[d,T],[c,g]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[l,/_/g," "],[d,D],[c,g]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[l,/_/g," "],[d,D],[c,v]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[l,[d,"OPPO"],[c,g]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[l,[d,"Vivo"],[c,g]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[l,[d,"Realme"],[c,g]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[l,[d,P],[c,g]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[l,[d,P],[c,v]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[l,[d,A],[c,v]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[l,[d,A],[c,g]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[l,[d,"Lenovo"],[c,v]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[l,/_/g," "],[d,"Nokia"],[c,g]],[/(pixel c)\b/i],[l,[d,O],[c,v]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[l,[d,O],[c,g]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[l,[d,L],[c,g]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[l,"Xperia Tablet"],[d,L],[c,v]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[l,[d,"OnePlus"],[c,g]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[l,[d,w],[c,v]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[l,/(.+)/g,"Fire Phone $1"],[d,w],[c,g]],[/(playbook);[-\w\),; ]+(rim)/i],[l,d,[c,v]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[l,[d,x],[c,g]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[l,[d,k],[c,v]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[l,[d,k],[c,g]],[/(nexus 9)/i],[l,[d,"HTC"],[c,v]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony(?!-bra))[-_ ]?([-\w]*)/i],[d,[l,/_/g," "],[c,g]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[l,[d,"Acer"],[c,v]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[l,[d,"Meizu"],[c,g]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[l,[d,N],[c,g]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[d,l,[c,g]],[/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[d,l,[c,v]],[/(surface duo)/i],[l,[d,R],[c,v]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[l,[d,"Fairphone"],[c,g]],[/(u304aa)/i],[l,[d,"AT&T"],[c,g]],[/\bsie-(\w*)/i],[l,[d,"Siemens"],[c,g]],[/\b(rct\w+) b/i],[l,[d,"RCA"],[c,v]],[/\b(venue[\d ]{2,7}) b/i],[l,[d,"Dell"],[c,v]],[/\b(q(?:mv|ta)\w+) b/i],[l,[d,"Verizon"],[c,v]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[l,[d,"Barnes & Noble"],[c,v]],[/\b(tm\d{3}\w+) b/i],[l,[d,"NuVision"],[c,v]],[/\b(k88) b/i],[l,[d,"ZTE"],[c,v]],[/\b(nx\d{3}j) b/i],[l,[d,"ZTE"],[c,g]],[/\b(gen\d{3}) b.+49h/i],[l,[d,"Swiss"],[c,g]],[/\b(zur\d{3}) b/i],[l,[d,"Swiss"],[c,v]],[/\b((zeki)?tb.*\b) b/i],[l,[d,"Zeki"],[c,v]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[d,"Dragon Touch"],l,[c,v]],[/\b(ns-?\w{0,9}) b/i],[l,[d,"Insignia"],[c,v]],[/\b((nxa|next)-?\w{0,9}) b/i],[l,[d,"NextBook"],[c,v]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[d,"Voice"],l,[c,g]],[/\b(lvtel\-)?(v1[12]) b/i],[[d,"LvTel"],l,[c,g]],[/\b(ph-1) /i],[l,[d,"Essential"],[c,g]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[l,[d,"Envizen"],[c,v]],[/\b(trio[-\w\. ]+) b/i],[l,[d,"MachSpeed"],[c,v]],[/\btu_(1491) b/i],[l,[d,"Rotor"],[c,v]],[/(shield[\w ]+) b/i],[l,[d,"Nvidia"],[c,v]],[/(sprint) (\w+)/i],[d,l,[c,g]],[/(kin\.[onetw]{3})/i],[[l,/\./g," "],[d,R],[c,g]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[l,[d,U],[c,v]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[l,[d,U],[c,g]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[d,l,[c,f]],[/droid.+; (shield) bui/i],[l,[d,"Nvidia"],[c,f]],[/(playstation [345portablevi]+)/i],[l,[d,L],[c,f]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[l,[d,R],[c,f]],[/smart-tv.+(samsung)/i],[d,[c,m]],[/hbbtv.+maple;(\d+)/i],[[l,/^/,"SmartTV"],[d,M],[c,m]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[d,A],[c,m]],[/(apple) ?tv/i],[d,[l,S+" TV"],[c,m]],[/crkey/i],[[l,C+"cast"],[d,O],[c,m]],[/droid.+aft(\w)( bui|\))/i],[l,[d,w],[c,m]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[l,[d,N],[c,m]],[/(bravia[\w ]+)( bui|\))/i],[l,[d,L],[c,m]],[/(mitv-\w{5}) bui/i],[l,[d,D],[c,m]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[d,z],[l,z],[c,m]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[c,m]],[/((pebble))app/i],[d,l,[c,y]],[/droid.+; (glass) \d/i],[l,[d,O],[c,y]],[/droid.+; (wt63?0{2,3})\)/i],[l,[d,U],[c,y]],[/(quest( 2)?)/i],[l,[d,F],[c,y]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[d,[c,b]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[l,[c,g]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[l,[c,v]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[c,v]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[c,g]],[/(android[-\w\. ]{0,9});.+buil/i],[l,[d,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[h,[u,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[h,[u,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i],[u,h],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[h,u]],os:[[/microsoft (windows) (vista|xp)/i],[u,h],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[u,[h,V,$]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[u,"Windows"],[h,V,$]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[h,/_/g,"."],[u,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[u,"Mac OS"],[h,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[h,u],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[u,h],[/\(bb(10);/i],[h,[u,x]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[h,[u,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[h,[u,I+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[h,[u,"webOS"]],[/crkey\/([\d\.]+)/i],[h,[u,C+"cast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[u,"Chromium OS"],h],[/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[u,h],[/(sunos) ?([\w\.\d]*)/i],[[u,"Solaris"],h],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[u,h]]},K=function(e,t){if(typeof e===s&&(t=e,e=n),!(this instanceof K))return new K(e,t).getResult();var i=e||(typeof r!==o&&r.navigator&&r.navigator.userAgent?r.navigator.userAgent:""),f=t?function(e,t){var r={};for(var n in e)t[n]&&t[n].length%2==0?r[n]=t[n].concat(e[n]):r[n]=e[n];return r}(H,t):H;return this.getBrowser=function(){var e,t={};return t[u]=n,t[h]=n,W.call(t,i,f.browser),t.major=typeof(e=t.version)===a?e.replace(/[^\d\.]/g,"").split(".")[0]:n,t},this.getCPU=function(){var e={};return e[p]=n,W.call(e,i,f.cpu),e},this.getDevice=function(){var e={};return e[d]=n,e[l]=n,e[c]=n,W.call(e,i,f.device),e},this.getEngine=function(){var e={};return e[u]=n,e[h]=n,W.call(e,i,f.engine),e},this.getOS=function(){var e={};return e[u]=n,e[h]=n,W.call(e,i,f.os),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return i},this.setUA=function(e){return i=typeof e===a&&e.length>350?z(e,350):e,this},this.setUA(i),this};K.VERSION="0.7.33",K.BROWSER=j([u,h,"major"]),K.CPU=j([p]),K.DEVICE=j([l,d,c,f,g,m,v,y,b]),K.ENGINE=K.OS=j([u,h]),typeof e!==o?(typeof t!==o&&t.exports&&(e=t.exports=K),e.UAParser=K):typeof define===i&&define.amd?define(function(){return K}):typeof r!==o&&(r.UAParser=K);var G=typeof r!==o&&(r.jQuery||r.Zepto);if(G&&!G.ua){var J=new K;G.ua=J.getResult(),G.ua.get=function(){return J.getUA()},G.ua.set=function(e){J.setUA(e);var t=J.getResult();for(var r in t)G.ua[r]=t[r]}}}("object"==typeof window?window:e)}}),yy={};c(yy,{DestinationAmplitude:()=>YO,default:()=>aT,destinationAmplitude:()=>sT});var by=Object.defineProperty,wy=(e,t)=>{for(var r in t)by(e,r,{get:t[r],enumerable:!0})};function Sy(e,t){if("collector"===e)return"collector";if(!t)throw new Error(`stepId(${e}) requires an id`);return`${e}.${t}`}wy({},{stepId:()=>Sy});function ky(e,t){const r=e.destinations[t];if(!r)throw new Error(`Destination not found: ${t}`);return r}wy({},{getDestination:()=>ky});wy({},{Level:()=>Ey});var xy,Ey=((xy=Ey||{})[xy.ERROR=0]="ERROR",xy[xy.WARN=1]="WARN",xy[xy.INFO=2]="INFO",xy[xy.DEBUG=3]="DEBUG",xy);function Cy(e,t){const r=e.transformers[t];if(!r)throw new Error(`Transformer not found: ${t}`);return r}wy({},{getTransformer:()=>Cy});function Iy(e,t){const r=e.sources[t];if(!r)throw new Error(`Source not found: ${t}`);return r}wy({},{getSource:()=>Iy});function Oy(e,t){const r=e.stores[t];if(!r)throw new Error(`Store not found: ${t}`);return r}async function Ty(e,t){return await e.get(t)}function Ay(e){return Array.isArray(e)}function Ry(e){return void 0!==e}function Py(e){return"number"==typeof e&&!Number.isNaN(e)}function _y(e){return"object"==typeof e&&null!==e&&!Ay(e)&&"[object Object]"===Object.prototype.toString.call(e)}function My(e){return"string"==typeof e}function Ny(e,t="",r){const n=t.split(".");let i=e;for(let e=0;e<n.length;e++){const t=n[e];if("*"===t&&Ay(i)){const t=n.slice(e+1).join("."),o=[];for(const e of i){const n=Ny(e,t,r);o.push(n)}return o}if(i=_y(i)||Ay(i)?i[t]:void 0,void 0===i)break}return Ry(i)?i:r}function Ly(e){return function(e){return"boolean"==typeof e}(e)||My(e)||Py(e)||!Ry(e)||Ay(e)&&e.every(Ly)||_y(e)&&Object.values(e).every(Ly)}function Dy(e){return Ly(e)?e:void 0}function Uy(e,t,r){return async function(...n){try{return await e(...n)}catch(e){if(!t)return;return await t(e)}finally{await(null==r?void 0:r())}}}wy({},{getStore:()=>Oy,getStoreValue:()=>Ty});var Fy=class e extends Error{constructor(t,r){super(t,r),this.name="FatalError",Object.setPrototypeOf(this,e.prototype)}};async function jy(e,t={},r){var n;if(!r.collector)throw new Error("getMappingValue: context.collector is required");const i=r.consent||r.collector.consent,o=null!=(n=r.event)?n:{},s={event:o,mapping:t,collector:r.collector,logger:r.collector.logger,consent:i},a=Ay(t)?t:[t];for(const t of a){const n=await Uy(By,e=>{if(e instanceof Fy)throw e;r.collector.status.failed++,s.logger.error("mapping processing failed",{event:o,error:e})})(e,t,{...s,mapping:t});if(Ry(n))return n}}async function By(e,t,r){return(Ay(t)?t:[t]).reduce(async(t,n)=>{const i=await t;if(i)return i;const o=My(n)?{key:n}:n;if(!Object.keys(o).length)return;const{condition:s,consent:a,fn:l,key:u,loop:c,map:d,set:h,validate:p,value:f}=o,g={...r,mapping:n};if(s&&!await Uy(s,e=>{if(e instanceof Fy)throw e;return g.logger.error("mapping condition failed",{event:g.event,error:e}),!1})(e,g))return;if(a&&!function(e,t={},r={}){const n={...t,...r},i={};let o=!e||0===Object.keys(e).length;return Object.keys(n).forEach(t=>{n[t]&&(i[t]=!0,e&&e[t]&&(o=!0))}),!!o&&i}(a,g.consent))return f;let v=Ry(f)?f:e;if(c){const[t,r]=c,n="this"===t?[e]:await jy(e,t,g);v=Ay(n)?(await Promise.all(n.map(e=>Ry(e)?jy(e,r,g):void 0))).filter(Ry):void 0}else d?v=await Object.entries(d).reduce(async(t,[r,n])=>{const i=await t,o=await jy(e,n,g);return Ry(o)&&(i[r]=o),i},Promise.resolve({})):h?v=await Promise.all(h.map(t=>By(e,t,g))):u?v=Ny(e,u,f):l&&(v=await Uy(l,e=>{if(e instanceof Fy)throw e;g.logger.error("mapping fn failed",{event:g.event,error:e})})(e,g));p&&!await Uy(p,e=>{if(e instanceof Fy)throw e;return g.logger.error("mapping validate failed",{event:g.event,error:e}),!1})(v,g)&&(v=void 0);const m=Dy(v);return Ry(m)?m:Dy(f)},Promise.resolve(void 0))}async function qy(e,t={},r){var n,i;if(!Ry(e))return;const o=_y(e)&&e.consent||(null==r?void 0:r.consent)||(null==(n=null==r?void 0:r.collector)?void 0:n.consent),s=null!=(i=null==r?void 0:r.event)?i:_y(e)?e:{};return jy(e,t,{...r,consent:o,event:s})}var zy={};c(zy,{Identify:()=>Z,Revenue:()=>xe,Types:()=>Pb,_setDiagnosticsSampleRate:()=>IO,add:()=>RO,createInstance:()=>EO,experiment:()=>TO,extendSession:()=>PO,flush:()=>_O,getDeviceId:()=>MO,getIdentity:()=>NO,getOptOut:()=>LO,getSessionId:()=>DO,getUserId:()=>UO,groupIdentify:()=>FO,identify:()=>jO,initAll:()=>OO,logEvent:()=>BO,remove:()=>qO,reset:()=>zO,revenue:()=>WO,sessionReplay:()=>AO,setDeviceId:()=>VO,setGroup:()=>$O,setIdentity:()=>HO,setOptOut:()=>KO,setSessionId:()=>GO,setTransport:()=>JO,setUserId:()=>QO,track:()=>XO}),Ne(),Pi(),Ne(),Pi(),Ne(),Pi();var Wy=function(e,t){return"boolean"==typeof e?e:!1!==(null==e?void 0:e[t])&&(i=de(),"string"!=typeof(null===(n=null===(r=null==i?void 0:i.chrome)||void 0===r?void 0:r.runtime)||void 0===n?void 0:n.id)||!!(null==e?void 0:e[t]));var r,n,i},Vy=function(e){return Wy(e,"attribution")},$y=function(e){return Wy(e,"formInteractions")},Hy=function(e){return Wy(e,"pageViews")},Ky=function(e){return Wy(e,"sessions")},Gy=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.networkTracking||"object"==typeof e.networkTracking)},Jy=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.elementInteractions||"object"==typeof e.elementInteractions)},Qy=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.frustrationInteractions||"object"==typeof e.frustrationInteractions)},Xy=function(e){if("object"==typeof e.autocapture){var t=e.autocapture.performanceTracking;return!0===t?{mainThreadBlock:!0}:"object"==typeof t&&null!==t?t:void 0}},Yy=function(e){if(Jy(e.autocapture)&&"object"==typeof e.autocapture&&"object"==typeof e.autocapture.elementInteractions)return e.autocapture.elementInteractions},Zy=function(e){if(Qy(e.autocapture)&&"object"==typeof e.autocapture&&"object"==typeof e.autocapture.frustrationInteractions)return e.autocapture.frustrationInteractions},eb=function(e){var r;if(Gy(e.autocapture)){var n=void 0;return"object"==typeof e.autocapture&&"object"==typeof e.autocapture.networkTracking?n=e.autocapture.networkTracking:e.networkTrackingOptions&&(n=e.networkTrackingOptions),t(t({},n),{captureRules:null===(r=null==n?void 0:n.captureRules)||void 0===r?void 0:r.map(function(r){var n,i,o;if((null===(n=r.urls)||void 0===n?void 0:n.length)&&(null===(i=r.hosts)||void 0===i?void 0:i.length)){var s=JSON.stringify(r.hosts),a=JSON.stringify(r.urls);return null===(o=e.loggerProvider)||void 0===o||o.warn("Found network capture rule with both urls='".concat(a,"' and hosts='").concat(s,"' set. ")+"Definition of urls takes precedence over hosts, so ignoring hosts."),t(t({},r),{hosts:void 0})}return r})})}},tb=function(e){var t,r=function(){return!1},n=void 0,i=e.pageCounter;return Hy(e.defaultTracking)&&(r=void 0,t=void 0,e.defaultTracking&&"object"==typeof e.defaultTracking&&e.defaultTracking.pageViews&&"object"==typeof e.defaultTracking.pageViews&&("trackOn"in e.defaultTracking.pageViews&&(r=e.defaultTracking.pageViews.trackOn),"trackHistoryChanges"in e.defaultTracking.pageViews&&(n=e.defaultTracking.pageViews.trackHistoryChanges),"eventType"in e.defaultTracking.pageViews&&e.defaultTracking.pageViews.eventType&&(t=e.defaultTracking.pageViews.eventType))),{trackOn:r,trackHistoryChanges:n,eventType:t,pageCounter:i}},rb=function(e,t){for(var r=0;r<t.length;r++){var n=t[r],i=n.name,o=n.args,s=n.resolve,a=e&&e[i];if("function"==typeof a){var l=a.apply(e,o);"function"==typeof s&&s(null==l?void 0:l.promise)}}return e},nb=function(e){return e&&void 0!==e._q};Ne(),Pi();var ib="2.42.5",ob="amplitude-ts",sb=function(){function e(){this.name="@amplitude/plugin-context-browser",this.type="before",this.library="".concat(ob,"/").concat(ib),"undefined"!=typeof navigator&&(this.userAgent=navigator.userAgent)}return e.prototype.setup=function(e){return this.config=e,Promise.resolve(void 0)},e.prototype.execute=function(e){var r,n;return v(this,void 0,void 0,function(){var i,o,s;return m(this,function(a){return i=(new Date).getTime(),o=null!==(r=this.config.lastEventId)&&void 0!==r?r:-1,s=null!==(n=e.event_id)&&void 0!==n?n:o+1,this.config.lastEventId=s,e.time||(this.config.lastEventTime=i),[2,t(t(t(t(t(t(t(t({user_id:this.config.userId,device_id:this.config.deviceId,session_id:this.config.sessionId,time:i},this.config.appVersion&&{app_version:this.config.appVersion}),this.config.trackingOptions.platform&&{platform:"Web"}),this.config.trackingOptions.language&&{language:At()}),this.config.trackingOptions.ipAddress&&{ip:"$remote"}),{insert_id:fe(),partner_id:this.config.partnerId,plan:this.config.plan}),this.config.ingestionMetadata&&{ingestion_metadata:{source_name:this.config.ingestionMetadata.sourceName,source_version:this.config.ingestionMetadata.sourceVersion}}),e),{event_id:s,library:this.library,user_agent:this.userAgent})]})})},e}();Ne(),Pi(),Ne(),Pi();var ab=1e3,lb=function(e){function t(t){var r,n,i,o=this;try{i=null===(r=de())||void 0===r?void 0:r.localStorage}catch(e){null===(n=null==t?void 0:t.loggerProvider)||void 0===n||n.debug("Failed to access localStorage. error=".concat(JSON.stringify(e))),i=void 0}return(o=e.call(this,i)||this).loggerProvider=null==t?void 0:t.loggerProvider,o}return f(t,e),t.prototype.set=function(t,r){var n;return v(this,void 0,void 0,function(){var i;return m(this,function(o){switch(o.label){case 0:return Array.isArray(r)&&r.length>ab?(i=r.length-ab,[4,e.prototype.set.call(this,t,r.slice(0,ab))]):[3,2];case 1:return o.sent(),null===(n=this.loggerProvider)||void 0===n||n.error("Failed to save ".concat(i," events because the queue length exceeded ").concat(ab,".")),[3,4];case 2:return[4,e.prototype.set.call(this,t,r)];case 3:o.sent(),o.label=4;case 4:return[2]}})})},t}($t);Ne(),Pi();var ub=function(e){function t(){var t;return e.call(this,null===(t=de())||void 0===t?void 0:t.sessionStorage)||this}return f(t,e),t}($t);Ne(),Pi();var cb=function(e){function r(t){void 0===t&&(t={});var r=e.call(this)||this;return r.state={done:4},r.customHeaders=t,r}return f(r,e),r.prototype.send=function(e,r,n){return void 0===n&&(n=!1),v(this,void 0,void 0,function(){var i=this;return m(this,function(o){return[2,new Promise(function(o,s){"undefined"==typeof XMLHttpRequest&&s(new Error("XHRTransport is not supported."));var a=new XMLHttpRequest;a.open("POST",e,!0),a.onreadystatechange=function(){if(a.readyState===i.state.done){var e=a.responseText;try{o(i.buildResponse(JSON.parse(e)))}catch(e){o(i.buildResponse({code:a.status}))}}};var l={"Content-Type":"application/json",Accept:"*/*"},u=JSON.stringify(r),c=n&&u.length>=or&&Cr(),d=function(e){var r,n;l=t(t({},i.customHeaders),l);try{for(var o=y(Object.entries(l)),s=o.next();!s.done;s=o.next()){var u=b(s.value,2),c=u[0],d=u[1];a.setRequestHeader(c,d)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}a.send(e)};v(i,void 0,void 0,function(){var e;return m(this,function(t){switch(t.label){case 0:return c?[4,Ir(u)]:[3,2];case 1:return(e=t.sent())?(l["Content-Encoding"]="gzip",d(e)):d(u),[3,3];case 2:d(u),t.label=3;case 3:return[2]}})}).catch(s)})]})})},r}(nr);Ne(),Pi();var db=function(e){function r(t){void 0===t&&(t={});var r=e.call(this)||this;return r.customHeaders=t,r}return f(r,e),r.prototype.send=function(e,r,n){return void 0===n&&(n=!1),v(this,void 0,void 0,function(){var i,o,s,a,l,u,c;return m(this,function(d){switch(d.label){case 0:if("undefined"==typeof fetch)throw new Error("FetchTransport is not supported");return i=JSON.stringify(r),o=n&&i.length>=or&&Cr(),s=i,a={"Content-Type":"application/json",Accept:"*/*"},o?[4,Ir(i)]:[3,2];case 1:(l=d.sent())&&(a["Content-Encoding"]="gzip",s=l),d.label=2;case 2:return a=t(t({},this.customHeaders),a),[4,fetch(e,{headers:a,body:s,method:"POST"})];case 3:return[4,(u=d.sent()).text()];case 4:c=d.sent();try{return[2,this.buildResponse(JSON.parse(c))]}catch(e){return[2,this.buildResponse({code:u.status})]}return[2]}})})},r}(nr);Ne(),Pi();var hb=function(e){function t(){return e.call(this)||this}return f(t,e),t.prototype.send=function(e,t,r){return void 0===r&&(r=!1),v(this,void 0,void 0,function(){var r=this;return m(this,function(n){return[2,new Promise(function(n,i){var o=de();if(!(null==o?void 0:o.navigator.sendBeacon))throw new Error("SendBeaconTransport is not supported");try{var s=JSON.stringify(t);return n(o.navigator.sendBeacon(e,s)?r.buildResponse({code:200,events_ingested:t.events.length,payload_size_bytes:s.length,server_upload_time:Date.now()}):r.buildResponse({code:500}))}catch(e){i(e)}})]})})},t}(nr);Ne(),Pi();var pb=function(e,t,r){return void 0===r&&(r=!0),v(void 0,void 0,void 0,function(){var n,i,o,s,a,l,u,c,d;return m(this,function(h){switch(h.label){case 0:return n=Tt(e),[4,t.getRaw(n)];case 1:return(i=h.sent())?r?[4,t.remove(n)]:[3,3]:[2,{optOut:!1}];case 2:h.sent(),h.label=3;case 3:return o=b(i.split("."),6),s=o[0],a=o[1],l=o[2],u=o[3],c=o[4],d=o[5],[2,{deviceId:s,userId:gb(a),sessionId:fb(u),lastEventId:fb(d),lastEventTime:fb(c),optOut:Boolean(l)}]}})})},fb=function(e){var t=parseInt(e,32);if(!isNaN(t))return t},gb=function(e){if(atob&&escape&&e)try{return decodeURIComponent(escape(atob(e)))}catch(e){return}},vb="[Amplitude]",mb=("".concat(vb," Page Viewed"),"".concat(vb," Form Started")),yb="".concat(vb," Form Submitted"),bb="".concat(vb," File Downloaded"),wb="session_start",Sb="session_end",kb="".concat(vb," File Extension"),xb="".concat(vb," File Name"),Eb="".concat(vb," Link ID"),Cb="".concat(vb," Link Text"),Ib="".concat(vb," Link URL"),Ob="".concat(vb," Form ID"),Tb="".concat(vb," Form Name"),Ab="".concat(vb," Form Destination"),Rb="cookie";Ne(),Pi();var Pb={};c(Pb,{DEFAULT_ACTION_CLICK_ALLOWLIST:()=>Hr,DEFAULT_CSS_SELECTOR_ALLOWLIST:()=>Vr,DEFAULT_DATA_ATTRIBUTE_PREFIX:()=>$r,EXCLUDE_INTERNAL_REFERRERS_CONDITIONS:()=>di,IdentifyOperation:()=>S,LogLevel:()=>Ie,OfflineDisabled:()=>Wr,RevenueProperty:()=>Ee,ServerZone:()=>zr,SpecialEventType:()=>k}),Pi();var _b=function(e){var t=e.split(".");return t.length<=2?e:t.slice(t.length-2,t.length).join(".")},Mb=function(e,r,n,i,o,s){void 0===o&&(o=!0);e.referrer;var a,l=e.referring_domain,u=g(e,["referrer","referring_domain"]),c=r||{},d=(c.referrer,c.referring_domain),h=g(c,["referrer","referring_domain"]),p=n.excludeInternalReferrers;if(p){var f=Lb(p,i);if(!(f instanceof TypeError)&&e.referring_domain&&jb(e.referring_domain,s)){if("always"===f)return Db(f,e.referring_domain,i),!1;if("ifEmptyCampaign"===f&&(a=t(t({},e),{referring_domain:void 0,referrer:void 0}),Object.values(a).every(function(e){return!e})))return Db(f,e.referring_domain,i),!1}}if(Nb(n.excludeReferrers,e.referring_domain))return i.debug("This is not a new campaign because ".concat(e.referring_domain," is in the exclude referrer list.")),!1;if(!o&&function(e){return Object.values(e).every(function(e){return!e})}(e)&&r)return i.debug("This is not a new campaign because this is a direct traffic in the same session."),!1;var v=JSON.stringify(u)!==JSON.stringify(h),m=_b(l||"")!==_b(d||""),y=!r||v||m;return y?i.debug("This is a new campaign. An $identify event will be sent."):i.debug("This is not a new campaign because it's the same as the previous one."),y},Nb=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=""),e.some(function(e){return e instanceof RegExp?e.test(t):e===t})},Lb=function(e,t){if(!0===e)return di.always;if("object"==typeof e){var r=e.condition;if("string"==typeof r&&Object.keys(di).includes(r))return r;if(void 0===r)return di.always}var n="Invalid configuration provided for attribution.excludeInternalReferrers: ".concat(JSON.stringify(e));return t.error(n),new TypeError(n)};function Db(e,t,r){var n="This is not a new campaign because referring_domain=".concat(t," is on the same domain as the current page and it is configured to exclude internal referrers");"always"===e?r.debug(n):"ifEmptyCampaign"===e&&r.debug("".concat(n," with empty campaign parameters"))}var Ub=["ac.in","ac.jp","ac.kr","ac.th","ac.uk","ac.za","appspot.com","asn.au","azurewebsites.net","cloudfront.net","myshopify.com","blogspot.com","co.ca","co.in","co.jp","co.kr","co.nz","co.th","co.uk","co.za","com.ar","com.au","com.br","com.cn","com.hk","com.in","com.jp","com.kr","com.mx","com.pl","com.sg","com.tr","com.tw","ed.jp","edu.au","edu.br","edu.cn","edu.hk","edu.sg","edu.th","edu.tr","edu.tw","firebaseapp.com","fly.dev","gc.ca","geek.nz","github.io","gitlab.io","go.jp","go.kr","go.th","gob.ar","gob.mx","gov.au","gov.br","gov.cn","gov.hk","gov.in","gov.pl","gov.sg","gov.tr","gov.tw","gov.uk","gov.za","govt.nz","gr.jp","herokuapp.com","id.au","idv.hk","iwi.nz","lg.jp","ltd.uk","maori.nz","me.uk","mil.kr","ne.jp","ne.kr","net.au","net.br","net.cn","net.hk","net.in","net.nz","net.pl","net.sg","net.tr","net.tw","net.za","onrender.com","or.jp","or.kr","or.th","org.ar","org.au","org.br","org.cn","org.hk","org.in","org.mx","org.nz","org.pl","org.sg","org.tw","org.uk","org.za","pages.dev","pe.kr","plc.uk","re.kr","res.in","sch.uk","vercel.app","netlify.app","workers.dev"],Fb=function(e){var t,r,n=e||(null===(r=null===(t=de())||void 0===t?void 0:t.location)||void 0===r?void 0:r.hostname);if(!n)return"";var i=n.split("."),o=i[i.length-1],s=i[i.length-2];return Ub.find(function(e){return n.endsWith(".".concat(e))})&&(o=i[i.length-2]+"."+i[i.length-1],s=i[i.length-3]),s?"".concat(s,".").concat(o):o},jb=function(e,t){var r=de();if(!r)return!1;var n,i,o,s=(t||"").trim()||Fb(r.location.hostname);return n=e,o=(i=s).startsWith(".")?i:".".concat(i),!!(n.startsWith(".")?n:".".concat(n)).endsWith(o)},Bb=function(e){function t(t,r,n,i,o,s,a,l,u,c,d,h,p,f,g,v,m,y,b,w,S,k,x,E,C,I,O,T,A,R,P,_,M,N,L,D,U,F,j,B,q,z,W,V){void 0===n&&(n=new Ut),void 0===i&&(i={domain:"",expiration:365,sameSite:"Lax",secure:!1,upgrade:!0}),void 0===l&&(l=1e3),void 0===u&&(u=5),void 0===c&&(c=30),void 0===d&&(d=Rb),void 0===v&&(v=new Te),void 0===m&&(m=Ie.Warn),void 0===b&&(b=!1),void 0===w&&(w=!1),void 0===x&&(x=""),void 0===E&&(E="US"),void 0===O&&(O=18e5),void 0===T&&(T=new lb({loggerProvider:v})),void 0===A&&(A={ipAddress:!0,language:!0,platform:!0}),void 0===R&&(R="fetch"),void 0===P&&(P=!1),void 0===_&&(_=!0),void 0===F&&(F=!0),void 0===j&&(j=0),void 0===W&&(W=!1);var $,H=this;(H=e.call(this,{apiKey:t,storageProvider:T,transportProvider:Wb(R)})||this).apiKey=t,H.appVersion=r,H.cookieOptions=i,H.defaultTracking=o,H.autocapture=s,H.flushIntervalMillis=l,H.flushMaxRetries=u,H.flushQueueSize=c,H.identityStorage=d,H.ingestionMetadata=h,H.instanceName=p,H.loggerProvider=v,H.logLevel=m,H.minIdLength=y,H.offline=b,H.partnerId=S,H.plan=k,H.serverUrl=x,H.serverZone=E,H.sessionTimeout=O,H.storageProvider=T,H.trackingOptions=A,H.transport=R,H.useBatch=P,H.fetchRemoteConfig=_,H.networkTrackingOptions=D,H.identify=U,H.enableDiagnostics=F,H.diagnosticsSampleRate=j,H.diagnosticsClient=B,H.remoteConfig=q,H.topLevelDomain=z,H.enableRequestBodyCompression=W,H.customEnrichment=V,H.version=ib,H._optOut=!1,H._cookieStorage=n,H.deviceId=a,H.lastEventId=f,H.lastEventTime=g,H.optOut=w,H.deferredSessionId=I,H.sessionId=C,H.pageCounter=N,H.userId=M,H.debugLogsEnabled=L,H.loggerProvider.enable(L?Ie.Debug:H.logLevel),H.networkTrackingOptions=D,H.identify=U,H.enableDiagnostics=F,H.diagnosticsSampleRate=j,H.diagnosticsClient=B;var K=null!==($=null==q?void 0:q.fetchRemoteConfig)&&void 0!==$?$:_;return H.remoteConfig=H.remoteConfig||{},H.remoteConfig.fetchRemoteConfig=K,H.fetchRemoteConfig=K,H.topLevelDomain=z||Fb(),H}return f(t,e),Object.defineProperty(t.prototype,"cookieStorage",{get:function(){return this._cookieStorage},set:function(e){this._cookieStorage!==e&&(this._cookieStorage=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"deviceId",{get:function(){return this._deviceId},set:function(e){this._deviceId!==e&&(this._deviceId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"userId",{get:function(){return this._userId},set:function(e){this._userId!==e&&(this._userId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sessionId",{get:function(){return this._sessionId},set:function(e){this._sessionId!==e&&(this._sessionId=e,void 0!==e&&void 0!==this._deferredSessionId&&(this._deferredSessionId=void 0),this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"deferredSessionId",{get:function(){return this._deferredSessionId},set:function(e){this._deferredSessionId!==e&&e!==this.sessionId&&(this._deferredSessionId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut!==e&&(this._optOut=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastEventTime",{get:function(){return this._lastEventTime},set:function(e){this._lastEventTime!==e&&(this._lastEventTime=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastEventId",{get:function(){return this._lastEventId},set:function(e){this._lastEventId!==e&&(this._lastEventId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageCounter",{get:function(){return this._pageCounter},set:function(e){this._pageCounter!==e&&(this._pageCounter=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"debugLogsEnabled",{set:function(e){this._debugLogsEnabled!==e&&(this._debugLogsEnabled=e,this.updateStorage())},enumerable:!1,configurable:!0}),t.prototype.updateStorage=function(){var e={deviceId:this._deviceId,userId:this._userId,sessionId:this._sessionId,deferredSessionId:this._deferredSessionId,optOut:this._optOut,lastEventTime:this._lastEventTime,lastEventId:this._lastEventId,pageCounter:this._pageCounter,debugLogsEnabled:this._debugLogsEnabled,cookieDomain:void 0};this.cookieStorage instanceof jt&&(e.cookieDomain=this.cookieStorage.options.domain),this.cookieStorage.set(Ot(this.apiKey),e)},t}(Re),qb=function(e,r,n,i,o){return void 0===r&&(r={}),v(void 0,void 0,void 0,function(){var s,a,l,u,c,d,h,p,f,g,v,y,b,w,S,k,x,E,C,I,O,T,A,R,P,_,M,N,L,D,U,F,j,B,q,z,W,V,$,H,K,G,J,Q,X,Y,Z,ee,te,re,ne;return m(this,function(m){switch(m.label){case 0:return s=r.identityStorage||Rb,a="",s!==Rb||(null===(T=r.cookieOptions)||void 0===T?void 0:T.domain)||""===(null===(A=r.cookieOptions)||void 0===A?void 0:A.domain)?[3,2]:[4,Vb(void 0,i)];case 1:a=m.sent(),m.label=2;case 2:return l=t({domain:null!==(P=null===(R=r.cookieOptions)||void 0===R?void 0:R.domain)&&void 0!==P?P:a,expiration:365,sameSite:"Lax",secure:!1,upgrade:!0},r.cookieOptions),u={duplicateResolverFn:function(e){var t=zt(e);if(!t)return!1;var r=JSON.parse(t);return Wt(r.cookieDomain,l.domain)},diagnosticsClient:i},c=zb(r.identityStorage,l,u),[4,pb(e,c,null===(M=null===(_=r.cookieOptions)||void 0===_?void 0:_.upgrade)||void 0===M||M)];case 3:return d=m.sent(),[4,c.get(Ot(e))];case 4:return h=m.sent(),p=Rt(),f=p.ampTimestamp?Number(p.ampTimestamp):void 0,g=!f||Date.now()<f,v=null!==(F=null!==(U=null!==(D=null!==(N=r.deviceId)&&void 0!==N?N:g?null!==(L=p.ampDeviceId)&&void 0!==L?L:p.deviceId:void 0)&&void 0!==D?D:null==h?void 0:h.deviceId)&&void 0!==U?U:d.deviceId)&&void 0!==F?F:fe(),y=null!==(j=null==h?void 0:h.lastEventId)&&void 0!==j?j:d.lastEventId,b=null!==(B=null==h?void 0:h.lastEventTime)&&void 0!==B?B:d.lastEventTime,w=null!==(z=null!==(q=r.optOut)&&void 0!==q?q:null==h?void 0:h.optOut)&&void 0!==z?z:d.optOut,S=null!==(W=null==h?void 0:h.sessionId)&&void 0!==W?W:d.sessionId,k=null==h?void 0:h.deferredSessionId,x=null!==($=null!==(V=r.userId)&&void 0!==V?V:null==h?void 0:h.userId)&&void 0!==$?$:d.userId,n.previousSessionDeviceId=null!==(H=null==h?void 0:h.deviceId)&&void 0!==H?H:d.deviceId,n.previousSessionUserId=null!==(K=null==h?void 0:h.userId)&&void 0!==K?K:d.userId,E={ipAddress:null===(J=null===(G=r.trackingOptions)||void 0===G?void 0:G.ipAddress)||void 0===J||J,language:null===(X=null===(Q=r.trackingOptions)||void 0===Q?void 0:Q.language)||void 0===X||X,platform:null===(Z=null===(Y=r.trackingOptions)||void 0===Y?void 0:Y.platform)||void 0===Z||Z},C=null==h?void 0:h.pageCounter,I=null==h?void 0:h.debugLogsEnabled,void 0!==r.autocapture&&(r.defaultTracking=r.autocapture),[4,(O=new Bb(e,r.appVersion,c,l,r.defaultTracking,r.autocapture,v,r.flushIntervalMillis,r.flushMaxRetries,r.flushQueueSize,s,r.ingestionMetadata,r.instanceName,y,b,null!==(ee=null==o?void 0:o.loggerProvider)&&void 0!==ee?ee:r.loggerProvider,r.logLevel,r.minIdLength,r.offline,w,r.partnerId,r.plan,r.serverUrl,null!==(te=null==o?void 0:o.serverZone)&&void 0!==te?te:r.serverZone,S,k,r.sessionTimeout,r.storageProvider,E,r.transport,r.useBatch,r.fetchRemoteConfig,x,C,I,r.networkTrackingOptions,r.identify,null!==(re=null==o?void 0:o.enableDiagnostics)&&void 0!==re?re:r.enableDiagnostics,null!==(ne=null==o?void 0:o.diagnosticsSampleRate)&&void 0!==ne?ne:n._diagnosticsSampleRate,i,r.remoteConfig,a,r.enableRequestBodyCompression,r.customEnrichment)).storageProvider.isEnabled()];case 5:return m.sent()||(O.loggerProvider.warn("Storage provider ".concat(O.storageProvider.constructor.name," is not enabled. Falling back to MemoryStorage.")),O.storageProvider=new Ut),[2,O]}})})},zb=function(e,r,n){switch(void 0===e&&(e=Rb),void 0===r&&(r={}),e){case"localStorage":return new lb;case"sessionStorage":return new ub;case"none":return new Ut;default:return new jt(t(t({},r),{expirationDays:r.expiration}),n)}},Wb=function(e){var t="object"==typeof e?e.type:e,r="object"==typeof e?e.headers:void 0;return"xhr"===t?new cb(r):"beacon"===t?new hb:new db(r)},Vb=function(e,t){return v(void 0,void 0,void 0,function(){var r,n,i,o,s,a,l;return m(this,function(u){switch(u.label){case 0:return[4,new jt(void 0,{diagnosticsClient:t}).isEnabled()];case 1:if(!u.sent()||!e&&("undefined"==typeof location||!location.hostname))return[2,""];if(r=null!=e?e:location.hostname,1===(n=r.split(".")).length)return[2,""];for(i=[],o=1,Ub.find(function(e){return r.endsWith(".".concat(e))})&&(o=2),s=n.length-o-1;s>=0;--s)i.push(n.slice(s).join("."));s=0,u.label=2;case 2:if(!(s<i.length))return[3,7];a=i[s],u.label=3;case 3:return u.trys.push([3,5,,6]),[4,jt.isDomainWritable(a)];case 4:return u.sent()?[2,"."+a]:[3,6];case 5:return l=u.sent(),t&&t.recordEvent("cookies.tld.failure",{reason:"Unexpected exception checking domain is writable: ".concat(a),error:l instanceof Error?l.message:String(l)}),[3,6];case 6:return s++,[3,2];case 7:return t&&t.recordEvent("cookies.tld.failure",{reason:"Could not determine TLD for host ".concat(r)}),[2,""]}})})};Ne(),Pi();var $b="AMP_PAGE_VIEW",Hb=function(e){var r;void 0===e&&(e={});var n,i,o=de(),s=void 0,a=!1,l=e.trackOn,u=e.trackHistoryChanges,c=e.eventType,d=void 0===c?"[Amplitude] Page Viewed":c,h=function(e){var t=e;try{t=decodeURI(e)}catch(e){null==s||s.error("Malformed URI sequence: ",e)}return t},p=function(e){return v(void 0,void 0,void 0,function(){var r,n,i;return m(this,function(o){switch(o.label){case 0:return r=h("undefined"!=typeof location&&location.href||""),i={event_type:d},n=[{}],[4,Kb()];case 1:return[2,(i.event_properties=t.apply(void 0,[t.apply(void 0,n.concat([o.sent()])),{"[Amplitude] Page Domain":"undefined"!=typeof location&&location.hostname||"","[Amplitude] Page Location":r,"[Amplitude] Page Path":"undefined"!=typeof location&&h(location.pathname)||"","[Amplitude] Page Title":Dn(Ln),"[Amplitude] Page URL":r.split("?")[0],"[Amplitude] Page View ID":e}]),i)]}})})},f=function(){return void 0===l||"function"==typeof l&&l()},g="undefined"!=typeof location?location.href:null,y=function(){v(void 0,void 0,void 0,function(){var e,t,n,o,a;return m(this,function(l){switch(l.label){case 0:return e=location.href,t=Jb(u,e,g||"")&&f(),g=e,t?(n=void 0,i&&(n=fe(),i.set($b,{pageViewId:n})),null==s||s.log("Tracking page view event"),null!=r?[3,1]:[3,3]):[3,4];case 1:return a=(o=r).track,[4,p(n)];case 2:a.apply(o,[l.sent()]),l.label=3;case 3:l.label=4;case 4:return[2]}})})};return{name:"@amplitude/plugin-page-view-tracking-browser",type:"enrichment",setup:function(e,t){return v(void 0,void 0,void 0,function(){var l,u,c;return m(this,function(d){switch(d.label){case 0:if(r=t,n=e,(s=e.loggerProvider).log("Installing @amplitude/plugin-page-view-tracking-browser"),a=!0,o){try{i=new $t(o.sessionStorage)}catch(e){null==s||s.debug("sessionStorage is not available in this environment.")}o.addEventListener("popstate",y),o.history.pushState=new Proxy(o.history.pushState,{apply:function(e,t,r){var n=b(r,3),i=n[0],o=n[1],s=n[2];e.apply(t,[i,o,s]),a&&y()}})}return f()?(s.log("Tracking page view event"),l=void 0,i&&(l=fe(),i.set($b,{pageViewId:l})),c=(u=r).track,[4,p(l)]):[3,2];case 1:c.apply(u,[d.sent()]),d.label=2;case 2:return[2]}})})},execute:function(e){return v(void 0,void 0,void 0,function(){var r,o,a;return m(this,function(u){switch(u.label){case 0:return"attribution"===l&&Gb(e)?(null==s||s.log("Enriching campaign event to page view event with campaign parameters"),r=void 0,i?[4,i.get($b)]:[3,2]):[3,4];case 1:o=u.sent(),r=null==o?void 0:o.pageViewId,u.label=2;case 2:return[4,p(r)];case 3:a=u.sent(),e.event_type=a.event_type,e.event_properties=t(t({},e.event_properties),a.event_properties),u.label=4;case 4:return n&&e.event_type===d&&(n.pageCounter=n.pageCounter?n.pageCounter+1:1,e.event_properties=t(t({},e.event_properties),{"[Amplitude] Page Counter":n.pageCounter})),[2,e]}})})},teardown:function(){return v(void 0,void 0,void 0,function(){return m(this,function(e){return o&&(o.removeEventListener("popstate",y),a=!1),[2]})})}}},Kb=function(){return v(void 0,void 0,void 0,function(){var e;return m(this,function(t){switch(t.label){case 0:return e=Dt,[4,(new An).parse()];case 1:return[2,e.apply(void 0,[t.sent()])]}})})},Gb=function(e){if("$identify"===e.event_type&&e.user_properties){var t=e.user_properties,r=t[S.SET]||{},n=t[S.UNSET]||{},i=w(w([],b(Object.keys(r)),!1),b(Object.keys(n)),!1);return Object.keys(G).every(function(e){return i.includes(e)})}return!1},Jb=function(e,t,r){if("pathOnly"===e){if(""==r)return!0;var n=new URL(t),i=new URL(r);return n.origin+n.pathname!==i.origin+i.pathname}return t!==r};Ne(),Pi();var Qb=function(){var e,t,r=[],n=function(e,t,n){e.addEventListener(t,n),r.push({element:e,type:t,handler:n})};return{name:"@amplitude/plugin-form-interaction-tracking-browser",type:"enrichment",setup:function(r,i){return v(void 0,void 0,void 0,function(){var o,s;return m(this,function(a){return t=function(e){if($y(e.defaultTracking)&&e.defaultTracking&&"object"==typeof e.defaultTracking&&"object"==typeof e.defaultTracking.formInteractions)return e.defaultTracking.formInteractions}(r),o=function(){if(i){if("undefined"!=typeof document){var o=new WeakSet,s=function(e){if(!o.has(e)){o.add(e);var s=!1;n(e,"change",function(){var t,r=Yb(e);s||i.track(mb,((t={})[Ob]=Xb(e.id),t[Tb]=Xb(e.name),t[Ab]=r,t)),s=!0}),n(e,"submit",function(n){var o,a,l=Yb(e);if(s||i.track(mb,((o={})[Ob]=Xb(e.id),o[Tb]=Xb(e.name),o[Ab]=l,o)),s=!0,void 0!==(null==t?void 0:t.shouldTrackSubmit))if("function"==typeof t.shouldTrackSubmit&&"undefined"!=typeof SubmitEvent&&n instanceof SubmitEvent)try{if(!t.shouldTrackSubmit(n))return}catch(e){r.loggerProvider.warn("shouldTrackSubmit callback threw an error, proceeding with tracking.")}else r.loggerProvider.warn("shouldTrackSubmit is ignored because it is not a function or event is not a SubmitEvent.");i.track(yb,((a={})[Ob]=Xb(e.id),a[Tb]=Xb(e.name),a[Ab]=l,a)),s=!1})}};Array.from(document.getElementsByTagName("form")).forEach(s),"undefined"!=typeof MutationObserver&&(e=new MutationObserver(function(e){e.forEach(function(e){e.addedNodes.forEach(function(e){"FORM"===e.nodeName&&s(e),"querySelectorAll"in e&&"function"==typeof e.querySelectorAll&&Array.from(e.querySelectorAll("form")).map(s)})})})).observe(document.body,{subtree:!0,childList:!0})}}else r.loggerProvider.warn("Form interaction tracking requires a later version of @amplitude/analytics-browser. Form interaction events are not tracked.")},"complete"===document.readyState?o():(s=de())?s.addEventListener("load",o):r.loggerProvider.debug("Form interaction tracking is not installed because global is undefined."),[2]})})},execute:function(e){return v(void 0,void 0,void 0,function(){return m(this,function(t){return[2,e]})})},teardown:function(){return v(void 0,void 0,void 0,function(){return m(this,function(t){return null==e||e.disconnect(),r.forEach(function(e){var t=e.element,r=e.type,n=e.handler;null==t||t.removeEventListener(r,n)}),r=[],[2]})})}}},Xb=function(e){if("string"==typeof e)return e},Yb=function(e){var t=e.getAttribute("action");try{t=new URL(encodeURI(null!=t?t:""),window.location.href).href}catch(e){}return t};Ne(),Pi();var Zb=function(){var e,t=[];return{name:"@amplitude/plugin-file-download-tracking-browser",type:"enrichment",setup:function(r,n){return v(void 0,void 0,void 0,function(){var i,o;return m(this,function(s){return i=function(){if(n){if("undefined"!=typeof document){var i=function(e){var r;try{r=new URL(e.href,window.location.href)}catch(e){return}var i,s,a,l=o.exec(r.href),u=null==l?void 0:l[1];u&&(s="click",a=function(){var t;u&&n.track(bb,((t={})[kb]=u,t[xb]=r.pathname,t[Eb]=e.id,t[Cb]=e.text,t[Ib]=e.href,t))},(i=e).addEventListener(s,a),t.push({element:i,type:s,handler:a}))},o=/\.(pdf|xlsx?|docx?|txt|rtf|csv|exe|key|pp(s|t|tx)|7z|pkg|rar|gz|zip|avi|mov|mp4|mpe?g|wmv|midi?|mp3|wav|wma)(\?.+)?$/;Array.from(document.getElementsByTagName("a")).forEach(i),"undefined"!=typeof MutationObserver&&(e=new MutationObserver(function(e){e.forEach(function(e){e.addedNodes.forEach(function(e){"A"===e.nodeName&&i(e),"querySelectorAll"in e&&"function"==typeof e.querySelectorAll&&Array.from(e.querySelectorAll("a")).map(i)})})})).observe(document.body,{subtree:!0,childList:!0})}}else r.loggerProvider.warn("File download tracking requires a later version of @amplitude/analytics-browser. File download events are not tracked.")},"complete"===document.readyState?i():(o=de())?o.addEventListener("load",i):r.loggerProvider.debug("File download tracking is not installed because global is undefined."),[2]})})},execute:function(e){return v(void 0,void 0,void 0,function(){return m(this,function(t){return[2,e]})})},teardown:function(){return v(void 0,void 0,void 0,function(){return m(this,function(r){return null==e||e.disconnect(),t.forEach(function(e){var t=e.element,r=e.type,n=e.handler;null==t||t.removeEventListener(r,n)}),t=[],[2]})})}}},ew=!1;Ne(),Pi();var tw=function(){var e=de(),t=[],r=function(r,n){(null==e?void 0:e.addEventListener)&&(null==e||e.addEventListener(r,n),t.push({type:r,handler:n}))};return{name:"@amplitude/plugin-network-checker-browser",type:"before",setup:function(e,t){return v(void 0,void 0,void 0,function(){return m(this,function(n){return"undefined"==typeof navigator?(e.loggerProvider.debug("Network connectivity checker plugin is disabled because navigator is not available."),e.offline=!1,[2]):(e.offline=!navigator.onLine,r("online",function(){e.loggerProvider.debug("Network connectivity changed to online."),e.offline=!1,setTimeout(function(){t.flush()},e.flushIntervalMillis)}),r("offline",function(){e.loggerProvider.debug("Network connectivity changed to offline."),e.offline=!0}),[2])})})},teardown:function(){return v(void 0,void 0,void 0,function(){return m(this,function(r){return t.forEach(function(t){var r=t.type,n=t.handler;null==e||e.removeEventListener(r,n)}),t=[],[2]})})}}};function rw(e){var t,r,n,i,o,s,a,l,u,c,d,h;if("object"==typeof e&&null!==e&&!Array.isArray(e)){var p=Object.keys(e);try{for(var f=y(p),g=f.next();!g.done;g=f.next()){var v=g.value;try{var m=e[v];"boolean"==typeof(null==m?void 0:m.enabled)&&(m.enabled?(delete m.enabled,0===Object.keys(m).length&&(e[v]=!0)):e[v]=!1),rw(m)}catch(e){}}}catch(e){t={error:e}}finally{try{g&&!g.done&&(r=f.return)&&r.call(f)}finally{if(t)throw t.error}}try{if(null===(u=null===(l=null===(a=e.autocapture)||void 0===a?void 0:a.networkTracking)||void 0===l?void 0:l.captureRules)||void 0===u?void 0:u.length)try{for(var S=y(e.autocapture.networkTracking.captureRules),k=S.next();!k.done;k=S.next()){var x=k.value;try{for(var E=(o=void 0,y(["responseHeaders","requestHeaders"])),C=E.next();!C.done;C=E.next()){var I=C.value,O=null!==(c=x[I])&&void 0!==c?c:{},T=O.captureSafeHeaders,A=O.allowlist;(T||A)&&(void 0===A||Array.isArray(A)?x[I]=w(w([],b(T?J:[]),!1),b(null!=A?A:[]),!1):delete x[I])}}catch(e){o={error:e}}finally{try{C&&!C.done&&(s=E.return)&&s.call(E)}finally{if(o)throw o.error}}}}catch(e){n={error:e}}finally{try{k&&!k.done&&(i=S.return)&&i.call(S)}finally{if(n)throw n.error}}}catch(e){}var R=null===(d=e.autocapture)||void 0===d?void 0:d.frustrationInteractions;R&&(R.rageClick&&(R.rageClicks=R.rageClick,delete R.rageClick),R.deadClick&&(R.deadClicks=R.deadClick,delete R.deadClick));try{var P=null===(h=e.autocapture)||void 0===h?void 0:h.elementInteractions;if(P&&"object"==typeof P&&(!0===P.viewportContentUpdated&&(P.viewportContentUpdated={}),!1===P.viewportContentUpdated&&(P.viewportContentUpdated={enabled:!1}),void 0!==P.exposureDuration)){var _=P.viewportContentUpdated;void 0===_?P.viewportContentUpdated={exposureDuration:P.exposureDuration}:"object"==typeof _&&void 0===_.exposureDuration&&!1!==_.enabled&&(_.exposureDuration=P.exposureDuration),delete P.exposureDuration}}catch(e){}}}function nw(e,t,r){var n,i,o=[];try{for(var s=y(null!=t?t:[]),a=s.next();!a.done;a=s.next()){var l=a.value;try{o.push(new RegExp(l))}catch(e){r.loggerProvider.warn("Invalid regex pattern: ".concat(l),e)}}}catch(e){n={error:e}}finally{try{a&&!a.done&&(i=s.return)&&i.call(s)}finally{if(n)throw n.error}}return e.concat(o)}function iw(e,r){var n,i,o,s,a,l,u;if(e){rw(e);try{r.loggerProvider.debug("Update browser config with remote configuration:",JSON.stringify(e));var c=e;if(c&&"autocapture"in c){if("boolean"==typeof c.autocapture&&(r.autocapture=c.autocapture),"object"==typeof c.autocapture&&null!==c.autocapture){var d=t({},c.autocapture);if(void 0===r.autocapture&&(r.autocapture=c.autocapture),"object"==typeof c.autocapture.elementInteractions&&null!==c.autocapture.elementInteractions&&(null===(o=c.autocapture.elementInteractions.pageUrlAllowlistRegex)||void 0===o?void 0:o.length)){d.elementInteractions=t({},c.autocapture.elementInteractions);var h=d.elementInteractions,p=null!==(s=h.pageUrlAllowlist)&&void 0!==s?s:[],f=c.autocapture.elementInteractions.pageUrlAllowlistRegex;h.pageUrlAllowlist=nw(p,f,r),delete h.pageUrlAllowlistRegex}if("object"==typeof c.autocapture.networkTracking&&null!==c.autocapture.networkTracking&&(null===(a=c.autocapture.networkTracking.captureRules)||void 0===a?void 0:a.length)){d.networkTracking=t({},c.autocapture.networkTracking);var g=null!==(l=d.networkTracking.captureRules)&&void 0!==l?l:[];try{for(var v=y(g),m=v.next();!m.done;m=v.next()){var b=m.value;b.urls=nw(null!==(u=b.urls)&&void 0!==u?u:[],b.urlsRegex,r),delete b.urlsRegex}}catch(e){n={error:e}}finally{try{m&&!m.done&&(i=v.return)&&i.call(v)}finally{if(n)throw n.error}}}"boolean"==typeof r.autocapture&&(r.autocapture=t({attribution:r.autocapture,fileDownloads:r.autocapture,formInteractions:r.autocapture,pageViews:r.autocapture,sessions:r.autocapture,elementInteractions:r.autocapture,webVitals:r.autocapture,frustrationInteractions:r.autocapture},d)),"object"==typeof r.autocapture&&(r.autocapture=t(t({},r.autocapture),d))}r.defaultTracking=r.autocapture}"customEnrichment"in c&&null!==c.customEnrichment&&!1!==r.customEnrichment&&(r.customEnrichment=c.customEnrichment),r.loggerProvider.debug("Browser config after remote config update:",JSON.stringify(r))}catch(e){r.loggerProvider.error("Failed to apply remote configuration because of error: ",e)}}}Ne(),Pi(),Ne(),Pi();var ow="1.27.2";Pi();var sw="[Amplitude] Element Clicked",aw="[Amplitude] Element Tag",lw="[Amplitude] Element Text",uw="[Amplitude] Page URL",cw="[Amplitude] Viewport Height",dw="[Amplitude] Viewport Width",hw="[Amplitude] Page View ID",pw="data-amp-mask-attributes";Ne(),Pi();var fw,gw,vw=["input","select","textarea"],mw=function(e,t){var r,n=null===(r=null===window||void 0===window?void 0:window.getComputedStyle)||void 0===r?void 0:r.call(window,e);return"pointer"===(null==n?void 0:n.getPropertyValue("cursor"))&&"click"===t},yw=function(e){var t=e.pageUrlAllowlist,r=e.pageUrlExcludelist;return!(r&&r.length>0&&_t(window.location.href,r))&&!!_t(window.location.href,t)},bw=function(e,t,r){return void 0===r&&(r=!1),function(n,i){var o,s,a=e.shouldTrackEventResolver,l=null===(s=null===(o=null==i?void 0:i.tagName)||void 0===o?void 0:o.toLowerCase)||void 0===s?void 0:s.call(o);if(!l)return!1;if(a)return a(n,i);if(!yw(e))return!1;var u=String(null==i?void 0:i.getAttribute("type"))||"";if("string"==typeof u)switch(u.toLowerCase()){case"hidden":case"password":return!1}var c=mw(i,n);if(r&&c)return!0;if(t&&!t.some(function(e){var t;return!!(null===(t=null==i?void 0:i.matches)||void 0===t?void 0:t.call(i,e))}))return!1;switch(l){case"input":case"select":case"textarea":return"change"===n||"click"===n;default:return!!c||"click"===n}}},ww=function(e){return e?e.split(",").map(function(e){return e.trim()}).filter(function(e){return e.length>0&&"id"!==e&&"class"!==e}):[]},Sw=function(e){return Object.keys(e).reduce(function(t,r){var n=e[r];return function(e){return null==e||"object"==typeof e&&0===Object.keys(e).length||"string"==typeof e&&0===e.trim().length}(n)||(t[r]=n),t},{})},kw=function(){var e;try{var t=de(),r=null===(e=null==t?void 0:t.sessionStorage)||void 0===e?void 0:e.getItem("AMP_PAGE_VIEW");if(!r)return;var n=JSON.parse(r);if("string"==typeof n.pageViewId)return n.pageViewId}catch(e){}},xw=function(e,t){return e?t.some(function(t){var r;return null===(r=null==e?void 0:e.matches)||void 0===r?void 0:r.call(e,t)})?e:xw(null==e?void 0:e.parentElement,t):null},Ew=function(e){return!(null===e.event.target||!e.closestTrackedAncestor)};(gw=fw||(fw={}))[gw.LEFT_OR_TOUCH_CONTACT=0]="LEFT_OR_TOUCH_CONTACT",gw[gw.MIDDLE=1]="MIDDLE",gw[gw.RIGHT=2]="RIGHT";var Cw="__AMPLITUDE_VISUAL_TAGGING__";Pi(),Pi(),Ne(),Pi();var Iw=de(),Ow=function(){return new Un.default(function(e){var t=new MutationObserver(function(t){e.next(t)});return document.body&&t.observe(document.body,{childList:!0,attributes:!0,characterData:!0,subtree:!0}),function(){return t.disconnect()}})},Tw=function(e){return void 0===e&&(e="click"),new Un.default(function(t){var r,n=function(e){t.next(e)};return null===(r=de())||void 0===r||r.document.addEventListener(e,n,{capture:!0}),function(){var t;null===(t=de())||void 0===t||t.document.removeEventListener(e,n,{capture:!0})}})},Aw=function(){var e=Vn(new Un.default(function(e){var r=function(r){if(r instanceof ErrorEvent){var n={kind:"error"};r.error instanceof Error||r.error instanceof DOMException?n=t(t({},n),{message:r.error.message,stack:r.error.stack,filename:r.filename,lineNumber:r.lineno,columnNumber:r.colno}):"string"==typeof r.error&&(n.message=r.error),e.next(n)}};return Iw.addEventListener("error",r),function(){Iw.removeEventListener("error",r)}}),new Un.default(function(e){var t=function(t){var r={kind:"unhandledrejection"};t.reason instanceof Error||t.reason instanceof DOMException?(r.message=t.reason.message,r.stack=t.reason.stack):"string"==typeof t.reason&&(r.message=t.reason),e.next(r)};return Iw.addEventListener("unhandledrejection",t),function(){Iw.removeEventListener("unhandledrejection",t)}}));return Vn(e,new Un.default(function(e){var t=function(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];var i=void 0;Array.isArray(r[0])&&"string"==typeof r[0][0]&&(i=r[0][0]),e.next({kind:"console",message:i})};return Lr.addListener("error",t),function(){Lr.removeListener(t)}}))};Ne();var Rw=function(e,t,r){e.forEach(function(e){if("string"!=typeof e&&"ATTACH_EVENT_PROPERTY"===e.actionType){var n=r.extractDataFromDataSource(e.dataSource,t.closestTrackedAncestor);t.targetElementProperties[e.destinationKey]=n}})},Pw={"[Amplitude] Element Clicked":"click","[Amplitude] Element Changed":"change"},_w=function(e){var t,r,n,i,o=Object.values(Pw).reduce(function(e,t){return e[t]=new Set,e},{});if(!e)return o;try{for(var s=y(e),a=s.next();!a.done;a=s.next()){var l=a.value;try{try{for(var u=(n=void 0,y(l.definition)),c=u.next();!c.done;c=u.next()){var d=c.value,h=Pw[d.event_type];h&&o[h].add(l.id)}}catch(e){n={error:e}}finally{try{c&&!c.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}}catch(e){console.warn("Skipping Labeled Event due to malformed definition",null==l?void 0:l.id,e)}}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}return o},Mw=function(e){var t,r,n,i,o=new Map;try{for(var s=y(e),a=s.next();!a.done;a=s.next()){var l=a.value;try{for(var u=(n=void 0,y(l.conditions)),c=u.next();!c.done;c=u.next()){var d=c.value;if("LABELED_EVENT"===d.type){var h=d.match.eventId,p=o.get(h);p||(p=[],o.set(h,p)),p.push(l)}}}catch(e){n={error:e}}finally{try{c&&!c.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}return o},Nw=function(e,t){return t.filter(function(t){return t.definition.some(function(t){return Pw[t.event_type]===e.type&&t.filters.every(function(t){return function(e,t){try{if("[Amplitude] Element Text"===t.subprop_key)return"is"===t.subprop_op&&t.subprop_value.includes(e.targetElementProperties["[Amplitude] Element Text"]);if("[Amplitude] Element Hierarchy"===t.subprop_key)return"autotrack css match"===t.subprop_op&&!!e.closestTrackedAncestor.closest(t.subprop_value.toString())}catch(e){return console.error("Error matching event to filter",e),!1}return!1}(e,t)})})})},Lw=function(){function e(e,t,r,n){this.groupedLabeledEvents=e,this.labeledEventToTriggerMap=t,this.dataExtractor=r,this.options=n}return e.prototype.evaluate=function(e){var t,r,n=this.options.pageActions;if(!n)return e;var i=function(e,t){var r,n,i,o,s=new Set;try{for(var a=y(e),l=a.next();!l.done;l=a.next()){var u=l.value,c=t.get(u.id);if(c)try{for(var d=(i=void 0,y(c)),h=d.next();!h.done;h=d.next()){var p=h.value;s.add(p)}}catch(e){i={error:e}}finally{try{h&&!h.done&&(o=d.return)&&o.call(d)}finally{if(i)throw i.error}}}}catch(e){r={error:e}}finally{try{l&&!l.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return Array.from(s)}(Nw(e,Array.from(this.groupedLabeledEvents[e.type]).map(function(e){return n.labeledEvents[e]})),this.labeledEventToTriggerMap);try{for(var o=y(i),s=o.next();!s.done;s=o.next()){var a=s.value;Rw(a.actions,e,this.dataExtractor)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return e},e.prototype.update=function(e,t,r){this.groupedLabeledEvents=e,this.labeledEventToTriggerMap=t,this.options=r},e}();Ne(),Pi(),Ne(),Pi();var Dw=new Set(["id","class","style","value","onclick","onchange","oninput","onblur","onsubmit","onfocus","onkeydown","onkeyup","onkeypress","data-reactid","data-react-checksum","data-reactroot",pw,Rn]),Uw=["type"],Fw=["svg","path","g"],jw=["password","hidden"];function Bw(e,t){var r,n,i,o,s,a;if(null===e)return null;var l=String(e.tagName).toLowerCase(),u={tag:l},c=Array.from(null!==(o=null===(i=e.parentElement)||void 0===i?void 0:i.children)&&void 0!==o?o:[]);c.length&&(u.index=c.indexOf(e),u.indexOfType=c.filter(function(t){return t.tagName===e.tagName}).indexOf(e));var d=null===(a=null===(s=e.previousElementSibling)||void 0===s?void 0:s.tagName)||void 0===a?void 0:a.toLowerCase();d&&(u.prevSib=String(d));var h=e.getAttribute("id");h&&(u.id=String(h));var p=Array.from(e.classList);p.length&&(u.classes=p);var f={},g=Array.from(e.attributes).filter(function(e){return!Dw.has(e.name)}),v=!function(e){var t,r,n,i=null===(r=null===(t=null==e?void 0:e.tagName)||void 0===t?void 0:t.toLowerCase)||void 0===r?void 0:r.call(t),o=e instanceof HTMLElement&&"true"===(null===(n=e.getAttribute("contenteditable"))||void 0===n?void 0:n.toLowerCase());return!vw.includes(i)&&!o}(e);if(!jw.includes(String(e.getAttribute("type")))&&!Fw.includes(l))try{for(var m=y(g),b=m.next();!b.done;b=m.next()){var w=b.value;v&&!Uw.includes(w.name)||(t.has(w.name)?f[w.name]=Pn:f[w.name]=String(w.value).substring(0,128))}}catch(e){r={error:e}}finally{try{b&&!b.done&&(n=m.return)&&n.call(m)}finally{if(r)throw r.error}}return Object.keys(f).length&&(u.attrs=f),u}Ne();var qw,zw,Ww=function(){function e(e,t){this.value=e,this.optimized=t}return e.prototype.toString=function(){return this.value},e}(),Vw=function(e,t,r){var n,i;if(e.nodeType!==Node.ELEMENT_NODE)return null;var o=e.getAttribute("id");if(t){if(o)return new Ww(c(o),!0);var s=e.tagName.toLowerCase();if("body"===s||"head"===s||"html"===s)return new Ww(s,!0)}var a=e.tagName.toLowerCase();if(o)return new Ww(a+c(o),!0);var l=e.parentNode;if(!l||l.nodeType===Node.DOCUMENT_NODE)return new Ww(a,!0);function u(e){var t=e.getAttribute("class");return t?t.split(/\s+/g).filter(Boolean).map(function(e){return"$"+e}):[]}function c(e){return"#"+CSS.escape(e)}for(var d=u(e),h=!1,p=!1,f=-1,g=-1,v=l.children,m=0;v&&(-1===f||!p)&&m<v.length;++m){var b=v[m];if(b.nodeType===Node.ELEMENT_NODE)if(g+=1,b!==e){if(!p&&b.tagName.toLowerCase()===a){h=!0;var w=new Set(d);if(w.size)for(var S=u(b),k=0;k<S.length;++k){var x=S[k];if(w.has(x)&&(w.delete(x),!w.size)){p=!0;break}}else p=!0}}else f=g}var E=a;if(r&&"input"===a.toLowerCase()&&e.getAttribute("type")&&!e.getAttribute("id")&&!e.getAttribute("class")&&(E+="[type="+CSS.escape(e.getAttribute("type")||"")+"]"),p)E+=":nth-child("+String(f+1)+")";else if(h)try{for(var C=y(d),I=C.next();!I.done;I=C.next()){var O=I.value;E+="."+CSS.escape(O.slice(1))}}catch(e){n={error:e}}finally{try{I&&!I.done&&(i=C.return)&&i.call(C)}finally{if(n)throw n.error}}return new Ww(E,!1)},$w=function(){return function(e,t){var r,n,i,o=this;this.replaceSensitiveString=function(e){return Ln(e,o.additionalMaskTextPatterns)},this.getHierarchy=function(e){var t,r,n,i,s,a=performance.now();if(!e)return[];for(var l=function(e){var t=[];if(!e)return t;t.push(e);for(var r=e.parentElement;r&&"HTML"!==r.tagName;)t.push(r),r=r.parentElement;return t}(e),u=new Map,c=l.length-1;c>=0;c--){var d=l[c];if(d){var h=ww(d.getAttribute(pw)),p=c===l.length-1?[]:null!==(n=u.get(l[c+1]))&&void 0!==n?n:new Set,f=new Set(w(w([],b(p),!1),b(h),!1));u.set(d,f)}}s=l.map(function(e){var t;return Bw(e,null!==(t=u.get(e))&&void 0!==t?t:new Set)});var g=function(e){(null==e?void 0:e.attrs)&&Object.entries(e.attrs).forEach(function(t){var r=b(t,2),n=r[0],i=r[1];e.attrs&&(e.attrs[n]=o.replaceSensitiveString(i))})};try{for(var v=y(s),m=v.next();!m.done;m=v.next()){g(m.value)}}catch(e){t={error:e}}finally{try{m&&!m.done&&(r=v.return)&&r.call(v)}finally{if(t)throw t.error}}var S=performance.now();return null===(i=o.diagnosticsClient)||void 0===i||i.recordHistogram("autocapturePlugin.getHierarchy",S-a),s},this.getNearestLabel=function(e){var t,r=e.parentElement;if(!r)return"";try{t=r.querySelector(":scope>span,h1,h2,h3,h4,h5,h6")}catch(e){t=null}return t?o.getText(t):o.getNearestLabel(r)},this.getElementPath=function(e){var t;if(!e)return"";var r=performance.now(),n=function(e,t){if(e.nodeType!==Node.ELEMENT_NODE)return"";for(var r=[],n=e;n;){var i=Vw(n,Boolean(t),n===e);if(!i)break;if(r.push(i),i.optimized)break;n=n.parentElement}return r.reverse(),r.join(" > ")}(e),i=performance.now();return null===(t=o.diagnosticsClient)||void 0===t||t.recordHistogram("autocapturePlugin.getElementPath",i-r),n},this.getEventProperties=function(e,t,r){var n,i,s,a,l,u,c=null===(s=null===(i=null==t?void 0:t.tagName)||void 0===i?void 0:i.toLowerCase)||void 0===s?void 0:s.call(i),d="function"==typeof t.getBoundingClientRect?t.getBoundingClientRect():{left:null,top:null},h=o.getHierarchy(t),p=null===(a=h[0])||void 0===a?void 0:a.attrs,f=o.getNearestLabel(t),g=(l=null!=p?p:{},u=r,Object.entries(l).reduce(function(e,t){var r=b(t,2),n=r[0],i=r[1];if(n.startsWith(u)){var o=n.replace(u,"");o&&(e[o]=i||"")}return e},{})),v=((n={})["[Amplitude] Element Hierarchy"]=h,n[aw]=c,n[lw]=o.getText(t),n["[Amplitude] Element Position Left"]=null==d.left?null:Math.round(d.left),n["[Amplitude] Element Position Top"]=null==d.top?null:Math.round(d.top),n["[Amplitude] Element Attributes"]=g,n["[Amplitude] Element Path"]=o.getElementPath(t),n["[Amplitude] Element Parent Label"]=f,n[uw]=Mt(window.location.href.split("?")[0]),n["[Amplitude] Page Title"]=Dn(o.replaceSensitiveString),n[cw]=window.innerHeight,n[dw]=window.innerWidth,n),m=kw();if(m&&(v[hw]=m),v["[Amplitude] Element ID"]=t.getAttribute("id")||"",v["[Amplitude] Element Class"]=t.getAttribute("class"),v["[Amplitude] Element Aria Label"]=null==p?void 0:p["aria-label"],"a"===c&&"click"===e&&t instanceof HTMLAnchorElement){var y=t.href.substring(0,128);v["[Amplitude] Element Href"]=o.replaceSensitiveString(y)}return Sw(v)},this.addTypeAndTimestamp=function(e,t){return{event:e,timestamp:Date.now(),type:t}},this.addAdditionalEventProperties=function(e,t,r,n,i){void 0===i&&(i=!1);var s=o.addTypeAndTimestamp(e,t);if(function(e){return"click"===e.type||"change"===e.type}(s)&&null!==s.event.target){if(i)if(mw(s.event.target,s.type))return s.closestTrackedAncestor=s.event.target,s.targetElementProperties=o.getEventProperties(s.type,s.closestTrackedAncestor,n),s;var a=xw(s.event.target,r);return a&&(s.closestTrackedAncestor=a,s.targetElementProperties=o.getEventProperties(s.type,a,n)),s}return s},this.extractDataFromDataSource=function(e,t){if("DOM_ELEMENT"===e.sourceType){var r=function(e,t){try{if("DOM_ELEMENT"===e.sourceType){var r=document.documentElement;return e.scope&&t&&(r=t.closest(e.scope)),r&&e.selector?r.querySelector(e.selector):r}}catch(e){return}}(e,t);if(!r)return;return"TEXT"===e.elementExtractType?o.getText(r):"ATTRIBUTE"===e.elementExtractType&&e.attribute?r.getAttribute(e.attribute):void 0}},this.getTextWithMaskedDescendants=function(e){var t,r,n="[".concat(Rn,"], [contenteditable]");if(!e.querySelector(n))return e.innerText;var i="",s=Array.from(e.childNodes);try{for(var a=y(s),l=a.next();!l.done;l=a.next()){var u=l.value;u.nodeType!==Node.TEXT_NODE?u instanceof Element&&(u.hasAttribute(Rn)||u.hasAttribute("contenteditable")?i+=Pn:i+=o.getTextWithMaskedDescendants(u)):i+=u.textContent||""}}catch(e){t={error:e}}finally{try{l&&!l.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}return i},this.getText=function(e){if(null!==e.closest("[".concat(Rn,"]")))return Pn;var t="";return t=e.querySelector("[".concat(Rn,"], [contenteditable]"))?o.getTextWithMaskedDescendants(e):e.innerText||"",o.replaceSensitiveString(t.substring(0,255)).replace(/\s+/g," ").trim()},this.getEventTagProps=function(e){var t,r,n;if(!e)return{};var i=null===(n=null===(r=null==e?void 0:e.tagName)||void 0===r?void 0:r.toLowerCase)||void 0===n?void 0:n.call(r),s=((t={})[aw]=i,t[lw]=o.getText(e),t[uw]=window.location.href.split("?")[0],t);return Sw(s)},this.diagnosticsClient=null==t?void 0:t.diagnosticsClient;var s=null!==(i=e.maskTextRegex)&&void 0!==i?i:[],a=[];try{for(var l=y(s),u=l.next();!u.done;u=l.next()){var c=u.value;if(a.length>=25)break;if(c instanceof RegExp)a.push(c);else if("pattern"in c&&"string"==typeof c.pattern)try{a.push(new RegExp(c.pattern,"i"))}catch(e){}}}catch(e){r={error:e}}finally{try{u&&!u.done&&(n=l.return)&&n.call(l)}finally{if(r)throw r.error}}this.additionalMaskTextPatterns=a}}();Pi(),Pi(),Pi(),(zw=qw||(qw={})).ClickObservable="clickObservable",zw.ChangeObservable="changeObservable",zw.NavigateObservable="navigateObservable",zw.MutationObservable="mutationObservable",zw.ScrollObservable="scrollObservable",zw.ExposureObservable="exposureObservable",zw.BrowserErrorObservable="browserErrorObservable",zw.SelectionObservable="selectionObservable",zw.MouseMoveObservable="mouseMoveObservable";var Hw=function(e,r){var n,i,o,s,a,l,u,c,d,h,p,f;void 0===e&&(e={}),null==r||r.diagnosticsClient.setTag("plugin.autocapture.version",ow);var g=e.dataAttributePrefix,S=void 0===g?$r:g,k=e.visualTaggingOptions,x=void 0===k?{enabled:!0}:k;e.cssSelectorAllowlist=null!==(n=e.cssSelectorAllowlist)&&void 0!==n?n:Vr,e.actionClickAllowlist=null!==(i=e.actionClickAllowlist)&&void 0!==i?i:Hr,e.debounceTime=null!==(o=e.debounceTime)&&void 0!==o?o:0;var E=!1!==(null===(s=e.viewportContentUpdated)||void 0===s?void 0:s.enabled),C=null!==(u=null!==(l=null===(a=e.viewportContentUpdated)||void 0===a?void 0:a.exposureDuration)&&void 0!==l?l:e.exposureDuration)&&void 0!==u?u:Kr;e.viewportContentUpdated=t(t({},e.viewportContentUpdated),{exposureDuration:C}),e.pageUrlExcludelist=null===(c=e.pageUrlExcludelist)||void 0===c?void 0:c.reduce(function(e,t){if("string"==typeof t&&e.push(t),t instanceof RegExp&&e.push(t),"object"==typeof t&&null!==t&&"pattern"in t)try{e.push(new RegExp(t.pattern))}catch(r){return console.warn("Invalid regex pattern: ".concat(t.pattern),r),e}return e},[]);var I,O="@amplitude/plugin-autocapture-browser",T=[],A=new $w(e,r),R=new Set,P=new Set,_=function(){var t,r,n=$n(Tw().map(function(t){return A.addAdditionalEventProperties(t,"click",e.cssSelectorAllowlist,S)})),i=$n(new Un.default(function(t){var r,n=function(r){var n=A.addAdditionalEventProperties(r,"change",e.cssSelectorAllowlist,S);t.next(n)};return null===(r=de())||void 0===r||r.document.addEventListener("change",n,{capture:!0}),function(){var e;return null===(e=de())||void 0===e?void 0:e.document.removeEventListener("change",n)}}));window.navigation&&(r=$n(new Un.default(function(t){var r=function(r){var n=A.addAdditionalEventProperties(r,"navigate",e.cssSelectorAllowlist,S);t.next(n)};return window.navigation.addEventListener("navigate",r),function(){window.navigation.removeEventListener("navigate",r)}})));var o=$n(Ow().map(function(t){return A.addAdditionalEventProperties(t,"mutation",e.cssSelectorAllowlist,S)})),s=new Un.default(function(e){var t,r=function(t){e.next(t)};return null===(t=de())||void 0===t||t.addEventListener("scroll",r),function(){var e;null===(e=de())||void 0===e||e.removeEventListener("scroll",r)}}),a=function(e,t){return new Un.default(function(r){var n,i=de();if(!(null==i?void 0:i.IntersectionObserver))return function(){};var o=new IntersectionObserver(function(e){e.forEach(function(e){r.next(e)})},{root:null,rootMargin:"0px",threshold:1}),s=t.join(",");(null!==(n=null==i?void 0:i.document.querySelectorAll(s))&&void 0!==n?n:[]).forEach(function(e){o.observe(e)});var a=e.subscribe(function(e){return e.event.forEach(function(e){return e.addedNodes.forEach(function(e){e instanceof Element&&(e.matches(s)&&o.observe(e),e.querySelectorAll(s).forEach(function(e){o.observe(e)}))})})});return function(){a.unsubscribe(),o.disconnect()}})}(o,e.cssSelectorAllowlist);return(t={})[qw.ChangeObservable]=i,t[qw.ClickObservable]=n,t[qw.MutationObservable]=o,t[qw.NavigateObservable]=r,t[qw.ScrollObservable]=s,t[qw.ExposureObservable]=a,t},M=_w(Object.values(null!==(h=null===(d=e.pageActions)||void 0===d?void 0:d.labeledEvents)&&void 0!==h?h:{})),N=Mw(null!==(f=null===(p=e.pageActions)||void 0===p?void 0:p.triggers)&&void 0!==f?f:[]),L=function(e,t,r,n){return new Lw(e,t,r,n)}(M,N,A,e);return{name:O,type:"enrichment",setup:function(r,n){return v(void 0,void 0,void 0,function(){var i,o,s,a,l,u,c,d,h,p,f,g,v,y,k,D,U,F,j,B,q;return m(this,function(m){return"undefined"==typeof document||(i=!1,o={maxX:void 0,maxY:void 0},r.fetchRemoteConfig&&(r.remoteConfigClient?r.remoteConfigClient.subscribe("configs.analyticsSDK.pageActions","all",function(r){!function(r){var n,i;r&&(e.pageActions=t(t({},e.pageActions),r),M=_w(Object.values(null!==(n=e.pageActions.labeledEvents)&&void 0!==n?n:{})),N=Mw(null!==(i=e.pageActions.triggers)&&void 0!==i?i:[]),L.update(M,N,e))}(r)}):r.loggerProvider.debug("Remote config client is not provided, skipping remote config fetch")),s=bw(e,e.cssSelectorAllowlist),a=bw(e,e.actionClickAllowlist),l=_(),u=function(e){var t=e.amplitude,r=e.allObservables,n=e.shouldTrackEvent,i=e.evaluateTriggers;return r.clickObservable.filter(Ew).filter(function(e){return n("click",e.closestTrackedAncestor)}).map(function(e){return i(e)}).subscribe(function(e){null==t||t.track(sw,e.targetElementProperties)})}({allObservables:l,amplitude:n,shouldTrackEvent:s,evaluateTriggers:L.evaluate.bind(L)}),T.push(u),c=function(e){var t=e.amplitude,r=e.allObservables,n=e.getEventProperties,i=e.shouldTrackEvent,o=e.evaluateTriggers;return r.changeObservable.filter(Ew).filter(function(e){return i("change",e.closestTrackedAncestor)}).map(function(e){return o(e)}).subscribe(function(e){null==t||t.track("[Amplitude] Element Changed",n("change",e.closestTrackedAncestor))})}({allObservables:l,getEventProperties:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return A.getEventProperties.apply(A,w(w([],b(e),!1),[S],!1))},amplitude:n,shouldTrackEvent:s,evaluateTriggers:L.evaluate.bind(L)}),T.push(c),d=function(e){var t=e.amplitude,r=e.allObservables,n=e.options,i=e.getEventProperties,o=e.shouldTrackEvent,s=e.shouldTrackActionClick,a=r.clickObservable,l=r.mutationObservable,u=r.navigateObservable,c=a.filter(function(e){return!o("click",e.closestTrackedAncestor)}).map(function(e){var t=xw(e.event.target,n.actionClickAllowlist);return e.closestTrackedAncestor=t,null!==e.closestTrackedAncestor&&(e.targetElementProperties=i(e.type,e.closestTrackedAncestor)),e}).filter(Ew).filter(function(e){return s("click",e.closestTrackedAncestor)}),d=u?Vn(l,u):l,h=Vn(c,d),p=null,f=null;return Wn(h,function(e){if(p&&(clearTimeout(p),p=null),"click"===e.type)return f=e,p=setTimeout(function(){p=null,f=null},500),Promise.resolve(null);if(f){var t=f;return f=null,Promise.resolve(t)}return Promise.resolve(null)}).subscribe(function(e){e&&(null==t||t.track(sw,i("click",e.closestTrackedAncestor)))})}({allObservables:l,options:e,getEventProperties:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return A.getEventProperties.apply(A,w(w([],b(e),!1),[S],!1))},amplitude:n,shouldTrackEvent:s,shouldTrackActionClick:a}),d&&T.push(d),h=function(e){e.amplitude;var t=e.allObservables.scrollObservable,r={maxX:0,maxY:0},n=t.subscribe(function(){var e,t,n,i,o=de(),s=Math.floor(null!==(t=null!==(e=null==o?void 0:o.scrollX)&&void 0!==e?e:null==o?void 0:o.pageXOffset)&&void 0!==t?t:0),a=Math.floor(null!==(i=null!==(n=null==o?void 0:o.scrollY)&&void 0!==n?n:null==o?void 0:o.pageYOffset)&&void 0!==i?i:0);r.maxX=Math.max(r.maxX,s),r.maxY=Math.max(r.maxY,a)});return{unsubscribe:function(){n.unsubscribe()},getState:function(){return r},reset:function(){r.maxX=0,r.maxY=0}}}({allObservables:l,amplitude:n}),T.push(h),p={},f=de(),g=function(e){e&&i||(setTimeout(function(){i=!1},100),i=!0,function(e){var t,r,n,i,o,s,a=e.amplitude,l=e.scrollTracker,u=e.currentElementExposed,c=e.elementExposedForPage,d=e.exposureTracker,h=e.isPageEnd,p=e.lastScroll,f=l.getState(),g=de(),v=null!==(r=null==g?void 0:g.innerWidth)&&void 0!==r?r:0,m=null!==(n=null==g?void 0:g.innerHeight)&&void 0!==n?n:0,y=((t={})[uw]=Mt(null!==(s=null===(o=null===(i=null==g?void 0:g.location)||void 0===i?void 0:i.href)||void 0===o?void 0:o.split("?")[0])&&void 0!==s?s:""),t["[Amplitude] Max Page X"]=f.maxX+v,t["[Amplitude] Max Page Y"]=f.maxY+m,t[cw]=m,t[dw]=v,t["[Amplitude] Element Exposed"]=Array.from(u),t),b=kw();b&&(y[hw]=b),0!==u.size||f.maxX!==p.maxX||f.maxY!==p.maxY?(null==a||a.track("[Amplitude] Viewport Content Updated",y),p.maxX=f.maxX,p.maxY=f.maxY,u.clear(),h&&(l.reset(),c.clear(),null==d||d.reset())):h&&(l.reset(),c.clear(),null==d||d.reset())}({amplitude:n,scrollTracker:h,currentElementExposed:P,elementExposedForPage:R,exposureTracker:p.exposure,isPageEnd:e,lastScroll:o}))},v=function(e){!function(e,t,r,n){if(!t.has(e)){t.add(e),r.add(e);var i=Array.from(r);JSON.stringify(i).length>=18e3&&n(!1)}}(e,R,P,g)},E&&(p.exposure=function(e){var t=e.allObservables,r=e.onExposure,n=e.dataExtractor,i=e.exposureDuration,o=void 0===i?Kr:i,s=new Map,a=new Map,l=t.exposureObservable.subscribe(function(e){var t=e,i=t.target;if(t.isIntersecting){if(!s.get(i)){var l=setTimeout(function(){s.set(i,!0);var e=n.getElementPath(i);r(e),a.set(i,null)},o);a.set(i,l)}}else!t.isIntersecting&&t.intersectionRatio<1&&(l=a.get(i))&&(clearTimeout(l),a.set(i,null))});return{unsubscribe:function(){l.unsubscribe()},reset:function(){a.forEach(function(e){e&&clearTimeout(e)}),a.clear(),s.clear()}}}({allObservables:l,onExposure:v,dataExtractor:A,exposureDuration:C}),p.exposure&&T.push(p.exposure),y=function(){g(!0)},null==f||f.addEventListener("beforeunload",y),I=function(){null==f||f.removeEventListener("beforeunload",y)},T.push({unsubscribe:function(){return I()}}),(k=l[qw.NavigateObservable])?T.push(k.subscribe(function(){g(!0)})):f&&(D=function(){g(!0)},f.addEventListener("popstate",D),U=f.history.pushState,f.history&&U&&(f.history.pushState=new Proxy(U,{apply:function(e,t,r){var n=b(r,3),i=n[0],o=n[1],s=n[2];e.apply(t,[i,o,s]),g(!0)}})),T.push({unsubscribe:function(){f.removeEventListener("popstate",D),f.history&&U&&(f.history.pushState=U)}}))),null===(q=null==r?void 0:r.loggerProvider)||void 0===q||q.log("".concat(O," has been successfully added.")),window.opener&&x.enabled&&(F=e.cssSelectorAllowlist,j=e.actionClickAllowlist,function(e,t){var r=e;if(!0!==r[Cw]){r[Cw]=!0;var n=t.dataExtractor,i=t.isElementSelectable,o=t.cssSelectorAllowlist,s=t.actionClickAllowlist,a=null,l=function(t){e.notify({action:"element-selected",data:t})},u=function(t,r){"selector-mode-changed"===t?e.notify({action:"track-selector-mode-changed",data:r}):"selector-moved"===t&&e.notify({action:"track-selector-moved",data:r})};e.registerActionHandler("initialize-visual-tagging-selector",function(t){e.loadScriptOnce("https://cdn.amplitude.com/libs/visual-tagging-selector-1.0.0-alpha.js.gz").then(function(){var r;a=null===(r=null===window||void 0===window?void 0:window.amplitudeVisualTaggingSelector)||void 0===r?void 0:r.call(window,{getEventTagProps:n.getEventTagProps,isElementSelectable:function(e){return!i||i((null==t?void 0:t.actionType)||"click",e)},onTrack:u,onSelect:l,visualHighlightClass:"amp-visual-tagging-selector-highlight",messenger:e,cssSelectorAllowlist:o,actionClickAllowlist:s,extractDataFromDataSource:n.extractDataFromDataSource,dataExtractor:n,diagnostics:{autocapture:{version:ow}}}),e.notify({action:"selector-loaded"})}).catch(function(){var t;null===(t=e.logger)||void 0===t||t.warn("Failed to initialize visual tagging selector")})}),e.registerActionHandler("close-visual-tagging-selector",function(){var e;null===(e=null==a?void 0:a.close)||void 0===e||e.call(a)})}}(B=ai(),{dataExtractor:A,isElementSelectable:bw(e,w(w([],b(F),!1),b(j),!1)),cssSelectorAllowlist:F,actionClickAllowlist:j}),ci(B),B.setup(t({logger:null==r?void 0:r.loggerProvider},(null==r?void 0:r.serverZone)&&{endpoint:Jn[r.serverZone]})))),[2]})})},execute:function(e){return v(void 0,void 0,void 0,function(){return m(this,function(t){return[2,e]})})},teardown:function(){return v(void 0,void 0,void 0,function(){var e,t,r,n;return m(this,function(i){try{for(e=y(T),t=e.next();!t.done;t=e.next())t.value.unsubscribe()}catch(e){r={error:e}}finally{try{t&&!t.done&&(n=e.return)&&n.call(e)}finally{if(r)throw r.error}}return[2]})})}}};Ne(),Pi(),Ne(),Pi();var Kw=["mutation","navigate"];Ne(),Pi();var Gw=Zr,Jw=Yr,Qw=en;function Xw(e,t){var r,n,i,o,s=t.event,a=s.pageX,l=s.pageY;e.yMin=Math.min(null!==(r=e.yMin)&&void 0!==r?r:l,l),e.yMax=Math.max(null!==(n=e.yMax)&&void 0!==n?n:l,l),e.xMin=Math.min(null!==(i=e.xMin)&&void 0!==i?i:a,a),e.xMax=Math.max(null!==(o=e.xMax)&&void 0!==o?o:a,a),e.isOutOfBounds=e.yMax-e.yMin>Qw||e.xMax-e.xMin>Qw}function Yw(e){if(0===e.length)return null;var r=e[0],n=e[e.length-1];return{rageClickEvent:t({"[Amplitude] Begin Time":new Date(r.timestamp).toISOString(),"[Amplitude] End Time":new Date(n.timestamp).toISOString(),"[Amplitude] Duration":n.timestamp-r.timestamp,"[Amplitude] Clicks":e.map(function(e){return{X:e.event.pageX,Y:e.event.pageY,Time:e.timestamp}}),"[Amplitude] Click Count":e.length},r.targetElementProperties),time:r.timestamp}}function Zw(e){var t=this,r=e.amplitude,n=e.allObservables,i=e.shouldTrackRageClick,o=n.clickObservable,s=n.selectionObservable,a=[],l={},u=null;function c(e){a=[],l={},e&&(Xw(l,e),a.push(e))}var d=Wn(o.filter(function(e){return i("click",e.closestTrackedAncestor)}),function(e){return v(t,void 0,void 0,function(){var t;return m(this,function(r){return Xw(l,e),t=null,0===a.length||function(e,t){return e.length>0&&e[e.length-1].closestTrackedAncestor!==t.closestTrackedAncestor}(a,e)||function(e,t){var r=e[Math.max(0,e.length-Gw+1)];return t.timestamp-r.timestamp>=Jw}(a,e)||l.isOutOfBounds?(u&&(t=Yw(a)),c(e)):a.push(e),u&&(clearTimeout(u.timerId),u.resolve(t),u=null),a.length>=Gw?[2,new Promise(function(e){u={resolve:e,timerId:setTimeout(function(){e(Yw(a))},Jw)}})]:[2,null]})})}),h=null==s?void 0:s.subscribe(function(){c()}),p=d.subscribe(function(e){null!==e&&r.track("[Amplitude] Rage Click",e.rageClickEvent,{time:e.time})});return{unsubscribe:function(){p.unsubscribe(),null==h||h.unsubscribe()}}}Ne(),Pi();var eS,tS,rS,nS;Pi(),(tS=eS||(eS={})).INCREASING="increasing",tS.DECREASING="decreasing",(nS=rS||(rS={})).X="x",nS.Y="y";function iS(e){var t=e.changes,r=e.changesThreshold,n=e.thresholdMs;return!(t.length<r)&&t[t.length-1]-t[0]<n}function oS(e){e.changes=[],e.startTime=void 0}function sS(e){for(var t=e.changes,r=e.thresholdMs,n=0,i=t[t.length-1];n<t.length;n++){if(i-t[n]<r)break}0!==n&&(e.startTime=t[n],e.changes.splice(0,n))}var aS=function(e){var t=e.mouseDirectionChangeObservable,r=e.directionChanges,n=void 0===r?20:r,i=e.thresholdMs,o=void 0===i?2e3:i;return new Un.default(function(e){var r={changes:[],changesThreshold:n,thresholdMs:o},i={changes:[],changesThreshold:n,thresholdMs:o},s=void 0,a=null;function l(){void 0!==s&&(e.next(s),s=void 0,null!==a&&clearTimeout(a),oS(r),oS(i))}return t.subscribe(function(e){null!==a&&clearTimeout(a),function(e){var t=+Date.now();e.startTime=e.startTime||t;var r=e.changes,n=e.changesThreshold;r.push(t),r.length>n&&r.shift()}(e===rS.X?r:i);var t=function(e,t){var r=void 0;if(iS(e)&&(r=e.startTime),iS(t)){var n=t.startTime;n&&(!r||n<r)&&(r=n)}return r}(r,i);return t?(s=s||t,a=setTimeout(function(){l(),a=null},o)):l(),sS(r),sS(i),function(){null!==a&&(clearTimeout(a),a=null)}})})},lS=function(e){var t=e.amplitude,r=e.options,n=e.allObservables,i=e.directionChanges,o=void 0===i?20:i,s=e.thresholdMs,a=void 0===s?2e3:s,l=function(e){var t=e.allWindowObservables.mouseMoveObservable;return new Un.default(function(e){var r=null,n=null,i=null;return t.subscribe(function(t){var o={x:t.clientX,y:t.clientY};null!==r?(o.x>r.x?(n===eS.DECREASING&&e.next(rS.X),n=eS.INCREASING):o.x<r.x&&(n===eS.INCREASING&&e.next(rS.X),n=eS.DECREASING),o.y>r.y?(i===eS.DECREASING&&e.next(rS.Y),i=eS.INCREASING):o.y<r.y&&(i===eS.INCREASING&&e.next(rS.Y),i=eS.DECREASING),r=o):r=o})})}({allWindowObservables:n});return aS({mouseDirectionChangeObservable:l,directionChanges:o,thresholdMs:a}).subscribe(function(e){yw(r)&&t.track("[Amplitude] Thrashed Cursor",void 0,{time:e})})};function uS(e,t,r,n){if(!n)return[];var i=e[t];return"object"==typeof i&&null!==i&&"cssSelectorAllowlist"in i&&Array.isArray(i.cssSelectorAllowlist)?i.cssSelectorAllowlist:r}var cS=4e3,dS=function(e){var r;void 0===e&&(e={});var n="@amplitude/plugin-frustration-browser",i=[],o=!1!==e.errorClicks;e.errorClicks||(o=!1);var s=!1!==e.deadClicks&&null!==e.deadClicks,a=!1!==e.rageClicks&&null!==e.rageClicks,l=!1!==e.thrashedCursor&&null!==e.thrashedCursor;e.thrashedCursor||(l=!1);var u=uS(e,"rageClicks",Xr,a),c=uS(e,"deadClicks",Jr,s),d=uS(e,"errorClicks",Qr,o),h=null!==(r=e.dataAttributePrefix)&&void 0!==r?r:$r,p=new $w(e),f=w([],b(new Set(w(w(w([],b(u),!1),b(c),!1),b(d),!1))),!1),g=function(){var e,r,n=$n(Tw("pointerdown").map(function(e){return p.addAdditionalEventProperties(e,"click",f,h,!0)})),i=$n(Aw().map(function(e){return p.addTypeAndTimestamp(e,"error")})),o=$n(Ow().map(function(e){return p.addAdditionalEventProperties(e,"mutation",f,h)}));window.navigation&&(r=$n(new Un.default(function(e){var r=function(r){e.next(t(t({},r),{type:"navigate"}))};return window.navigation.addEventListener("navigate",r),function(){window.navigation.removeEventListener("navigate",r)}}).map(function(e){return p.addAdditionalEventProperties(e,"navigate",f,h)})));var s=$n(new Un.default(function(e){var t=function(){var t=document.activeElement;if(t&&("TEXTAREA"===t.tagName||"INPUT"===t.tagName)){try{if(t.selectionStart===t.selectionEnd)return}catch(e){return}return e.next()}var r=window.getSelection();if(r&&!r.isCollapsed)return e.next()};return window.document.addEventListener("selectionchange",t),function(){window.document.removeEventListener("selectionchange",t)}})),a=$n(new Un.default(function(e){var t=function(t){e.next(t)},r={capture:!0};return Iw.document.addEventListener("mousemove",t,r),function(){Iw.document.removeEventListener("mousemove",t,r)}}));return(e={})[qw.ClickObservable]=n,e[qw.MutationObservable]=o,e[qw.NavigateObservable]=r,e[qw.BrowserErrorObservable]=i,e[qw.SelectionObservable]=s,e[qw.MouseMoveObservable]=a,e};return{name:n,type:"enrichment",setup:function(r,f){return v(void 0,void 0,void 0,function(){var v,y,b,w,S,k,x,E,C,I,O;return m(this,function(m){return"undefined"==typeof document||(v=g(),a&&(y=bw(e,u),b=Zw({allObservables:v,amplitude:f,shouldTrackRageClick:y}),i.push(b)),s&&(w=bw(e,c),S=function(e){var r=e.amplitude,n=e.allObservables,i=e.getEventProperties,o=e.shouldTrackDeadClick,s=n.clickObservable,a=n.mutationObservable,l=n.navigateObservable,u=s.filter(function(e){return Ew(e)&&o("click",e.closestTrackedAncestor)&&e.event.target instanceof Element&&null===e.event.target.closest('a[target="_blank"]')&&e.event.button===fw.LEFT_OR_TOUCH_CONTACT}),c=l?Vn(a,l):a,d=Vn(u,c),h=null;return Wn(d,function(e){return h&&Kw.includes(e.type)?(clearTimeout(h),h=null,Promise.resolve(null)):"click"===e.type?h?Promise.resolve(null):new Promise(function(t){h=setTimeout(function(){t(e),h=null},3e3)}):Promise.resolve(null)}).subscribe(function(e){if(e){var n={"[Amplitude] X":e.event.clientX,"[Amplitude] Y":e.event.clientY};r.track("[Amplitude] Dead Click",t(t({},i("click",e.closestTrackedAncestor)),n),{time:e.timestamp})}})}({amplitude:f,allObservables:v,getEventProperties:function(e,t){return p.getEventProperties(e,t,h)},shouldTrackDeadClick:w}),i.push(S)),o&&(k=bw(e,d),x=function(e){var r=e.amplitude,n=e.allObservables,i=e.shouldTrackErrorClick,o=n.clickObservable,s=n.browserErrorObservable,a=o.filter(function(e){return Ew(e)&&i("click",e.closestTrackedAncestor)&&e.event.target instanceof Element&&null===e.event.target.closest('a[target="_blank"]')&&e.event.button===fw.LEFT_OR_TOUCH_CONTACT}),l=null,u=null,c=function(){null!==l&&(clearTimeout(l),l=null),u=null};return Vn(a,s).subscribe(function(e){var n;if("click"===e.type)return c(),u=e,void(l=setTimeout(c,2e3));"error"===e.type&&u&&(r.track("[Amplitude] Error Click",t(((n={})["[Amplitude] Kind"]=e.event.kind,n["[Amplitude] Message"]=e.event.message,n["[Amplitude] Stack"]=e.event.stack,n["[Amplitude] Filename"]=e.event.filename,n["[Amplitude] Line Number"]=e.event.lineNumber,n["[Amplitude] Column Number"]=e.event.columnNumber,n),u.targetElementProperties)),c())})}({amplitude:f,allObservables:v,shouldTrackErrorClick:k}),i.push(x)),l&&(E=void 0,C=void 0,"object"==typeof e.thrashedCursor&&(E=e.thrashedCursor.directionChanges,C=e.thrashedCursor.threshold,E&&E<5&&(r.loggerProvider.warn("'thrashedCursor.directionChanges' of ".concat(E," is below the minimum of ").concat(5,", setting to ").concat(5)),E=5),C&&C>cS&&(r.loggerProvider.warn("'thrashedCursor.threshold' of ".concat(C," is above the maximum of ").concat(cS,", setting to ").concat(cS)),C=cS)),I=lS({amplitude:f,options:e,allObservables:v,directionChanges:E,thresholdMs:C}),i.push(I)),null===(O=null==r?void 0:r.loggerProvider)||void 0===O||O.log("".concat(n," has been successfully added."))),[2]})})},execute:function(e){return v(void 0,void 0,void 0,function(){return m(this,function(t){return[2,e]})})},teardown:function(){return v(void 0,void 0,void 0,function(){var e,t,r,n;return m(this,function(o){try{for(e=y(i),t=e.next();!t.done;t=e.next())t.value.unsubscribe()}catch(e){r={error:e}}finally{try{t&&!t.done&&(n=e.return)&&n.call(e)}finally{if(r)throw r.error}}return[2]})})}}};Ne(),Ne();function hS(e,t){var r=e.startTime+e.duration;return t.filter(function(t){return t.startTime<r&&t.startTime+t.duration>e.startTime}).map(function(e){return e.name})}function pS(e,r){var n,i=hS(e,r),o=null!==(n=e.scripts)&&void 0!==n?n:[],s=o.map(function(e){return e.sourceURL}).filter(Boolean),a=o.map(function(e){return e.sourceFunctionName}).filter(Boolean),l=o.map(function(e){return e.sourceCharPosition}).filter(function(e){return"number"==typeof e&&e>=0}),u=o.map(function(e){return e.invokerType}).filter(Boolean),c=o.map(function(e){return e.invoker}).filter(Boolean);return t(t(t(t(t(t(t({"[Amplitude] Main Thread Block Source":"long-animation-frame","[Amplitude] Main Thread Block Duration":e.duration,"[Amplitude] Main Thread Block Blocking Duration":e.blockingDuration,"[Amplitude] Main Thread Block Start Time":e.startTime},i.length>0&&{"[Amplitude] Main Thread Block Measures":i}),{"[Amplitude] Main Thread Block Render Start":e.renderStart,"[Amplitude] Main Thread Block Style And Layout Start":e.styleAndLayoutStart,"[Amplitude] Main Thread Block Script Count":o.length}),s.length>0&&{"[Amplitude] Main Thread Block Script URLs":s}),a.length>0&&{"[Amplitude] Main Thread Block Script Functions":a}),l.length>0&&{"[Amplitude] Main Thread Block Script Positions":l}),u.length>0&&{"[Amplitude] Main Thread Block Invoker Types":u}),c.length>0&&{"[Amplitude] Main Thread Block Invokers":c})}function fS(e,r){var n,i=hS(e,r),o=null!==(n=e.attribution)&&void 0!==n?n:[];return t(t({"[Amplitude] Main Thread Block Source":"long-task","[Amplitude] Main Thread Block Duration":e.duration,"[Amplitude] Main Thread Block Blocking Duration":e.duration,"[Amplitude] Main Thread Block Start Time":e.startTime},i.length>0&&{"[Amplitude] Main Thread Block Measures":i}),o.length>0&&{"[Amplitude] Main Thread Block Attribution":o.map(function(e){return e.name})})}function gS(e){var t=e.amplitude,r=e.options,n=e.durationThreshold,i=void 0===n?100:n,o=function(){if("undefined"==typeof PerformanceObserver)return null;try{var e=PerformanceObserver.supportedEntryTypes;if(e.includes("long-animation-frame"))return"long-animation-frame";if(e.includes("longtask"))return"longtask"}catch(e){}return null}();if(!o)return{unsubscribe:function(){}};var s=[],a=new PerformanceObserver(function(e){var t,r,n=performance.now();try{for(var i=y(e.getEntries()),o=i.next();!o.done;o=i.next()){var a=o.value;s.push(a)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}for(var l=n-1e4;s.length>0&&s[0].startTime<l;)s.shift()});try{a.observe({entryTypes:["measure"]})}catch(e){}var l=new PerformanceObserver(function(e){var n,a;try{for(var l=y(e.getEntries()),u=l.next();!u.done;u=l.next()){var c=u.value;if(!yw(r))return;if(!(c.duration<i)){var d="long-animation-frame"===o?pS(c,s):fS(c,s);t.track("[Amplitude] Main Thread Block",d)}}}catch(e){n={error:e}}finally{try{u&&!u.done&&(a=l.return)&&a.call(l)}finally{if(n)throw n.error}}});try{l.observe({entryTypes:[o]})}catch(e){return a.disconnect(),{unsubscribe:function(){}}}return{unsubscribe:function(){l.disconnect(),a.disconnect()}}}var vS=function(e){void 0===e&&(e={});var t="@amplitude/plugin-performance-browser",r=[],n=!0===e.mainThreadBlock||"object"==typeof e.mainThreadBlock&&null!==e.mainThreadBlock;return{name:t,type:"enrichment",setup:function(i,o){return v(void 0,void 0,void 0,function(){var s,a,l;return m(this,function(u){return"undefined"==typeof document||(n&&(s=100,"object"==typeof e.mainThreadBlock&&void 0!==e.mainThreadBlock.durationThreshold&&(s=e.mainThreadBlock.durationThreshold),a=gS({amplitude:o,options:e,durationThreshold:s}),r.push(a)),null===(l=null==i?void 0:i.loggerProvider)||void 0===l||l.log("".concat(t," performance tracking has been successfully added."))),[2]})})},execute:function(e){return v(void 0,void 0,void 0,function(){return m(this,function(t){return[2,e]})})},teardown:function(){return v(void 0,void 0,void 0,function(){var e,t,n,i;return m(this,function(o){try{for(e=y(r),t=e.next();!t.done;t=e.next())t.value.unsubscribe()}catch(e){n={error:e}}finally{try{t&&!t.done&&(i=e.return)&&i.call(e)}finally{if(n)throw n.error}}return[2]})})}}};Ne(),Pi();var mS="[Amplitude] Network Request";Pi(),Ne(),Pi();var yS,bS,wS="500-599";function SS(e,t){var r="^"+t.replace(/[-[\]{}()+?.,\\^$|#\s]/g,"\\$&").replace(/\*/g,".*")+"$";return new RegExp(r).test(e)}function kS(e,t){var r,n,i=t.split(",");try{for(var o=y(i),s=o.next();!s.done;s=o.next()){var a=b(s.value.split("-").map(Number),2),l=a[0],u=a[1];if(e===l&&void 0===u)return!0;if(e>=l&&e<=u)return!0}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return!1}function xS(e){var t;if(e)try{var r=null===(t=de())||void 0===t?void 0:t.location.href,n=new URL(e,r),i=n.searchParams.toString(),o=n.hash.replace("#",""),s=n.href,a=n.host;return n.hash="",n.search="",{query:i,fragment:o,href:s,hrefWithoutQueryOrHash:n.href,host:a}}catch(e){return}}function ES(e){if("object"==typeof e&&null!==e){if(0!==e.length)return e}else{if(e)return w([],b(J),!1);if(void 0===e){return}}}function CS(e){var t,r,n;return!(null===(t=null==e?void 0:e.allowlist)||void 0===t?void 0:t.length)&&!(null===(r=null==e?void 0:e.blocklist)||void 0===r?void 0:r.length)&&!(null===(n=null==e?void 0:e.excludelist)||void 0===n?void 0:n.length)}function IS(e,t){var r;void 0===t&&(t={});var n=xS(e.url);if(!n)return!1;var i,o=n.host;if(!1!==t.ignoreAmplitudeRequests&&(SS(o,"*.amplitude.com")||SS(o,"amplitude.com")))return!1;if(null===(r=t.ignoreHosts)||void 0===r?void 0:r.find(function(e){return SS(o,e)}))return!1;if(!t.captureRules&&void 0!==e.status&&!kS(e.status,wS))return!1;if(t.captureRules&&(w([],b(t.captureRules),!1).reverse().find(function(t){if(i=function(e,t,r,n,i){if((!e.hosts||e.hosts.find(function(e){return SS(t,e)}))&&(!n||!e.urls||_t(n,e.urls))&&(!i||!e.methods||e.methods.find(function(e){return i.toLowerCase()===e.toLowerCase()||"*"===e})))return!((r||0===r)&&!kS(r,e.statusCodeRange||wS))}(t,o,e.status,e.url,e.method),i){var r=ES(t.responseHeaders);if(e.responseWrapper&&r){var n=e.responseWrapper.headers(r);n&&(e.responseHeaders=n)}var s=ES(t.requestHeaders);if(e.requestWrapper&&s){var a=e.requestWrapper.headers(s);a&&(e.requestHeaders=a)}if(e.responseWrapper&&t.responseBody&&!CS(t.responseBody)){var l=t.responseBody.excludelist||t.responseBody.blocklist;e.responseBodyJson=e.responseWrapper.json(t.responseBody.allowlist,l)}if(e.requestWrapper&&t.requestBody&&!CS(t.requestBody)){l=t.requestBody.excludelist||t.requestBody.blocklist;e.requestBodyJson=e.requestWrapper.json(t.requestBody.allowlist,l)}}return void 0!==i}),!i))return!1;return!e.requestWrapper||!function(e,t){if(e.includes("amplitude.com"))try{var r=t.body;if("string"!=typeof r)return!1;if(JSON.parse(r).events.find(function(e){return e.event_type===mS}))return!0}catch(e){}return!1}(o,e.requestWrapper)}function OS(e){var t=e.allObservables,r=e.networkTrackingOptions,n=e.amplitude,i=e.loggerProvider;return t.networkObservable.filter(function(e){return IS(e.event,r)}).subscribe(function(e){var t,r,o,s=e.event,a=xS(s.url);if(a){var l=null===(r=s.responseWrapper)||void 0===r?void 0:r.bodySize,u=null===(o=s.requestWrapper)||void 0===o?void 0:o.bodySize;!function(e,t,r,n){v(this,void 0,void 0,function(){var i,o,s;return m(this,function(a){switch(a.label){case 0:return t.requestBodyJson||t.responseBodyJson?[4,Promise.all([t.requestBodyJson,t.responseBodyJson])]:[3,2];case 1:if(i=b.apply(void 0,[a.sent(),2]),o=i[0],s=i[1],o)try{e["[Amplitude] Request Body"]=JSON.stringify(o)}catch(e){null==n||n.debug("Failed to stringify request body",e)}if(s)try{e["[Amplitude] Response Body"]=JSON.stringify(s)}catch(e){null==n||n.debug("Failed to stringify response body")}a.label=2;case 2:return null==r||r.track(mS,e),[2]}})})}(((t={})["[Amplitude] URL"]=a.hrefWithoutQueryOrHash,t["[Amplitude] URL Query"]=a.query,t["[Amplitude] URL Fragment"]=a.fragment,t["[Amplitude] Request Method"]=s.method,t["[Amplitude] Status Code"]=s.status,t["[Amplitude] Start Time"]=s.startTime,t["[Amplitude] Completion Time"]=s.endTime,t["[Amplitude] Duration"]=s.duration,t["[Amplitude] Request Body Size"]=u,t["[Amplitude] Response Body Size"]=l,t["[Amplitude] Request Type"]=s.type,t["[Amplitude] Request Headers"]=s.requestHeaders,t["[Amplitude] Response Headers"]=s.responseHeaders,t),s,n,i)}})}!function(e){e.NetworkObservable="networkObservable"}(yS||(yS={}));var TS=function(e){void 0===e&&(e={});var t,r="@amplitude/plugin-network-capture-browser",n=function(){var e,r=new Un.default(function(e){var r=new En(function(t){var r=function(e,t){return{event:e,timestamp:Date.now(),type:t}}(t,"network");e.next(r)});return In.subscribe(r,t),function(){In.unsubscribe(r)}});return(e={})[yS.NetworkObservable]=r,e};return{name:r,type:"enrichment",setup:function(i,o){return v(void 0,void 0,void 0,function(){var s;return m(this,function(a){return"undefined"==typeof document||(s=n(),t=null==i?void 0:i.loggerProvider,bS=OS({allObservables:s,networkTrackingOptions:e,amplitude:o,loggerProvider:t}),null==t||t.log("".concat(r," has been successfully added."))),[2]})})},execute:function(e){return v(void 0,void 0,void 0,function(){return m(this,function(t){return[2,e]})})},teardown:function(){return v(void 0,void 0,void 0,function(){return m(this,function(e){return bS.unsubscribe(),[2]})})}}};Ne(),Pi();var AS=-1,RS=e=>{addEventListener("pageshow",t=>{t.persisted&&(AS=t.timeStamp,e(t))},!0)},PS=(e,t,r,n)=>{let i,o;return s=>{var a,l;t.value>=0&&(s||n)&&(o=t.value-(null!=i?i:0),(o||void 0===i)&&(i=t.value,t.delta=o,t.rating=(a=t.value)>(l=r)[1]?"poor":a>l[0]?"needs-improvement":"good",e(t)))}},_S=e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))},MS=()=>{const e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},NS=()=>{var e;const t=MS();return null!=(e=null==t?void 0:t.activationStart)?e:0},LS=(e,t=-1)=>{const r=MS();let n="navigate";return AS>=0?n="back-forward-cache":r&&(document.prerendering||NS()>0?n="prerender":document.wasDiscarded?n="restore":r.type&&(n=r.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:`v5-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:n}},DS=new WeakMap;function US(e,t){return DS.get(e)||DS.set(e,new t),DS.get(e)}var FS,jS=class{constructor(){p(this,"t"),p(this,"i",0),p(this,"o",[])}h(e){var t;if(e.hadRecentInput)return;const r=this.o[0],n=this.o.at(-1);this.i&&r&&n&&e.startTime-n.startTime<1e3&&e.startTime-r.startTime<5e3?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),null==(t=this.t)||t.call(this,e)}},BS=(e,t,r={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){const n=new PerformanceObserver(e=>{Promise.resolve().then(()=>{t(e.getEntries())})});return n.observe({type:e,buffered:!0,...r}),n}}catch(e){}},qS=e=>{let t=!1;return()=>{t||(e(),t=!0)}},zS=-1,WS=new Set,VS=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,$S=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(const e of WS)e();isFinite(zS)||(zS="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",$S,!0))}},HS=()=>{var e;if(zS<0){const t=NS(),r=document.prerendering||null==(e=globalThis.performance.getEntriesByType("visibility-state").filter(e=>"hidden"===e.name&&e.startTime>t)[0])?void 0:e.startTime;zS=null!=r?r:VS(),addEventListener("visibilitychange",$S,!0),addEventListener("prerenderingchange",$S,!0),RS(()=>{setTimeout(()=>{zS=VS()})})}return{get firstHiddenTime(){return zS},onHidden(e){WS.add(e)}}},KS=e=>{document.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()},GS=[1800,3e3],JS=(e,t={})=>{KS(()=>{const r=HS();let n,i=LS("FCP");const o=BS("paint",e=>{for(const t of e)"first-contentful-paint"===t.name&&(o.disconnect(),t.startTime<r.firstHiddenTime&&(i.value=Math.max(t.startTime-NS(),0),i.entries.push(t),n(!0)))});o&&(n=PS(e,i,GS,t.reportAllChanges),RS(r=>{i=LS("FCP"),n=PS(e,i,GS,t.reportAllChanges),_S(()=>{i.value=performance.now()-r.timeStamp,n(!0)})}))})},QS=[.1,.25],XS=0,YS=1/0,ZS=0,ek=e=>{for(const t of e)t.interactionId&&(YS=Math.min(YS,t.interactionId),ZS=Math.max(ZS,t.interactionId),XS=ZS?(ZS-YS)/7+1:0)},tk=()=>{var e;return FS?XS:null!=(e=performance.interactionCount)?e:0},rk=0,nk=class{constructor(){p(this,"u",[]),p(this,"l",new Map),p(this,"m"),p(this,"p")}v(){rk=tk(),this.u.length=0,this.l.clear()}L(){const e=Math.min(this.u.length-1,Math.floor((tk()-rk)/50));return this.u[e]}h(e){var t,r;if(null==(t=this.m)||t.call(this,e),!e.interactionId&&"first-input"!==e.entryType)return;const n=this.u.at(-1);let i=this.l.get(e.interactionId);if(i||this.u.length<10||e.duration>n.P){if(i?e.duration>i.P?(i.entries=[e],i.P=e.duration):e.duration===i.P&&e.startTime===i.entries[0].startTime&&i.entries.push(e):(i={id:e.interactionId,entries:[e],P:e.duration},this.l.set(i.id,i),this.u.push(i)),this.u.sort((e,t)=>t.P-e.P),this.u.length>10){const e=this.u.splice(10);for(const t of e)this.l.delete(t.id)}null==(r=this.p)||r.call(this,i)}}},ik=e=>{const t=globalThis.requestIdleCallback||setTimeout;"hidden"===document.visibilityState?e():(e=qS(e),addEventListener("visibilitychange",e,{once:!0,capture:!0}),t(()=>{e(),removeEventListener("visibilitychange",e,{capture:!0})}))},ok=[200,500],sk=(e,t={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const r=HS();KS(()=>{var n;"interactionCount"in performance||FS||(FS=BS("event",ek,{type:"event",buffered:!0,durationThreshold:0}));let i,o=LS("INP");const s=US(t,nk),a=e=>{ik(()=>{for(const t of e)s.h(t);const t=s.L();t&&t.P!==o.value&&(o.value=t.P,o.entries=t.entries,i())})},l=BS("event",a,{durationThreshold:null!=(n=t.durationThreshold)?n:40});i=PS(e,o,ok,t.reportAllChanges),l&&(l.observe({type:"first-input",buffered:!0}),r.onHidden(()=>{a(l.takeRecords()),i(!0)}),RS(()=>{s.v(),o=LS("INP"),i=PS(e,o,ok,t.reportAllChanges)}))})},ak=class{constructor(){p(this,"m")}h(e){var t;null==(t=this.m)||t.call(this,e)}},lk=[2500,4e3],uk=[800,1800],ck=e=>{document.prerendering?KS(()=>ck(e)):"complete"!==document.readyState?addEventListener("load",()=>ck(e),!0):setTimeout(e)};function dk(e){var t,r=(null===(t=e.entries[0])||void 0===t?void 0:t.startTime)||0;return performance.timeOrigin+r}function hk(e){return{value:e.value,rating:e.rating,delta:e.delta,navigationType:e.navigationType,id:e.id,timestamp:Math.floor(dk(e)),navigationStart:Math.floor(performance.timeOrigin)}}var pk=function(){var e=null,t=de(),r=null==t?void 0:t.document,n=null==t?void 0:t.location;return{name:"web-vitals-browser",type:"enrichment",setup:function(t,i){return v(void 0,void 0,void 0,function(){var o,s;return m(this,function(a){return void 0===r||(o=Mt((null==n?void 0:n.href)||"",t.loggerProvider),s={"[Amplitude] Page Domain":(null==n?void 0:n.hostname)||"","[Amplitude] Page Location":o,"[Amplitude] Page Path":Mt((null==n?void 0:n.pathname)||"",t.loggerProvider),"[Amplitude] Page Title":"undefined"!=typeof document&&document.title||"","[Amplitude] Page URL":Mt(o.split("?")[0],t.loggerProvider)},((e,t={})=>{KS(()=>{const r=HS();let n,i=LS("LCP");const o=US(t,ak),s=e=>{t.reportAllChanges||(e=e.slice(-1));for(const t of e)o.h(t),t.startTime<r.firstHiddenTime&&(i.value=Math.max(t.startTime-NS(),0),i.entries=[t],n())},a=BS("largest-contentful-paint",s);if(a){n=PS(e,i,lk,t.reportAllChanges);const r=qS(()=>{s(a.takeRecords()),a.disconnect(),n(!0)}),o=e=>{e.isTrusted&&(ik(r),removeEventListener(e.type,o,{capture:!0}))};for(const e of["keydown","click","visibilitychange"])addEventListener(e,o,{capture:!0});RS(r=>{i=LS("LCP"),n=PS(e,i,lk,t.reportAllChanges),_S(()=>{i.value=performance.now()-r.timeStamp,n(!0)})})}})})(function(e){s["[Amplitude] LCP"]=hk(e)}),JS(function(e){s["[Amplitude] FCP"]=hk(e)}),sk(function(e){s["[Amplitude] INP"]=hk(e)}),((e,t={})=>{const r=HS();JS(qS(()=>{let n,i=LS("CLS",0);const o=US(t,jS),s=e=>{for(const t of e)o.h(t);o.i>i.value&&(i.value=o.i,i.entries=o.o,n())},a=BS("layout-shift",s);a&&(n=PS(e,i,QS,t.reportAllChanges),r.onHidden(()=>{s(a.takeRecords()),n(!0)}),RS(()=>{o.i=0,i=LS("CLS",0),n=PS(e,i,QS,t.reportAllChanges),_S(()=>n())}),setTimeout(n))}))})(function(e){s["[Amplitude] CLS"]=hk(e)}),((e,t={})=>{let r=LS("TTFB"),n=PS(e,r,uk,t.reportAllChanges);ck(()=>{const i=MS();i&&(r.value=Math.max(i.responseStart-NS(),0),r.entries=[i],n(!0),RS(()=>{r=LS("TTFB",0),n=PS(e,r,uk,t.reportAllChanges),n(!0)}))})})(function(e){s["[Amplitude] TTFB"]=hk(e)}),e=function(){"hidden"===r.visibilityState&&e&&(i.track("[Amplitude] Web Vitals",s),r.removeEventListener("visibilitychange",e),e=null)},r.addEventListener("visibilitychange",e)),[2]})})},execute:function(e){return v(void 0,void 0,void 0,function(){return m(this,function(t){return[2,e]})})},teardown:function(){return v(void 0,void 0,void 0,function(){return m(this,function(t){return e&&(null==r||r.removeEventListener("visibilitychange",e)),[2]})})}}};Ne(),Pi();var fk=function(){function e(e,r){var n,i,o;this.shouldTrackNewCampaign=!1,this.options=t({initialEmptyValue:"EMPTY",resetSessionOnNewCampaign:!1,excludeReferrers:(i=(null===(n=r.cookieOptions)||void 0===n?void 0:n.domain)||r.topLevelDomain,o=i,o?(o.startsWith(".")&&(o=o.substring(1)),[new RegExp("".concat(o.replace(".","\\."),"$"))]):[]),optOut:r.optOut},e),this.storage=r.cookieStorage,this.storageKey=Vt(r.apiKey,"MKTG"),this.webExpStorageKey=Vt(r.apiKey,"MKTG_ORIGINAL"),this.currentCampaign=G,this.sessionTimeout=r.sessionTimeout,this.lastEventTime=r.lastEventTime,this.logger=r.loggerProvider,this.topLevelDomain=r.topLevelDomain,r.loggerProvider.log("Installing web attribution tracking.")}return e.prototype.init=function(){return v(this,void 0,void 0,function(){var e,t;return m(this,function(r){switch(r.label){case 0:return this.options.optOut?[2]:[4,this.fetchCampaign()];case 1:return t=b.apply(void 0,[r.sent(),2]),this.currentCampaign=t[0],this.previousCampaign=t[1],e=!this.lastEventTime||It(this.sessionTimeout,this.lastEventTime),Mb(this.currentCampaign,this.previousCampaign,this.options,this.logger,e,this.topLevelDomain)?(this.shouldTrackNewCampaign=!0,[4,this.storage.set(this.storageKey,this.currentCampaign)]):[3,3];case 2:r.sent(),r.label=3;case 3:return[2]}})})},e.prototype.fetchCampaign=function(){return v(this,void 0,void 0,function(){var e;return m(this,function(t){switch(t.label){case 0:return[4,this.storage.get(this.webExpStorageKey)];case 1:return(e=t.sent())?[4,this.storage.remove(this.webExpStorageKey)]:[3,3];case 2:t.sent(),t.label=3;case 3:return[4,Promise.all([e||(new An).parse(),this.storage.get(this.storageKey)])];case 4:return[2,t.sent()]}})})},e.prototype.generateCampaignEvent=function(e){this.shouldTrackNewCampaign=!1;var r,n,i,o,s=(r=this.currentCampaign,n=this.options,i=t(t({},G),r),o=Object.entries(i).reduce(function(e,t){var r,i=b(t,2),o=i[0],s=i[1];return e.setOnce("initial_".concat(o),null!==(r=null!=s?s:n.initialEmptyValue)&&void 0!==r?r:"EMPTY"),s?e.set(o,s):e.unset(o)},new Z),me(o));return e&&(s.event_id=e),s},e.prototype.shouldSetSessionIdOnNewCampaign=function(){return this.shouldTrackNewCampaign&&!!this.options.resetSessionOnNewCampaign},e}();Ne(),Pi();var gk=new Set([k.IDENTIFY,k.GROUP_IDENTIFY]),vk=function(e){var r;void 0===e&&(e={});var n,i,o,s,a,l,u=null!==(r=e.fallbackAttributionEvent)&&void 0!==r&&r,c=de(),d={},h=!1,p=!1,f=function(){return v(void 0,void 0,void 0,function(){var e;return m(this,function(t){switch(t.label){case 0:return[4,(new An).parse()];case 1:return e=t.sent(),d=Dt(e),u&&(null==i||i.log("Tracking attribution fallback event."),null==n||n.track("[Amplitude] Attribution",d)),[2]}})})},g=function(){f()},y=function(e){return new Proxy(e,{apply:function(e,t,r){Reflect.apply(e,t,r),h&&g()}})};return{name:"@amplitude/plugin-event-property-attribution-browser",type:"enrichment",setup:function(e,t){return v(void 0,void 0,void 0,function(){return m(this,function(r){switch(r.label){case 0:return n=t,i=e.loggerProvider,h=!0,i.log("Installing event property attribution tracking."),[4,f()];case 1:if(r.sent(),!c)return[2];if(c.addEventListener("popstate",g),!p){if(o=Reflect.get(c.history,"pushState"),s=Reflect.get(c.history,"replaceState"),!o||!s)return[2];a=y(o),c.history.pushState=a,l=y(s),c.history.replaceState=l,p=!0}return[2]}})})},execute:function(e){return v(void 0,void 0,void 0,function(){return m(this,function(r){return gk.has(e.event_type)||(e.event_properties=t(t({},d),e.event_properties)),[2,e]})})},teardown:function(){return v(void 0,void 0,void 0,function(){var e,t;return m(this,function(r){return c&&(c.removeEventListener("popstate",g),e=Reflect.get(c.history,"pushState"),t=Reflect.get(c.history,"replaceState"),p&&e===a&&o&&(c.history.pushState=o),p&&t===l&&s&&(c.history.replaceState=s)),h=!1,p=!1,o=void 0,s=void 0,a=void 0,l=void 0,d={},[2]})})}}};Ne(),Pi();var mk,yk,bk="AMP_CURRENT_PAGE",wk="AMP_PREVIOUS_PAGE",Sk="AMP_URL_INFO";(yk=mk||(mk={})).Direct="direct",yk.Internal="internal",yk.External="external";var kk=new Set([k.IDENTIFY,k.GROUP_IDENTIFY,k.REVENUE]),xk=function(e){var r=(void 0===e?{}:e).internalDomains,n=void 0===r?[]:r,i=de(),o=void 0,s=!1,a=void 0,l=!1,u=!1,c=function(e){var t;try{var r=Mt(e,a);t=new URL(r).hostname}catch(e){null==a||a.error("Could not parse URL: ",e)}return t},d=function(e){var t="undefined"!=typeof location&&location.hostname||"",r=e?c(e):void 0;if(!r)return mk.Direct;var i=n.some(function(e){return-1!==t.indexOf(e)}),o=n.some(function(e){return-1!==r.indexOf(e)});return t===r||o&&i?mk.Internal:mk.External},h=function(){return v(void 0,void 0,void 0,function(){var e,t,r,n,i;return m(this,function(a){switch(a.label){case 0:return o&&s?[4,o.get(Sk)]:[3,3];case 1:return e=a.sent(),t=Mt("undefined"!=typeof location&&location.href||""),r=(null==e?void 0:e[bk])||"",n=void 0,n=t===r?(null==e?void 0:e[wk])||"":r||(document.referrer||""),[4,o.set(Sk,(i={},i[bk]=t,i[wk]=n,i))];case 2:a.sent(),a.label=3;case 3:return[2]}})})},p=function(){h()};return{name:"@amplitude/plugin-page-url-enrichment-browser",type:"enrichment",setup:function(e,t){return v(void 0,void 0,void 0,function(){var t,r,n,d,f,g,v,y;return m(this,function(m){switch(m.label){case 0:if((a=e.loggerProvider).log("Installing @amplitude/plugin-page-url-enrichment-browser"),u=!0,!i)return[3,7];try{o=new $t(i.sessionStorage)}catch(e){null==a||a.debug("sessionStorage is not available in this environment.")}return[4,null==o?void 0:o.isEnabled()];case 1:return s=null!==(y=m.sent())&&void 0!==y&&y,o&&s?(t="undefined"!=typeof document&&document.referrer||"",r=t?c(t):void 0,n="undefined"!=typeof location&&location.hostname||"",d=Mt("undefined"!=typeof location&&location.href||""),[4,o.get(Sk)]):[3,6];case 2:return f=m.sent(),g=(null==f?void 0:f[bk])||"",!!r&&r!==n&&g!==d?[4,o.set(Sk,(v={},v[bk]=d,v[wk]=t,v))]:[3,4];case 3:return m.sent(),[3,6];case 4:return[4,h()];case 5:m.sent(),m.label=6;case 6:i.addEventListener("popstate",p),l||(i.history.pushState=new Proxy(i.history.pushState,{apply:function(e,t,r){var n=b(r,3),i=n[0],o=n[1],s=n[2];e.apply(t,[i,o,s]),u&&p()}}),i.history.replaceState=new Proxy(i.history.replaceState,{apply:function(e,t,r){var n=b(r,3),i=n[0],o=n[1],s=n[2];e.apply(t,[i,o,s]),u&&p()}}),l=!0),m.label=7;case 7:return[2]}})})},execute:function(e){return v(void 0,void 0,void 0,function(){var r,n,i;return m(this,function(a){switch(a.label){case 0:return r=Mt("undefined"!=typeof location&&location.href||""),o&&s?[4,o.get(Sk)]:[3,2];case 1:if(n=a.sent(),i=(null==n?void 0:n[wk])||"",kk.has(e.event_type))return[2,e];e.event_properties=t(t({},e.event_properties||{}),{"[Amplitude] Page Domain":Ek(e,"[Amplitude] Page Domain","undefined"!=typeof location&&location.hostname||""),"[Amplitude] Page Location":Ek(e,"[Amplitude] Page Location",r),"[Amplitude] Page Path":Ek(e,"[Amplitude] Page Path","undefined"!=typeof location&&Mt(location.pathname)||""),"[Amplitude] Page Title":Ek(e,"[Amplitude] Page Title",Dn(Ln)),"[Amplitude] Page URL":Ek(e,"[Amplitude] Page URL",r.split("?")[0]),"[Amplitude] Previous Page Location":i,"[Amplitude] Previous Page Type":d(i)}),a.label=2;case 2:return[2,e]}})})},teardown:function(){return v(void 0,void 0,void 0,function(){return m(this,function(e){switch(e.label){case 0:return i&&(i.removeEventListener("popstate",p),u=!1),o&&s?[4,o.set(Sk,{})]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}})})}}};function Ek(e,t,r){return e.event_properties||(e.event_properties={}),void 0===e.event_properties[t]?r:e.event_properties[t]}Ne();var Ck=function(){var e,t,r;function n(t){if(t)try{var r=new Function("return "+t)();if("function"==typeof r)return r;null==e||e.error("Custom enrichment body did not evaluate to a function")}catch(t){null==e||e.error("Could not create custom enrichment function",t)}return function(e){return e}}return{name:"@amplitude/plugin-custom-enrichment-browser",type:"enrichment",setup:function(i,o){return v(void 0,void 0,void 0,function(){var o,s;return m(this,function(a){return null==(e=i.loggerProvider)||e.log("Installing @amplitude/plugin-custom-enrichment-browser"),(null===(s=i.remoteConfig)||void 0===s?void 0:s.fetchRemoteConfig)&&(i.remoteConfigClient?(o=i.remoteConfigClient.subscribe("configs.analyticsSDK.browserSDK.customEnrichment","all",function(e){r=e&&function(e){return"object"==typeof e&&null!==e&&"body"in e&&"string"==typeof e.body}(e)?n(e.body||""):n("")}),t=function(){var e;return null===(e=i.remoteConfigClient)||void 0===e?void 0:e.unsubscribe(o)}):null==e||e.debug("Remote config client is not provided, skipping remote config fetch")),[2]})})},execute:function(t){return v(void 0,void 0,void 0,function(){var n;return m(this,function(i){if(r)try{return[2,null!==(n=r(t))&&void 0!==n?n:null]}catch(r){return null==e||e.error("Could not execute custom enrichment function",r),[2,t]}return[2,t]})})},teardown:function(){return v(void 0,void 0,void 0,function(){return m(this,function(e){return t&&t(),[2]})})}}};Ne();var Ik,Ok="userProperty",Tk="eventProperty",Ak=function(e){return e===Ok||e===Tk},Rk=function(e,t){return function(e){var t=w([],b(new Set((Array.isArray(e)?e:[e]).filter(Ak))),!1);return t.length>0?t:[Ok]}(e.trackingMethod).includes(t)},Pk=function(e){return Rk(e,Ok)},_k=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return t._diagnosticsSampleRate=0,t}return f(r,e),r.prototype.init=function(e,r,n){var i,o;return void 0===e&&(e=""),arguments.length>2?(i=r,o=n):"string"==typeof r?(i=r,o=void 0):(i=null==r?void 0:r.userId,o=r),Se(this._init(t(t({},o),{userId:i,apiKey:e})))},r.prototype._init=function(r){var n,i,o,s,a,l,u,c;return v(this,void 0,void 0,function(){var d,h,p,f,y,b,w,S,k,x,E,C,I,O,T,A=this;return m(this,function(R){switch(R.label){case 0:return this.initializing?[2]:(this.initializing=!0,d=function(e){var t,r;return void 0===e&&(e={}),!0===(null===(t=e.remoteConfig)||void 0===t?void 0:t.fetchRemoteConfig)||!1!==(null===(r=e.remoteConfig)||void 0===r?void 0:r.fetchRemoteConfig)&&!1!==e.fetchRemoteConfig}(r),h=null!==(n=r.loggerProvider)&&void 0!==n?n:new Te,r.loggerProvider||h.enable(null!==(i=r.logLevel)&&void 0!==i?i:Ie.Warn),p=null!==(o=r.serverZone)&&void 0!==o?o:"US",y=this._diagnosticsSampleRate,b=null===(s=r.enableDiagnostics)||void 0===s||s,d?(f=new Ar(r.apiKey,h,p,null===(a=r.remoteConfig)||void 0===a?void 0:a.serverUrl),[4,new Promise(function(e){null==f||f.subscribe("configs.diagnostics.browserSDK","all",function(t,r,n){if(h.debug("Diagnostics remote configuration received:",JSON.stringify({remoteConfig:t,source:r,lastFetch:n},null,2)),t){var i=t.sampleRate;"number"!=typeof i||isNaN(i)||(y=i);var o=t.enabled;"boolean"==typeof o&&(b=o)}e()})})]):[3,2]);case 1:R.sent(),R.label=2;case 2:return(w=new rr(r.apiKey,h,p,{enabled:b,sampleRate:y})).setTag("library","".concat(ob,"/").concat(ib)),"undefined"!=typeof navigator&&w.setTag("user_agent",navigator.userAgent),[4,qb(r.apiKey,r,this,w,{loggerProvider:h,serverZone:p,enableDiagnostics:b,diagnosticsSampleRate:y})];case 3:return S=R.sent(),d&&f?[4,new Promise(function(e){null==f||f.subscribe("configs.analyticsSDK.browserSDK","all",function(t,r,n){S.loggerProvider.debug("Remote configuration received:",JSON.stringify({remoteConfig:t,source:r,lastFetch:n},null,2)),t&&iw(t,S),e()})})]:[3,5];case 4:R.sent(),R.label=5;case 5:return[4,e.prototype._init.call(this,S)];case 6:return R.sent(),this.logBrowserOptions(S),this.config.remoteConfigClient=f,M=this.config,k=Vy(M.defaultTracking)&&M.defaultTracking&&"object"==typeof M.defaultTracking&&M.defaultTracking.attribution&&"object"==typeof M.defaultTracking.attribution?t({},M.defaultTracking.attribution):{},Vy(this.config.defaultTracking)&&Pk(k)?(this.config.optOut&&this.timeline.addOptOutListener(function(e){return v(A,void 0,void 0,function(){return m(this,function(t){switch(t.label){case 0:return e?[3,2]:(this.webAttribution=new fk(k,this.config),[4,this.webAttribution.init()]);case 1:t.sent(),t.label=2;case 2:return[2]}})})}),this.webAttribution=new fk(k,this.config),[4,this.webAttribution.init()]):[3,8];case 7:R.sent(),R.label=8;case 8:return x=Rt(),E=x.ampTimestamp?Number(x.ampTimestamp):void 0,C=!E||Date.now()<E,I=C&&!Number.isNaN(Number(x.ampSessionId))?Number(x.ampSessionId):void 0,-1!==(O=this.config.deferredSessionId)||this.config.optOut||(O=Date.now()),this.setSessionId(null!==(c=null!==(u=null!==(l=r.sessionId)&&void 0!==l?l:I)&&void 0!==u?u:O)&&void 0!==c?c:this.config.sessionId),this.config.optOut&&this.timeline.addOptOutListener(function(e){return v(A,void 0,void 0,function(){return m(this,function(t){return!e&&this.config.deferredSessionId&&(-1===this.config.deferredSessionId?this.setSessionId(void 0):this.setSessionId(this.config.deferredSessionId)),[2]})})}),(T=kt(r.instanceName)).identityStore.setIdentity({userId:this.config.userId,deviceId:this.config.deviceId}),this.config.offline===Wr?[3,10]:[4,this.add(tw()).promise];case 9:R.sent(),R.label=10;case 10:return[4,this.add(new at({diagnosticsClient:w})).promise];case 11:return R.sent(),[4,this.add(new sb).promise];case 12:return R.sent(),[4,this.add(new Ct).promise];case 13:return R.sent(),function(e){ew||void 0!==e.defaultTracking||(e.loggerProvider.warn("`options.defaultTracking` is set to undefined. This implicitly configures your Amplitude instance to track Page Views, Sessions, File Downloads, and Form Interactions. You can suppress this warning by explicitly setting a value to `options.defaultTracking`. The value must either be a boolean, to enable and disable all default events, or an object, for advanced configuration. For example:\n\namplitude.init(<YOUR_API_KEY>, {\n defaultTracking: true,\n});\n\nVisit https://www.docs.developers.amplitude.com/data/sdks/browser-2/#tracking-default-events for more details."),ew=!0)}(this.config),_=this.config.defaultTracking,Wy(_,"fileDownloads")?(this.config.loggerProvider.debug("Adding file download tracking plugin"),[4,this.add(Zb()).promise]):[3,15];case 14:R.sent(),R.label=15;case 15:return $y(this.config.defaultTracking)?(this.config.loggerProvider.debug("Adding form interaction plugin"),[4,this.add(Qb()).promise]):[3,17];case 16:R.sent(),R.label=17;case 17:return Hy(this.config.defaultTracking)?this.config.optOut?[3,19]:(this.config.loggerProvider.debug("Adding page view tracking plugin"),[4,this.add(Hb(tb(this.config))).promise]):[3,20];case 18:return R.sent(),[3,20];case 19:this.timeline.addOptOutListener(function(e){return v(A,void 0,void 0,function(){return m(this,function(t){switch(t.label){case 0:return e?[2]:(this.config.loggerProvider.debug("Adding page view tracking plugin"),[4,this.add(Hb(tb(this.config))).promise]);case 1:return t.sent(),[2]}})})}),R.label=20;case 20:return Vy(this.config.defaultTracking)&&function(e){return Rk(e,Tk)}(k)?(this.config.loggerProvider.debug("Adding event property attribution plugin"),[4,this.add(vk(k)).promise]):[3,22];case 21:R.sent(),R.label=22;case 22:return Jy(this.config.autocapture)?(this.config.loggerProvider.debug("Adding user interactions plugin (autocapture plugin)"),[4,this.add(Hw(Yy(this.config),{diagnosticsClient:w})).promise]):[3,24];case 23:R.sent(),R.label=24;case 24:return Qy(this.config.autocapture)?(this.config.loggerProvider.debug("Adding frustration interactions plugin"),[4,this.add(dS(Zy(this.config))).promise]):[3,26];case 25:R.sent(),R.label=26;case 26:return Gy(this.config.autocapture)?(this.config.loggerProvider.debug("Adding network tracking plugin"),[4,this.add(TS(eb(this.config))).promise]):[3,28];case 27:R.sent(),R.label=28;case 28:return function(e){return"boolean"==typeof e?e:"object"==typeof e&&!0===e.webVitals}(this.config.autocapture)?(this.config.loggerProvider.debug("Adding web vitals plugin"),[4,this.add(pk()).promise]):[3,30];case 29:R.sent(),R.label=30;case 30:return function(e){return"object"==typeof e&&(!0===e.performanceTracking||"object"==typeof e.performanceTracking)}(this.config.autocapture)?(this.config.loggerProvider.debug("Adding performance tracking plugin"),[4,this.add(vS(Xy(this.config))).promise]):[3,32];case 31:R.sent(),R.label=32;case 32:return function(e){return Wy(e,"pageUrlEnrichment")}(this.config.autocapture)?(this.config.loggerProvider.debug("Adding referrer page url plugin"),[4,this.add(xk()).promise]):[3,34];case 33:R.sent(),R.label=34;case 34:return("boolean"==typeof(P=this.config.customEnrichment)?P:"object"==typeof P&&null!==P&&!1!==P.enabled)?(this.config.loggerProvider.debug("Adding custom enrichment plugin"),[4,this.add(Ck()).promise]):[3,36];case 35:R.sent(),R.label=36;case 36:return this.initializing=!1,[4,this.runQueuedFunctions("dispatchQ")];case 37:return R.sent(),T.eventBridge.setEventReceiver(function(e){var t=e.eventProperties||{},r=t.time,n=g(t,["time"]),i="number"==typeof r?{time:r}:void 0;A.track(e.eventType,n,i)}),[2]}var P,_,M})})},r.prototype.getUserId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.userId},r.prototype.setUserId=function(e){this.config?(this.config.loggerProvider.debug("function setUserId: ",e),e===this.config.userId&&void 0!==e||(this.config.userId=e,this.timeline.onIdentityChanged({userId:e}),xt(e,this.config.instanceName))):this.q.push(this.setUserId.bind(this,e))},r.prototype.getDeviceId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.deviceId},r.prototype.setDeviceId=function(e){this.config?(this.config.loggerProvider.debug("function setDeviceId: ",e),e!==this.config.deviceId&&(this.config.deviceId=e,this.timeline.onIdentityChanged({deviceId:e}),Et(e,this.config.instanceName))):this.q.push(this.setDeviceId.bind(this,e))},r.prototype.reset=function(){this.setDeviceId(fe()),this.setUserId(void 0),this.timeline.onReset()},r.prototype.getIdentity=function(){var e,t;return{deviceId:null===(e=this.config)||void 0===e?void 0:e.deviceId,userId:null===(t=this.config)||void 0===t?void 0:t.userId,userProperties:this.userProperties}},r.prototype.setIdentity=function(e){var t,r,n;if("userId"in e&&this.setUserId(e.userId),"deviceId"in e&&e.deviceId&&this.setDeviceId(e.deviceId),"userProperties"in e){this.userProperties=e.userProperties;var i=new Z,o=null!==(n=e.userProperties)&&void 0!==n?n:{};try{for(var s=y(Object.entries(o)),a=s.next();!a.done;a=s.next()){var l=b(a.value,2),u=l[0],c=l[1];i.set(u,c)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}this.identify(i)}},r.prototype.getOptOut=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.optOut},r.prototype.getSessionId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.sessionId},r.prototype.setSessionId=function(e){var t,r=[];if(!this.config)return this.q.push(this.setSessionId.bind(this,e)),Se(Promise.resolve());if(this.config.optOut)return this.config.deferredSessionId=null!=e?e:-1,Se(Promise.resolve());if(void 0===e&&(e=Date.now()),e===this.config.sessionId)return Se(Promise.resolve());this.config.loggerProvider.debug("function setSessionId: ",e);var n=this.getSessionId();n!==e&&this.timeline.onSessionIdChanged(e);var i=this.config.lastEventTime,o=null!==(t=this.config.lastEventId)&&void 0!==t?t:-1;this.config.sessionId=e,this.config.lastEventTime=void 0,this.config.pageCounter=0,Ky(this.config.defaultTracking)&&(n&&i&&r.push(this.track(Sb,void 0,{device_id:this.previousSessionDeviceId,event_id:++o,session_id:n,time:i+1,user_id:this.previousSessionUserId}).promise),this.config.lastEventTime=this.config.sessionId);var s=this.trackCampaignEventIfNeeded(++o,r);return this.config.identify&&r.push(this.track(me(this.config.identify)).promise),Ky(this.config.defaultTracking)&&r.push(this.track(wb,void 0,{event_id:s?++o:o,session_id:this.config.sessionId,time:this.config.lastEventTime}).promise),this.previousSessionDeviceId=this.config.deviceId,this.previousSessionUserId=this.config.userId,Se(Promise.all(r))},r.prototype.extendSession=function(){this.config?this.config.lastEventTime=Date.now():this.q.push(this.extendSession.bind(this))},r.prototype.setTransport=function(e){this.config?this.config.transportProvider=Wb(e):this.q.push(this.setTransport.bind(this,e))},r.prototype.identify=function(t,r){if(nb(t)){var n=t._q;t._q=[],t=rb(new Z,n)}return(null==r?void 0:r.user_id)&&this.setUserId(r.user_id),(null==r?void 0:r.device_id)&&this.setDeviceId(r.device_id),e.prototype.identify.call(this,t,r)},r.prototype.groupIdentify=function(t,r,n,i){if(nb(n)){var o=n._q;n._q=[],n=rb(new Z,o)}return e.prototype.groupIdentify.call(this,t,r,n,i)},r.prototype.revenue=function(t,r){if(nb(t)){var n=t._q;t._q=[],t=rb(new xe,n)}return e.prototype.revenue.call(this,t,r)},r.prototype.trackCampaignEventIfNeeded=function(e,t){if(!this.webAttribution||!this.webAttribution.shouldTrackNewCampaign||!Pk(this.webAttribution.options))return!1;var r=this.webAttribution.generateCampaignEvent(e);return t?t.push(this.track(r).promise):this.track(r),this.config.loggerProvider.log("Tracking attribution."),!0},r.prototype.process=function(t){return v(this,void 0,void 0,function(){var r,n,i;return m(this,function(o){return r=Date.now(),n=It(this.config.sessionTimeout,this.config.lastEventTime),i=this.webAttribution&&this.webAttribution.shouldSetSessionIdOnNewCampaign(),t.event_type===wb||t.event_type===Sb||t.session_id&&t.session_id!==this.getSessionId()||(n||i?(this.setSessionId(r),i&&this.config.loggerProvider.log("Created a new session for new campaign.")):n||this.trackCampaignEventIfNeeded()),[2,e.prototype.process.call(this,t)]})})},r.prototype.logBrowserOptions=function(e){try{var r=t(t({},e),{apiKey:e.apiKey.substring(0,10)+"********"});this.config.loggerProvider.debug("Initialized Amplitude with BrowserConfig:",Kn(r))}catch(e){this.config.loggerProvider.error("Error logging browser config",e)}},r.prototype._setDiagnosticsSampleRate=function(e){e>1||e<0||this.config||(this._diagnosticsSampleRate=e)},r}(ke);Ik=new _k,it(Ik.init.bind(Ik),"init",tt(Ik),nt(Ik,["config"])),it(Ik.add.bind(Ik),"add",tt(Ik),nt(Ik,["config.apiKey","timeline.plugins"])),it(Ik.remove.bind(Ik),"remove",tt(Ik),nt(Ik,["config.apiKey","timeline.plugins"])),it(Ik.track.bind(Ik),"track",tt(Ik),nt(Ik,["config.apiKey","timeline.queue.length"])),it(Ik.logEvent.bind(Ik),"logEvent",tt(Ik),nt(Ik,["config.apiKey","timeline.queue.length"])),it(Ik.identify.bind(Ik),"identify",tt(Ik),nt(Ik,["config.apiKey","timeline.queue.length"])),it(Ik.groupIdentify.bind(Ik),"groupIdentify",tt(Ik),nt(Ik,["config.apiKey","timeline.queue.length"])),it(Ik.setGroup.bind(Ik),"setGroup",tt(Ik),nt(Ik,["config.apiKey","timeline.queue.length"])),it(Ik.revenue.bind(Ik),"revenue",tt(Ik),nt(Ik,["config.apiKey","timeline.queue.length"])),it(Ik.flush.bind(Ik),"flush",tt(Ik),nt(Ik,["config.apiKey","timeline.queue.length"])),it(Ik.getUserId.bind(Ik),"getUserId",tt(Ik),nt(Ik,["config","config.userId"])),it(Ik.setUserId.bind(Ik),"setUserId",tt(Ik),nt(Ik,["config","config.userId"])),it(Ik.getDeviceId.bind(Ik),"getDeviceId",tt(Ik),nt(Ik,["config","config.deviceId"])),it(Ik.setDeviceId.bind(Ik),"setDeviceId",tt(Ik),nt(Ik,["config","config.deviceId"])),it(Ik.reset.bind(Ik),"reset",tt(Ik),nt(Ik,["config","config.userId","config.deviceId"])),it(Ik.getSessionId.bind(Ik),"getSessionId",tt(Ik),nt(Ik,["config"])),it(Ik.setSessionId.bind(Ik),"setSessionId",tt(Ik),nt(Ik,["config"])),it(Ik.extendSession.bind(Ik),"extendSession",tt(Ik),nt(Ik,["config"])),it(Ik.setOptOut.bind(Ik),"setOptOut",tt(Ik),nt(Ik,["config"])),it(Ik.setTransport.bind(Ik),"setTransport",tt(Ik),nt(Ik,["config"])),it(Ik.getIdentity.bind(Ik),"getIdentity",tt(Ik),nt(Ik,["config"])),it(Ik.setIdentity.bind(Ik),"setIdentity",tt(Ik),nt(Ik,["config","config.userId","config.deviceId"])),it(Ik.getOptOut.bind(Ik),"getOptOut",tt(Ik),nt(Ik,["config"])),it(Ik._setDiagnosticsSampleRate.bind(Ik),"_setDiagnosticsSampleRate",tt(Ik),nt(Ik,["config"]));Pi();Ne(),Pi(),Pi(),Ne(),Pi(),Pi();var Mk,Nk,Lk="[Amplitude]",Dk="".concat(Lk," Session Replay ID"),Uk=zr.US,Fk={enabled:!0},jk=1e3,Bk="".concat(Lk," Session Replay Debug"),qk="amp-mask",zk="amp-unmask",Wk="https://api-sr.amplitude.com/sessions/v2/track",Vk="https://api-sr.eu.amplitude.com/sessions/v2/track",$k="https://api-sr.stag2.amplitude.com/sessions/v2/track",Hk=("".concat(E,"_replay_unsent"),7e5),Kk=9e6,Gk=/payload.*exceed/i,Jk=500,Qk=1e4,Xk=1024,Yk="amplitude-sr-iframe";(Nk=Mk||(Mk={})).GET_SR_PROPS="get-sr-props",Nk.DEBUG_INFO="debug-info",Nk.FETCH_REQUEST="fetch-request",Nk.METADATA="metadata",Nk.TARGETING_DECISION="targeting-decision",Nk.REPLAY_GATE_DECISION="replay-gate-decision";var Zk=function(){function e(e){this.logger=e,this.log=this.getSafeMethod("log"),this.warn=this.getSafeMethod("warn"),this.error=this.getSafeMethod("error"),this.debug=this.getSafeMethod("debug")}return e.prototype.getSafeMethod=function(e){var t;if(!this.logger)return function(){};var r=this.logger[e];return"function"==typeof r?(null!==(t=r.__rrweb_original__)&&void 0!==t?t:r).bind(this.logger):function(){}},e.prototype.enable=function(e){this.logger.enable(e)},e.prototype.disable=function(){this.logger.disable()},e}();Ne(),Pi();var ex="medium";function tx(e,t){return t||("STAGING"===e?$k:"EU"===e?Vk:Wk)}var rx=function(e,t,r){switch(t){case"light":if("input"!==e)return!1;var n=r?function(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?t.toLowerCase():null}(r):"";return!!n&&(!!["password","hidden","email","tel"].includes(n)||!!r.autocomplete.startsWith("cc-"));case"medium":return"input"===e;case"conservative":return!0;default:return rx(e,ex,r)}},nx=function(e,t){var r,n,i;if(e&&t.urlMaskLevels)try{for(var o=y(t.urlMaskLevels),s=o.next();!s.done;s=o.next()){var a=s.value;if(ux(a.match).test(e))return a.maskLevel}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return null!==(i=t.defaultMaskLevel)&&void 0!==i?i:ex},ix=function(e,t,r,n){var i,o;if(void 0===t&&(t={defaultMaskLevel:ex}),r){if(r.closest("."+qk))return!0;if((null!==(i=t.maskSelector)&&void 0!==i?i:[]).some(function(e){return r.closest(e)}))return!0;if(r.closest("."+zk))return!1;if((null!==(o=t.unmaskSelector)&&void 0!==o?o:[]).some(function(e){return r.closest(e)}))return!1}return rx(e,nx(n,t),r)},ox=function(e,t,r){return function(n,i){return ix(e,t,i,null==r?void 0:r())?n.replace(/[^\s]/g,"*"):n}},sx=function(e,t){return function(r,n,i){var o;if("style"===r)return n;if(!(null!==(o=null==e?void 0:e.maskAttributes)&&void 0!==o?o:[]).includes(r))return n;var s=["INPUT","SELECT","TEXTAREA"].includes(i.tagName)?"input":"text";return ix(s,e,i,null==t?void 0:t())?n.replace(/[^\s]/g,"*"):n}},ax=function(){var e=de();return(null==e?void 0:e.location)?e.location.href:""},lx=new Map,ux=function(e){var t=lx.get(e);if(t)return t;var r="\0TRAIL\0",n="\0MID\0",i="\0DS\0",o="\0ST\0",s="\0QU\0",a=e;a=(a=(a=(a=(a=(a=(a=(a=(a=(a=(a=a.replace(/\/\*\*$/,r)).replace(/\/\*\*\//g,n)).replace(/\*\*/g,i)).replace(/\*/g,o)).replace(/\?/g,s)).replace(/[.+^${}()|[\]\\]/g,"\\$&")).split(r).join("(/.*)?")).split(n).join("/(.*\\/)?")).split(i).join(".*")).split(o).join(".*")).split(s).join(".");var l=new RegExp("^".concat(a,"$"));return lx.set(e,l),l},cx=function(e,t){var r,n;try{for(var i=y(t),o=i.next();!o.done;o=i.next()){var s=o.value,a=ux(s.selector);if(a.test(e))return e.replace(a,s.replacement)}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return e},dx=function(){return v(void 0,void 0,void 0,function(){var e,t,r,n,i,o,s;return m(this,function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),(e=de())?[4,e.navigator.storage.estimate()]:[3,2];case 1:return t=a.sent(),r=t.usage,n=t.quota,i=t.usageDetails,o=r?Math.round(r/Xk):0,s=r&&n?Math.round(1e3*(r/n+Number.EPSILON))/1e3:0,[2,{totalStorageSize:o,percentOfQuota:s,usageDetails:JSON.stringify(i)}];case 2:return[3,4];case 3:return a.sent(),[3,4];case 4:return[2,{totalStorageSize:0,percentOfQuota:0,usageDetails:""}]}})})},hx=function(e){var r=t({},e),n=r.apiKey;return r.apiKey="****".concat(n.substring(n.length-4)),r},px=function(){return{flushMaxRetries:2,logLevel:Ie.Warn,loggerProvider:new Te,transportProvider:new ir}},fx=function(e){function r(r,n){var i,o,s,a,l,u,c,d,h,p,f=this,g=px();if((f=e.call(this,t(t({transportProvider:g.transportProvider,loggerProvider:new Zk(n.loggerProvider||g.loggerProvider)},n),{apiKey:r}))||this).flushMaxRetries=void 0!==n.flushMaxRetries&&n.flushMaxRetries<=g.flushMaxRetries?n.flushMaxRetries:g.flushMaxRetries,f.apiKey=r,f.sampleRate=n.sampleRate||0,f.serverZone=n.serverZone||Uk,f.configServerUrl=n.configServerUrl,f.trackServerUrl=n.trackServerUrl,f.shouldInlineStylesheet=n.shouldInlineStylesheet,f.version=n.version,f.performanceConfig=n.performanceConfig||Fk,f.storeType=null!==(i=n.storeType)&&void 0!==i?i:"memory",f.applyBackgroundColorToBlockedElements=null!==(o=n.applyBackgroundColorToBlockedElements)&&void 0!==o&&o,f.enableUrlChangePolling=null!==(s=n.enableUrlChangePolling)&&void 0!==s&&s,f.urlChangePollingInterval=null!==(a=n.urlChangePollingInterval)&&void 0!==a?a:jk,f.captureDocumentTitle=null!==(l=n.captureDocumentTitle)&&void 0!==l&&l,void 0!==n.fullSnapshotIntervalMs&&(f.fullSnapshotIntervalMs=n.fullSnapshotIntervalMs),f.privacyConfig=t(t({},null!==(u=n.privacyConfig)&&void 0!==u?u:{}),{unmaskSelector:Array.from(new Set(w([".".concat(zk)],b(null!==(d=null===(c=n.privacyConfig)||void 0===c?void 0:c.unmaskSelector)&&void 0!==d?d:[]),!1)))}),n.interactionConfig&&(f.interactionConfig=n.interactionConfig,f.interactionConfig.ugcFilterRules&&function(e){if(!e.every(function(e){return"string"==typeof e.selector&&"string"==typeof e.replacement}))throw new Error("ugcFilterRules must be an array of objects with selector and replacement properties");if(!e.every(function(e){return"string"==typeof(t=e.selector)&&""!==t.trim()&&!!/^\/|^https?:\/\/[^\s]+$/.test(t);var t}))throw new Error("ugcFilterRules must be an array of objects with valid globs")}(f.interactionConfig.ugcFilterRules)),n.debugMode&&(f.debugMode=n.debugMode),void 0!==n.useWebWorker)f.useWebWorker=n.useWebWorker;else{var v=n;void 0!==(null===(h=v.experimental)||void 0===h?void 0:h.useWebWorker)&&(f.useWebWorker=v.experimental.useWebWorker)}return f.captureAdoptedStyleSheets=null===(p=n.captureAdoptedStyleSheets)||void 0===p||p,n.crossOriginIframes&&(f.crossOriginIframes=n.crossOriginIframes),n.flushIntervalConfig&&(f.flushIntervalConfig=function(e,t){var r,n,i={};void 0!==e.minIntervalMs&&(!Number.isFinite(e.minIntervalMs)||e.minIntervalMs<gx?(t.warn("flushIntervalConfig.minIntervalMs ".concat(e.minIntervalMs," is below floor ").concat(gx,"ms; clamping.")),i.minIntervalMs=gx):i.minIntervalMs=e.minIntervalMs);void 0!==e.maxIntervalMs&&(Number.isNaN(e.maxIntervalMs)||e.maxIntervalMs<gx?(t.warn("flushIntervalConfig.maxIntervalMs ".concat(e.maxIntervalMs," is below floor ").concat(gx,"ms; clamping.")),i.maxIntervalMs=gx):i.maxIntervalMs=e.maxIntervalMs);if(void 0!==i.minIntervalMs||void 0!==i.maxIntervalMs){var o=null!==(r=i.minIntervalMs)&&void 0!==r?r:Jk,s=null!==(n=i.maxIntervalMs)&&void 0!==n?n:Qk;s<o&&(void 0===i.maxIntervalMs?(t.warn("flushIntervalConfig.minIntervalMs (".concat(o,") exceeds the default maxIntervalMs (").concat(Qk,"); raising max to match min.")),i.maxIntervalMs=o):void 0===i.minIntervalMs?(t.warn("flushIntervalConfig.maxIntervalMs (".concat(s,") is below the default minIntervalMs (").concat(Jk,"); lowering min to match max.")),i.minIntervalMs=s):(t.warn("flushIntervalConfig.maxIntervalMs (".concat(i.maxIntervalMs,") is less than minIntervalMs (").concat(i.minIntervalMs,"); raising max to match min.")),i.maxIntervalMs=i.minIntervalMs))}return i}(n.flushIntervalConfig,f.loggerProvider)),f}return f(r,e),r}(Re),gx=100;Ne(),Pi();var vx=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(vx||{}),mx=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(mx||{}),yx=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(yx||{});Ne(),Pi();var bx=function(){function e(e,t){this.localConfig=t,this.remoteConfigClient=e}return e.prototype.generateJoinedConfig=function(){var e,r,n,i,o,s,a;return v(this,void 0,void 0,function(){var l,u,c,d,h,p,f,g,v,S,k,x,E,C,I,O,T,A=this;return m(this,function(m){switch(m.label){case 0:(l=t({},this.localConfig)).optOut=this.localConfig.optOut,l.captureEnabled=!0,m.label=1;case 1:return m.trys.push([1,3,,4]),[4,new Promise(function(e,t){A.remoteConfigClient.subscribe("configs.sessionReplay",{timeout:1500},function(r,n){var i;if(A.localConfig.loggerProvider.debug("Session Replay remote configuration received from ".concat(n,":"),JSON.stringify(r,null,2)),r){var o=r,s=o.sr_sampling_config,a=o.sr_privacy_config,c=o.sr_targeting_config,d=null===(i=l.interactionConfig)||void 0===i?void 0:i.ugcFilterRules;l.interactionConfig=o.sr_interaction_config,l.interactionConfig&&d&&(l.interactionConfig.ugcFilterRules=d),l.loggingConfig=o.sr_logging_config,(s||a||c)&&(u={},s&&(u.sr_sampling_config=s),a&&(u.sr_privacy_config=a),c&&(u.sr_targeting_config=c)),e()}else t(new Error("No remote config received"))})})];case 2:return m.sent(),[3,4];case 3:return c=m.sent(),this.localConfig.loggerProvider.error("Failed to generate joined config: ",c),l.captureEnabled=!1,[2,{localConfig:this.localConfig,joinedConfig:l,remoteConfig:void 0}];case 4:if(!u)return[2,{localConfig:this.localConfig,joinedConfig:l,remoteConfig:u}];if(d=u.sr_sampling_config,h=u.sr_privacy_config,p=u.sr_targeting_config,d&&Object.keys(d).length>0?(Object.prototype.hasOwnProperty.call(d,"capture_enabled")?l.captureEnabled=d.capture_enabled:l.captureEnabled=!1,Object.prototype.hasOwnProperty.call(d,"sample_rate")&&(l.sampleRate=d.sample_rate),Object.prototype.hasOwnProperty.call(d,"min_session_duration_ms")&&(l.minSessionDurationMs=this.sanitizeMinSessionDurationMs(d.min_session_duration_ms))):(l.captureEnabled=!0,this.localConfig.loggerProvider.debug("Remote config successfully fetched, but no values set for project, Session Replay capture enabled.")),h){f=null!==(e=l.privacyConfig)&&void 0!==e?e:{},g={defaultMaskLevel:null!==(n=null!==(r=h.defaultMaskLevel)&&void 0!==r?r:f.defaultMaskLevel)&&void 0!==n?n:"medium",blockSelector:[],maskSelector:[],unmaskSelector:[],maskAttributes:w([],b(new Set(w(w([],b(null!==(i=f.maskAttributes)&&void 0!==i?i:[]),!1),b(null!==(o=h.maskAttributes)&&void 0!==o?o:[]),!1))),!1),urlMaskLevels:w(w([],b(null!==(s=h.urlMaskLevels)&&void 0!==s?s:[]),!1),b(null!==(a=f.urlMaskLevels)&&void 0!==a?a:[]),!1)},v=function(e){var t,r,n,i,o,s,a,l,u,c={};"string"==typeof e.blockSelector&&(e.blockSelector=[e.blockSelector]);try{for(var d=y(null!==(a=e.blockSelector)&&void 0!==a?a:[]),h=d.next();!h.done;h=d.next()){c[h.value]="block"}}catch(e){t={error:e}}finally{try{h&&!h.done&&(r=d.return)&&r.call(d)}finally{if(t)throw t.error}}try{for(var p=y(null!==(l=e.maskSelector)&&void 0!==l?l:[]),f=p.next();!f.done;f=p.next()){c[f.value]="mask"}}catch(e){n={error:e}}finally{try{f&&!f.done&&(i=p.return)&&i.call(p)}finally{if(n)throw n.error}}try{for(var g=y(null!==(u=e.unmaskSelector)&&void 0!==u?u:[]),v=g.next();!v.done;v=g.next()){c[v.value]="unmask"}}catch(e){o={error:e}}finally{try{v&&!v.done&&(s=g.return)&&s.call(g)}finally{if(o)throw o.error}}return c},S=t(t({},v(f)),v(h));try{for(k=y(Object.entries(S)),x=k.next();!x.done;x=k.next())E=b(x.value,2),C=E[0],"mask"===(I=E[1])?g.maskSelector.push(C):"block"===I?g.blockSelector.push(C):"unmask"===I&&g.unmaskSelector.push(C)}catch(e){O={error:e}}finally{try{x&&!x.done&&(T=k.return)&&T.call(k)}finally{if(O)throw O.error}}l.privacyConfig=(R=g,P=this.localConfig.loggerProvider,_=document.createDocumentFragment(),M=function(e){if(void 0===e&&(e=[]),"string"==typeof e&&(e=[e]),0!==(e=e.filter(function(e){try{_.querySelector(e)}catch(t){return P.warn('[session-replay-browser] omitting selector "'.concat(e,'" because it is invalid')),!1}return!0})).length)return e},R.blockSelector=M(R.blockSelector),R.maskSelector=M(R.maskSelector),R.unmaskSelector=M(R.unmaskSelector),R)}return p&&Object.keys(p).length>0&&(l.targetingConfig=p),this.localConfig.loggerProvider.debug(JSON.stringify({name:"session replay joined config",config:hx(l)},null,2)),[2,{localConfig:this.localConfig,joinedConfig:l,remoteConfig:u}]}var R,P,_,M})})},e.prototype.sanitizeMinSessionDurationMs=function(e){if("number"==typeof e&&Number.isFinite(e)){if(!(e<0))return e>wx?(this.localConfig.loggerProvider.warn("min_session_duration_ms remote value ".concat(e," exceeds ").concat(wx,"ms ceiling; clamping.")),wx):e;this.localConfig.loggerProvider.warn("min_session_duration_ms remote value is negative (".concat(e,"); ignoring."))}else this.localConfig.loggerProvider.warn("min_session_duration_ms remote value is not a finite number (got ".concat(String(e),"); ignoring."))},e}(),wx=6e4,Sx=function(e,t){return v(void 0,void 0,void 0,function(){var r,n;return m(this,function(i){return r=new fx(e,t),n=new Ar(e,r.loggerProvider,r.serverZone,t.configServerUrl),[2,new bx(n,r)]})})};function kx(e){if(e.type!==vx.IncrementalSnapshot)return!1;var t=e.data;return t.source===mx.Mutation&&!t.isAttachIframe}function xx(e){var r,n,i,o,s=e[0],a=new Map,l=new Map,u=new Map,c=new Map,d=new Map;e.forEach(function(e,t){var r,n,i,o,s=e.data;try{for(var h=y(s.adds),p=h.next();!p.done;p=h.next()){var f=p.value;a.has(f.node.id)||a.set(f.node.id,t),l.set(f.node.id,t),d.set(f.node.id,f.parentId)}}catch(e){r={error:e}}finally{try{p&&!p.done&&(n=h.return)&&n.call(h)}finally{if(r)throw r.error}}try{for(var g=y(s.removes),v=g.next();!v.done;v=g.next()){var m=v.value;u.has(m.id)||u.set(m.id,t),c.set(m.id,t)}}catch(e){i={error:e}}finally{try{v&&!v.done&&(o=g.return)&&o.call(g)}finally{if(i)throw i.error}}});var h=new Set,p=new Set;try{for(var f=y(a),g=f.next();!g.done;g=f.next()){var v=b(g.value,2),m=v[0],w=v[1],S=u.get(m);if(void 0!==S)l.get(m)>=c.get(m)||(w<S?h.add(m):S<w&&p.add(m))}}catch(e){r={error:e}}finally{try{g&&!g.done&&(n=f.return)&&n.call(f)}finally{if(r)throw r.error}}var k=new Set;if(h.size>0||p.size>0)for(var x=!0;x;){x=!1;try{for(var E=(i=void 0,y(d)),C=E.next();!C.done;C=E.next()){var I=b(C.value,2),O=I[0],T=I[1];if(!h.has(O)&&!p.has(O)&&!k.has(O)&&(h.has(T)||p.has(T)||k.has(T))){var A=u.get(O),R=a.get(O);void 0!==A&&void 0!==R&&A<R?p.add(O):void 0!==A&&void 0!==R&&A===R?k.add(O):h.add(O),x=!0}}}catch(e){i={error:e}}finally{try{C&&!C.done&&(o=E.return)&&o.call(E)}finally{if(i)throw i.error}}}var P=h.size>0||p.size>0||k.size>0,_=[];e.forEach(function(e,t){var r,n;try{for(var i=y(e.data.removes),o=i.next();!o.done;o=i.next()){var s=o.value;h.has(s.id)||(p.has(s.id)&&t>=a.get(s.id)||k.has(s.id)&&(h.has(s.parentId)||p.has(s.parentId)||k.has(s.parentId))||_.push(s))}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}});var M=e.flatMap(function(e){return e.data.adds}),N=e.flatMap(function(e){return e.data.texts}),L=e.flatMap(function(e){return e.data.attributes}),D={source:mx.Mutation,removes:_,adds:P?M.filter(function(e){return!h.has(e.node.id)&&!p.has(e.node.id)&&!k.has(e.node.id)}):M,texts:P?N.filter(function(e){return!h.has(e.id)&&!p.has(e.id)&&!k.has(e.id)}):N,attributes:P?L.filter(function(e){return!h.has(e.id)&&!p.has(e.id)&&!k.has(e.id)}):L};return t(t({},s),{data:D})}function Ex(e){if(e.length<=1)return e;for(var t=[],r=0;r<e.length;)if(kx(e[r])){for(var n=r+1;n<e.length&&kx(e[n]);)n++;t.push(n>r+1?xx(e.slice(r,n)):e[r]),r=n}else t.push(e[r]),r++;return t}Ne(),Pi(),Ne();var Cx=function(){function e(e,t,r,n,i){var o,s=this;this.taskQueue=[],this.pendingQueue=[],this.isProcessing=!1,this.compressEvent=function(e){var t=e,r=t.type,n=t.timestamp,i=t.delay,o=t.data;return null!=i?JSON.stringify({type:r,timestamp:n,delay:i,data:o}):JSON.stringify({type:r,timestamp:n,data:o})},this.addCompressedEventToManager=function(e,t){var r=new Blob([e]).size;r>Kk?s.config.loggerProvider.warn("Session replay event dropped: serialized size ".concat(Math.round(r/1024)," KB exceeds maximum allowed event size. If this recurs, please open a GitHub issue at https://github.com/amplitude/Amplitude-TypeScript/issues or contact Amplitude support.")):s.eventsManager&&s.deviceId&&s.eventsManager.addEvent({event:{type:"replay",data:e},sessionId:t,deviceId:s.deviceId})},this.addCompressedEvent=function(e,t){if(s.worker)try{s.worker.postMessage({event:e,sessionId:t})}catch(r){"DataCloneError"===r.name?s.worker.postMessage(JSON.stringify({event:e,sessionId:t})):s.config.loggerProvider.warn("Unexpected error while posting message to worker:",r)}else{var r=s.compressEvent(e);s.addCompressedEventToManager(r,t)}},this.flushQueue=function(){var e;for(s.pendingQueue.length>0&&(e=s.taskQueue).push.apply(e,w([],b(s.mergeMutationTasks(s.pendingQueue.splice(0))),!1));s.taskQueue.length>0;){var t=s.taskQueue.shift();if(t){var r=t.event,n=t.sessionId,i=s.compressEvent(r);s.addCompressedEventToManager(i,n)}}s.isProcessing=!1},this.terminate=function(){var e;null===(e=s.worker)||void 0===e||e.terminate()};var a=de();if(this.canUseIdleCallback=a&&"requestIdleCallback"in a,this.eventsManager=e,this.config=t,this.deviceId=r,this.timeout=(null===(o=t.performanceConfig)||void 0===o?void 0:o.timeout)||2e3,this.onFullSnapshotProcessed=i,n){t.loggerProvider.log("Enabling web worker for compression");try{var l=new Blob([n],{type:"application/javascript"}),u=URL.createObjectURL(l),c=new Worker(u);c.onerror=function(e){e.preventDefault(),t.loggerProvider.error("Worker failed, falling back to non-worker compression: ".concat(e.message," (").concat(e.filename,":").concat(e.lineno,")")),c.terminate(),s.worker=void 0},c.onmessage=function(e){var t=e.data,r=t.compressedEvent,n=t.sessionId;s.addCompressedEventToManager(r,n)},this.worker=c}catch(e){t.loggerProvider.error("Failed to create worker, falling back to non-worker compression:",e)}}}return e.prototype.scheduleIdleProcessing=function(){var e=this;this.isProcessing||(this.isProcessing=!0,requestIdleCallback(function(t){e.processQueue(t)},{timeout:this.timeout}))},e.prototype.enqueueEvent=function(e,t){var r,n,i,o;if(e.type===vx.FullSnapshot){if(this.config.loggerProvider.debug("Processing full snapshot immediately."),this.taskQueue.length>0||this.pendingQueue.length>0){var s=w(w([],b(this.taskQueue.splice(0)),!1),b(this.mergeMutationTasks(this.pendingQueue.splice(0))),!1);try{for(var a=y(s),l=a.next();!l.done;l=a.next()){var u=l.value,c=this.compressEvent(u.event);this.addCompressedEventToManager(c,u.sessionId)}}catch(e){r={error:e}}finally{try{l&&!l.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}this.isProcessing=!1}var d=this.compressEvent(e);return this.addCompressedEventToManager(d,t),void(null===(i=this.onFullSnapshotProcessed)||void 0===i||i.call(this))}this.canUseIdleCallback&&(null===(o=this.config.performanceConfig)||void 0===o?void 0:o.enabled)?(this.config.loggerProvider.debug("Enqueuing event for processing during idle time."),this.pendingQueue.push({event:e,sessionId:t}),this.scheduleIdleProcessing()):(this.config.loggerProvider.debug("Processing event without idle callback."),this.addCompressedEvent(e,t))},e.prototype.processQueue=function(e){var t,r=this;for(this.pendingQueue.length>0&&(t=this.taskQueue).push.apply(t,w([],b(this.mergeMutationTasks(this.pendingQueue.splice(0))),!1));this.taskQueue.length>0&&(e.timeRemaining()>0||e.didTimeout);){var n=this.taskQueue.shift();if(n){var i=n.event,o=n.sessionId;this.addCompressedEvent(i,o)}}this.taskQueue.length>0||this.pendingQueue.length>0?requestIdleCallback(function(e){r.processQueue(e)},{timeout:this.timeout}):this.isProcessing=!1},e.prototype.mergeMutationTasks=function(e){var t,r,n;if(!(null===(n=this.config.performanceConfig)||void 0===n?void 0:n.mergeMutations))return e;if(e.length<=1)return e;for(var i=[],o=0;o<e.length;){for(var s=e[o].sessionId,a=o+1;a<e.length&&e[a].sessionId===s;)a++;var l=Ex(e.slice(o,a).map(function(e){return e.event}));try{for(var u=(t=void 0,y(l)),c=u.next();!c.done;c=u.next()){var d=c.value;i.push({event:d,sessionId:s})}}catch(e){t={error:e}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(t)throw t.error}}o=a}return i},e}();Ne(),Ne(),Pi();var Ix="Session replay event batch rejected due to exceeded retry count",Ox="Failed to store session replay events in IndexedDB",Tx="Session replay event batch dropped: server signalled capture disabled or session out of valid range for this session",Ax="1.44.0";function Rx(e,t){return v(this,void 0,void 0,function(){var r,n,i,o,s,a,l,u,c,d,h,p,f,g,b=this;return m(this,function(w){switch(w.label){case 0:return w.trys.push([0,4,,5]),r=t.CompressionStream,n=new r("gzip"),i=n.writable.getWriter(),o=n.readable.getReader(),s=[],a=v(b,void 0,void 0,function(){var e,t,r;return m(this,function(n){switch(n.label){case 0:return[4,o.read()];case 1:if(e=n.sent(),t=e.done,r=e.value,t)return[3,3];s.push(r),n.label=2;case 2:return[3,0];case 3:return[2]}})}),[4,i.write((new TextEncoder).encode(e))];case 1:return w.sent(),[4,i.close()];case 2:return w.sent(),[4,a];case 3:w.sent(),l=s.reduce(function(e,t){return e+t.length},0),u=new Uint8Array(l),c=0;try{for(d=y(s),h=d.next();!h.done;h=d.next())p=h.value,u.set(p,c),c+=p.length}catch(e){f={error:e}}finally{try{h&&!h.done&&(g=d.return)&&g.call(d)}finally{if(f)throw f.error}}return[2,u];case 4:return w.sent(),[2,null];case 5:return[2]}})})}Ne();var Px=function(){function e(e){var t=e.trackServerUrl,r=e.loggerProvider,n=e.payloadBatcher,i=e.workerScript,o=this;if(this.storageKey="",this.retryTimeout=1e3,this.scheduled=null,this.queue=[],this.sendIdCounter=0,this.pendingWorkerRequests=new Map,this.flushPauseUntilMs=0,this.mergeOnNextFlush=!1,this.mergeLogFiredThisPause=!1,this.killedSessions=new Set,this.loggerProvider=r,this.payloadBatcher=n||function(e){return e},this.trackServerUrl=t,i)try{var s=new Blob([i],{type:"application/javascript"}),a=URL.createObjectURL(s),l=new Worker(a);l.onerror=function(e){var t,n;e.preventDefault(),r.error("Track destination worker failed, falling back to main-thread sending: ".concat(e.message," (").concat(e.filename,":").concat(e.lineno,")")),l.terminate(),o.worker=void 0;try{for(var i=y(o.pendingWorkerRequests),s=i.next();!s.done;s=i.next()){var a=b(s.value,2)[1];r.warn("Session replay event send failed due to worker crash: ".concat(e.message)),a.resolve()}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}o.pendingWorkerRequests.clear()},l.onmessage=function(e){var t=e.data;if("log"===t.type)r.log(t.message);else if("warn"===t.type)r.warn(t.message);else if("payload_too_large"===t.type){var n=o.pendingWorkerRequests.get(t.id);n&&(o.handlePayloadTooLargeResponse(n.context,t.isWaf),n.resolve(),o.pendingWorkerRequests.delete(t.id))}else if("complete"===t.type){var i=o.pendingWorkerRequests.get(t.id);i&&(void 0!==t.skipCode&&o.applyServerDirective(i.context.sessionId,t.skipCode),o.completeRequest({context:i.context}),i.resolve(),o.pendingWorkerRequests.delete(t.id))}},this.worker=l}catch(e){r.error("Failed to create track destination worker, falling back to main-thread sending:",e)}}return e.prototype.sendEventsList=function(e){this.addToQueue(t(t({},e),{attempts:0,timeout:0}))},e.prototype.sendBeacon=function(e){var t,r,n=e.events,i=e.sessionId,o=e.deviceId,s=e.apiKey,a=e.serverZone,l=function(e){return new Blob([e]).size},u=n,c=JSON.stringify({version:2,events:u});if(l(c)>65536){for(var d=0,h=u.length;d<h;){var p=Math.floor((d+h+1)/2);l(JSON.stringify({version:2,events:u.slice(0,p)}))<=65536?d=p:h=p-1}u=u.slice(0,d),c=JSON.stringify({version:2,events:u}),this.loggerProvider.warn("sendBeacon payload exceeded 64 KB limit, trimmed from ".concat(n.length," to ").concat(u.length," events"))}if(0!==u.length){var f=new URLSearchParams({device_id:o,session_id:String(i),type:"replay",api_key:s}),g="".concat(tx(a,this.trackServerUrl),"?").concat(f.toString()),v=de();try{var m=new Blob([c],{type:"application/json"});!1===(null===(r=null===(t=null==v?void 0:v.navigator)||void 0===t?void 0:t.sendBeacon)||void 0===r?void 0:r.call(t,g,m))&&this.loggerProvider.warn("sendBeacon failed to queue session replay payload")}catch(e){}}},e.prototype.addToQueue=function(){for(var e=this,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];t.filter(function(t){return e.killedSessions.has(t.sessionId)?(e.completeRequest({context:t,err:Tx}),!1):t.attempts<(t.flushMaxRetries||0)?(t.attempts+=1,!0):(e.completeRequest({context:t,err:Ix}),!1)}).forEach(function(t){e.queue=e.queue.concat(t),e.schedule(0)})},e.prototype.schedule=function(e){var t=this;if(!this.scheduled){var r=this.flushPauseUntilMs-Date.now(),n=r>e?r:e;r>0&&(this.mergeOnNextFlush=!0),this.scheduled=setTimeout(function(){t.flush(!0).then(function(){t.queue.length>0&&t.schedule(e)})},n)}},e.prototype.flush=function(e){return void 0===e&&(e=!1),v(this,void 0,void 0,function(){var t,r,n,i,o,s,a;return m(this,function(l){switch(l.label){case 0:t=this.queue,this.queue=[],this.scheduled&&(clearTimeout(this.scheduled),this.scheduled=null),this.mergeOnNextFlush&&(this.mergeOnNextFlush=!1,t=this.mergeQueueAfterThrottle(t)),l.label=1;case 1:l.trys.push([1,6,7,8]),r=y(t),n=r.next(),l.label=2;case 2:return n.done?[3,5]:(i=n.value,[4,this.send(i,e)]);case 3:l.sent(),l.label=4;case 4:return n=r.next(),[3,2];case 5:return[3,8];case 6:return o=l.sent(),s={error:o},[3,8];case 7:try{n&&!n.done&&(a=r.return)&&a.call(r)}finally{if(s)throw s.error}return[7];case 8:return[2]}})})},e.prototype.mergeQueueAfterThrottle=function(e){var r,n,i,o,s,a,l,u,c,d,h,p=this;if(e.length<=1)return e;var f=new Map;try{for(var g=y(e),S=g.next();!S.done;S=g.next()){var k=S.value,x=[k.sessionId,null!==(s=k.deviceId)&&void 0!==s?s:"",null!==(a=k.apiKey)&&void 0!==a?a:"",k.type,null!==(l=k.serverZone)&&void 0!==l?l:"",k.sampleRate,null!==(c=null===(u=k.version)||void 0===u?void 0:u.type)&&void 0!==c?c:"",null!==(h=null===(d=k.version)||void 0===d?void 0:d.version)&&void 0!==h?h:""].join("|"),E=f.get(x);E?E.push(k):f.set(x,[k])}}catch(e){r={error:e}}finally{try{S&&!S.done&&(n=g.return)&&n.call(g)}finally{if(r)throw r.error}}var C=[],I=function(e){var r,n;if(1===e.length)return C.push(e[0]),"continue";var i=null,o=0,s=function(){i&&C.push(i),i=null,o=0},a=function(e){var r=e.events.reduce(function(e,t){return e+new Blob([t]).size},0);if(null===i)return i=t(t({},e),{events:w([],b(e.events),!1),attempts:0}),o=r,"continue";if(o+r>14e5)return s(),i=t(t({},e),{events:w([],b(e.events),!1),attempts:0}),o=r,"continue";var n=i.onComplete,a=e.onComplete;i.events=i.events.concat(e.events),o+=r,i.onComplete=function(){return v(p,void 0,void 0,function(){return m(this,function(e){switch(e.label){case 0:return[4,Promise.allSettled([n(),a()])];case 1:return e.sent(),[2]}})})}};try{for(var l=(r=void 0,y(e)),u=l.next();!u.done;u=l.next()){a(u.value)}}catch(e){r={error:e}}finally{try{u&&!u.done&&(n=l.return)&&n.call(l)}finally{if(r)throw r.error}}s()};try{for(var O=y(f.values()),T=O.next();!T.done;T=O.next()){I(T.value)}}catch(e){i={error:e}}finally{try{T&&!T.done&&(o=O.return)&&o.call(O)}finally{if(i)throw i.error}}return C.length<e.length&&!this.mergeLogFiredThisPause&&(this.mergeLogFiredThisPause=!0,this.loggerProvider.log("Session replay throttle pause ended; merged ".concat(e.length," queued batches into ").concat(C.length," request(s)"))),C},e.prototype.send=function(e,t){return void 0===t&&(t=!0),v(this,void 0,void 0,function(){var r,n,i,o;return m(this,function(s){return this.killedSessions.has(e.sessionId)?[2,this.completeRequest({context:e,err:Tx})]:(r=e.apiKey)?(n=e.deviceId)?0===(i=this.payloadBatcher({version:1,events:e.events})).events.length?(this.completeRequest({context:e}),[2]):(o=this.worker)?[2,this.sendViaWorker(o,e,i,t)]:[2,this.sendOnMainThread(r,n,e,i,t)]:[2,this.completeRequest({context:e,err:"Session replay event batch not sent due to missing device ID"})]:[2,this.completeRequest({context:e,err:"Session replay event batch not sent due to missing api key"})]})})},e.prototype.sendViaWorker=function(e,t,r,n){return v(this,void 0,void 0,function(){var i,o=this;return m(this,function(s){return i="".concat(++this.sendIdCounter),[2,new Promise(function(s){var a;o.pendingWorkerRequests.set(i,{context:t,resolve:s}),e.postMessage({type:"send",id:i,payload:r,useRetry:n,context:{apiKey:t.apiKey,deviceId:t.deviceId,sessionId:t.sessionId,events:t.events,eventType:t.type,flushMaxRetries:null!==(a=t.flushMaxRetries)&&void 0!==a?a:0,sampleRate:t.sampleRate,serverZone:t.serverZone,trackServerUrl:o.trackServerUrl,version:t.version,currentUrl:ax(),sdkVersion:Ax}})})]})})},e.prototype.sendOnMainThread=function(e,r,n,i,o){var s,a,l,u,c,d,h;return v(this,void 0,void 0,function(){var p,f,g,v,y,b,w,S,k,x,E,C,I,O,T,A;return m(this,function(m){switch(m.label){case 0:p=ax(),f=Ax,g=n.sampleRate,v=new URLSearchParams({device_id:r,session_id:"".concat(n.sessionId),type:"".concat(n.type)}),y="".concat(null!==(a=null===(s=n.version)||void 0===s?void 0:s.type)&&void 0!==a?a:"standalone","/").concat(null!==(u=null===(l=n.version)||void 0===l?void 0:l.version)&&void 0!==u?u:f),m.label=1;case 1:return m.trys.push([1,13,,14]),b=JSON.stringify(i),(w=de())&&"CompressionStream"in w?[4,Rx(b,w)]:[3,3];case 2:return k=m.sent(),[3,4];case 3:k=null,m.label=4;case 4:return x=(S=k)?S.byteLength:new Blob([b]).size,E={headers:t({"Content-Type":"application/json",Accept:"*/*",Authorization:"Bearer ".concat(e),"X-Client-Version":f,"X-Client-Library":y,"X-Client-Url":p.substring(0,1e3),"X-Client-Sample-Rate":"".concat(g),"X-Sampling-Hash-Alg":"xxhash32"},S?{"Content-Encoding":"gzip"}:{}),body:null!=S?S:b,method:"POST",keepalive:x<=65536},C="".concat(tx(n.serverZone,this.trackServerUrl),"?").concat(v.toString()),0===i.events.length?(this.completeRequest({context:n}),[2]):[4,fetch(C,E)];case 5:if(null===(I=m.sent()))return this.completeRequest({context:n,err:"Unexpected error occurred"}),[2];if(I.status>=200&&I.status<300&&(O=null!==(h=null===(d=null===(c=I.headers)||void 0===c?void 0:c.get)||void 0===d?void 0:d.call(c,"X-Session-Replay-Event-Skipped"))&&void 0!==h?h:null,this.applyServerDirective(n.sessionId,O)),o)return[3,6];T="";try{T=JSON.stringify(I.body,null,2)}catch(e){}return this.completeRequest({context:n,success:"".concat(I.status,": ").concat(T)}),[3,12];case 6:if(T="",413!==I.status)return[3,10];m.label=7;case 7:return m.trys.push([7,9,,10]),[4,I.text()];case 8:return T=m.sent(),[3,10];case 9:return m.sent(),[3,10];case 10:return[4,this.handleReponse(I.status,n,T)];case 11:m.sent(),m.label=12;case 12:return[3,14];case 13:return A=m.sent(),this.completeRequest({context:n,err:A}),[3,14];case 14:return[2]}})})},e.prototype.handleReponse=function(e,t,r){return void 0===r&&(r=""),v(this,void 0,void 0,function(){var n;return m(this,function(i){switch(i.label){case 0:switch(n=(new nr).buildStatus(e),n){case ue.Success:return[3,1];case ue.Failed:case ue.Timeout:case ue.RateLimit:return[3,2];case ue.PayloadTooLarge:return[3,4]}return[3,5];case 1:return this.handleSuccessResponse(t),[3,8];case 2:return[4,this.handleOtherResponse(t)];case 3:return i.sent(),[3,8];case 4:return this.handlePayloadTooLargeResponse(t,Gk.test(r)),[3,8];case 5:return 499!==e?[3,7]:[4,this.handleOtherResponse(t)];case 6:return i.sent(),[3,8];case 7:this.completeRequest({context:t,err:"Network error occurred, event batch rejected"}),i.label=8;case 8:return[2]}})})},e.prototype.handlePayloadTooLargeResponse=function(e,r){var n=r?"WAF (compressed payload too large)":"server (event too large)",i=Math.round(e.events.reduce(function(e,t){return e+t.length},0)/Xk);if(r)if(1!==e.events.length){this.loggerProvider.warn("Session replay event batch rejected by ".concat(n," (").concat(e.events.length," events, ").concat(i," KB total) — splitting and retrying")),e.onComplete();var o=function(){return Promise.resolve()},s=Math.floor(e.events.length/2);this.sendEventsList(t(t({},e),{events:e.events.slice(0,s),onComplete:o})),this.sendEventsList(t(t({},e),{events:e.events.slice(s),onComplete:o}))}else this.completeRequest({context:e,err:"Session replay event dropped: single event (".concat(i," KB, 1 event) rejected by ").concat(n," — cannot split further")});else this.completeRequest({context:e,err:"Session replay event batch dropped: ".concat(n," rejected payload (").concat(e.events.length," events, ").concat(i," KB) — not retrying non-WAF 413")})},e.prototype.handleSuccessResponse=function(e){var t=Math.round(new Blob(e.events).size/Xk);this.completeRequest({context:e,success:"Session replay event batch tracked successfully for session id ".concat(e.sessionId,", size of events: ").concat(t," KB")})},e.prototype.handleOtherResponse=function(e){return v(this,void 0,void 0,function(){var t;return m(this,function(r){switch(r.label){case 0:return t=Math.random()*e.attempts*this.retryTimeout,e.attempts++,e.attempts>(e.flushMaxRetries||0)?(this.completeRequest({context:e,err:Ix}),[2]):[4,new Promise(function(e){return setTimeout(e,t)})];case 1:return r.sent(),[4,this.send(e,!0)];case 2:return r.sent(),[2]}})})},e.prototype.completeRequest=function(e){var t=e.context,r=e.err,n=e.success;t.onComplete(),r?this.loggerProvider.warn(r):n&&this.loggerProvider.log(n)},e.prototype.applyServerDirective=function(e,t){if(null===t)return this.flushPauseUntilMs=0,void(this.mergeLogFiredThisPause=!1);if("429"===t){var r=this.flushPauseUntilMs>Date.now();return this.flushPauseUntilMs=Date.now()+6e4,void(r||this.loggerProvider.log("Session replay throttled by server; pausing flush schedule for ".concat(60,"s")))}"4005"!==t&&"4004"!==t||this.killSession(e,t)},e.prototype.killSession=function(e,t){var r,n,i,o;if(!this.killedSessions.has(e)){if(this.killedSessions.add(e),this.killedSessions.size>256)try{for(var s=y(this.killedSessions),a=s.next();!a.done;a=s.next()){var l=a.value;this.killedSessions.delete(l);break}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}this.loggerProvider.log("Session replay capture stopped for session ".concat(e," by server directive ").concat(t,"; remaining events will be dropped"));var u=[];try{for(var c=y(this.queue),d=c.next();!d.done;d=c.next()){var h=d.value;h.sessionId===e?this.completeRequest({context:h,err:Tx}):u.push(h)}}catch(e){i={error:e}}finally{try{d&&!d.done&&(o=c.return)&&o.call(c)}finally{if(i)throw i.error}}this.queue=u}},e}();Ne(),Vo(),Ne();var _x=function(){function e(e){var t,r,n,i=this;this.minInterval=Jk,this.maxInterval=Qk,this.maxPersistedEventsSize=Hk,this._timeAtLastSplit=Date.now(),this.shouldSplitEventsList=function(e,t){var r=i.getStringSize(t);return i.getEventsArraySize(e)+r>=i.maxPersistedEventsSize||!!(Date.now()-i.timeAtLastSplit>i.interval&&e.length)&&(i.interval=Math.min(i.maxInterval,i.interval+i.minInterval),i._timeAtLastSplit=Date.now(),!0)},this.loggerProvider=e.loggerProvider,this.minInterval=null!==(t=e.minInterval)&&void 0!==t?t:this.minInterval,this.maxInterval=null!==(r=e.maxInterval)&&void 0!==r?r:this.maxInterval,this.maxPersistedEventsSize=null!==(n=e.maxPersistedEventsSize)&&void 0!==n?n:this.maxPersistedEventsSize,this.interval=this.minInterval}return Object.defineProperty(e.prototype,"timeAtLastSplit",{get:function(){return this._timeAtLastSplit},enumerable:!1,configurable:!0}),e.prototype.getStringSize=function(e){for(var t=0,r=0;r<e.length;r++){var n=e.charCodeAt(r);if(n<=127)t++;else if(n<=2047)t+=2;else if(n>=55296&&n<=56319){var i=r+1<e.length?e.charCodeAt(r+1):NaN;i>=56320&&i<=57343?(t+=4,r++):t+=3}else t+=3}return t},e.prototype.getEventsArraySize=function(e){var t,r,n=0;try{for(var i=y(e),o=i.next();!o.done;o=i.next()){var s=o.value;n+=this.getStringSize(s)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return n+(2+Math.max(0,e.length-1)+2*e.length)},e}(),Mx=function(e,t,r){!function(e){return"object"==typeof e&&null!==e&&"AbortError"===e.name}(r)?e.warn(t):e.debug(t)};var Nx="sessionCurrentSequence",Lx="sequencesToSend",Dx=5e3;function Ux(e,t,r){var n=setTimeout(r,t);return e.then(function(){return clearTimeout(n)},function(){return clearTimeout(n)}),function(){return clearTimeout(n)}}var Fx=function(e){var t,r;return e.objectStoreNames.contains(Nx)||(r=e.createObjectStore(Nx,{keyPath:"sessionId"})),e.objectStoreNames.contains(Lx)||(t=e.createObjectStore(Lx,{keyPath:"sequenceId",autoIncrement:!0})).createIndex("sessionId","sessionId"),{sequencesStore:t,currentSequenceStore:r}},jx=function(e){return v(void 0,void 0,void 0,function(){return m(this,function(t){switch(t.label){case 0:return[4,(r=Di(e,1,{upgrade:Fx}),n=2e3,i="IDB openDB timed out",void 0===i&&(i="IDB operation timed out"),new Promise(function(e,t){var o=setTimeout(function(){return t(new Error("".concat(i," after ").concat(n,"ms")))},n);r.then(function(t){clearTimeout(o),e(t)},function(e){clearTimeout(o),t(e)})}))];case 1:return[2,t.sent()]}var r,n,i})})},Bx=function(e){function r(r){var n,i=this;return(i=e.call(this,r)||this).consecutiveFailures=0,i.hasTriggeredFallback=!1,i.emptyFilteredCount=0,i.getSequencesToSend=function(){return v(i,void 0,void 0,function(){var e,t,r,n,i,o,s,a,l,u,c=this;return m(this,function(d){switch(d.label){case 0:e=!1,t=!1,d.label=1;case 1:return d.trys.push([1,9,,10]),r=[],(n=this.db.transaction("sequencesToSend","readwrite")).done.catch(function(r){e||t||(Mx(c.loggerProvider,"".concat(Ox,": ").concat(r),r),c.recordFailure())}),i=Ux(n.done,Dx,function(){e||t||(t=!0,Mx(c.loggerProvider,"".concat(Ox,": transaction timed out")),c.recordFailure())}),[4,n.store.openCursor()];case 2:o=d.sent(),d.label=3;case 3:return o?(s=o.value,a=s.sessionId,0!==(l=s.events).length?[3,5]:(this.maybeLogEmptyFiltered("getSequencesToSend"),[4,o.delete()])):[3,8];case 4:return d.sent(),[3,6];case 5:r.push({events:l,sequenceId:o.key,sessionId:a}),d.label=6;case 6:return[4,o.continue()];case 7:return o=d.sent(),[3,3];case 8:return this.recordSuccess(),i(),[2,r];case 9:return u=d.sent(),t||(e=!0,Mx(this.loggerProvider,"".concat(Ox,": ").concat(u),u),this.recordFailure()),[3,10];case 10:return[2,void 0]}})})},i.storeCurrentSequence=function(e){return v(i,void 0,void 0,function(){var r,n,i,o,s,a,l,u,c=this;return m(this,function(d){switch(d.label){case 0:r=!1,n=!1,d.label=1;case 1:return d.trys.push([1,5,,6]),(i=this.db.transaction([Nx,Lx],"readwrite")).done.catch(function(e){r||n||(Mx(c.loggerProvider,"".concat(Ox,": ").concat(e),e),c.recordFailure())}),o=Ux(i.done,Dx,function(){r||n||(n=!0,Mx(c.loggerProvider,"".concat(Ox,": transaction timed out")),c.recordFailure())}),[4,i.objectStore(Nx).get(e)];case 2:return!(s=d.sent())||s.tabId&&s.tabId!==this.tabId?(o(),[2,void 0]):0===s.events.length?(this.maybeLogEmptyFiltered("storeCurrentSequence"),o(),[2,void 0]):[4,i.objectStore(Lx).put({sessionId:e,events:s.events,tabId:this.tabId})];case 3:return a=d.sent(),[4,i.objectStore(Nx).put({sessionId:e,events:[],tabId:this.tabId})];case 4:return d.sent(),this.recordSuccess(),o(),s.tabId,l=g(s,["tabId"]),[2,t(t({},l),{sessionId:e,sequenceId:a})];case 5:return u=d.sent(),n||(r=!0,Mx(this.loggerProvider,"".concat(Ox,": ").concat(u),u),this.recordFailure()),[3,6];case 6:return[2,void 0]}})})},i.addEventToCurrentSequence=function(e,t){return v(i,void 0,void 0,function(){var r,n,i,o,s,a,l,u,c,d=this;return m(this,function(h){switch(h.label){case 0:r=!1,n=!1,h.label=1;case 1:return h.trys.push([1,15,,16]),(i=this.db.transaction([Nx,Lx],"readwrite")).done.catch(function(e){r||n||(Mx(d.loggerProvider,"".concat(Ox,": ").concat(e),e),d.recordFailure())}),o=Ux(i.done,Dx,function(){r||n||(n=!0,Mx(d.loggerProvider,"".concat(Ox,": transaction timed out")),d.recordFailure())}),[4,i.objectStore(Nx).get(e)];case 2:return(null==(s=h.sent())?void 0:s.tabId)&&s.tabId!==this.tabId?s.events.length>0?[4,i.objectStore(Lx).put({sessionId:e,events:s.events,tabId:s.tabId})]:[3,4]:[3,6];case 3:h.sent(),h.label=4;case 4:return[4,i.objectStore(Nx).put({sessionId:e,events:[t],tabId:this.tabId})];case 5:return h.sent(),this.recordSuccess(),o(),[2,void 0];case 6:return(a=s)?[3,8]:[4,i.objectStore(Nx).put({sessionId:e,events:[t],tabId:this.tabId})];case 7:return h.sent(),this.recordSuccess(),o(),[2,void 0];case 8:return this.shouldSplitEventsList(a.events,t)?[3,10]:[4,i.objectStore(Nx).put({sessionId:e,events:a.events.concat(t),tabId:this.tabId})];case 9:return h.sent(),this.recordSuccess(),o(),[2,void 0];case 10:return 0!==(l=a.events).length?[3,12]:(this.maybeLogEmptyFiltered("addEventToCurrentSequence"),[4,i.objectStore(Nx).put({sessionId:e,events:[t],tabId:this.tabId})]);case 11:return h.sent(),this.recordSuccess(),o(),[2,void 0];case 12:return[4,i.objectStore(Nx).put({sessionId:e,events:[t],tabId:this.tabId})];case 13:return h.sent(),[4,i.objectStore(Lx).put({sessionId:e,events:l,tabId:this.tabId})];case 14:return u=h.sent(),this.recordSuccess(),o(),[2,{events:l,sessionId:e,sequenceId:u}];case 15:return c=h.sent(),n||(r=!0,Mx(this.loggerProvider,"".concat(Ox,": ").concat(c),c),this.recordFailure()),[3,16];case 16:return[2,void 0]}})})},i.storeSendingEvents=function(e,t){return v(i,void 0,void 0,function(){var r,n;return m(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.db.put(Lx,{sessionId:e,events:t,tabId:this.tabId})];case 1:return r=i.sent(),this.recordSuccess(),[2,r];case 2:return n=i.sent(),Mx(this.loggerProvider,"".concat(Ox,": ").concat(n),n),this.recordFailure(),[3,3];case 3:return[2,void 0]}})})},i.cleanUpSessionEventsStore=function(e,t){return v(i,void 0,void 0,function(){var e;return m(this,function(r){switch(r.label){case 0:if(!t)return[2];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this.db.delete(Lx,t)];case 2:return r.sent(),this.recordSuccess(),[3,4];case 3:return e=r.sent(),Mx(this.loggerProvider,"".concat(Ox,": ").concat(e),e),this.recordFailure(),[3,4];case 4:return[2]}})})},i.db=r.db,i.tabId=r.tabId,i.onPersistentFailure=r.onPersistentFailure,i.consecutiveFailureThreshold=null!==(n=r.consecutiveFailureThreshold)&&void 0!==n?n:1,i}return f(r,e),r.prototype.maybeLogEmptyFiltered=function(e){this.emptyFilteredCount++%100==0&&this.loggerProvider.debug("Filtered empty session replay sequence at ".concat(e," (idb store)"))},r.prototype.recordFailure=function(){var e;this.consecutiveFailures++,!this.hasTriggeredFallback&&this.consecutiveFailures>=this.consecutiveFailureThreshold&&(this.hasTriggeredFallback=!0,null===(e=this.onPersistentFailure)||void 0===e||e.call(this))},r.prototype.recordSuccess=function(){this.consecutiveFailures=0},r.new=function(e,n){var i;return v(this,void 0,void 0,function(){var o,s,a,l,u;return m(this,function(c){switch(c.label){case 0:return c.trys.push([0,2,,3]),o="replay"===e?"":"_".concat(e),s="".concat(n.apiKey.substring(0,10),"_amp_session_replay_events").concat(o),[4,jx(s)];case 1:return a=c.sent(),l=null!==(i=n.tabId)&&void 0!==i?i:function(){try{return crypto.randomUUID()}catch(e){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}}(),[2,new r(t(t({},n),{db:a,tabId:l}))];case 2:return u=c.sent(),Mx(n.loggerProvider,"".concat(Ox,": ").concat(u),u),[3,3];case 3:return[2]}})})},r.prototype.getCurrentSequenceEvents=function(e){return v(this,void 0,void 0,function(){var t,r,n,i,o,s,a,l;return m(this,function(u){switch(u.label){case 0:return e?[4,this.db.get("sessionCurrentSequence",e)]:[3,2];case 1:return(i=u.sent())?i.tabId&&i.tabId!==this.tabId?[2,void 0]:(i.tabId,[2,[o=g(i,["tabId"])]]):[2,void 0];case 2:t=[],u.label=3;case 3:return u.trys.push([3,8,9,10]),[4,this.db.getAll("sessionCurrentSequence")];case 4:r=y.apply(void 0,[u.sent()]),n=r.next(),u.label=5;case 5:if(n.done)return[3,7];if((i=n.value).tabId&&i.tabId!==this.tabId)return[3,6];i.tabId,o=g(i,["tabId"]),t.push(o),u.label=6;case 6:return n=r.next(),[3,5];case 7:return[3,10];case 8:return s=u.sent(),a={error:s},[3,10];case 9:try{n&&!n.done&&(l=r.return)&&l.call(r)}finally{if(a)throw a.error}return[7];case 10:return[2,t]}})})},r}(_x);Ne();var qx=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.finalizedSequences={},t.sequences={},t.sequenceId=0,t.emptyFilteredCount=0,t}return f(t,e),t.prototype.resetCurrentSequence=function(e){this.sequences[e]=[]},t.prototype.addSequence=function(e){var t=this.sequenceId++,r=w([],b(this.sequences[e]),!1);return this.finalizedSequences[t]={sessionId:e,events:r},this.resetCurrentSequence(e),{sequenceId:t,events:r,sessionId:e}},t.prototype.maybeLogEmptyFiltered=function(e){this.emptyFilteredCount++%100==0&&this.loggerProvider.debug("Filtered empty session replay sequence at ".concat(e," (in-memory store)"))},t.prototype.getSequencesToSend=function(){return v(this,void 0,void 0,function(){var e,t,r,n,i,o,s,a,l,u;return m(this,function(c){e=[];try{for(t=y(Object.entries(this.finalizedSequences)),r=t.next();!r.done;r=t.next())n=b(r.value,2),i=n[0],o=n[1],s=o.sessionId,0!==(a=o.events).length?e.push({sequenceId:Number(i),sessionId:s,events:a}):(this.maybeLogEmptyFiltered("getSequencesToSend"),delete this.finalizedSequences[Number(i)])}catch(e){l={error:e}}finally{try{r&&!r.done&&(u=t.return)&&u.call(t)}finally{if(l)throw l.error}}return[2,e]})})},t.prototype.storeCurrentSequence=function(e){return v(this,void 0,void 0,function(){var t;return m(this,function(r){return(t=this.sequences[e])?0===t.length?(this.maybeLogEmptyFiltered("storeCurrentSequence"),[2,void 0]):[2,this.addSequence(e)]:[2,void 0]})})},t.prototype.addEventToCurrentSequence=function(e,t){return v(this,void 0,void 0,function(){var r;return m(this,function(n){return this.sequences[e]||this.resetCurrentSequence(e),this.shouldSplitEventsList(this.sequences[e],t)&&(0===this.sequences[e].length?this.maybeLogEmptyFiltered("addEventToCurrentSequence"):r=this.addSequence(e)),this.sequences[e].push(t),[2,r]})})},t.prototype.storeSendingEvents=function(e,t){return v(this,void 0,void 0,function(){return m(this,function(r){return this.finalizedSequences[this.sequenceId]={sessionId:e,events:t},[2,this.sequenceId++]})})},t.prototype.cleanUpSessionEventsStore=function(e,t){return v(this,void 0,void 0,function(){return m(this,function(e){return void 0!==t&&delete this.finalizedSequences[t],[2]})})},t}(_x),zx=function(e){var r=e.config,n=e.minInterval,i=e.maxInterval,o=e.type,s=e.payloadBatcher,a=e.storeType,l=e.trackDestinationWorkerScript,u=e.shouldSend;return v(void 0,void 0,void 0,function(){function e(e){return void 0===e&&(e=!1),v(this,void 0,void 0,function(){return m(this,function(t){return[2,c.flush(e)]})})}var c,d,h,p,f,g,y,S,k,x,E,C,I,O;return m(this,function(T){switch(T.label){case 0:return c=new Px(t(t({},r),{loggerProvider:r.loggerProvider,payloadBatcher:s,workerScript:l})),d=function(){return new qx({loggerProvider:r.loggerProvider,maxInterval:i,minInterval:n})},p=!1,g=function(){return v(void 0,void 0,void 0,function(){var e,t,n;return m(this,function(i){switch(i.label){case 0:return p?(p=!1,r.loggerProvider.warn("IDB store is experiencing repeated failures; falling back to in-memory event store."),h?[4,f.getSequencesToSend()]:[3,2]):[2];case 1:return t=i.sent(),[3,3];case 2:t=void 0,i.label=3;case 3:return e=t,f=d(),e&&h&&(n=h,e.forEach(function(e){C({sequenceId:e.sequenceId,events:e.events,sessionId:e.sessionId,deviceId:n})})),[2]}})})},y=function(){return v(void 0,void 0,void 0,function(){var e;return m(this,function(t){switch(t.label){case 0:return[4,Bx.new(o,{loggerProvider:r.loggerProvider,minInterval:n,maxInterval:i,apiKey:r.apiKey,onPersistentFailure:function(){g()}})];case 1:return(e=t.sent())?(p=!0,[2,e]):(r.loggerProvider.log("Failed to initialize idb store, falling back to memory store."),[2,d()])}})})},"idb"!==a?[3,2]:[4,y()];case 1:return S=T.sent(),[3,3];case 2:S=d(),T.label=3;case 3:return f=S,k=[],x=0,E=function(e){if(!(e<=x)){var t=Math.min(e-x,k.length);t>0&&(k.splice(0,t),x=e)}},C=function(e){var t=e.events,n=e.sessionId,i=e.deviceId,s=e.sequenceId,a=t.map(function(e){return{event:e,bytes:new Blob([e]).size}}),l=a.filter(function(e){return e.bytes>Kk});l.length>0&&r.loggerProvider.warn("Dropping ".concat(l.length," oversized event(s) from session replay sequence before send. Sizes: ").concat(l.map(function(e){return"".concat(Math.round(e.bytes/1024)," KB")}).join(", "),". If this recurs, please open a GitHub issue at https://github.com/amplitude/Amplitude-TypeScript/issues or contact Amplitude support."));var u=l.length>0?a.filter(function(e){return e.bytes<=Kk}).map(function(e){return e.event}):t;0!==u.length?(r.debugMode&&dx().then(function(e){var t=e.totalStorageSize,n=e.percentOfQuota,i=e.usageDetails;r.loggerProvider.debug("Total storage size: ".concat(t," KB, percentage of quota: ").concat(n,"%, usage details: ").concat(i))}).catch(function(){}),c.sendEventsList({events:u,sessionId:n,flushMaxRetries:r.flushMaxRetries,apiKey:r.apiKey,deviceId:i,sampleRate:r.sampleRate,serverZone:r.serverZone,version:r.version,type:o,onComplete:function(){return v(void 0,void 0,void 0,function(){return m(this,function(e){switch(e.label){case 0:return[4,f.cleanUpSessionEventsStore(n,s)];case 1:return e.sent(),[2]}})})}})):f.cleanUpSessionEventsStore(n,s).catch(function(e){r.loggerProvider.warn("Failed to clean up session replay events store:",e)})},I=function(e){var t=e.sessionId,n=e.deviceId;if(h=n,!u||u()){var i=x+k.length;f.storeCurrentSequence(t).then(function(e){e&&(E(i),C({sequenceId:e.sequenceId,events:e.events,sessionId:e.sessionId,deviceId:n}))}).catch(function(e){r.loggerProvider.warn("Failed to get current sequence of session replay events for session:",e)})}},O=function(e){var t=e.event,n=e.sessionId,i=e.deviceId;h=i;var o=!u||u(),s=x+k.length;k.push(t.data),f.addEventToCurrentSequence(n,t.data).then(function(e){if(e){if(!o)return f.cleanUpSessionEventsStore(e.sessionId,e.sequenceId).catch(function(e){r.loggerProvider.warn("Failed to clean up dropped session replay sequence:",e)}),void E(s);E(s),C({sequenceId:e.sequenceId,events:e.events,sessionId:e.sessionId,deviceId:i})}}).catch(function(e){r.loggerProvider.warn("Failed to add event to session replay capture:",e)})},[2,{sendCurrentSequenceEvents:I,addEvent:O,sendStoredEvents:function(e){var t=e.deviceId;return v(void 0,void 0,void 0,function(){var e;return m(this,function(n){switch(n.label){case 0:return h=t,[4,f.getSequencesToSend()];case 1:return(null==(e=n.sent())?void 0:e.length)?(r.loggerProvider.log("Draining ".concat(e.length," stored sequence(s) from previous session.")),e.forEach(function(e){C({sequenceId:e.sequenceId,events:e.events,sessionId:e.sessionId,deviceId:t})}),[2]):[2]}})})},flush:e,getBeaconEvents:function(){return w([],b(k),!1)},dropPendingBeaconEvents:function(){E(x+k.length)},trackDestination:c}]}})})};Ne();var Wx,Vx,$x,Hx=function(){function e(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=new Map;e.forEach(function(e){r.set(e.name,e.manager)}),this.managers=r}return e.prototype.sendStoredEvents=function(e){return v(this,void 0,void 0,function(){var t;return m(this,function(r){switch(r.label){case 0:return t=[],this.managers.forEach(function(r){t.push(r.sendStoredEvents(e))}),[4,Promise.all(t)];case 1:return r.sent(),[2]}})})},e.prototype.addEvent=function(e){var t,r=e.sessionId,n=e.event,i=e.deviceId;null===(t=this.managers.get(n.type))||void 0===t||t.addEvent({sessionId:r,event:n,deviceId:i})},e.prototype.sendCurrentSequenceEvents=function(e){var t=e.sessionId,r=e.deviceId;this.managers.forEach(function(e){e.sendCurrentSequenceEvents({sessionId:t,deviceId:r})})},e.prototype.flush=function(e){return v(this,void 0,void 0,function(){var t;return m(this,function(r){switch(r.label){case 0:return t=[],this.managers.forEach(function(r){t.push(r.flush(e))}),[4,Promise.all(t)];case 1:return r.sent(),[2]}})})},e}();function Kx(e,r){if($x=new Date,e.nodeType!==Node.ELEMENT_NODE)throw new Error("Can't generate CSS selector for non-element node type.");if("html"===e.tagName.toLowerCase())return"html";var n={root:document.body,idName:function(e){return!0},className:function(e){return!0},tagName:function(e){return!0},attr:function(e,t){return!1},seedMinLength:1,optimizedMinLength:2,threshold:1e3,maxNumberOfTries:1e4,timeoutMs:void 0};Wx=t(t({},n),r),Vx=function(e,t){if(e.nodeType===Node.DOCUMENT_NODE)return e;if(e===t.root)return e.ownerDocument;return e}(Wx.root,n);var i=Gx(e,"all",function(){return Gx(e,"two",function(){return Gx(e,"one",function(){return Gx(e,"none")})})});if(i){var o=iE(oE(i,e));return o.length>0&&(i=o[0]),Qx(i)}throw new Error("Selector was not found.")}function Gx(e,t,r){for(var n=null,i=[],o=e,s=0,a=function(){var e,a,l=(new Date).getTime()-$x.getTime();if(void 0!==Wx.timeoutMs&&l>Wx.timeoutMs)throw new Error("Timeout: Can't find a unique selector after ".concat(l,"ms"));var u=tE(function(e){var t=e.getAttribute("id");if(t&&Wx.idName(t))return{name:"#"+CSS.escape(t),penalty:0};return null}(o))||tE.apply(void 0,w([],b(function(e){var t=Array.from(e.attributes).filter(function(e){return Wx.attr(e.name,e.value)});return t.map(function(e){return{name:"[".concat(CSS.escape(e.name),'="').concat(CSS.escape(e.value),'"]'),penalty:.5}})}(o)),!1))||tE.apply(void 0,w([],b(function(e){var t=Array.from(e.classList).filter(Wx.className);return t.map(function(e){return{name:"."+CSS.escape(e),penalty:1}})}(o)),!1))||tE(function(e){var t=e.tagName.toLowerCase();if(Wx.tagName(t))return{name:t,penalty:2};return null}(o))||[{name:"*",penalty:3}],c=function(e){var t=e.parentNode;if(!t)return null;var r=t.firstChild;if(!r)return null;var n=0;for(;r&&(r.nodeType===Node.ELEMENT_NODE&&n++,r!==e);)r=r.nextSibling;return n}(o);if("all"==t)c&&(u=u.concat(u.filter(eE).map(function(e){return Zx(e,c)})));else if("two"==t)u=u.slice(0,1),c&&(u=u.concat(u.filter(eE).map(function(e){return Zx(e,c)})));else if("one"==t){var d=b(u=u.slice(0,1),1)[0];c&&eE(d)&&(u=[Zx(d,c)])}else"none"==t&&(u=[{name:"*",penalty:3}],c&&(u=[Zx(u[0],c)]));try{for(var h=(e=void 0,y(u)),p=h.next();!p.done;p=h.next()){(d=p.value).level=s}}catch(t){e={error:t}}finally{try{p&&!p.done&&(a=h.return)&&a.call(h)}finally{if(e)throw e.error}}if(i.push(u),i.length>=Wx.seedMinLength&&(n=Jx(i,r)))return"break";o=o.parentElement,s++};o;){if("break"===a())break}return n||(n=Jx(i,r)),!n&&r?r():n}function Jx(e,t){var r,n,i=iE(nE(e));if(i.length>Wx.threshold)return t?t():null;try{for(var o=y(i),s=o.next();!s.done;s=o.next()){var a=s.value;if(Yx(a))return a}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return null}function Qx(e){for(var t=e[0],r=t.name,n=1;n<e.length;n++){var i=e[n].level||0;r=t.level===i-1?"".concat(e[n].name," > ").concat(r):"".concat(e[n].name," ").concat(r),t=e[n]}return r}function Xx(e){return e.map(function(e){return e.penalty}).reduce(function(e,t){return e+t},0)}function Yx(e){var t=Qx(e);switch(Vx.querySelectorAll(t).length){case 0:throw new Error("Can't select any node with this selector: ".concat(t));case 1:return!0;default:return!1}}function Zx(e,t){return{name:e.name+":nth-child(".concat(t,")"),penalty:e.penalty+1}}function eE(e){return"html"!==e.name&&!e.name.startsWith("#")}function tE(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e.filter(rE);return r.length>0?r:null}function rE(e){return null!=e}function nE(e,t){var r,n,i,o,s,a;return void 0===t&&(t=[]),m(this,function(l){switch(l.label){case 0:if(!(e.length>0))return[3,9];l.label=1;case 1:l.trys.push([1,6,7,8]),r=y(e[0]),n=r.next(),l.label=2;case 2:return n.done?[3,5]:(i=n.value,[5,y(nE(e.slice(1,e.length),t.concat(i)))]);case 3:l.sent(),l.label=4;case 4:return n=r.next(),[3,2];case 5:return[3,8];case 6:return o=l.sent(),s={error:o},[3,8];case 7:try{n&&!n.done&&(a=r.return)&&a.call(r)}finally{if(s)throw s.error}return[7];case 8:return[3,11];case 9:return[4,t];case 10:l.sent(),l.label=11;case 11:return[2]}})}function iE(e){return w([],b(e),!1).sort(function(e,t){return Xx(e)-Xx(t)})}function oE(e,t,r){var n,i,o;return void 0===r&&(r={counter:0,visited:new Map}),m(this,function(s){switch(s.label){case 0:if(!(e.length>2&&e.length>Wx.optimizedMinLength))return[3,5];n=1,s.label=1;case 1:return n<e.length-1?r.counter>Wx.maxNumberOfTries?[2]:(r.counter+=1,(i=w([],b(e),!1)).splice(n,1),o=Qx(i),r.visited.has(o)?[2]:Yx(i)&&function(e,t){return Vx.querySelector(Qx(e))===t}(i,t)?[4,i]:[3,4]):[3,5];case 2:return s.sent(),r.visited.set(o,!0),[5,y(oE(i,t,r))];case 3:s.sent(),s.label=4;case 4:return n++,[3,1];case 5:return[2]}})}Ne(),Ne(),Pi();var sE=function(e){var t=e.version,r=e.events,n=[];return r.forEach(function(e){var t=JSON.parse(e);t.count=1,"click"===t.type&&n.push(t)}),{version:t,events:n}},aE=function(e){var r=e.version,n=e.events,i=[];n.forEach(function(e){var t=JSON.parse(e);"click"===t.type&&i.push(t)});var o=i.reduce(function(e,r){var n=r.x,i=r.y,o=r.selector,s=r.timestamp,a=s-s%36e5,l="".concat(n,":").concat(i,":").concat(null!=o?o:"",":").concat(a);return e[l]?e[l].count+=1:e[l]=t(t({},r),{timestamp:a,count:1}),e},{});return{version:r,events:Object.values(o)}},lE=function(){return function(e,t){var r=this;this.createHook=function(e){var t=e.eventsManager,n=e.sessionId,i=e.deviceIdFn,o=e.mirror,s=e.ugcFilterRules,a=e.performanceOptions;return function(e){if(e.type===yx.Click){var l=de();if(l){var u=l.location,c=l.innerHeight,d=l.innerWidth;if(u){var h=e.x,p=e.y;if(void 0!==h&&void 0!==p){var f,g=o.getNode(e.id);if(g)try{f=Kx(g,a)}catch(e){r.logger.debug("error resolving selector from finder")}var v=cx(u.href,s),m={x:h+r.scrollWatcher.currentScrollX,y:p+r.scrollWatcher.currentScrollY,selector:f,viewportHeight:c,viewportWidth:d,pageUrl:v,timestamp:Date.now(),type:"click"},y=i();y&&t.addEvent({sessionId:n,event:{type:"interaction",data:JSON.stringify(m)},deviceId:y})}}}}}},this.logger=e,this.scrollWatcher=t}}();function uE(){var e=de();return(null==e?void 0:e.innerHeight)||document.documentElement&&document.documentElement.clientHeight||0}function cE(){var e=de();return(null==e?void 0:e.innerWidth)||document.documentElement&&document.documentElement.clientWidth||0}Pi(),Pi();var dE=function(){function e(e,t){var r=de();r&&r.navigator&&"function"==typeof r.navigator.sendBeacon?this.sendBeacon=function(e,t){try{if(r.navigator.sendBeacon(e,JSON.stringify(t)))return!0}catch(e){}return!1}:this.sendBeacon=function(){return!1},this.sendXhr=function(e,t){var r=new XMLHttpRequest;return r.open("POST",e,!0),r.setRequestHeader("Accept","*/*"),r.send(JSON.stringify(t)),!0},this.basePageUrl=tx(t.serverZone,t.trackServerUrl),this.apiKey=t.apiKey,this.context=e}return e.prototype.send=function(e,t){var r=this.context,n=r.sessionId,i=r.type,o=new URLSearchParams({device_id:e,session_id:String(n),type:String(i),api_key:this.apiKey}),s="".concat(this.basePageUrl,"?").concat(o.toString());this.sendBeacon(s,t)||this.sendXhr(s,t)},e}();Pi();var hE=function(){function e(e,t){var r=this;this.timestamp=Date.now(),this.hook=function(e){r.update(e)},this.send=function(e){return function(t){var n,i,o,s,a=e(),l=de();if(l&&a){var u=null!==(n=l.scrollX)&&void 0!==n?n:0,c=null!==(i=l.scrollY)&&void 0!==i?i:0;(u>0||c>0)&&r.update({id:1,x:u,y:c}),r.transport.send(a,{version:1,events:[{maxScrollX:r._maxScrollX,maxScrollY:r._maxScrollY,maxScrollWidth:r._maxScrollWidth,maxScrollHeight:r._maxScrollHeight,viewportHeight:uE(),viewportWidth:cE(),pageUrl:cx(l.location.href,null!==(s=null===(o=r.config.interactionConfig)||void 0===o?void 0:o.ugcFilterRules)&&void 0!==s?s:[]),timestamp:r.timestamp,type:"scroll"}]})}}},this._maxScrollX=0,this._maxScrollY=0,this._currentScrollX=0,this._currentScrollY=0,this._maxScrollWidth=cE(),this._maxScrollHeight=uE(),this.config=t,this.transport=e}return e.default=function(t,r){return new e(new dE(t,r),r)},Object.defineProperty(e.prototype,"maxScrollX",{get:function(){return this._maxScrollX},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxScrollY",{get:function(){return this._maxScrollY},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxScrollWidth",{get:function(){return this._maxScrollWidth},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxScrollHeight",{get:function(){return this._maxScrollHeight},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentScrollX",{get:function(){return this._currentScrollX},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentScrollY",{get:function(){return this._currentScrollY},enumerable:!1,configurable:!0}),e.prototype.update=function(e){var t=Date.now();if(this._currentScrollX=e.x,this._currentScrollY=e.y,e.x>this._maxScrollX){var r=cE();this._maxScrollX=e.x;var n=e.x+r;n>this._maxScrollWidth&&(this._maxScrollWidth=n),this.timestamp=t}if(e.y>this._maxScrollY){var i=uE();this._maxScrollY=e.y;var o=e.y+i;o>this._maxScrollHeight&&(this._maxScrollHeight=o),this.timestamp=t}},e}(),pE=function(){return function(e){var t=e.sessionId,r=e.deviceId;this.deviceId=r,this.sessionId=t,t&&r&&(this.sessionReplayId=function(e,t){return"".concat(t,"/").concat(e)}(t,r))}}();Ne(),Pi();var fE=864e5,gE=function(e){return"".concat("AMP_SR_START_").concat(e.substring(0,10),"_")},vE=function(e,t){return"".concat(gE(e)).concat(t)},mE=function(){try{var e=de();return null==e?void 0:e.localStorage}catch(e){return}};Ne(),Ne(),Vo();var yE=new(function(){return function(){var e=this;this.dbs={},this.createStore=function(t){return v(e,void 0,void 0,function(){return m(this,function(e){switch(e.label){case 0:return[4,Di(t,1,{upgrade:function(e){e.objectStoreNames.contains("sessionTargetingMatch")||e.createObjectStore("sessionTargetingMatch",{keyPath:"sessionId"})}})];case 1:return[2,e.sent()]}})})},this.openOrCreateDB=function(t){return v(e,void 0,void 0,function(){var e,r;return m(this,function(n){switch(n.label){case 0:return this.dbs&&this.dbs[t]?[2,this.dbs[t]]:(e="".concat(t.substring(0,10),"_amp_session_replay_targeting"),[4,this.createStore(e)]);case 1:return r=n.sent(),this.dbs[t]=r,[2,r]}})})},this.getTargetingMatchForSession=function(t){var r=t.loggerProvider,n=t.apiKey,i=t.sessionId;return v(e,void 0,void 0,function(){var e,t,o,s;return m(this,function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),[4,this.openOrCreateDB(n)];case 1:return e=a.sent(),t=String(i),[4,e.get("sessionTargetingMatch",t)];case 2:return[2,null==(o=a.sent())?void 0:o.targetingMatch];case 3:return s=a.sent(),Mx(r,"Failed to get targeting match for session id ".concat(i,": ").concat(s),s),[3,4];case 4:return[2,void 0]}})})},this.storeTargetingMatchForSession=function(t){var r=t.loggerProvider,n=t.apiKey,i=t.sessionId,o=t.targetingMatch;return v(e,void 0,void 0,function(){var e,t,s;return m(this,function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),[4,this.openOrCreateDB(n)];case 1:return e=a.sent(),t=String(i),[4,e.put("sessionTargetingMatch",{targetingMatch:o,sessionId:t,lastUpdated:Date.now()})];case 2:return[2,a.sent()];case 3:return s=a.sent(),Mx(r,"Failed to store targeting match for session id ".concat(i,": ").concat(s),s),[3,4];case 4:return[2,void 0]}})})},this.clearStoreOfOldSessions=function(t){var r=t.loggerProvider,n=t.apiKey,i=t.currentSessionId;return v(e,void 0,void 0,function(){var e,t,o,s,a,l,u,c;return m(this,function(d){switch(d.label){case 0:return d.trys.push([0,8,,9]),[4,this.openOrCreateDB(n)];case 1:return e=d.sent(),t=String(i),[4,(o=e.transaction("sessionTargetingMatch","readwrite")).store.getAll()];case 2:s=d.sent(),a=0,d.label=3;case 3:return a<s.length?(l=s[a],u=Date.now()-l.lastUpdated,l.sessionId!==t&&u>1728e5?[4,o.store.delete(l.sessionId)]:[3,5]):[3,6];case 4:d.sent(),d.label=5;case 5:return a++,[3,3];case 6:return[4,o.done];case 7:return d.sent(),[3,9];case 8:return c=d.sent(),Mx(r,"Failed to clear old targeting matches for sessions: ".concat(c),c),[3,9];case 9:return[2]}})})}}}()),bE=function(e){var r=e.sessionId,n=e.targetingConfig,i=e.loggerProvider,o=e.apiKey,s=e.targetingParams,a=e.urlChange,l=void 0!==a&&a;return v(void 0,void 0,void 0,function(){var e,a,u,c,d,h;return m(this,function(p){switch(p.label){case 0:return[4,yE.clearStoreOfOldSessions({loggerProvider:i,apiKey:o,currentSessionId:r})];case 1:return p.sent(),[4,yE.getTargetingMatchForSession({loggerProvider:i,apiKey:o,sessionId:r})];case 2:if(!0===p.sent()&&!l)return[2,!0];e=!0,p.label=3;case 3:return p.trys.push([3,6,,7]),[4,Promise.resolve().then(()=>(os(),rs))];case 4:return a=p.sent().evaluateTargeting,u=t(t({},s),{flag:n,sessionId:"string"==typeof r?parseInt(r,10):r,apiKey:o,loggerProvider:i}),[4,a(u)];case 5:return(c=p.sent())&&c.sr_targeting_config&&(e="on"===c.sr_targeting_config.key),yE.storeTargetingMatchForSession({loggerProvider:i,apiKey:o,sessionId:r,targetingMatch:e}),[3,7];case 6:return d=p.sent(),h=d,i.warn(h.message),[3,7];case 7:return[2,e]}})})},wE=2654435761,SE=2246822519,kE=3266489917,xE=374761393;function EE(e,t){return(e<<t|e>>>32-t)>>>0}function CE(e,t){return e=EE(e=e+Math.imul(t,SE)>>>0,13),e=Math.imul(e,wE)>>>0}function IE(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function OE(e,t){void 0===t&&(t=0);var r,n=function(e){for(var t=[],r=0;r<e.length;r++){var n=e.charCodeAt(r);if(n>=55296&&n<=56319&&r+1<e.length){var i=e.charCodeAt(r+1);i>=56320&&i<=57343&&(n=i-56320+(n-55296<<10)+65536,r++)}n<128?t.push(n):n<2048?t.push(192|n>>6,128|63&n):n<65536?t.push(224|n>>12,128|n>>6&63,128|63&n):t.push(240|n>>18,128|n>>12&63,128|n>>6&63,128|63&n)}return new Uint8Array(t)}(e),i=n.length,o=0;if(i>=16){for(var s=t+wE+SE>>>0,a=t+SE>>>0,l=t>>>0,u=t-wE>>>0;o<=i-16;)s=CE(s,IE(n,o)),a=CE(a,IE(n,o+=4)),l=CE(l,IE(n,o+=4)),u=CE(u,IE(n,o+=4)),o+=4;r=EE(s,1)+EE(a,7)+EE(l,12)+EE(u,18)>>>0}else r=t+xE>>>0;for(r=r+i>>>0;o<=i-4;)r=r+Math.imul(IE(n,o),kE)>>>0,r=Math.imul(EE(r,17),668265263)>>>0,o+=4;for(;o<i;)r=r+Math.imul(n[o],xE)>>>0,r=Math.imul(EE(r,11),wE)>>>0,o++;return r^=r>>>15,r=Math.imul(r,SE)>>>0,r^=r>>>13,r=Math.imul(r,kE)>>>0,(r^=r>>>16)>>>0}Ne();var TE="__amplitude_url_tracking_patched__",AE=new WeakMap;function RE(e,t,r){if(void 0===r&&(r={}),!(null==e?void 0:e.location))return function(){};var n=r.enablePolling,i=void 0!==n&&n,o=r.pollingInterval,s=void 0===o?jk:o;if(i){var a=function(){var t;return null!==(t=e.location.href)&&void 0!==t?t:""},l=a(),u=e.setInterval(function(){var e=a();e!==l&&(l=e,t(e))},s);return function(){null!=u&&e.clearInterval(u)}}var c=AE.get(e);if(!c){var d=void 0,h=new Set,p=function(){var t,r=null!==(t=e.location.href)&&void 0!==t?t:"";void 0!==d&&r===d||(d=r,h.forEach(function(e){return e(r)}))},f=function(e){var t=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=e.apply(this,t);return p(),n};return t[TE]=!0,t},g=e.history;if(null==g?void 0:g.pushState){var v=Reflect.get(g,"pushState");v[TE]||(g.pushState=f(v))}if(null==g?void 0:g.replaceState){var m=Reflect.get(g,"replaceState");m[TE]||(g.replaceState=f(m))}c={callbacks:h,notify:p,onPopStateOrHashChange:function(){return p()},listenersAttached:!1},AE.set(e,c)}var y=c;return y.listenersAttached||(e.addEventListener("popstate",y.onPopStateOrHashChange),e.addEventListener("hashchange",y.onPopStateOrHashChange),y.listenersAttached=!0),y.callbacks.add(t),function(){y.callbacks.delete(t),0===y.callbacks.size&&y.listenersAttached&&(e.removeEventListener("popstate",y.onPopStateOrHashChange),e.removeEventListener("hashchange",y.onPopStateOrHashChange),y.listenersAttached=!1)}}function PE(e){return void 0===e&&(e={}),{name:"amplitude/url-tracking@1",observer:function(r,n,i){var o,s,a,l=t(t({},e),i),u=l.ugcFilterRules||[],c=null!==(o=l.enablePolling)&&void 0!==o&&o,d=null!==(s=l.pollingInterval)&&void 0!==s?s:jk,h=null!==(a=l.captureDocumentTitle)&&void 0!==a&&a;if(!n)return function(){};var p=void 0,f=function(){return n.location&&n.location.href||""},g=function(){var e=f();if(void 0===p||e!==p){p=e;var t=function(){var e=n.innerHeight,t=n.innerWidth,r=n.document,i=f(),o="";return h&&(o=(null==r?void 0:r.title)||""),{href:u.length>0?cx(i,u):i,title:o,viewportHeight:e,viewportWidth:t,type:"url-change-event"}}();r(t)}},v=RE(n,function(){return g()},c?{enablePolling:!0,pollingInterval:d}:{});return g(),function(){return v()}},options:e}}PE();Ne(),Pi();var _E=function(){function e(){this.pendingLoadListeners=new Map}return e.prototype.start=function(){var e,t=this;null===(e=this.mutationObserver)||void 0===e||e.disconnect(),de()&&(this.sendToAllIframes({type:Yk,action:"start"}),this.mutationObserver=new MutationObserver(function(e){var r,n,i,o,s,a;try{for(var l=y(e),u=l.next();!u.done;u=l.next()){var c=u.value;try{for(var d=(i=void 0,y(Array.from(c.addedNodes))),h=d.next();!h.done;h=d.next()){(g=h.value)instanceof HTMLIFrameElement?t.sendToIframeAfterLoad(g):g instanceof Element&&g.querySelectorAll("iframe").forEach(function(e){t.sendToIframeAfterLoad(e)})}}catch(e){i={error:e}}finally{try{h&&!h.done&&(o=d.return)&&o.call(d)}finally{if(i)throw i.error}}try{for(var p=(s=void 0,y(Array.from(c.removedNodes))),f=p.next();!f.done;f=p.next()){var g;if((g=f.value)instanceof HTMLIFrameElement){var v=t.pendingLoadListeners.get(g);v&&(g.removeEventListener("load",v),t.pendingLoadListeners.delete(g))}}}catch(e){s={error:e}}finally{try{f&&!f.done&&(a=p.return)&&a.call(p)}finally{if(s)throw s.error}}}}catch(e){r={error:e}}finally{try{u&&!u.done&&(n=l.return)&&n.call(l)}finally{if(r)throw r.error}}}),this.mutationObserver.observe(document.documentElement,{childList:!0,subtree:!0}))},e.prototype.stop=function(){var e;null===(e=this.mutationObserver)||void 0===e||e.disconnect(),this.mutationObserver=void 0,this.pendingLoadListeners.forEach(function(e,t){t.removeEventListener("load",e)}),this.pendingLoadListeners.clear(),this.sendToAllIframes({type:Yk,action:"stop"})},e.prototype.sendToIframeAfterLoad=function(e){var t=this,r=function(){t.pendingLoadListeners.delete(e),t.sendToIframe(e,{type:Yk,action:"start"})};this.pendingLoadListeners.set(e,r),e.addEventListener("load",r,{once:!0})},e.prototype.sendToAllIframes=function(e){var t=this;document.querySelectorAll("iframe").forEach(function(r){return t.sendToIframe(r,e)})},e.prototype.sendToIframe=function(e,t){var r;try{null===(r=e.contentWindow)||void 0===r||r.postMessage(t,"*")}catch(e){}},e}();var ME,NE=function(){function e(){var e=this;this.name="@amplitude/session-replay-browser",this.recordCancelCallback=null,this.eventCount=0,this.sessionTargetingMatch=!1,this.pageLeaveFns=[],this.suppressedSendCount=0,this.hasEmittedGateDecision=!1,this.recordFunction=null,this.recordEventsInFlight=!1,this.pendingEmitEvents=[],this.currentPageUrl="",this.recordEventsPendingShouldLogMetadata=null,this.urlChangeCleanup=null,this.crossOriginIframeCoordinator=null,this.crossOriginParentSignalCleanup=null,this.latestUrlChangeTargetingEvaluationId=0,this.teardownEventListeners=function(t){var r=de();r&&(r.removeEventListener("blur",e.blurListener),r.removeEventListener("focus",e.focusListener),!t&&r.addEventListener("blur",e.blurListener),!t&&r.addEventListener("focus",e.focusListener),r.self&&"onpagehide"in r.self?(r.removeEventListener("pagehide",e.pageLeaveListener),!t&&r.addEventListener("pagehide",e.pageLeaveListener)):(r.removeEventListener("beforeunload",e.pageLeaveListener),!t&&r.addEventListener("beforeunload",e.pageLeaveListener)))},this.blurListener=function(){e.sendEvents()},this.focusListener=function(){if(e.recordCancelCallback&&e.recordFunction)try{e.recordFunction.takeFullSnapshot(!0)}catch(t){e.loggerProvider.warn("Failed to take full snapshot on focus:",t)}else e.recordEventsInFlight||e.recordEvents(!1)},this.pageLeaveListener=function(t){var r;null===(r=e.eventCompressor)||void 0===r||r.flushQueue(),e.sendEvents(),e.pageLeaveFns.forEach(function(e){e(t)})},this.evaluateTargetingAndCapture=function(t,r,n,i){return void 0===r&&(r=!1),void 0===n&&(n=!1),void 0===i&&(i=!1),v(e,void 0,void 0,function(){var e,o,s,a,l,u,c,d,h,p,f,g;return m(this,function(v){switch(v.label){case 0:if(!this.identifiers||!this.identifiers.sessionId||!this.config)return this.identifiers&&!this.identifiers.sessionId?this.loggerProvider.log("Session ID has not been set yet, cannot evaluate targeting for Session Replay."):this.loggerProvider.warn("Session replay init has not been called, cannot evaluate targeting."),[2];if(!this.config.targetingConfig){if(!r)return this.loggerProvider.log("No targeting config set, skipping initialization/recording for event."),[2];this.loggerProvider.log("Targeting config has not been set yet, cannot evaluate targeting.")}return this.lastTargetingParams=t,e=this.config.targetingConfig,e&&!this.sessionTargetingMatch?(o=i?this.latestUrlChangeTargetingEvaluationId:void 0,(s=t.event)&&Object.values(k).includes(s.event_type)&&(s=void 0),a=null!==(f=null!==(d=null===(c=t.page)||void 0===c?void 0:c.url)&&void 0!==d?d:null===(p=null===(h=de())||void 0===h?void 0:h.location)||void 0===p?void 0:p.href)&&void 0!==f?f:"",l=null!==(g=t.page)&&void 0!==g?g:""!==a?{url:a}:void 0,[4,bE({sessionId:this.identifiers.sessionId,targetingConfig:e,loggerProvider:this.loggerProvider,apiKey:this.config.apiKey,targetingParams:{userProperties:t.userProperties,event:s,page:l},urlChange:i})]):[3,2];case 1:if(u=v.sent(),i&&void 0!==o&&o!==this.latestUrlChangeTargetingEvaluationId)return this.loggerProvider.debug("Ignoring stale URL-change targeting result #".concat(o,"; latest is #").concat(this.latestUrlChangeTargetingEvaluationId,".")),[2];this.sessionTargetingMatch=this.sessionTargetingMatch||u,this.loggerProvider.debug(JSON.stringify({name:"targeted replay capture config",sessionTargetingMatch:this.sessionTargetingMatch,event:s,targetingParams:t},null,2)),v.label=2;case 2:return r?(this.initialize(!0),[3,5]):[3,3];case 3:return!n&&this.recordCancelCallback?[3,5]:(this.loggerProvider.log("Recording events for session due to forceRestart or no ongoing recording."),[4,this.recordEvents()]);case 4:v.sent(),v.label=5;case 5:return[2]}})})},this.addCustomRRWebEvent=function(r,n,i){return void 0===n&&(n={}),void 0===i&&(i=!0),v(e,void 0,void 0,function(){var e,o,s,a;return m(this,function(l){switch(l.label){case 0:return l.trys.push([0,3,,4]),e=void 0,(o=this.config)&&r!==Mk.METADATA?(e={config:hx(o),version:Ax},i?[4,dx()]:[3,2]):[3,2];case 1:s=l.sent(),e=t(t({},s),e),l.label=2;case 2:return this.recordCancelCallback&&this.recordFunction?this.recordFunction.addCustomEvent(r,t(t({},n),e)):this.loggerProvider.debug("Not able to add custom replay capture event ".concat(r," due to no ongoing recording.")),[3,4];case 3:return a=l.sent(),this.loggerProvider.debug("Error while adding custom replay capture event: ",a),[3,4];case 4:return[2]}})})},this.stopRecordingEvents=function(){var t,r,n;try{e.loggerProvider.log("Session Replay capture stopping."),e.recordCancelCallback&&e.recordCancelCallback(),e.recordCancelCallback=null,null===(t=e.networkObservers)||void 0===t||t.stop(),null===(r=e.crossOriginIframeCoordinator)||void 0===r||r.stop(),e.crossOriginIframeCoordinator=null,null===(n=e.crossOriginParentSignalCleanup)||void 0===n||n.call(e),e.crossOriginParentSignalCleanup=null}catch(t){var i=t;e.loggerProvider.warn("Error occurred while stopping replay capture: ".concat(i.toString()))}},this.loggerProvider=new Zk(new Te)}return e.prototype.init=function(e,t){return Se(this._init(e,t))},e.prototype.setupUrlChangeListener=function(){var e,t,r=this;null===(e=this.urlChangeCleanup)||void 0===e||e.call(this);var n=de();if(null==n?void 0:n.location){var i=!!(null===(t=this.config)||void 0===t?void 0:t.targetingConfig),o=RE(n,function(e){if(r.currentPageUrl=e,i){var t=++r.latestUrlChangeTargetingEvaluationId;r.evaluateTargetingAndCapture({userProperties:{},event:void 0,page:{url:e}},!1,!1,!0),r.loggerProvider.debug("Queued URL-change targeting re-evaluation #".concat(t," for ").concat(e,"."))}});this.urlChangeCleanup=function(){o(),r.urlChangeCleanup=null}}},e.prototype.isBelowMinSessionDuration=function(){var e,t=null===(e=this.config)||void 0===e?void 0:e.minSessionDurationMs;return void 0!==t&&void 0!==this.sessionStartTime&&Date.now()-this.sessionStartTime<t},e.prototype.getCurrentPageForTargeting=function(){var e,t,r=null===(t=null===(e=de())||void 0===e?void 0:e.location)||void 0===t?void 0:t.href;return null!=r?{url:r}:void 0},e.prototype._init=function(e,r){var n,i,o,s,a,l,u,c,d,h,p,f,g,S;return v(this,void 0,void 0,function(){var v,k,x,E,C,I,O,T,A,R,P,_,M,N,L,D,U,F,j,B,q,z,W,V,$,H,K,G,J,Q,X=this;return m(this,function(m){switch(m.label){case 0:return null===(n=this.urlChangeCleanup)||void 0===n||n.call(this),this.loggerProvider=new Zk(r.loggerProvider||new Te),Object.prototype.hasOwnProperty.call(r,"logLevel")&&this.loggerProvider.enable(r.logLevel),this.currentPageUrl=ax(),this.identifiers=new pE({sessionId:r.sessionId,deviceId:r.deviceId}),v=Date.now(),function(e,t,r){var n,i,o=mE();if(o){var s=gE(e);try{for(var a=[],l=0;l<o.length;l++)if((p=o.key(l))&&p.startsWith(s)){var u=o.getItem(p);if(null!==u){var c=Number(u);(!Number.isFinite(c)||c<=0||t-c>=fE)&&a.push(p)}}try{for(var d=y(a),h=d.next();!h.done;h=d.next()){var p=h.value;o.removeItem(p)}}catch(e){n={error:e}}finally{try{h&&!h.done&&(i=d.return)&&i.call(d)}finally{if(n)throw n.error}}}catch(e){null==r||r.debug("Failed to prune stale replay start times: ".concat(String(e)))}}}(e,v,this.loggerProvider),this.sessionStartTime=void 0!==r.sessionId&&null!==(i=function(e,t,r,n){var i=mE();if(i){var o=vE(e,t);try{var s=i.getItem(o);if(null!==s){var a=Number(s);if(Number.isFinite(a)&&a>0&&a<=r&&r-a<fE)return a}return i.setItem(o,String(r)),r}catch(e){return void(null==n||n.debug("Failed to read/write replay start time from storage: ".concat(String(e))))}}}(e,r.sessionId,v,this.loggerProvider))&&void 0!==i?i:v,k=this,[4,Sx(e,r)];case 1:return k.joinedConfigGenerator=m.sent(),[4,this.joinedConfigGenerator.generateJoinedConfig()];case 2:return x=m.sent(),E=x.joinedConfig,C=x.localConfig,I=x.remoteConfig,this.config=E,this.setMetadata(r.sessionId,E,C,I,null===(o=r.version)||void 0===o?void 0:o.version,Ax,null===(s=r.version)||void 0===s?void 0:s.type),this.pageLeaveFns=[],r.sessionId&&(null===(a=this.config.interactionConfig)||void 0===a?void 0:a.enabled)&&(O=hE.default({sessionId:r.sessionId,type:"interaction"},this.config),this.pageLeaveFns=[O.send(this.getDeviceId.bind(this)).bind(O)],this.scrollHook=O.hook.bind(O),this.clickHandler=new lE(this.loggerProvider,O)),T=[],"idb"!==(A=this.config.storeType)||(null===(l=de())||void 0===l?void 0:l.indexedDB)||(A="memory",this.loggerProvider.warn("Could not use preferred indexedDB storage, reverting to in memory option.")),this.loggerProvider.log("Using ".concat(A," for event storage.")),_=de(),this.config.useWebWorker&&_&&_.Worker?[4,Promise.resolve().then(()=>(gu(),ss))]:[3,4];case 3:M=m.sent(),N=M.compressionScript,L=M.trackDestinationScript,R=N,P=L,m.label=4;case 4:return m.trys.push([4,6,,7]),[4,zx({config:this.config,type:"replay",minInterval:null===(u=this.config.flushIntervalConfig)||void 0===u?void 0:u.minIntervalMs,maxInterval:null===(c=this.config.flushIntervalConfig)||void 0===c?void 0:c.maxIntervalMs,storeType:A,trackDestinationWorkerScript:P,shouldSend:function(){return!X.isBelowMinSessionDuration()}})];case 5:return D=m.sent(),this.rrwebEventManager=D,T.push({name:"replay",manager:D}),[3,7];case 6:return U=m.sent(),q=U,this.loggerProvider.warn("Error occurred while creating replay events manager: ".concat(q.toString())),[3,7];case 7:if(!(null===(d=this.config.interactionConfig)||void 0===d?void 0:d.enabled))return[3,11];F=this.config.interactionConfig.batch?aE:sE,m.label=8;case 8:return m.trys.push([8,10,,11]),[4,zx({config:this.config,type:"interaction",minInterval:null!==(h=this.config.interactionConfig.trackEveryNms)&&void 0!==h?h:3e4,maxInterval:6e4,payloadBatcher:F,storeType:A,trackDestinationWorkerScript:P})];case 9:return j=m.sent(),T.push({name:"interaction",manager:j}),[3,11];case 10:return B=m.sent(),q=B,this.loggerProvider.warn("Error occurred while creating interaction events manager: ".concat(q.toString())),[3,11];case 11:if(this.eventsManager=new(Hx.bind.apply(Hx,w([void 0],b(T),!1))),this.eventCompressor&&this.eventCompressor.terminate(),this.eventCompressor=new Cx(this.eventsManager,this.config,this.getDeviceId(),R,function(){return X.sendEvents()}),this.pendingEmitEvents.length>0){z=this.pendingEmitEvents.splice(0);try{for(W=y(z),V=W.next();!V.done;V=W.next())$=V.value,H=$.event,K=$.sessionId,this.eventCompressor.enqueueEvent(H,K)}catch(e){J={error:e}}finally{try{V&&!V.done&&(Q=W.return)&&Q.call(W)}finally{if(J)throw J.error}}}return this.pageLeaveFns=w(w([],b(this.pageLeaveFns),!1),[function(){var e;if(X.config&&(null===(e=X.identifiers)||void 0===e?void 0:e.sessionId)&&D){var t=D.getBeaconEvents();if(t.length){var r=X.getDeviceId();r&&(X.isBelowMinSessionDuration()||D.trackDestination.sendBeacon({events:t,sessionId:X.identifiers.sessionId,deviceId:r,apiKey:X.config.apiKey,serverZone:X.config.serverZone}))}}}],!1),[4,this.initializeNetworkObservers()];case 12:return m.sent(),(null===(p=de())||void 0===p?void 0:p.opener)&&(ci(G=ai()),G.setup(t({logger:this.loggerProvider},this.config.serverZone&&{endpoint:Jn[this.config.serverZone]}))),this.loggerProvider.log("Installing @amplitude/session-replay-browser."),this.teardownEventListeners(!1),[4,this.evaluateTargetingAndCapture({userProperties:r.userProperties,page:this.getCurrentPageForTargeting()},!0)];case 13:return m.sent(),(this.config.targetingConfig||(null!==(S=null===(g=null===(f=this.config.privacyConfig)||void 0===f?void 0:f.urlMaskLevels)||void 0===g?void 0:g.length)&&void 0!==S?S:0)>0)&&this.setupUrlChangeListener(),[2]}})})},e.prototype.setSessionId=function(e,t){return Se(this.asyncSetSessionId(e,t))},e.prototype.asyncSetSessionId=function(e,t,r){var n,i,o;return v(this,void 0,void 0,function(){var s,a,l,u;return m(this,function(c){switch(c.label){case 0:return this.latestUrlChangeTargetingEvaluationId++,this.sessionTargetingMatch=!1,this.lastShouldRecordDecision=void 0,(s=this.identifiers&&this.identifiers.sessionId)&&this.sendEvents(s),(a=s!==e)&&(null===(n=this.rrwebEventManager)||void 0===n||n.dropPendingBeaconEvents()),l=t||this.getDeviceId(),this.identifiers=new pE({sessionId:e,deviceId:l}),a&&(this.sessionStartTime=Date.now(),this.suppressedSendCount=0,this.hasEmittedGateDecision=!1,(null===(i=this.config)||void 0===i?void 0:i.apiKey)&&(function(e,t,r,n){var i=mE();if(i)try{i.setItem(vE(e,t),String(r))}catch(e){null==n||n.debug("Failed to write replay start time to storage: ".concat(String(e)))}}(this.config.apiKey,e,this.sessionStartTime,this.loggerProvider),void 0!==s&&function(e,t,r){var n=mE();if(n)try{n.removeItem(vE(e,t))}catch(e){null==r||r.debug("Failed to remove replay start time from storage: ".concat(String(e)))}}(this.config.apiKey,s,this.loggerProvider))),this.joinedConfigGenerator&&s?[4,this.joinedConfigGenerator.generateJoinedConfig()]:[3,2];case 1:u=c.sent().joinedConfig,this.config=u,c.label=2;case 2:return(null===(o=this.config)||void 0===o?void 0:o.targetingConfig)?[4,this.evaluateTargetingAndCapture({userProperties:null==r?void 0:r.userProperties,page:this.getCurrentPageForTargeting()},!1,!0)]:[3,4];case 3:return c.sent(),[3,6];case 4:return[4,this.recordEvents()];case 5:c.sent(),c.label=6;case 6:return[2]}})})},e.prototype.getSessionReplayProperties=function(){var e,t=this.config,r=this.identifiers;if(!t||!r)return this.loggerProvider.warn("Session replay init has not been called, cannot get session replay properties."),{};var n=this.getShouldRecord(),i={};return n&&((e={})[Dk]=r.sessionReplayId?r.sessionReplayId:null,i=e,t.debugMode&&(i[Bk]=JSON.stringify({appHash:Nt(t.apiKey).toString()}))),this.addCustomRRWebEvent(Mk.GET_SR_PROPS,{shouldRecord:n,eventProperties:i},10===this.eventCount),10===this.eventCount&&(this.eventCount=0),this.eventCount++,i},e.prototype.sendEvents=function(e){var t,r,n=e||(null===(t=this.identifiers)||void 0===t?void 0:t.sessionId),i=this.getDeviceId();if(this.eventsManager&&n&&i){if(this.isBelowMinSessionDuration()){var o=this.sessionStartTime,s=this.config.minSessionDurationMs;return this.loggerProvider.log("Session ".concat(n," not sent: duration ").concat(Date.now()-o,"ms is below minimum ").concat(s,"ms.")),void this.suppressedSendCount++}if(!this.hasEmittedGateDecision&&void 0!==(null===(r=this.config)||void 0===r?void 0:r.minSessionDurationMs)&&this.recordCancelCallback&&this.recordFunction){this.hasEmittedGateDecision=!0;var a=void 0!==this.sessionStartTime?Date.now()-this.sessionStartTime:void 0;this.addCustomRRWebEvent(Mk.REPLAY_GATE_DECISION,{sessionId:n,suppressedSendCount:this.suppressedSendCount,elapsedMs:a,minSessionDurationMs:this.config.minSessionDurationMs},!1)}this.eventsManager.sendCurrentSequenceEvents({sessionId:n,deviceId:i})}},e.prototype.initialize=function(e){var t;return void 0===e&&(e=!1),v(this,void 0,void 0,function(){var r;return m(this,function(n){return(null===(t=this.identifiers)||void 0===t?void 0:t.sessionId)?(r=this.getDeviceId())?(this.eventsManager&&e&&this.eventsManager.sendStoredEvents({deviceId:r}),[2,this.recordEvents()]):(this.loggerProvider.log("Session is not being recorded due to lack of device id."),[2,Promise.resolve()]):(this.loggerProvider.log("Session is not being recorded due to lack of session id."),[2,Promise.resolve()])})})},e.prototype.shouldOptOut=function(){var e,t,r;(null===(e=this.config)||void 0===e?void 0:e.instanceName)&&(r=kt(this.config.instanceName).identityStore.getIdentity().optOut);return void 0!==r?r:null===(t=this.config)||void 0===t?void 0:t.optOut},e.prototype.getShouldRecord=function(){if(!this.identifiers||!this.config||!this.identifiers.sessionId)return this.loggerProvider.warn("Session is not being recorded due to lack of config, please call sessionReplay.init."),!1;if(!this.config.captureEnabled)return this.loggerProvider.log("Session ".concat(this.identifiers.sessionId," not being captured due to capture being disabled for project or because the remote config could not be fetched.")),!1;if(this.shouldOptOut())return this.loggerProvider.log("Opting session ".concat(this.identifiers.sessionId," out of recording due to optOut config.")),!1;var e,t,r=!1,n="",i=!1;this.config.targetingConfig?this.sessionTargetingMatch?(n="Capturing replays for session ".concat(this.identifiers.sessionId," due to matching targeting conditions."),this.loggerProvider.log(n),r=!0,i=!0):(n="Not capturing replays for session ".concat(this.identifiers.sessionId," due to not matching targeting conditions."),this.loggerProvider.log(n),r=!1,i=!1):(e=this.identifiers.sessionId,t=this.config.sampleRate,OE(e.toString())%1e6/1e6<t)?(r=!0,i=!0):(n="Opting session ".concat(this.identifiers.sessionId," out of recording due to sample rate."),this.loggerProvider.log(n),r=!1,i=!1);return this.lastShouldRecordDecision!==r&&this.config.targetingConfig&&(this.addCustomRRWebEvent(Mk.TARGETING_DECISION,{message:n,sessionId:this.identifiers.sessionId,matched:i,targetingParams:this.lastTargetingParams}),this.lastShouldRecordDecision=r),r},e.prototype.getBlockSelectors=function(){var e,t,r,n=null!==(r=null===(t=null===(e=this.config)||void 0===e?void 0:e.privacyConfig)||void 0===t?void 0:t.blockSelector)&&void 0!==r?r:[];if(0!==n.length)return n},e.prototype.getMaskTextSelectors=function(){var e,t,r=null===(e=this.config)||void 0===e?void 0:e.privacyConfig;if("conservative"===(r?nx(this.currentPageUrl,r):void 0))return"*";if(null===(t=null==r?void 0:r.urlMaskLevels)||void 0===t?void 0:t.some(function(e){return"conservative"===e.maskLevel}))return"*";var n=null==r?void 0:r.urlMaskLevels;if("conservative"===(null==r?void 0:r.defaultMaskLevel)&&n&&n.length>0)return"*";var i=null==r?void 0:r.maskSelector;return i||void 0},e.prototype.getRecordingPlugins=function(e){var t,r,n,i,o,s;return v(this,void 0,void 0,function(){var a,l,u,c;return m(this,function(d){switch(d.label){case 0:a=[];try{l=PE({ugcFilterRules:(null===(r=null===(t=this.config)||void 0===t?void 0:t.interactionConfig)||void 0===r?void 0:r.ugcFilterRules)||[],enablePolling:(null===(n=this.config)||void 0===n?void 0:n.enableUrlChangePolling)||!1,pollingInterval:null===(i=this.config)||void 0===i?void 0:i.urlChangePollingInterval,captureDocumentTitle:null===(o=this.config)||void 0===o?void 0:o.captureDocumentTitle}),a.push(l)}catch(e){this.loggerProvider.warn("Failed to create URL tracking plugin:",e)}if(!(null===(s=null==e?void 0:e.console)||void 0===s?void 0:s.enabled))return[3,4];d.label=1;case 1:return d.trys.push([1,3,,4]),[4,Promise.resolve().then(()=>(kg(),vu))];case 2:return u=d.sent().getRecordConsolePlugin,a.push(u({level:e.console.levels})),[3,4];case 3:return c=d.sent(),this.loggerProvider.warn("Failed to load console plugin:",c),[3,4];case 4:return[2,a.length>0?a:void 0]}})})},e.prototype.getRecordFunction=function(){return v(this,void 0,void 0,function(){var e,t;return m(this,function(r){switch(r.label){case 0:if(this.recordFunction)return[2,this.recordFunction];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,Promise.resolve().then(()=>(py(),xg))];case 2:return e=r.sent().record,this.recordFunction=e,[2,e];case 3:return t=r.sent(),this.loggerProvider.warn("Failed to load rrweb-record module:",t),[2,null];case 4:return[2]}})})},e.prototype.recordEvents=function(e){return void 0===e&&(e=!0),v(this,void 0,void 0,function(){var t;return m(this,function(r){switch(r.label){case 0:if(this.recordEventsInFlight)return this.recordEventsPendingShouldLogMetadata=e,[2];this.recordEventsInFlight=!0,r.label=1;case 1:return r.trys.push([1,,6,7]),[4,this._recordEvents(e)];case 2:r.sent(),r.label=3;case 3:return null===this.recordEventsPendingShouldLogMetadata?[3,5]:(t=this.recordEventsPendingShouldLogMetadata,this.recordEventsPendingShouldLogMetadata=null,[4,this._recordEvents(t)]);case 4:return r.sent(),[3,3];case 5:return[3,7];case 6:return this.recordEventsInFlight=!1,this.recordEventsPendingShouldLogMetadata=null,[7];case 7:return[2]}})})},e.prototype._recordEvents=function(e){var r,n,i,o,s,a,l,u;return void 0===e&&(e=!0),v(this,void 0,void 0,function(){var c,d,h,p,f,g,v,y,b,w,S,k,x,E,C,I,O,T,A,R=this;return m(this,function(m){switch(m.label){case 0:return c=this.config,d=this.getShouldRecord(),h=null===(r=this.identifiers)||void 0===r?void 0:r.sessionId,d&&h&&c?(this.stopRecordingEvents(),[4,this.getRecordFunction()]):[2];case 1:return(p=m.sent())?[4,this.initializeNetworkObservers()]:[2];case 2:m.sent(),f=null===(n=c.loggingConfig)||void 0===n?void 0:n.network,g=tx(c.serverZone,c.trackServerUrl),v=[Wk,Vk,$k,g],null===(i=this.networkObservers)||void 0===i||i.start(function(e){v.some(function(t){return e.url.startsWith(t)})||R.addCustomRRWebEvent(Mk.FETCH_REQUEST,e)},f),y=c.interactionConfig,b=c.loggingConfig,w=(null==y?void 0:y.enabled)?{mouseInteraction:this.eventsManager&&(null===(o=this.clickHandler)||void 0===o?void 0:o.createHook({eventsManager:this.eventsManager,sessionId:h,deviceIdFn:this.getDeviceId.bind(this),mirror:p.mirror,ugcFilterRules:null!==(s=y.ugcFilterRules)&&void 0!==s?s:[],performanceOptions:null===(a=c.performanceConfig)||void 0===a?void 0:a.interaction})),scroll:this.scrollHook}:{},S=(null==y?void 0:y.enabled)&&y.ugcFilterRules?y.ugcFilterRules:[],this.loggerProvider.log("Session Replay capture beginning for ".concat(h,".")),m.label=3;case 3:return m.trys.push([3,5,,6]),k=!!(null===(l=c.crossOriginIframes)||void 0===l?void 0:l.enabled),x=!1!==(null===(u=c.crossOriginIframes)||void 0===u?void 0:u.coordinateChildren),(E=k&&function(){try{var e=de();return!!e&&e.parent!==e}catch(e){return!0}}())&&x?(this.crossOriginParentSignalCleanup=function(e){var t=de();if(!t)return function(){};var r=t.parent;function n(t){if(t.source===r){var n=t.data;(null==n?void 0:n.type)===Yk&&("start"===n.action?e.onStart():"stop"===n.action&&e.onStop())}}return t.addEventListener("message",n),function(){return t.removeEventListener("message",n)}}({onStart:function(){return R._recordEventsInChildMode(p,h,c,w)},onStop:function(){try{R.recordCancelCallback&&R.recordCancelCallback(),R.recordCancelCallback=null}catch(t){var e=t;R.loggerProvider.warn("Error occurred while stopping child iframe replay capture: ".concat(e.toString()))}}}),[2]):(C=this,I=p,O=[t({},this.buildRRWebRecordOptions(c,w,function(e){if(R.shouldOptOut())return R.loggerProvider.log("Opting session ".concat(h," out of recording due to optOut config.")),R.stopRecordingEvents(),void R.sendEvents();e.type===vx.Meta&&(e.data.href=cx(e.data.href,S)),R.eventCompressor?R.eventCompressor.enqueueEvent(e,h):R.pendingEmitEvents.push({event:e,sessionId:h})},"Error while capturing replay: "))],A={},[4,this.getRecordingPlugins(b)]);case 4:return C.recordCancelCallback=I.apply(void 0,[t.apply(void 0,O.concat([(A.plugins=m.sent(),A.recordCrossOriginIframes=k,A)]))]),k&&!E&&x&&(this.crossOriginIframeCoordinator||(this.crossOriginIframeCoordinator=new _E),this.crossOriginIframeCoordinator.start()),this.addCustomRRWebEvent(Mk.DEBUG_INFO),e&&this.addCustomRRWebEvent(Mk.METADATA,this.metadata),[3,6];case 5:return T=m.sent(),this.loggerProvider.warn("Failed to initialize session replay:",T),[3,6];case 6:return[2]}})})},e.prototype.buildRRWebRecordOptions=function(e,r,n,i){var o=this,s=e.privacyConfig;return t(t({emit:n,inlineStylesheet:e.shouldInlineStylesheet,hooks:r,maskAllInputs:!0,maskTextClass:qk,blockClass:"amp-block",blockSelector:this.getBlockSelectors(),applyBackgroundColorToBlockedElements:e.applyBackgroundColorToBlockedElements,maskInputFn:ox("input",s,function(){return o.currentPageUrl}),maskTextFn:ox("text",s,function(){return o.currentPageUrl}),maskAttributeFn:sx(s,function(){return o.currentPageUrl}),maskTextSelector:this.getMaskTextSelectors()},void 0!==e.fullSnapshotIntervalMs&&{checkoutEveryNms:e.fullSnapshotIntervalMs}),{recordCanvas:!1,captureAdoptedStyleSheets:e.captureAdoptedStyleSheets,slimDOMOptions:{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0},errorHandler:function(e){var t=e;if(t.message.includes("insertRule")&&t.message.includes("CSSStyleSheet"))throw t;if(t._external_)throw t;return o.loggerProvider.warn(i,t.toString()),!0}})},e.prototype._recordEventsInChildMode=function(e,r,n,i){try{this.recordCancelCallback&&this.recordCancelCallback(),this.recordCancelCallback=null,this.recordCancelCallback=e(t(t({},this.buildRRWebRecordOptions(n,i,function(){},"Error while capturing replay (child iframe): ")),{recordCrossOriginIframes:!0})),this.loggerProvider.log("Session Replay child iframe capture beginning for session ".concat(r,"."))}catch(e){this.loggerProvider.warn("Failed to initialize session replay in child iframe mode:",e)}},e.prototype.getDeviceId=function(){var e;return null===(e=this.identifiers)||void 0===e?void 0:e.deviceId},e.prototype.getSessionId=function(){var e;return null===(e=this.identifiers)||void 0===e?void 0:e.sessionId},e.prototype.flush=function(e){var t;return void 0===e&&(e=!1),v(this,void 0,void 0,function(){return m(this,function(r){return[2,null===(t=this.eventsManager)||void 0===t?void 0:t.flush(e)]})})},e.prototype.shutdown=function(){var e,t;null===(e=this.urlChangeCleanup)||void 0===e||e.call(this),null===(t=this.crossOriginParentSignalCleanup)||void 0===t||t.call(this),this.crossOriginParentSignalCleanup=null,this.teardownEventListeners(!0),this.stopRecordingEvents(),this.sendEvents()},e.prototype.mapSDKType=function(e){return"plugin"===e?"@amplitude/plugin-session-replay-browser":"segment"===e?"@amplitude/segment-session-replay-plugin":null},e.prototype.setMetadata=function(e,t,r,n,i,o,s){var a=(null==e?void 0:e.toString())?Nt(e.toString()):void 0;this.metadata={joinedConfig:t,localConfig:r,remoteConfig:n,sessionId:e,hashValue:a,sampleRate:t.sampleRate,replaySDKType:this.mapSDKType(s),replaySDKVersion:i,standaloneSDKType:"@amplitude/session-replay-browser",standaloneSDKVersion:o}},e.prototype.initializeNetworkObservers=function(){var e,t,r;return v(this,void 0,void 0,function(){var n,i;return m(this,function(o){switch(o.label){case 0:if(!(null===(r=null===(t=null===(e=this.config)||void 0===e?void 0:e.loggingConfig)||void 0===t?void 0:t.network)||void 0===r?void 0:r.enabled)||this.networkObservers)return[3,4];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,Promise.resolve().then(()=>(vy(),fy))];case 2:return n=o.sent().NetworkObservers,this.networkObservers=new n,[3,4];case 3:return i=o.sent(),this.loggerProvider.warn("Failed to import or instantiate NetworkObservers:",i),[3,4];case 4:return[2]}})})},e}(),LE=function(e){return function(){var t=e.config||px();return{logger:t.loggerProvider,logLevel:t.logLevel}}},DE=(ME=new NE,{init:it(ME.init.bind(ME),"init",LE(ME)),evaluateTargetingAndCapture:it(ME.evaluateTargetingAndCapture.bind(ME),"evaluateTargetingAndRecord",LE(ME)),setSessionId:it(ME.setSessionId.bind(ME),"setSessionId",LE(ME)),getSessionId:it(ME.getSessionId.bind(ME),"getSessionId",LE(ME)),getSessionReplayProperties:it(ME.getSessionReplayProperties.bind(ME),"getSessionReplayProperties",LE(ME)),flush:it(ME.flush.bind(ME),"flush",LE(ME)),shutdown:it(ME.shutdown.bind(ME),"shutdown",LE(ME))}),UE=DE.init,FE=DE.setSessionId,jE=DE.getSessionId,BE=DE.getSessionReplayProperties,qE=DE.flush,zE=DE.shutdown,WE=DE.evaluateTargetingAndCapture;sr();var VE,$E,HE,KE,GE,JE;Ne(),($E=VE||(VE={})).SET="$set",$E.SET_ONCE="$setOnce",$E.ADD="$add",$E.APPEND="$append",$E.PREPEND="$prepend",$E.REMOVE="$remove",$E.PREINSERT="$preInsert",$E.POSTINSERT="$postInsert",$E.UNSET="$unset",$E.CLEAR_ALL="$clearAll",(KE=HE||(HE={})).REVENUE_PRODUCT_ID="$productId",KE.REVENUE_QUANTITY="$quantity",KE.REVENUE_PRICE="$price",KE.REVENUE_TYPE="$revenueType",KE.REVENUE_CURRENCY="$currency",KE.REVENUE="$revenue",(JE=GE||(GE={})).IDENTIFY="$identify",JE.GROUP_IDENTIFY="$groupidentify",JE.REVENUE="revenue_amount";var QE=[VE.SET,VE.SET_ONCE,VE.ADD,VE.APPEND,VE.PREPEND,VE.POSTINSERT],XE="1.31.0",YE="".concat("[Amplitude]"," Session Replay ID"),ZE=function(){function e(r){this.name=e.pluginName,this.type="enrichment",this.config=null,this.sessionReplay={flush:qE,getSessionId:jE,getSessionReplayProperties:BE,init:UE,setSessionId:FE,shutdown:zE,evaluateTargetingAndCapture:WE},this.options=t({forceSessionTracking:!1},r),this.srInitOptions=this.options}return e.prototype.setup=function(e,r){var n,i,o,s,a,l,u,c;return v(this,void 0,void 0,function(){var r,d,h;return m(this,function(p){switch(p.label){case 0:return p.trys.push([0,2,,3]),null==e||e.loggerProvider.log("Installing @amplitude/plugin-session-replay, version ".concat(XE,".")),this.config=e,this.options.forceSessionTracking&&("boolean"==typeof e.defaultTracking?!1===e.defaultTracking&&(e.defaultTracking={pageViews:!1,formInteractions:!1,fileDownloads:!1,sessions:!0}):e.defaultTracking=t(t({},e.defaultTracking),{sessions:!0})),r=(f=this.config.instanceName,void 0===f&&(f="$default_instance"),yt.getInstance(f)).identityStore,d=r.getIdentity().userProperties,this.srInitOptions={instanceName:this.config.instanceName,deviceId:null!==(n=this.options.deviceId)&&void 0!==n?n:this.config.deviceId,optOut:this.config.optOut,sessionId:this.options.customSessionId?void 0:this.config.sessionId,loggerProvider:this.config.loggerProvider,logLevel:this.config.logLevel,flushMaxRetries:this.config.flushMaxRetries,serverZone:this.config.serverZone,configServerUrl:this.options.configServerUrl||(null===(i=this.config.remoteConfig)||void 0===i?void 0:i.serverUrl),trackServerUrl:this.options.trackServerUrl,sampleRate:this.options.sampleRate,privacyConfig:{blockSelector:null===(o=this.options.privacyConfig)||void 0===o?void 0:o.blockSelector,maskSelector:null===(s=this.options.privacyConfig)||void 0===s?void 0:s.maskSelector,unmaskSelector:null===(a=this.options.privacyConfig)||void 0===a?void 0:a.unmaskSelector,defaultMaskLevel:null===(l=this.options.privacyConfig)||void 0===l?void 0:l.defaultMaskLevel},debugMode:this.options.debugMode,shouldInlineStylesheet:this.options.shouldInlineStylesheet,version:{type:"plugin",version:XE},performanceConfig:this.options.performanceConfig,storeType:this.options.storeType,useWebWorker:null!==(u=this.options.useWebWorker)&&void 0!==u?u:null===(c=this.options.experimental)||void 0===c?void 0:c.useWebWorker,userProperties:d,applyBackgroundColorToBlockedElements:this.options.applyBackgroundColorToBlockedElements,interactionConfig:this.options.interactionConfig,captureDocumentTitle:this.options.captureDocumentTitle,enableUrlChangePolling:this.options.enableUrlChangePolling,urlChangePollingInterval:this.options.urlChangePollingInterval,captureAdoptedStyleSheets:this.options.captureAdoptedStyleSheets,crossOriginIframes:this.options.crossOriginIframes,flushIntervalConfig:this.options.flushIntervalConfig},[4,this.sessionReplay.init(e.apiKey,this.srInitOptions).promise];case 1:return p.sent(),[3,3];case 2:return h=p.sent(),null==e||e.loggerProvider.error("Session Replay: Failed to initialize due to ".concat(h.message)),[3,3];case 3:return[2]}var f})})},e.prototype.onSessionIdChanged=function(e){var t;return v(this,void 0,void 0,function(){return m(this,function(r){switch(r.label){case 0:return null===(t=this.config)||void 0===t||t.loggerProvider.debug("Analytics session id is changed to ".concat(e,", SR session id is ").concat(String(this.sessionReplay.getSessionId()),".")),[4,this.sessionReplay.setSessionId(e).promise];case 1:return r.sent(),[2]}})})},e.prototype.onOptOutChanged=function(e){var t;return v(this,void 0,void 0,function(){return m(this,function(r){switch(r.label){case 0:return null===(t=this.config)||void 0===t||t.loggerProvider.debug("optOut is changed to ".concat(String(e),", calling ").concat(e?"sessionReplay.shutdown()":"sessionReplay.init()",".")),e?(this.sessionReplay.shutdown(),[3,4]):[3,1];case 1:return null!=this.config?[4,this.sessionReplay.init(this.config.apiKey,this.srInitOptions).promise]:[3,3];case 2:r.sent(),r.label=3;case 3:r.label=4;case 4:return[2]}})})},e.prototype.execute=function(e){var r,n,i;return v(this,void 0,void 0,function(){var o,s,a,l,u;return m(this,function(c){switch(c.label){case 0:return c.trys.push([0,9,,10]),this.options.customSessionId?(o=this.options.customSessionId(e))?o===this.sessionReplay.getSessionId()?[3,2]:[4,this.sessionReplay.setSessionId(o).promise]:[3,3]:[3,4];case 1:c.sent(),c.label=2;case 2:l=this.sessionReplay.getSessionReplayProperties(),e.event_properties=t(t({},e.event_properties),l),c.label=3;case 3:return[3,8];case 4:return(o=null===(r=this.config)||void 0===r?void 0:r.sessionId)&&o!==this.sessionReplay.getSessionId()?[4,this.sessionReplay.setSessionId(o).promise]:[3,6];case 5:c.sent(),c.label=6;case 6:return o&&o===e.session_id?(s=void 0,e.event_type===k.IDENTIFY&&(s=function(e){if(e.user_properties){var r={};return Object.keys(e.user_properties).forEach(function(n){if(QE.includes(n)){var i=e.user_properties&&e.user_properties[n];r=t(t({},r),i)}}),r}}(e)),a=de(),[4,this.sessionReplay.evaluateTargetingAndCapture({event:e,userProperties:s,page:null!=(null===(n=null==a?void 0:a.location)||void 0===n?void 0:n.href)?{url:a.location.href}:void 0})]):[3,8];case 7:c.sent(),l=this.sessionReplay.getSessionReplayProperties(),e.event_properties=t(t({},e.event_properties),l),c.label=8;case 8:return e.event_type===k.IDENTIFY&&e.event_properties&&delete e.event_properties[YE],[2,Promise.resolve(e)];case 9:return u=c.sent(),null===(i=this.config)||void 0===i||i.loggerProvider.error("Session Replay: Failed to enrich event due to ".concat(u.message)),[2,Promise.resolve(e)];case 10:return[2]}})})},e.prototype.teardown=function(){var e;return v(this,void 0,void 0,function(){return m(this,function(t){try{this.sessionReplay.shutdown(),this.config=null}catch(t){null===(e=this.config)||void 0===e||e.loggerProvider.error("Session Replay: teardown failed due to ".concat(t.message))}return[2]})})},e.prototype.getSessionReplayProperties=function(){return this.sessionReplay.getSessionReplayProperties()},e.pluginName="@amplitude/plugin-session-replay-browser",e}();Ne();var eC=function(e,t){return(eC=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)};function tC(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}eC(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var rC=function(){return rC=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},rC.apply(this,arguments)};function nC(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})}function iC(e,t){var r,n,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(l){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}function oC(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function sC(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}function aC(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}var lC="is",uC="is not",cC="contains",dC="does not contain",hC="less",pC="less or equal",fC="greater",gC="greater or equal",vC="version less",mC="version less or equal",yC="version greater",bC="version greater or equal",wC="set is",SC="set is not",kC="set contains",xC="set does not contain",EC="set contains any",CC="set does not contain any",IC="regex match",OC="regex does not match",TC=-862048943,AC=461845907,RC=function(e,t){void 0===t&&(t=0);for(var r=function(e){for(var t=[],r=0,n=0;n<e.length;n++){var i=e.charCodeAt(n);i<128?t[r++]=i:i<2048?(t[r++]=i>>6|192,t[r++]=63&i|128):55296==(64512&i)&&n+1<e.length&&56320==(64512&e.charCodeAt(n+1))?(i=65536+((1023&i)<<10)+(1023&e.charCodeAt(++n)),t[r++]=i>>18|240,t[r++]=i>>12&63|128,t[r++]=i>>6&63|128,t[r++]=63&i|128):(t[r++]=i>>12|224,t[r++]=i>>6&63|128,t[r++]=63&i|128)}return Uint8Array.from(t)}(e),n=r.length,i=n>>2,o=t,s=0;s<i;s++){var a=NC(r,s<<2);o=PC(a,o)}var l=i<<2,u=0;switch(n-l){case 3:u^=r[l+2]<<16,u^=r[l+1]<<8,u^=r[l],u=Math.imul(u,TC),u=MC(u,15),o^=u=Math.imul(u,AC);break;case 2:u^=r[l+1]<<8,u^=r[l],u=Math.imul(u,TC),u=MC(u,15),o^=u=Math.imul(u,AC);break;case 1:u^=r[l],u=Math.imul(u,TC),u=MC(u,15),o^=u=Math.imul(u,AC)}return _C(o^=n)>>>0},PC=function(e,t){var r=e,n=t;return r=Math.imul(r,TC),r=MC(r,15),r=Math.imul(r,AC),n=MC(n^=r,13),(n=Math.imul(n,5))+-430675100|0},_C=function(e){var t=e;return t^=t>>>16,t=Math.imul(t,-2048144789),t^=t>>>13,t=Math.imul(t,-1028477387),t^=t>>>16},MC=function(e,t,r){return void 0===r&&(r=32),t>r&&(t%=r),(e<<t|(e&4294967295<<r-t>>>0)>>>0>>>r-t>>>0)>>>0},NC=function(e,t){void 0===t&&(t=0);var r=e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3];return LC(r)},LC=function(e){return(-16777216&e)>>>24|(16711680&e)>>>8|(65280&e)<<8|(255&e)<<24},DC=function(e,t){var r,n;if(t&&0!==t.length){try{for(var i=oC(t),o=i.next();!o.done;o=i.next()){var s=o.value;if(!s||!e||"object"!=typeof e)return;e=e[s]}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return null==e?void 0:e}},UC="^".concat("(\\d+)\\.(\\d+)","(\\.").concat("(\\d+)").concat("(-(([-\\w]+\\.?)*))?",")?$"),FC=function(){function e(e,t,r,n){void 0===n&&(n=void 0),this.major=e,this.minor=t,this.patch=r,this.preRelease=n}return e.parse=function(t){if(t){var r=new RegExp(UC).exec(t);if(r){var n=Number(r[1]),i=Number(r[2]);if(!isNaN(n)&&!isNaN(i))return new e(n,i,Number(r[4])||0,r[5]||void 0)}}},e.prototype.compareTo=function(e){return this.major>e.major?1:this.major<e.major?-1:this.minor>e.minor?1:this.minor<e.minor?-1:this.patch>e.patch?1:this.patch<e.patch||this.preRelease&&!e.preRelease?-1:!this.preRelease&&e.preRelease?1:this.preRelease&&e.preRelease?this.preRelease>e.preRelease?1:this.preRelease<e.preRelease?-1:0:0},e}(),jC=function(){function e(){}return e.prototype.evaluate=function(e,t){var r,n,i={},o={context:e,result:i};try{for(var s=oC(t),a=s.next();!a.done;a=s.next()){var l=a.value,u=this.evaluateFlag(o,l);u&&(i[l.key]=u)}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return i},e.prototype.evaluateWithTraces=function(e,t){var r,n,i={},o={},s={context:e,result:i};try{for(var a=oC(t),l=a.next();!l.done;l=a.next()){var u=l.value,c=this.evaluateFlagWithTrace(s,u),d=c.variant,h=c.trace;d&&(i[u.key]=d),o[u.key]=h}}catch(e){r={error:e}}finally{try{l&&!l.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return{results:i,traces:o}},e.prototype.evaluateFlag=function(e,t){var r,n,i;try{for(var o=oC(t.segments),s=o.next();!s.done;s=o.next()){var a=s.value;if(i=this.evaluateSegment(e,t,a)){var l=rC(rC(rC({},t.metadata),a.metadata),i.metadata);i=rC(rC({},i),{metadata:l});break}}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return i},e.prototype.evaluateFlagWithTrace=function(e,t){var r,n,i,o,s,a,l,u,c,d,h,p=[];try{for(var f=oC(t.segments),g=f.next();!g.done;g=f.next()){var v=g.value;if(v.conditions){var m=[],y=!1;try{for(var b=(i=void 0,oC(v.conditions)),w=b.next();!w.done;w=b.next()){var S=w.value,k=!0,x=[];try{for(var E=(s=void 0,oC(S)),C=E.next();!C.done;C=E.next()){var I=C.value,O=DC(e,I.selector),T=this.matchCondition(e,I);if(x.push({propValue:O,condition:I,matched:T}),!T){k=!1;break}}}catch(e){s={error:e}}finally{try{C&&!C.done&&(a=E.return)&&a.call(E)}finally{if(s)throw s.error}}if(m.push(x),k){y=!0;break}}}catch(e){i={error:e}}finally{try{w&&!w.done&&(o=b.return)&&o.call(b)}finally{if(i)throw i.error}}var A=!1,R=void 0;y&&(A=void 0!==(R=this.bucket(e,v))),p.push({segmentMetadata:v.metadata,conditionsPassed:y,bucketed:A,bucketVariant:R,conditionResult:m,matched:y&&A}),y&&void 0!==R&&!c&&(c=t.variants[R],d=v,h=null===(u=v.metadata)||void 0===u?void 0:u.segmentName)}else{var P=this.bucket(e,v),_=void 0!==P;p.push({segmentMetadata:v.metadata,conditionsPassed:!0,bucketed:_,bucketVariant:P,conditionResult:void 0,matched:_}),c||void 0===P||(c=t.variants[P],d=v,h=null===(l=v.metadata)||void 0===l?void 0:l.segmentName)}}}catch(e){r={error:e}}finally{try{g&&!g.done&&(n=f.return)&&n.call(f)}finally{if(r)throw r.error}}if(c&&d){var M=rC(rC(rC({},t.metadata),d.metadata),c.metadata);c=rC(rC({},c),{metadata:M})}return{variant:c,trace:{flagKey:t.key,matched:void 0!==c,matchedSegment:h,steps:p}}},e.prototype.evaluateSegment=function(e,t,r){var n;return r.conditions?this.evaluateConditions(e,r.conditions)&&void 0!==(n=this.bucket(e,r))?t.variants[n]:void 0:void 0!==(n=this.bucket(e,r))?t.variants[n]:void 0},e.prototype.evaluateConditions=function(e,t){var r,n,i,o;try{for(var s=oC(t),a=s.next();!a.done;a=s.next()){var l=a.value,u=!0;try{for(var c=(i=void 0,oC(l)),d=c.next();!d.done;d=c.next()){var h=d.value;if(!(u=this.matchCondition(e,h)))break}}catch(e){i={error:e}}finally{try{d&&!d.done&&(o=c.return)&&o.call(c)}finally{if(i)throw i.error}}if(u)return!0}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return!1},e.prototype.matchCondition=function(e,t){var r=DC(e,t.selector);if(null==r)return this.matchNull(t.op,t.values);var n=this.coerceStringArray(r);if(this.isSetOperator(t.op))return!!n&&this.matchSet(n,t.op,t.values);if(n)return this.matchStringsNonSet(n,t.op,t.values);var i=this.coerceString(r);return void 0!==i&&this.matchString(i,t.op,t.values)},e.prototype.getHash=function(e){return RC(e)},e.prototype.bucket=function(e,t){var r,n,i,o;if(!t.bucket)return t.variant;var s=this.coerceString(DC(e,t.bucket.selector));if(!s||0===s.length)return t.variant;var a="".concat(t.bucket.salt,"/").concat(s),l=this.getHash(a),u=l%100,c=Math.floor(l/100);try{for(var d=oC(t.bucket.allocations),h=d.next();!h.done;h=d.next()){var p=h.value,f=p.range[0],g=p.range[1];if(u>=f&&u<g)try{for(var v=(i=void 0,oC(p.distributions)),m=v.next();!m.done;m=v.next()){var y=m.value,b=y.range[0],w=y.range[1];if(c>=b&&c<w)return y.variant}}catch(e){i={error:e}}finally{try{m&&!m.done&&(o=v.return)&&o.call(v)}finally{if(i)throw i.error}}}}catch(e){r={error:e}}finally{try{h&&!h.done&&(n=d.return)&&n.call(d)}finally{if(r)throw r.error}}return t.variant},e.prototype.matchNull=function(e,t){var r=this.containsNone(t);switch(e){case lC:case cC:case hC:case pC:case fC:case gC:case vC:case mC:case yC:case bC:case wC:case kC:case EC:return r;case uC:case dC:case xC:case CC:return!r;default:return!1}},e.prototype.matchSet=function(e,t,r){switch(t){case wC:return this.setEquals(e,r);case SC:return!this.setEquals(e,r);case kC:return this.matchesSetContainsAll(e,r);case xC:return!this.matchesSetContainsAll(e,r);case EC:return this.matchesSetContainsAny(e,r);case CC:return!this.matchesSetContainsAny(e,r);default:return!1}},e.prototype.matchString=function(e,t,r){var n=this;switch(t){case lC:return this.matchesIs(e,r);case uC:return!this.matchesIs(e,r);case cC:return this.matchesContains(e,r);case dC:return!this.matchesContains(e,r);case hC:case pC:case fC:case gC:return this.matchesComparable(e,t,r,function(e){return n.parseNumber(e)},this.comparator);case vC:case mC:case yC:case bC:return this.matchesComparable(e,t,r,function(e){return FC.parse(e)},this.versionComparator);case IC:return this.matchesRegex(e,r);case OC:return!this.matchesRegex(e,r);default:return!1}},e.prototype.matchStringsNonSet=function(e,t,r){var n=this;return e.some(function(e){return n.matchString(e,t,r)})},e.prototype.matchesIs=function(e,t){if(this.containsBooleans(t)){var r=e.toLowerCase();if("true"===r||"false"===r)return t.some(function(e){return e.toLowerCase()===r})}return t.some(function(t){return e===t})},e.prototype.matchesContains=function(e,t){var r,n;try{for(var i=oC(t),o=i.next();!o.done;o=i.next()){var s=o.value;if(e.toLowerCase().includes(s.toLowerCase()))return!0}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return!1},e.prototype.matchesComparable=function(e,t,r,n,i){var o=this,s=n(e),a=r.map(function(e){return n(e)}).filter(function(e){return void 0!==e});return void 0===s||0===a.length?r.some(function(r){return o.comparator(e,t,r)}):a.some(function(e){return i(s,t,e)})},e.prototype.comparator=function(e,t,r){switch(t){case hC:case vC:return e<r;case pC:case mC:return e<=r;case fC:case yC:return e>r;case gC:case bC:return e>=r;default:return!1}},e.prototype.versionComparator=function(e,t,r){var n=e.compareTo(r);switch(t){case hC:case vC:return n<0;case pC:case mC:return n<=0;case fC:case yC:return n>0;case gC:case bC:return n>=0;default:return!1}},e.prototype.matchesRegex=function(e,t){return t.some(function(t){return Boolean(new RegExp(t).exec(e))})},e.prototype.containsNone=function(e){return e.some(function(e){return"(none)"===e})},e.prototype.containsBooleans=function(e){return e.some(function(e){switch(e.toLowerCase()){case"true":case"false":return!0;default:return!1}})},e.prototype.parseNumber=function(e){var t;return null!==(t=Number(e))&&void 0!==t?t:void 0},e.prototype.coerceString=function(e){if(null!=e)return"object"==typeof e?JSON.stringify(e):String(e)},e.prototype.coerceStringArray=function(e){var t=this;if(Array.isArray(e))return e.map(function(e){return t.coerceString(e)}).filter(Boolean);var r=String(e);if(r.startsWith("["))try{var n=JSON.parse(r);return Array.isArray(n)?n.map(function(e){return t.coerceString(e)}).filter(Boolean):void 0}catch(e){return}},e.prototype.isSetOperator=function(e){switch(e){case wC:case SC:case kC:case xC:case EC:case CC:return!0;default:return!1}},e.prototype.setEquals=function(e,t){var r=new Set(e),n=new Set(t);return r.size===n.size&&aC([],sC(n),!1).every(function(e){return r.has(e)})},e.prototype.matchesSetContainsAll=function(e,t){var r,n;if(e.length<t.length)return!1;try{for(var i=oC(t),o=i.next();!o.done;o=i.next()){var s=o.value;if(!this.matchesIs(s,e))return!1}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return!0},e.prototype.matchesSetContainsAny=function(e,t){var r,n;try{for(var i=oC(t),o=i.next();!o.done;o=i.next()){var s=o.value;if(this.matchesIs(s,e))return!0}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return!1},e}(),BC=function(e,t){var r,n,i=rC({},e),o=[],s=t||Object.keys(i);try{for(var a=oC(s),l=a.next();!l.done;l=a.next()){var u=l.value,c=qC(u,i);c&&o.push.apply(o,aC([],sC(c),!1))}}catch(e){r={error:e}}finally{try{l&&!l.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return o},qC=function(e,t,r){var n,i;void 0===r&&(r=[]);var o=t[e];if(o){if(!o.dependencies||0===o.dependencies.length)return delete t[o.key],[o];r.push(o.key);var s=[],a=function(e){if(r.some(function(t){return t===e}))throw Error("Detected a cycle between flags ".concat(r));var n=qC(e,t,r);n&&s.push.apply(s,aC([],sC(n),!1))};try{for(var l=oC(o.dependencies),u=l.next();!u.done;u=l.next()){a(u.value)}}catch(e){n={error:e}}finally{try{u&&!u.done&&(i=l.return)&&i.call(l)}finally{if(n)throw n.error}}return s.push(o),r.pop(),delete t[o.key],s}},zC="function"==typeof Buffer,WC=("function"==typeof TextDecoder&&new TextDecoder,"function"==typeof TextEncoder?new TextEncoder:void 0),VC=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),$C=(e=>{let t={};return e.forEach((e,r)=>t[e]=r),t})(VC),HC=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,KC=String.fromCharCode.bind(String),GC=("function"==typeof Uint8Array.from&&Uint8Array.from.bind(Uint8Array),e=>e.replace(/=/g,"").replace(/[+\/]/g,e=>"+"==e?"-":"_")),JC=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),QC=e=>{let t,r,n,i,o="";const s=e.length%3;for(let s=0;s<e.length;){if((r=e.charCodeAt(s++))>255||(n=e.charCodeAt(s++))>255||(i=e.charCodeAt(s++))>255)throw new TypeError("invalid character found");t=r<<16|n<<8|i,o+=VC[t>>18&63]+VC[t>>12&63]+VC[t>>6&63]+VC[63&t]}return s?o.slice(0,s-3)+"===".substring(s):o},XC="function"==typeof btoa?e=>btoa(e):zC?e=>Buffer.from(e,"binary").toString("base64"):QC,YC=zC?e=>Buffer.from(e).toString("base64"):e=>{let t=[];for(let r=0,n=e.length;r<n;r+=4096)t.push(KC.apply(null,e.subarray(r,r+4096)));return XC(t.join(""))},ZC=e=>{if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?KC(192|t>>>6)+KC(128|63&t):KC(224|t>>>12&15)+KC(128|t>>>6&63)+KC(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return KC(240|t>>>18&7)+KC(128|t>>>12&63)+KC(128|t>>>6&63)+KC(128|63&t)},eI=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,tI=e=>e.replace(eI,ZC),rI=zC?e=>Buffer.from(e,"utf8").toString("base64"):WC?e=>YC(WC.encode(e)):e=>XC(tI(e)),nI=(e,t=!1)=>t?GC(rI(e)):rI(e),iI=e=>nI(e,!0),oI=e=>{if(e=e.replace(/\s+/g,""),!HC.test(e))throw new TypeError("malformed base64.");let t,r,n;e+="==".slice(2-(3&e.length));let i=[];for(let o=0;o<e.length;)t=$C[e.charAt(o++)]<<18|$C[e.charAt(o++)]<<12|(r=$C[e.charAt(o++)])<<6|(n=$C[e.charAt(o++)]),64===r?i.push(KC(t>>16&255)):64===n?i.push(KC(t>>16&255,t>>8&255)):i.push(KC(t>>16&255,t>>8&255,255&t));return i.join("")},sI=iI,aI=function(e){function t(r,n){var i=e.call(this,n)||this;return i.statusCode=r,Object.setPrototypeOf(i,t.prototype),i}return tC(t,e),t}(Error),lI=function(e){function t(r){var n=e.call(this,r)||this;return Object.setPrototypeOf(n,t.prototype),n}return tC(t,e),t}(Error),uI=function(){function e(e,t,r){this.deploymentKey=e,this.serverUrl=t,this.httpClient=r}return e.prototype.getVariants=function(e,t){return nC(this,void 0,void 0,function(){var r,n,i,o;return iC(this,function(s){switch(s.label){case 0:return r=sI(JSON.stringify(e)),n={Authorization:"Api-Key ".concat(this.deploymentKey),"X-Amp-Exp-User":r},(null==t?void 0:t.flagKeys)&&(n["X-Amp-Exp-Flag-Keys"]=sI(JSON.stringify(t.flagKeys))),(null==t?void 0:t.trackingOption)&&(n["X-Amp-Exp-Track"]=t.trackingOption),(null==t?void 0:t.exposureTrackingOption)&&(n["X-Amp-Exp-Exposure-Track"]=t.exposureTrackingOption),i=new URL("".concat(this.serverUrl,"/sdk/v2/vardata?v=0")),(null==t?void 0:t.evaluationMode)&&i.searchParams.append("eval_mode",null==t?void 0:t.evaluationMode),(null==t?void 0:t.deliveryMethod)&&i.searchParams.append("delivery_method",null==t?void 0:t.deliveryMethod),[4,this.httpClient.request({requestUrl:i.toString(),method:"GET",headers:n,timeoutMillis:null==t?void 0:t.timeoutMillis})];case 1:if(200!=(o=s.sent()).status)throw new aI(o.status,"Fetch error response: status=".concat(o.status));return[2,JSON.parse(o.body)]}})})},e}(),cI=function(){function e(e,t,r){this.deploymentKey=e,this.serverUrl=t,this.httpClient=r}return e.prototype.getFlags=function(e){return nC(this,void 0,void 0,function(){var t,r;return iC(this,function(n){switch(n.label){case 0:return t={Authorization:"Api-Key ".concat(this.deploymentKey)},(null==e?void 0:e.libraryName)&&(null==e?void 0:e.libraryVersion)&&(t["X-Amp-Exp-Library"]="".concat(e.libraryName,"/").concat(e.libraryVersion)),(null==e?void 0:e.user)&&(t["X-Amp-Exp-User"]=sI(JSON.stringify(e.user))),[4,this.httpClient.request({requestUrl:"".concat(this.serverUrl,"/sdk/v2/flags")+((null==e?void 0:e.deliveryMethod)?"?delivery_method=".concat(e.deliveryMethod):""),method:"GET",headers:t,timeoutMillis:null==e?void 0:e.timeoutMillis})];case 1:if(200!=(r=n.sent()).status)throw Error("Flags error response: status=".concat(r.status));return[2,JSON.parse(r.body).reduce(function(e,t){return e[t.key]=t,e},{})]}})})},e}(),dI="undefined"!=typeof globalThis?globalThis:global||self,hI=function(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:void 0},pI=function(){function e(e,t){this.poller=void 0,this.action=e,this.ms=t}return e.prototype.start=function(){this.poller||(this.poller=dI.setInterval(this.action,this.ms),this.action())},e.prototype.stop=function(){this.poller&&(dI.clearInterval(this.poller),this.poller=void 0)},e}();sr();var fI=h(my()),gI=(function(){function e(e){this.amplitudeInstance=e}e.prototype.getUser=function(){var e,t,r,n,i,o,s,a,l,u;return{device_id:null===(t=null===(e=this.amplitudeInstance)||void 0===e?void 0:e.options)||void 0===t?void 0:t.deviceId,user_id:null===(n=null===(r=this.amplitudeInstance)||void 0===r?void 0:r.options)||void 0===n?void 0:n.userId,version:null===(o=null===(i=this.amplitudeInstance)||void 0===i?void 0:i.options)||void 0===o?void 0:o.versionName,language:null===(a=null===(s=this.amplitudeInstance)||void 0===s?void 0:s.options)||void 0===a?void 0:a.language,platform:null===(u=null===(l=this.amplitudeInstance)||void 0===l?void 0:l.options)||void 0===u?void 0:u.platform,os:this.getOs(),device_model:this.getDeviceModel()}},e.prototype.getOs=function(){var e,t,r,n,i,o;return[null===(r=null===(t=null===(e=this.amplitudeInstance)||void 0===e?void 0:e._ua)||void 0===t?void 0:t.browser)||void 0===r?void 0:r.name,null===(o=null===(i=null===(n=this.amplitudeInstance)||void 0===n?void 0:n._ua)||void 0===i?void 0:i.browser)||void 0===o?void 0:o.major].filter(function(e){return null!=e}).join(" ")},e.prototype.getDeviceModel=function(){var e,t,r;return null===(r=null===(t=null===(e=this.amplitudeInstance)||void 0===e?void 0:e._ua)||void 0===t?void 0:t.os)||void 0===r?void 0:r.name}}(),function(){function e(e){this.amplitudeInstance=e}e.prototype.track=function(e){this.amplitudeInstance.logEvent(e.name,e.properties)},e.prototype.setUserProperty=function(e){var t,r;this.amplitudeInstance.setUserProperties(((t={})[e.userProperty]=null===(r=e.variant)||void 0===r?void 0:r.value,t))},e.prototype.unsetUserProperty=function(e){var t;this.amplitudeInstance._logEvent("$identify",null,null,{$unset:(t={},t[e.userProperty]="-",t)})}}(),function(){return gI=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},gI.apply(this,arguments)});function vI(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})}function mI(e,t){var r,n,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(l){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}function yI(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function bI(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}function wI(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}var SI=function(e,t){var r,n;void 0===t&&(t=!1);var i=kI(e,t),o=void 0,s=dI.document.cookie.split("; ");try{for(var a=yI(s),l=a.next();!l.done;l=a.next()){var u=bI(l.value.split("=",2),2),c=u[0],d=u[1];c===i&&(o=decodeURIComponent(d))}}catch(e){r={error:e}}finally{try{l&&!l.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}if(o)try{if(t){var h=atob(o);return JSON.parse(decodeURIComponent(h))}var p=o.split("."),f=void 0;return p.length>=2&&p[1]&&(f=atob(p[1])),{deviceId:p[0],userId:f}}catch(e){return}},kI=function(e,t){if(t){if((null==e?void 0:e.length)<10)return;return"AMP_".concat(e.substring(0,10))}if(!((null==e?void 0:e.length)<6))return"amp_".concat(e.substring(0,6))},xI=function(){function e(e,t,r){this.type="integration",this.apiKey=e,this.identityStore=t.identityStore,this.eventBridge=t.eventBridge,this.contextProvider=t.applicationContextProvider,this.timeoutMillis=r,this.loadPersistedState(),r<=0&&(this.setup=void 0)}return e.prototype.setup=function(e,t){return vI(this,void 0,void 0,function(){return mI(this,function(r){return(null==e?void 0:e.automaticFetchOnAmplitudeIdentityChange)&&this.identityStore.addIdentityListener(function(){null==t||t.fetch()}),[2,this.waitForConnectorIdentity(this.timeoutMillis)]})})},e.prototype.getUser=function(){var e=this.identityStore.getIdentity();return{user_id:e.userId,device_id:e.deviceId,user_properties:e.userProperties,version:this.contextProvider.versionName}},e.prototype.track=function(e){return!!this.eventBridge.receiver&&(this.eventBridge.logEvent({eventType:e.eventType,eventProperties:e.eventProperties}),!0)},e.prototype.loadPersistedState=function(){if(!this.apiKey||this.apiKey.startsWith("client-"))return!1;var e=SI(this.apiKey,!0);return(e||(e=SI(this.apiKey,!1))||(e=function(e){var t=kI(e,!0);try{var r=dI.localStorage.getItem(t);if(!r)return;var n=JSON.parse(r);if("object"!=typeof n)return;return n}catch(e){return}}(this.apiKey))||!!(e=function(e){var t=kI(e,!0);try{var r=dI.sessionStorage.getItem(t);if(!r)return;var n=JSON.parse(r);if("object"!=typeof n)return;return n}catch(e){return}}(this.apiKey)))&&(this.commitIdentityToConnector(e),!0)},e.prototype.commitIdentityToConnector=function(e){var t=this.identityStore.editIdentity();t.setDeviceId(e.deviceId),e.userId&&t.setUserId(e.userId),t.commit()},e.prototype.waitForConnectorIdentity=function(e){return vI(this,void 0,void 0,function(){var t,r=this;return mI(this,function(n){return(t=this.identityStore.getIdentity()).userId||t.deviceId?[2]:[2,Promise.race([new Promise(function(e){var t=function(){e(),r.identityStore.removeIdentityListener(t)};r.identityStore.addIdentityListener(t)}),new Promise(function(t,r){dI.setTimeout(r,e,"Timed out waiting for Amplitude Analytics SDK to initialize.")})])]})})},e}();var EI,CI,II,OI,TI,AI,RI=dI.fetch||function(e,t){return t=t||{},new Promise(function(r,n){var i=new XMLHttpRequest,o=[],s=[],a={},l=function(){return{ok:2==(i.status/100|0),statusText:i.statusText,status:i.status,url:i.responseURL,text:function(){return Promise.resolve(i.responseText)},json:function(){return Promise.resolve(JSON.parse(i.responseText))},blob:function(){return Promise.resolve(new Blob([i.response]))},clone:l,headers:{keys:function(){return o},entries:function(){return s},get:function(e){return a[e.toLowerCase()]},has:function(e){return e.toLowerCase()in a}}}};for(var u in i.open(t.method||"get",e,!0),i.onload=function(){i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(e,t,r){o.push(t=t.toLowerCase()),s.push([t,r]),a[t]=a[t]?a[t]+","+r:r}),r(l())},i.onerror=n,i.withCredentials="include"==t.credentials,t.headers)i.setRequestHeader(u,t.headers[u]);i.send(t.body||null)})},PI=function(){function e(e){this.client=e}return e.prototype.request=function(e){return vI(this,void 0,void 0,function(){return mI(this,function(t){switch(t.label){case 0:return[4,this.client.request(e.requestUrl,e.method,e.headers,null,e.timeoutMillis)];case 1:return[2,t.sent()]}})})},e}(),_I={request:function(e,t,r,n,i){return function(e,t){return null==t||t<=0?e:new Promise(function(r,n){dI.setTimeout(function(){n(new lI("Request timeout after "+t+" milliseconds"))},t),e.then(r,n)})}(vI(void 0,void 0,void 0,function(){var i,o;return mI(this,function(s){switch(s.label){case 0:return[4,RI(e,{method:t,headers:r,body:n})];case 1:return i=s.sent(),o={status:i.status},[4,i.text()];case 2:return o.body=s.sent(),[2,o]}})}),i)}};(CI=EI||(EI={}))[CI.Disable=0]="Disable",CI[CI.Error=1]="Error",CI[CI.Warn=2]="Warn",CI[CI.Info=3]="Info",CI[CI.Debug=4]="Debug",CI[CI.Verbose=5]="Verbose",(OI=II||(II={})).LocalStorage="localStorage",OI.InitialVariants="initialVariants",(AI=TI||(TI={})).LocalStorage="storage",AI.InitialVariants="initial",AI.SecondaryLocalStorage="secondary-storage",AI.SecondaryInitialVariants="secondary-initial",AI.FallbackInline="fallback-inline",AI.FallbackConfig="fallback-config",AI.LocalEvaluation="local-evaluation";var MI=function(e){return!e||e===TI.FallbackInline||e===TI.FallbackConfig||e===TI.SecondaryInitialVariants},NI={debug:!1,logLevel:EI.Error,loggerProvider:null,instanceName:"$default_instance",fallbackVariant:{},initialVariants:{},initialFlags:void 0,source:II.LocalStorage,serverUrl:"https://api.lab.amplitude.com",flagsServerUrl:"https://flag.lab.amplitude.com",serverZone:"US",fetchTimeoutMillis:1e4,retryFetchOnFailure:!0,throwOnError:!1,automaticExposureTracking:!0,pollOnStart:!0,flagConfigPollingIntervalMillis:3e5,fetchOnStart:!0,automaticFetchOnAmplitudeIdentityChange:!1,userProvider:null,analyticsProvider:null,exposureTrackingProvider:null,httpClient:_I},LI="1.21.1",DI=function(){function e(e,t){var r,n=this;this.isReady=new Promise(function(e){n.resolve=e}),this.config=e,this.client=t;var i=null!==(r=e.instanceName)&&void 0!==r?r:NI.instanceName;this.queue=new FI(i),this.cache=new UI(i)}return e.prototype.ready=function(){return this.integration?this.isReady:Promise.resolve()},e.prototype.setIntegration=function(e){var t=this;this.integration&&this.integration.teardown&&this.integration.teardown(),this.integration=e,e.setup?this.integration.setup(this.config,this.client).then(function(){t.queue.setTracker(t.integration.track.bind(e)),t.resolve()},function(){t.queue.setTracker(t.integration.track.bind(e)),t.resolve()}):(this.queue.setTracker(this.integration.track.bind(e)),this.resolve())},e.prototype.getUser=function(){return this.integration?this.integration.getUser():{}},e.prototype.track=function(e,t){if(this.cache.shouldTrack(e,t)){var r=this.getExposureEvent(e);this.queue.push(r)}},e.prototype.getExposureEvent=function(e){var t,r,n,i={eventType:"$exposure",eventProperties:e};return(null===(t=e.metadata)||void 0===t?void 0:t.exposureEvent)?i={eventType:null===(r=e.metadata)||void 0===r?void 0:r.exposureEvent,eventProperties:e}:"web"===(null===(n=e.metadata)||void 0===n?void 0:n.deliveryMethod)&&(i={eventType:"$impression",eventProperties:e}),i},e}(),UI=function(){function e(e){this.isSessionStorageAvailable=jI(),this.inMemoryCache={},this.identity={},this.storageKey="EXP_sent_v3_".concat(e),this.isSessionStorageAvailable&&(dI.sessionStorage.removeItem("EXP_sent_".concat(e)),dI.sessionStorage.removeItem("EXP_sent_v2_".concat(e)))}return e.prototype.shouldTrack=function(e,t){var r,n;if("web"===(null===(r=e.metadata)||void 0===r?void 0:r.deliveryMethod))return!0;var i={userId:null==t?void 0:t.user_id,deviceId:null==t?void 0:t.device_id};this.identityEquals(this.identity,i)||this.clearCache(),this.identity=i,this.loadCache();var o=e.flag_key in this.inMemoryCache,s=this.inMemoryCache[e.flag_key],a=null!==(n=e.variant)&&void 0!==n?n:null,l=!1;return o&&(null!=s?s:null)===a||(l=!0,this.inMemoryCache[e.flag_key]=a),this.storeCache(),l},e.prototype.clearCache=function(){this.inMemoryCache={},this.isSessionStorageAvailable&&dI.sessionStorage.removeItem(this.storageKey)},e.prototype.identityEquals=function(e,t){return e.userId&&t.userId?e.userId===t.userId:!e.userId&&!t.userId&&e.deviceId===t.deviceId},e.prototype.loadCache=function(){if(this.isSessionStorageAvailable){var e=dI.sessionStorage.getItem(this.storageKey);this.inMemoryCache=e?JSON.parse(e):{}}},e.prototype.storeCache=function(){if(this.isSessionStorageAvailable)try{dI.sessionStorage.setItem(this.storageKey,JSON.stringify(this.inMemoryCache))}catch(e){}},e}(),FI=function(){function e(e,t){void 0===t&&(t=512),this.isLocalStorageAvailable=function(){var e=hI();if(e)try{var t="EXP_test";return e.localStorage.setItem(t,t),e.localStorage.removeItem(t),!0}catch(e){return!1}return!1}(),this.inMemoryQueue=[],this.storageKey="EXP_unsent_".concat(e),this.maxQueueSize=t}return e.prototype.push=function(e){this.loadQueue(),this.inMemoryQueue.push(e),this.flush(),this.storeQueue()},e.prototype.setTracker=function(e){var t=this;this.tracker=e,this.poller=dI.setInterval(function(){t.loadFlushStore()},1e3),this.loadFlushStore()},e.prototype.flush=function(){if(this.tracker&&0!==this.inMemoryQueue.length){for(var e=0;e<this.inMemoryQueue.length;e++)try{if(!this.tracker(this.inMemoryQueue[e]))break}catch(e){break}this.inMemoryQueue=this.inMemoryQueue.slice(e),0===this.inMemoryQueue.length&&this.poller&&(dI.clearInterval(this.poller),this.poller=void 0)}},e.prototype.loadQueue=function(){if(this.isLocalStorageAvailable){var e=dI.localStorage.getItem(this.storageKey);this.inMemoryQueue=e?JSON.parse(e):[]}},e.prototype.storeQueue=function(){this.isLocalStorageAvailable&&(this.inMemoryQueue.length>this.maxQueueSize&&(this.inMemoryQueue=this.inMemoryQueue.slice(this.inMemoryQueue.length-this.maxQueueSize)),dI.localStorage.setItem(this.storageKey,JSON.stringify(this.inMemoryQueue)))},e.prototype.loadFlushStore=function(){this.loadQueue(),this.flush(),this.storeQueue()},e}(),jI=function(){var e=hI();if(e)try{var t="EXP_test";return e.sessionStorage.setItem(t,t),e.sessionStorage.removeItem(t),!0}catch(e){return!1}return!1},BI=function(){function e(e,t){void 0===t&&(t=EI.Error),this.logger=e,this.logLevel=t}return e.prototype.error=function(e){for(var t,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];this.logLevel>=EI.Error&&(t=this.logger).error.apply(t,wI([e],bI(r),!1))},e.prototype.warn=function(e){for(var t,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];this.logLevel>=EI.Warn&&(t=this.logger).warn.apply(t,wI([e],bI(r),!1))},e.prototype.info=function(e){for(var t,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];this.logLevel>=EI.Info&&(t=this.logger).info.apply(t,wI([e],bI(r),!1))},e.prototype.debug=function(e){for(var t,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];this.logLevel>=EI.Debug&&(t=this.logger).debug.apply(t,wI([e],bI(r),!1))},e.prototype.verbose=function(e){for(var t,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];this.logLevel>=EI.Verbose&&(t=this.logger).verbose.apply(t,wI([e],bI(r),!1))},e}(),qI=function(){function e(){}return e.prototype.error=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];console.error.apply(console,wI([e],bI(t),!1))},e.prototype.warn=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];console.warn.apply(console,wI([e],bI(t),!1))},e.prototype.info=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];console.info.apply(console,wI([e],bI(t),!1))},e.prototype.debug=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];console.debug.apply(console,wI([e],bI(t),!1))},e.prototype.verbose=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];console.debug.apply(console,wI([e],bI(t),!1))},e}(),zI=function(){function e(){this.globalScope=hI()}return e.prototype.get=function(e){var t;return null===(t=this.globalScope)||void 0===t?void 0:t.localStorage.getItem(e)},e.prototype.put=function(e,t){var r;null===(r=this.globalScope)||void 0===r||r.localStorage.setItem(e,t)},e.prototype.delete=function(e){var t;null===(t=this.globalScope)||void 0===t||t.localStorage.removeItem(e)},e}(),WI=function(){function e(e,t){this.namespace=e,this.storage=t}return e.prototype.get=function(){return this.value},e.prototype.put=function(e){this.value=e},e.prototype.load=function(){var e=this.storage.get(this.namespace);e&&(this.value=JSON.parse(e))},e.prototype.store=function(){void 0===this.value?this.storage.delete(this.namespace):this.storage.put(this.namespace,JSON.stringify(this.value))},e}(),VI=function(){function e(e,t,r){this.cache={},this.namespace=e,this.storage=t,this.transformer=r}return e.prototype.get=function(e){return this.cache[e]},e.prototype.getAll=function(){return gI({},this.cache)},e.prototype.put=function(e,t){this.cache[e]=t},e.prototype.putAll=function(e){var t,r;try{for(var n=yI(Object.keys(e)),i=n.next();!i.done;i=n.next()){var o=i.value;this.cache[o]=e[o]}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}},e.prototype.remove=function(e){delete this.cache[e]},e.prototype.clear=function(){this.cache={}},e.prototype.load=function(){var e,t,r,n=this.storage.get(this.namespace);try{r=JSON.parse(n)||{}}catch(e){return}var i={};try{for(var o=yI(Object.keys(r)),s=o.next();!s.done;s=o.next()){var a=s.value;try{var l=void 0;(l=this.transformer?this.transformer(r[a]):r[a])&&(i[a]=l)}catch(e){}}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}this.clear(),this.putAll(i)},e.prototype.store=function(e){void 0===e&&(e=this.cache),this.storage.put(this.namespace,JSON.stringify(e))},e}(),$I=function(e){if("string"==typeof e)return{key:e,value:e};if("object"==typeof e){var t=e.key,r=e.value,n=e.payload,i=e.metadata,o=e.expKey;i&&i.experimentKey?o=i.experimentKey:o&&((i=i||{}).experimentKey=o);var s={};return t?s.key=t:r&&(s.key=r),r&&(s.value=r),i&&(s.metadata=i),n&&(s.payload=n),o&&(s.expKey=o),s}},HI=function(){function e(){this.globalScope=hI()}return e.prototype.get=function(e){var t;return null===(t=this.globalScope)||void 0===t?void 0:t.sessionStorage.getItem(e)},e.prototype.put=function(e,t){var r;null===(r=this.globalScope)||void 0===r||r.sessionStorage.setItem(e,t)},e.prototype.delete=function(e){var t;null===(t=this.globalScope)||void 0===t||t.sessionStorage.removeItem(e)},e}(),KI=function(e){return null==e},GI=function(e){return!!KI(e)||e&&0===Object.keys(e).length},JI=function(e){var t;return"local"===(null===(t=null==e?void 0:e.metadata)||void 0===t?void 0:t.evaluationMode)},QI=function(){function e(e,t,r,n){this.started=!1,this.done=!1,this.attempts=e,this.min=t,this.max=r,this.scalar=n}return e.prototype.start=function(e){return vI(this,void 0,void 0,function(){return mI(this,function(t){switch(t.label){case 0:if(this.started)throw Error("Backoff already started");return this.started=!0,[4,this.backoff(e,0,this.min)];case 1:return t.sent(),[2]}})})},e.prototype.cancel=function(){this.done=!0,clearTimeout(this.timeoutHandle)},e.prototype.backoff=function(e,t,r){return vI(this,void 0,void 0,function(){var n=this;return mI(this,function(i){return this.done||(this.timeoutHandle=dI.setTimeout(function(){return vI(n,void 0,void 0,function(){var n,i;return mI(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,e()];case 1:return o.sent(),[3,3];case 2:return o.sent(),(n=t+1)<this.attempts&&(i=Math.min(r*this.scalar,this.max),this.backoff(e,n,i)),[3,3];case 3:return[2]}})})},r)),[2]})})},e}(),XI=function(e){var t,r,n,i;if(!e)return{};var o={user:e},s=hI();s&&(o.page={url:s.location.href});var a={};if(!e.groups)return o;try{for(var l=yI(Object.keys(e.groups)),u=l.next();!u.done;u=l.next()){var c=u.value,d=e.groups[c];if(d.length>0&&d[0]){var h=d[0],p={group_name:h},f=null===(i=null===(n=e.group_properties)||void 0===n?void 0:n[c])||void 0===i?void 0:i[h];f&&Object.keys(f).length>0&&(p.group_properties=f),a[c]=p}}}catch(e){t={error:e}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(t)throw t.error}}return Object.keys(a).length>0&&(o.groups=a),delete o.user.groups,delete o.user.group_properties,o},YI=function(e){return null==e?{}:"string"==typeof e?{key:e,value:e}:e},ZI=function(e){if(!e)return{};var t=void 0;e.metadata&&(t=e.metadata.experimentKey);var r={};return e.key&&(r.key=e.key),e.value&&(r.value=e.value),e.payload&&(r.payload=e.payload),t&&(r.expKey=t),e.metadata&&(r.metadata=e.metadata),r},eO=function(){function e(e){this.setProperties={},this.unsetProperties={},this.analyticsProvider=e}return e.prototype.track=function(e){this.setProperties[e.key]!=e.variant.value&&(this.setProperties[e.key]=e.variant.value,delete this.unsetProperties[e.key],this.analyticsProvider.track(e))},e.prototype.setUserProperty=function(e){this.setProperties[e.key]!=e.variant.value&&this.analyticsProvider.setUserProperty(e)},e.prototype.unsetUserProperty=function(e){this.unsetProperties[e.key]||(this.unsetProperties[e.key]="unset",delete this.setProperties[e.key],this.analyticsProvider.unsetUserProperty(e))},e}(),tO=function(){function e(e){this.tracked={},this.identity={},this.exposureTrackingProvider=e}return e.prototype.track=function(e,t){var r={userId:null==t?void 0:t.user_id,deviceId:null==t?void 0:t.device_id};this.identityEquals(this.identity,r)||(this.tracked={}),this.identity=r;var n=e.flag_key in this.tracked,i=this.tracked[e.flag_key];n&&i===e.variant||(this.tracked[e.flag_key]=e.variant,this.exposureTrackingProvider.track(e))},e.prototype.identityEquals=function(e,t){return e.userId===t.userId&&e.deviceId===t.deviceId},e}(),rO=function(){function e(t,r){var n,i,o,s,a=this;this.engine=new jC,this.isRunning=!1,this.apiKey=t,r=function(e){var t,r;if(!e||"object"!=typeof e)return{};var n={};try{for(var i=yI(Object.entries(e)),o=i.next();!o.done;o=i.next()){var s=bI(o.value,2),a=s[0],l=s[1];KI(l)||(n[a]=l)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return n}(r),this.config=gI(gI(gI({},NI),r),{serverUrl:(null==r?void 0:r.serverUrl)||("eu"===(null===(n=null==r?void 0:r.serverZone)||void 0===n?void 0:n.toLowerCase())?"https://api.lab.eu.amplitude.com":NI.serverUrl),flagsServerUrl:(null==r?void 0:r.flagsServerUrl)||("eu"===(null===(i=null==r?void 0:r.serverZone)||void 0===i?void 0:i.toLowerCase())?"https://flag.lab.eu.amplitude.com":NI.flagsServerUrl),flagConfigPollingIntervalMillis:r.flagConfigPollingIntervalMillis<6e4?6e4:null!==(o=r.flagConfigPollingIntervalMillis)&&void 0!==o?o:NI.flagConfigPollingIntervalMillis}),this.logger=new BI(this.config.loggerProvider||new qI,e.getLogLevel(r));var l=null===(s=this.config)||void 0===s?void 0:s.internalInstanceNameSuffix;if(this.isWebExperiment="web"===l,this.poller=new pI(function(){return vI(a,void 0,void 0,function(){var e;return mI(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.doFlags()];case 1:return t.sent(),[3,3];case 2:return e=t.sent(),this.logger.info(e),[3,3];case 3:return[2]}})})},this.config.flagConfigPollingIntervalMillis),this.config.initialVariants)for(var u in this.config.initialVariants)this.config.initialVariants[u]=$I(this.config.initialVariants[u]);this.config.userProvider&&(this.userProvider=this.config.userProvider),this.config.analyticsProvider&&(this.analyticsProvider=new eO(this.config.analyticsProvider)),this.config.exposureTrackingProvider&&(this.userSessionExposureTracker=new tO(this.config.exposureTrackingProvider)),this.integrationManager=new DI(this.config,this);var c,d=new PI(this.config.httpClient||_I);this.flagApi=new cI(this.apiKey,this.config.flagsServerUrl,d),this.evaluationApi=new uI(this.apiKey,this.config.serverUrl,d);var h=l?"".concat(this.config.instanceName,"-").concat(l):this.config.instanceName;c=this.isWebExperiment?new HI:new zI,this.variants=function(e,t,r){var n=e.substring(e.length-6),i="amp-exp-".concat(t,"-").concat(n);return new VI(i,r,$I)}(this.apiKey,h,c),this.flags=function(e,t,r){void 0===r&&(r=new zI);var n=e.substring(e.length-6),i="amp-exp-".concat(t,"-").concat(n,"-flags");return new VI(i,r)}(this.apiKey,h,c),this.fetchVariantsOptions=function(e,t,r){void 0===r&&(r=new zI);var n=e.substring(e.length-6),i="amp-exp-".concat(t,"-").concat(n,"-variants-options");return new WI(i,r)}(this.apiKey,h,c);try{this.flags.load(),this.variants.load(),this.fetchVariantsOptions.load()}catch(e){}this.mergeInitialFlagsWithStorage()}return e.prototype.start=function(e){return vI(this,void 0,void 0,function(){var t,r,n;return mI(this,function(i){switch(i.label){case 0:if(this.isRunning)return[2];this.isRunning=!0,this.setUser(e),i.label=1;case 1:return i.trys.push([1,6,,7]),t=this.doFlags(),null===(n=this.config.fetchOnStart)||void 0===n||n?[4,Promise.all([this.fetch(e),t])]:[3,3];case 2:return i.sent(),[3,5];case 3:return[4,t];case 4:i.sent(),i.label=5;case 5:return[3,7];case 6:if(r=i.sent(),this.config.throwOnError)throw r;return[3,7];case 7:return this.config.pollOnStart&&this.poller.start(),[2]}})})},e.prototype.stop=function(){this.isRunning&&(this.poller.stop(),this.isRunning=!1)},e.prototype.fetch=function(){return vI(this,arguments,void 0,function(e,t){var r;return void 0===e&&(e=this.user),mI(this,function(n){switch(n.label){case 0:this.setUser(e||{}),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.fetchInternal(e,this.config.fetchTimeoutMillis,this.config.retryFetchOnFailure,t)];case 2:return n.sent(),[3,4];case 3:if(r=n.sent(),this.config.throwOnError)throw r;return r instanceof lI?this.logger.debug(r):this.logger.error(r),[3,4];case 4:return[2,this]}})})},e.prototype.variant=function(e,t){var r,n;if(!this.apiKey)return{value:void 0};var i=this.variantAndSource(e,t);return this.config.automaticExposureTracking&&this.exposureInternal(e,i),this.logger.debug("[Experiment] variant for ".concat(e," is ").concat((null===(r=i.variant)||void 0===r?void 0:r.key)||(null===(n=i.variant)||void 0===n?void 0:n.value))),i.variant||{}},e.prototype.exposure=function(e){var t=this.variantAndSource(e);this.exposureInternal(e,t)},e.prototype.all=function(){if(!this.apiKey)return{};var e=this.evaluate();for(var t in e){var r=this.flags.get(t);JI(r)||delete e[t]}return gI(gI(gI({},this.secondaryVariants()),this.sourceVariants()),e)},e.prototype.clear=function(){this.variants.clear();try{this.variants.store()}catch(e){}},e.prototype.getUser=function(){var e;if(!this.user)return this.user;if(null===(e=this.user)||void 0===e?void 0:e.user_properties){var t=gI({},this.user.user_properties);return gI(gI({},this.user),{user_properties:t})}return gI({},this.user)},e.prototype.setUser=function(e){var t;if(e)if(null===(t=this.user)||void 0===t?void 0:t.user_properties){var r=gI({},e.user_properties);this.user=gI(gI({},e),{user_properties:r})}else this.user=gI({},e);else this.user=null},e.prototype.getUserProvider=function(){return this.userProvider},e.prototype.setUserProvider=function(e){return this.userProvider=e,this},e.prototype.mergeInitialFlagsWithStorage=function(){var e=this;this.config.initialFlags&&JSON.parse(this.config.initialFlags).forEach(function(t){e.flags.get(t.key)||e.flags.put(t.key,t)})},e.prototype.evaluate=function(e){var t,r,n=this.addContext(this.user),i=BC(this.flags.getAll(),e),o=XI(n),s=this.engine.evaluate(o,i),a={};try{for(var l=yI(Object.keys(s)),u=l.next();!u.done;u=l.next()){var c=u.value;a[c]=ZI(s[c])}}catch(e){t={error:e}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(t)throw t.error}}return a},e.prototype.getEvaluationTraces=function(e){var t=this.addContext(this.user),r=BC(this.flags.getAll(),e),n=XI(t);return this.engine.evaluateWithTraces(n,r).traces},e.prototype.variantAndSource=function(e,t){var r={};this.config.source===II.LocalStorage?r=this.localStorageVariantAndSource(e,t):this.config.source===II.InitialVariants&&(r=this.initialVariantsVariantAndSource(e,t));var n=this.flags.get(e);return(JI(n)||!r.variant&&n)&&(r=this.localEvaluationVariantAndSource(e,n,t)),r},e.prototype.localEvaluationVariantAndSource=function(e,t,r){var n,i={},o=this.evaluate([t.key])[e],s=TI.LocalEvaluation,a=null===(n=null==o?void 0:o.metadata)||void 0===n?void 0:n.default;if(!KI(o)&&!a)return{variant:YI(o),source:s,hasDefaultVariant:!1};if(a&&(i={variant:YI(o),source:s,hasDefaultVariant:!0}),!KI(r))return{variant:YI(r),source:TI.FallbackInline,hasDefaultVariant:i.hasDefaultVariant};var l=this.config.initialVariants[e];if(!KI(l))return{variant:YI(l),source:TI.SecondaryInitialVariants,hasDefaultVariant:i.hasDefaultVariant};var u=YI(this.config.fallbackVariant),c={variant:u,source:TI.FallbackConfig,hasDefaultVariant:i.hasDefaultVariant};return GI(u)?i:c},e.prototype.localStorageVariantAndSource=function(e,t){var r,n={},i=this.variants.get(e),o=null===(r=null==i?void 0:i.metadata)||void 0===r?void 0:r.default;if(!KI(i)&&!o)return{variant:YI(i),source:TI.LocalStorage,hasDefaultVariant:!1};if(o&&(n={variant:YI(i),source:TI.LocalStorage,hasDefaultVariant:!0}),!KI(t))return{variant:YI(t),source:TI.FallbackInline,hasDefaultVariant:n.hasDefaultVariant};var s=this.config.initialVariants[e];if(!KI(s))return{variant:YI(s),source:TI.SecondaryInitialVariants,hasDefaultVariant:n.hasDefaultVariant};var a=YI(this.config.fallbackVariant),l={variant:a,source:TI.FallbackConfig,hasDefaultVariant:n.hasDefaultVariant};return GI(a)?n:l},e.prototype.initialVariantsVariantAndSource=function(e,t){var r,n={},i=this.config.initialVariants[e];if(!KI(i))return{variant:YI(i),source:TI.InitialVariants,hasDefaultVariant:!1};var o=this.variants.get(e),s=null===(r=null==o?void 0:o.metadata)||void 0===r?void 0:r.default;if(!KI(o)&&!s)return{variant:YI(o),source:TI.LocalStorage,hasDefaultVariant:!1};if(s&&(n={variant:YI(o),source:TI.LocalStorage,hasDefaultVariant:!0}),!KI(t))return{variant:YI(t),source:TI.FallbackInline,hasDefaultVariant:n.hasDefaultVariant};var a=YI(this.config.fallbackVariant),l={variant:a,source:TI.FallbackConfig,hasDefaultVariant:n.hasDefaultVariant};return GI(a)?n:l},e.prototype.fetchInternal=function(e,t,r,n){return vI(this,void 0,void 0,function(){var i,o,s;return mI(this,function(a){switch(a.label){case 0:if(!this.apiKey)throw Error("Experiment API key is empty");this.logger.debug("[Experiment] Fetch all: retry=".concat(r)),r&&this.stopRetries(),a.label=1;case 1:return a.trys.push([1,4,,5]),[4,this.doFetch(e,t,gI({trackingOption:null===(s=this.fetchVariantsOptions.get())||void 0===s?void 0:s.trackingOption},n))];case 2:return i=a.sent(),[4,this.storeVariants(i,n)];case 3:return a.sent(),[2,i];case 4:throw o=a.sent(),r&&this.shouldRetryFetch(o)&&this.startRetries(e,n),o;case 5:return[2]}})})},e.prototype.setTracksAssignment=function(e){return vI(this,void 0,void 0,function(){return mI(this,function(t){return this.fetchVariantsOptions.put(gI(gI({},this.fetchVariantsOptions.get()||{}),{trackingOption:e?"track":"no-track"})),this.fetchVariantsOptions.store(),[2]})})},e.prototype.cleanUserPropsForFetch=function(e){var t=gI({},e);return delete t.cookie,t},e.prototype.doFetch=function(e,t,r){return vI(this,void 0,void 0,function(){var n,i,o,s,a,l,u;return mI(this,function(c){switch(c.label){case 0:return[4,this.addContextOrWait(e)];case 1:return e=c.sent(),e=this.cleanUserPropsForFetch(e),this.logger.debug("[Experiment] Fetch variants for user: ",e),[4,this.evaluationApi.getVariants(e,gI({timeoutMillis:t},r))];case 2:n=c.sent(),i={};try{for(o=yI(Object.keys(n)),s=o.next();!s.done;s=o.next())a=s.value,i[a]=ZI(n[a])}catch(e){l={error:e}}finally{try{s&&!s.done&&(u=o.return)&&u.call(o)}finally{if(l)throw l.error}}return this.logger.debug("[Experiment] Received variants: ",i),[2,i]}})})},e.prototype.doFlags=function(){return vI(this,void 0,void 0,function(){var e,t,r;return mI(this,function(n){switch(n.label){case 0:return n.trys.push([0,4,,5]),e=void 0,this.isWebExperiment?[4,this.addContextOrWait(this.getUser())]:[3,2];case 1:e=n.sent(),n.label=2;case 2:return[4,this.flagApi.getFlags({libraryName:"experiment-js-client",libraryVersion:LI,timeoutMillis:this.config.fetchTimeoutMillis,deliveryMethod:this.isWebExperiment?"web":void 0,user:(null==e?void 0:e.user_id)||(null==e?void 0:e.device_id)?{user_id:null==e?void 0:e.user_id,device_id:null==e?void 0:e.device_id}:void 0})];case 3:return t=n.sent(),this.flags.clear(),this.flags.putAll(t),[3,5];case 4:if(!((r=n.sent())instanceof lI))throw r;if(this.logger.debug(r),this.config.throwOnError)throw r;return[3,5];case 5:try{this.flags.store()}catch(e){}return this.mergeInitialFlagsWithStorage(),[2]}})})},e.prototype.storeVariants=function(e,t){return vI(this,void 0,void 0,function(){var r,n,i,o;return mI(this,function(s){for(o in 0===(r=t&&t.flagKeys?t.flagKeys:[]).length&&this.variants.clear(),n=function(t){r=r.filter(function(e){return e!==t}),i.variants.put(t,e[t])},i=this,e)n(o);for(o in r)this.variants.remove(o);try{this.variants.store()}catch(e){}return this.logger.debug("[Experiment] Stored variants: ",e),[2]})})},e.prototype.startRetries=function(e,t){return vI(this,void 0,void 0,function(){var r=this;return mI(this,function(n){return this.logger.debug("[Experiment] Retry fetch"),this.retriesBackoff=new QI(8,500,1e4,1.5),this.retriesBackoff.start(function(){return vI(r,void 0,void 0,function(){return mI(this,function(r){switch(r.label){case 0:return[4,this.fetchInternal(e,1e4,!1,t)];case 1:return r.sent(),[2]}})})}),[2]})})},e.prototype.stopRetries=function(){this.retriesBackoff&&this.retriesBackoff.cancel()},e.prototype.addContext=function(e){var t,r=null===(t=this.userProvider)||void 0===t?void 0:t.getUser(),n=this.integrationManager.getUser(),i=gI(gI(gI({},null==r?void 0:r.user_properties),n.user_properties),null==e?void 0:e.user_properties);return gI(gI(gI(gI({library:"experiment-js-client/".concat(LI)},r),n),e),{user_properties:i})},e.prototype.addContextOrWait=function(e){return vI(this,void 0,void 0,function(){return mI(this,function(t){switch(t.label){case 0:return[4,this.integrationManager.ready()];case 1:return t.sent(),[2,this.addContext(e)]}})})},e.prototype.sourceVariants=function(){return this.config.source==II.LocalStorage?this.variants.getAll():this.config.source==II.InitialVariants?this.config.initialVariants:void 0},e.prototype.secondaryVariants=function(){return this.config.source==II.LocalStorage?this.config.initialVariants:this.config.source==II.InitialVariants?this.variants.getAll():void 0},e.prototype.exposureInternal=function(e,t){var r,n,i,o,s,a,l,u,c;if(null===(i=null===(n=null===(r=t.variant)||void 0===r?void 0:r.metadata)||void 0===n?void 0:n.trackExposure)||void 0===i||i){this.legacyExposureInternal(e,t.variant,t.source);var d={flag_key:e},h=MI(t.source);if(!h||t.hasDefaultVariant){(null===(o=t.variant)||void 0===o?void 0:o.expKey)&&(d.experiment_key=null===(s=t.variant)||void 0===s?void 0:s.expKey);var p=null===(a=t.variant)||void 0===a?void 0:a.metadata;if(h||(null==p?void 0:p.default)||((null===(l=t.variant)||void 0===l?void 0:l.key)?d.variant=t.variant.key:(null===(u=t.variant)||void 0===u?void 0:u.value)&&(d.variant=t.variant.value)),p&&(d.metadata=p),this.isWebExperiment&&(d.time=Date.now()),this.isWebExperiment){var f=hI();if(null==f?void 0:f.location)try{var g=f.location.href;d.metadata.url=g.split("?")[0]||""}catch(e){}}var v=this.addContext(this.getUser());null===(c=this.userSessionExposureTracker)||void 0===c||c.track(d,v),this.integrationManager.track(d,v)}}},e.prototype.legacyExposureInternal=function(e,t,r){var n,i,o,s,a;if(this.analyticsProvider){var l=function(e,t,r,n){var i,o=null==r?void 0:r.value,s="[Experiment] ".concat(t);return{name:"[Experiment] Exposure",user:e,key:t,variant:r,userProperty:s,properties:{key:t,variant:o,source:n},userProperties:(i={},i[s]=o,i)}}(this.addContext(this.getUser()),e,t,r);MI(r)||!(null==t?void 0:t.value)?null===(i=null===(n=this.analyticsProvider)||void 0===n?void 0:n.unsetUserProperty)||void 0===i||i.call(n,l):(null==t?void 0:t.value)&&(null===(s=null===(o=this.analyticsProvider)||void 0===o?void 0:o.setUserProperty)||void 0===s||s.call(o,l),null===(a=this.analyticsProvider)||void 0===a||a.track(l))}},e.getLogLevel=function(e){var t;return!0===e.debug?EI.Debug:null!==(t=e.logLevel)&&void 0!==t?t:EI.Error},e.prototype.shouldRetryFetch=function(e){return!(e instanceof aI)||(e.statusCode<400||e.statusCode>=500||429===e.statusCode)},e.prototype.addPlugin=function(e){"integration"===e.type&&this.integrationManager.setIntegration(e)},e}(),nO=function(){function e(e,t){var r,n,i;this.globalScope=hI(),this.userAgent=void 0!==(null===(r=this.globalScope)||void 0===r?void 0:r.navigator)?null===(n=this.globalScope)||void 0===n?void 0:n.navigator.userAgent:void 0,this.ua=new fI.UAParser(this.userAgent).getResult(),this.localStorage=new zI,this.sessionStorage=new HI,this.userProvider=e,this.apiKey=t,this.storageKey="EXP_".concat(null===(i=this.apiKey)||void 0===i?void 0:i.slice(0,10),"_DEFAULT_USER_PROVIDER")}return e.prototype.getUser=function(){var e,t,r,n,i,o=(null===(e=this.userProvider)||void 0===e?void 0:e.getUser())||{};return gI({language:this.getLanguage(),platform:"Web",os:this.getOs(this.ua),device_model:this.getDeviceModel(this.ua),device_category:null!==(r=null===(t=this.ua.device)||void 0===t?void 0:t.type)&&void 0!==r?r:"desktop",referring_url:null===(i=null===(n=this.globalScope)||void 0===n?void 0:n.document)||void 0===i?void 0:i.referrer.replace(/\/$/,""),cookie:this.getCookie(),browser:this.getBrowser(this.ua),landing_url:this.getLandingUrl(),first_seen:this.getFirstSeen(),url_param:this.getUrlParam(),user_agent:this.userAgent},o)},e.prototype.getLanguage=function(){return"undefined"!=typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},e.prototype.getOs=function(e){var t,r;return[null===(t=e.browser)||void 0===t?void 0:t.name,null===(r=e.browser)||void 0===r?void 0:r.major].filter(function(e){return null!=e}).join(" ")},e.prototype.getDeviceModel=function(e){var t;return null===(t=e.os)||void 0===t?void 0:t.name},e.prototype.getBrowser=function(e){var t,r=null===(t=e.browser)||void 0===t?void 0:t.name;return(null==r?void 0:r.includes("Chrom"))&&(r="Chrome"),(null==r?void 0:r.includes("Firefox"))&&(r="Firefox"),(null==r?void 0:r.includes("Safari"))&&(r="Safari"),(null==r?void 0:r.includes("Edge"))&&(r="Edge"),(null==r?void 0:r.includes("Opera"))&&(r="Opera"),r},e.prototype.getCookie=function(){var e,t,r,n,i;if(null===(t=null===(e=this.globalScope)||void 0===e?void 0:e.document)||void 0===t?void 0:t.cookie)return Object.fromEntries(null===(i=null===(n=null===(r=this.globalScope)||void 0===r?void 0:r.document)||void 0===n?void 0:n.cookie)||void 0===i?void 0:i.split("; ").map(function(e){return e.split("=")}))},e.prototype.getLandingUrl=function(){var e,t;try{var r=JSON.parse(this.sessionStorage.get(this.storageKey)||"{}");return r.landing_url||(r.landing_url=null===(t=null===(e=this.globalScope)||void 0===e?void 0:e.location)||void 0===t?void 0:t.href.replace(/\/$/,""),this.sessionStorage.put(this.storageKey,JSON.stringify(r))),r.landing_url}catch(e){return}},e.prototype.getFirstSeen=function(){try{var e=JSON.parse(this.localStorage.get(this.storageKey)||"{}");return e.first_seen||(e.first_seen=(Date.now()/1e3).toString(),this.localStorage.put(this.storageKey,JSON.stringify(e))),e.first_seen}catch(e){return}},e.prototype.getUrlParam=function(){var e,t,r;if(this.globalScope){var n={};try{var i=new URL(this.globalScope.location.href);try{for(var o=yI(i.searchParams),s=o.next();!s.done;s=o.next()){var a=bI(s.value,2),l=a[0],u=a[1];n[l]=wI(wI([],bI(null!==(r=n[l])&&void 0!==r?r:[]),!1),bI(u.split(",")),!1)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}}catch(e){return}return Object.entries(n).reduce(function(e,t){var r=bI(t,2),n=r[0],i=r[1];return e[n]=1==i.length?i[0]:i,e},{})}},e}();dI.experimentInstances={};var iO=dI.experimentInstances,oO=function(e){return(null==e?void 0:e.instanceName)||NI.instanceName},sO=function(e,t,r){var n=function(e,t){var r=oO(t),n=null==t?void 0:t.internalInstanceNameSuffix;return n?"".concat(r,".").concat(e,".").concat(n):"".concat(r,".").concat(e)}(e,t),i=iO[n];return i||(i=function(e,t){return new rO(e,gI(gI({},t),{userProvider:new nO(null==t?void 0:t.userProvider,e)}))}(e,t),r&&i.addPlugin(r()),iO[n]=i,i)},aO=(function(){function e(){}e.prototype.getUser=function(){return{}},e.prototype.start=function(e){return vI(this,void 0,void 0,function(){return mI(this,function(e){return[2]})})},e.prototype.stop=function(){},e.prototype.setUser=function(e){},e.prototype.fetch=function(e,t){return vI(this,void 0,void 0,function(){return mI(this,function(e){return[2,this]})})},e.prototype.getUserProvider=function(){return null},e.prototype.setUserProvider=function(e){return this},e.prototype.variant=function(e,t){return NI.fallbackVariant},e.prototype.all=function(){return{}},e.prototype.clear=function(){},e.prototype.exposure=function(e){}}(),function(){function e(t){this.name=e.pluginName,this.config=t}return e.prototype.setup=function(e,t){var r;return v(this,void 0,void 0,function(){return m(this,function(t){return this.experiment=function(e,t){return sO(e,t,function(){return new xI(e,yt.getInstance(oO(t)),1e4)})}((null===(r=this.config)||void 0===r?void 0:r.deploymentKey)||e.apiKey,this.config),[2]})})},e.pluginName="@amplitude/experiment-analytics-plugin",e}()),lO=function(){function e(){}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:uO(),platform:"Web",os:void 0,deviceModel:void 0}},e}(),uO=function(){return typeof navigator<"u"&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},cO=function(){function e(){this.queue=[]}return e.prototype.logEvent=function(e){this.receiver?this.receiver(e):this.queue.length<512&&this.queue.push(e)},e.prototype.setEventReceiver=function(e){this.receiver=e,this.queue.length>0&&(this.queue.forEach(function(t){e(t)}),this.queue=[])},e}(),dO=function(){return dO=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},dO.apply(this,arguments)};function hO(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function pO(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}var fO=function(e,t){var r,n,i=typeof e;if(i!==typeof t)return!1;try{for(var o=hO(["string","number","boolean","undefined"]),s=o.next();!s.done;s=o.next()){if(s.value===i)return e===t}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}if(null==e&&null==t)return!0;if(null==e||null==t||e.length!==t.length)return!1;var a=Array.isArray(e),l=Array.isArray(t);if(a!==l)return!1;if(!a||!l){var u=Object.keys(e).sort(),c=Object.keys(t).sort();if(!fO(u,c))return!1;var d=!0;return Object.keys(e).forEach(function(r){fO(e[r],t[r])||(d=!1)}),d}for(var h=0;h<e.length;h++)if(!fO(e[h],t[h]))return!1;return!0};Object.entries||(Object.entries=function(e){for(var t=Object.keys(e),r=t.length,n=new Array(r);r--;)n[r]=[t[r],e[t[r]]];return n});var gO=function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var e=this,t=dO({},this.identity.userProperties),r=dO(dO({},this.identity),{userProperties:t});return{setUserId:function(e){return r.userId=e,this},setDeviceId:function(e){return r.deviceId=e,this},setUserProperties:function(e){return r.userProperties=e,this},setOptOut:function(e){return r.optOut=e,this},updateUserProperties:function(e){var t,n,i,o,s,a,l=r.userProperties||{};try{for(var u=hO(Object.entries(e)),c=u.next();!c.done;c=u.next()){var d=pO(c.value,2),h=d[0],p=d[1];switch(h){case"$set":try{for(var f=(i=void 0,hO(Object.entries(p))),g=f.next();!g.done;g=f.next()){var v=pO(g.value,2),m=v[0],y=v[1];l[m]=y}}catch(e){i={error:e}}finally{try{g&&!g.done&&(o=f.return)&&o.call(f)}finally{if(i)throw i.error}}break;case"$unset":try{for(var b=(s=void 0,hO(Object.keys(p))),w=b.next();!w.done;w=b.next()){delete l[m=w.value]}}catch(e){s={error:e}}finally{try{w&&!w.done&&(a=b.return)&&a.call(b)}finally{if(s)throw s.error}}break;case"$clearAll":l={}}}}catch(e){t={error:e}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(t)throw t.error}}return r.userProperties=l,this},commit:function(){return e.setIdentity(r),this}}},e.prototype.getIdentity=function(){return dO({},this.identity)},e.prototype.setIdentity=function(e){var t=dO({},this.identity);this.identity=dO({},e),fO(t,this.identity)||this.listeners.forEach(function(t){t(e)})},e.prototype.addIdentityListener=function(e){this.listeners.add(e)},e.prototype.removeIdentityListener=function(e){this.listeners.delete(e)},e}(),vO=typeof globalThis<"u"?globalThis:typeof window<"u"?window:self,mO=function(){function e(){this.identityStore=new gO,this.eventBridge=new cO,this.applicationContextProvider=new lO}return e.getInstance=function(t){return vO.analyticsConnectorInstances||(vO.analyticsConnectorInstances={}),vO.analyticsConnectorInstances[t]||(vO.analyticsConnectorInstances[t]=new e),vO.analyticsConnectorInstances[t]},e}(),yO=["boot"],bO=Symbol.for("amplitude-engagement-plugin-caller");var wO,SO=((wO=SO||{}).Local="https://local.amplitude.com:3010/",wO.Staging="https://apps.stag2.amplitude.com/",wO.Production="https://app.amplitude.com/",wO.ProductionEU="https://app.eu.amplitude.com/",wO);var kO=((e=>{if(typeof window<"u"&&window.opener)for(let t of Object.values(SO))window.opener.postMessage({message:e},t)})("ENGAGEMENT_SNIPPET"),function(e){var t,r,n,i,o,s,a,l,u,c;let d=typeof window<"u"?window.engagement:void 0,h=!1,p={_q:null!=(t=null==d?void 0:d._q)?t:[],_configuration:{apiKey:null!=(n=null==(r=null==d?void 0:d._configuration)?void 0:r.apiKey)?n:"",serverUrl:null==(i=null==d?void 0:d._configuration)?void 0:i.serverUrl,chatUrl:null==(o=null==d?void 0:d._configuration)?void 0:o.chatUrl,mediaUrl:null==(s=null==d?void 0:d._configuration)?void 0:s.mediaUrl,serverZone:null!=(l=null==(a=null==d?void 0:d._configuration)?void 0:a.serverZone)?l:"US",autoRefreshIntervalSeconds:null==(u=null==d?void 0:d._configuration)?void 0:u.autoRefreshIntervalSeconds,options:{...null==(c=null==d?void 0:d._configuration)?void 0:c.options}},init(t,r){var n,i,o,s;if(p._configuration.apiKey)return void console.log("Engagement SDK has already been initialized. Ignoring additional init call.");if(!0===(null==r?void 0:r.skip))return console.log("Engagement SDK init skipped via `skip: true`. The SDK bundle will not be loaded."),void(h=!0);if(h&&(p._q.length=0),h=!1,null!=r&&r.useEngagementDomain){let e="EU"===(null!=(n=r.serverZone)?n:p._configuration.serverZone),t="amplitudeengagement.com";r.serverUrl||(r.serverUrl=e?`https://gs.eu.${t}`:`https://gs.${t}`),r.chatUrl||(r.chatUrl=e?`https://houston-chat.eu.${t}`:`https://houston-chat.${t}`),r.mediaUrl||(r.mediaUrl=e?`https://engagement-static.eu.${t}`:`https://engagement-static.${t}`),r.cdnUrl||(r.cdnUrl=e?`https://cdn.eu.${t}`:`https://cdn.${t}`)}let a;if(p._configuration={...p._configuration,...r,apiKey:t,options:{splitting:!0,...p._configuration.options,...null==r?void 0:r.options}},null!=(o=null==(i=p._configuration)?void 0:i.options)&&o.logger&&p._configuration.options.logger.enable(null!=(s=p._configuration.options.logLevel)?s:2),null!=r&&r.cdnUrl)a=p._configuration.options.splitting?`${r.cdnUrl}/engagement-browser/prod/split/index.js`:r.cdnUrl+"/engagement-browser/prod/index.min.js.gz";else{let e="EU"===p._configuration.serverZone?"https://cdn.eu.amplitude.com":"https://cdn.amplitude.com";a=p._configuration.options.splitting?`${e}/engagement-browser/prod/split/index.js`:`${e}/engagement-browser/prod/index.min.js.gz`}let l=null,u=()=>{if(h=!0,l&&(clearTimeout(l),l=null),p._q&&p._q.length>0)for(console.warn(`Engagement SDK failed to load within ${c}ms. Resolving pending calls gracefully.`);p._q.length>0;){let e=p._q.shift();if(!e)continue;let t=e[0],r=yO.includes(t);if(console.warn(`Engagement SDK method '${t}' still in queue (isAsyncMethod=${r}); attempting to resolve as no-op.`),r&&e[1]instanceof Function&&e[2]instanceof Function){let r=e[1];console.warn(`Engagement SDK method '${t}' resolved as no-op due to script loading failure`),r(void 0)}}};e(a,p._configuration.options.splitting?"module":void 0,null==r?void 0:r.nonce,u);let c=1e4;l=setTimeout(()=>{u()},c)},plugin(e){let t=p.init,r=null==e?void 0:e.token,n=!0===(null==e?void 0:e.skip),i=(e,t)=>{let n=t.getIdentity(),i="function"==typeof r?r():r;return{user_id:e.getUserId(),device_id:e.getDeviceId(),user_properties:n.userProperties,getSessionId:e.getSessionId,...i?{token:i}:{}}};return{name:"@amplitude/engagement-browser",type:"enrichment",async setup(r,o){var s;if(n)return void t(r.apiKey,{skip:!0});let a=null!=(s=r.instanceName)?s:"$default_instance",l=mO.getInstance(a).identityStore;p._configuration._installedViaPlugin=!0,t(r.apiKey,{serverZone:r.serverZone,...e,options:{logLevel:r.logLevel,logger:r.loggerProvider,...null==e?void 0:e.options}});let u=[{track:e=>{o.track(e)}}];await window.engagement.boot({user:()=>i(o,l),integrations:u},bO),l.addIdentityListener(e=>{var t,r,n,s;null!=(t=window.engagement)&&t._.user&&null!=(r=window.engagement)&&r._analytics.hasBooted?(null==(s=null==(n=window.engagement)?void 0:n._.user)?void 0:s.user_id)!==e.userId?(window.engagement.shutdown(bO),window.engagement.boot({user:()=>i(o,l),integrations:u},bO)):window.engagement._setUserProperties(e.userProperties):console.warn("Engagement SDK not booted. Ignoring identity change.")})},execute:async e=>(n||window.engagement.forwardEvent(e),e)}}},f=p;return new Proxy(p,{get:function(e,t){return t in f?f[t]:"then"!==t?"gs"===t||"rc"===t||"assistant"===t?new Proxy({},{get:function(e,r){return function(){let e=Array.from(arguments),n=`${t}.${r}`;e.unshift(n),p._q.push(e)}}}):yO.includes(t)?function(){let e=Array.prototype.slice.call(arguments);return new Promise((r,n)=>{e.unshift(t,r,n),p._q.push(e),h&&r(void 0)})}:function(){let e=Array.prototype.slice.call(arguments);e.unshift(t),p._q.push(e)}:void 0}})}((e,t,r,n)=>function(e,t,r,n){for(let i of e){let e=document.createElement("script");e.src=i,e.id="engagement-sdk-bundle",r&&e.setAttribute("nonce",r),t&&e.setAttribute("type",t),n&&(e.onerror=n);let o=document.getElementsByTagName("head")[0];o&&o.appendChild(e)}}([e||"https://cdn.amplitude.com/engagement-browser/prod/index.min.js.gz"],t,r,n)));Ne();var xO=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return f(r,e),r.prototype.sessionReplay=function(){return this._sessionReplay},r.prototype.experiment=function(){if(void 0!==this.config){var e=this.plugins(aO);return 0===e.length?void this.config.loggerProvider.debug("".concat(aO.pluginName," plugin is not found.")):1===e.length?e[0].experiment:void this.config.loggerProvider.debug("Multiple instances of ".concat(aO.pluginName," are found."))}},r.prototype.initAll=function(r,n){return v(this,void 0,void 0,function(){var i=this;return m(this,function(o){return this._initAllPromise||(this._initAllPromise=v(i,void 0,void 0,function(){var i,o;return m(this,function(s){switch(s.label){case 0:return i={serverZone:null==n?void 0:n.serverZone,instanceName:null==n?void 0:n.instanceName},e.prototype.add.call(this,{type:"enrichment",name:"@amplitude/unified-library-plugin",execute:function(e){var t;return v(this,void 0,void 0,function(){return m(this,function(r){return e.library="".concat("amplitude-ts-unified","/").concat("1.1.10","-").concat(null!==(t=e.library)&&void 0!==t?t:""),[2,e]})})}}),[4,e.prototype.init.call(this,r,t(t({},null==n?void 0:n.analytics),i)).promise];case 1:return s.sent(),[4,e.prototype.add.call(this,(u=t(t({},null==n?void 0:n.sessionReplay),i),new ZE(u))).promise];case 2:return s.sent(),[4,e.prototype.add.call(this,(l=t(t({},null==n?void 0:n.experiment),i),new aO(l))).promise];case 3:return s.sent(),void 0===(o=this.plugin(ZE.pluginName))?this.config.loggerProvider.debug("".concat(ZE.pluginName," plugin is not found.")):this._sessionReplay=o.sessionReplay,[4,e.prototype.add.call(this,(a=t(t({},null==n?void 0:n.engagement),i),typeof window<"u"&&!window.engagement&&(window.engagement=kO),kO.plugin(a))).promise];case 4:return s.sent(),[2]}var a,l,u})}).finally(function(){i._initAllPromise=void 0})),[2,this._initAllPromise]})})},r.prototype.init=function(t,r,n){return void 0===t&&(t=""),e.prototype.init.call(this,t,r,n)},r}(_k);Pi();var EO=function(){var e=new xO;return{_setDiagnosticsSampleRate:it(e._setDiagnosticsSampleRate.bind(e),"_setDiagnosticsSampleRate",tt(e),nt(e,["config"])),experiment:it(e.experiment.bind(e),"experiment",tt(e),nt(e,["config"])),sessionReplay:it(e.sessionReplay.bind(e),"sessionReplay",tt(e),nt(e,["config"])),initAll:it(e.initAll.bind(e),"initAll",tt(e),nt(e,["config"])),init:it(e.init.bind(e),"init",tt(e),nt(e,["config"])),add:it(e.add.bind(e),"add",tt(e),nt(e,["config.apiKey","timeline.plugins"])),remove:it(e.remove.bind(e),"remove",tt(e),nt(e,["config.apiKey","timeline.plugins"])),track:it(e.track.bind(e),"track",tt(e),nt(e,["config.apiKey","timeline.queue.length"])),logEvent:it(e.logEvent.bind(e),"logEvent",tt(e),nt(e,["config.apiKey","timeline.queue.length"])),identify:it(e.identify.bind(e),"identify",tt(e),nt(e,["config.apiKey","timeline.queue.length"])),groupIdentify:it(e.groupIdentify.bind(e),"groupIdentify",tt(e),nt(e,["config.apiKey","timeline.queue.length"])),setGroup:it(e.setGroup.bind(e),"setGroup",tt(e),nt(e,["config.apiKey","timeline.queue.length"])),revenue:it(e.revenue.bind(e),"revenue",tt(e),nt(e,["config.apiKey","timeline.queue.length"])),flush:it(e.flush.bind(e),"flush",tt(e),nt(e,["config.apiKey","timeline.queue.length"])),getUserId:it(e.getUserId.bind(e),"getUserId",tt(e),nt(e,["config","config.userId"])),setUserId:it(e.setUserId.bind(e),"setUserId",tt(e),nt(e,["config","config.userId"])),getDeviceId:it(e.getDeviceId.bind(e),"getDeviceId",tt(e),nt(e,["config","config.deviceId"])),setDeviceId:it(e.setDeviceId.bind(e),"setDeviceId",tt(e),nt(e,["config","config.deviceId"])),reset:it(e.reset.bind(e),"reset",tt(e),nt(e,["config","config.userId","config.deviceId"])),getSessionId:it(e.getSessionId.bind(e),"getSessionId",tt(e),nt(e,["config"])),setSessionId:it(e.setSessionId.bind(e),"setSessionId",tt(e),nt(e,["config"])),extendSession:it(e.extendSession.bind(e),"extendSession",tt(e),nt(e,["config"])),setOptOut:it(e.setOptOut.bind(e),"setOptOut",tt(e),nt(e,["config"])),getOptOut:it(e.getOptOut.bind(e),"getOptOut",tt(e),nt(e,["config"])),setTransport:it(e.setTransport.bind(e),"setTransport",tt(e),nt(e,["config"])),getIdentity:it(e.getIdentity.bind(e),"getIdentity",tt(e),nt(e,["config"])),setIdentity:it(e.setIdentity.bind(e),"setIdentity",tt(e),nt(e,["config","config.userId","config.deviceId"]))}},CO=EO(),IO=CO._setDiagnosticsSampleRate,OO=CO.initAll,TO=CO.experiment,AO=CO.sessionReplay,RO=CO.add,PO=CO.extendSession,_O=CO.flush,MO=CO.getDeviceId,NO=CO.getIdentity,LO=CO.getOptOut,DO=CO.getSessionId,UO=CO.getUserId,FO=CO.groupIdentify,jO=CO.identify,BO=CO.logEvent,qO=CO.remove,zO=CO.reset,WO=CO.revenue,VO=CO.setDeviceId,$O=CO.setGroup,HO=CO.setIdentity,KO=CO.setOptOut,GO=CO.setSessionId,JO=CO.setTransport,QO=CO.setUserId,XO=CO.track,YO={};function ZO(e){var t;return null!=(t=null==e?void 0:e.amplitude)?t:zy}function eT(e,t,r={}){const n={...r};if("user"in t){const i=t.user;null===i||""===i?(e.setUserId(void 0),delete n.user):My(i)&&i!==r.user&&(e.setUserId(i),n.user=i)}if("device"in t){const i=t.device;My(i)&&i!==r.device&&(e.setDeviceId(i),n.device=i)}if("session"in t){const i=t.session,o=Py(i)?i:My(i)&&/^\d+$/.test(i)?Number(i):My(i)?function(e){let t=5381;for(let r=0;r<e.length;r++)t=(t<<5)+t+e.charCodeAt(r)|0;return Math.abs(t)}(i):void 0;void 0!==o&&o!==r.session&&(e.setSessionId(o),n.session=o)}return n}var tT=["set","setOnce","add","append","prepend","preInsert","postInsert","remove"];function rT(e,t){let r;const n=()=>(r||(r=new e.Identify),r);for(const e of tT){const r=t[e];if(_y(r))for(const[t,i]of Object.entries(r))Ry(i)&&("add"===e?Py(i)&&n().add(t,i):n()[e](t,i))}if(Ay(t.unset))for(const e of t.unset)My(e)&&n().unset(e);return!0===t.clearAll&&n().clearAll(),r}var nT={productId:"setProductId",price:"setPrice",quantity:"setQuantity",revenueType:"setRevenueType",currency:"setCurrency",revenue:"setRevenue",receipt:"setReceipt",receiptSig:"setReceiptSig"};function iT(e,t){const r=new e.Revenue;for(const[e,n]of Object.entries(nT)){const i=t[e];Ry(i)&&r[n](i)}return _y(t.eventProperties)&&r.setEventProperties(t.eventProperties),r}var oT,sT={type:"amplitude",config:{},async init({config:e,env:t}){const r=e.settings;if(!(null==r?void 0:r.apiKey))return!1;const n=ZO(t),{apiKey:i,identify:o,sessionReplay:s,experiment:a,engagement:l,_state:u,...c}=r,d={autocapture:!1,identityStorage:"none",...c};await n.initAll(i,{serverZone:d.serverZone,analytics:d,...s?{sessionReplay:s}:{},...(null==a?void 0:a.deploymentKey)?{experiment:a}:{},...l?{engagement:!0===l?void 0:l}:{}});return{...e,settings:{...r,_state:{lastIdentity:{}}}}},async push(e,{config:t,rule:r,env:n,data:i,collector:o}){var s;const a=ZO(n),l=t.settings||{},u=(null==r?void 0:r.settings)||{},c=l._state||{};if(void 0!==u.reset){("boolean"==typeof u.reset?u.reset:await qy(e,u.reset,{collector:o}))&&(a.reset(),c.lastIdentity={})}const d=null!=(s=u.identify)?s:l.identify;let h;if(void 0!==d){const t=await qy(e,d,{collector:o});_y(t)&&(h=t,c.lastIdentity=eT(a,h,c.lastIdentity))}if(h){const e=rT(a,h);e&&a.identify(e)}if(void 0!==u.group){const t=await qy(e,u.group,{collector:o});if(_y(t)){const{type:e,name:r}=t;My(e)&&(My(r)||Ay(r))&&a.setGroup(e,r)}}if(void 0!==u.groupIdentify){const t=await qy(e,u.groupIdentify,{collector:o});if(_y(t)){const{type:e,name:r}=t;if(My(e)&&My(r)){const n=rT(a,t);n&&a.groupIdentify(e,r,n)}}}if(void 0!==u.revenue){const t=await qy(e,u.revenue,{collector:o}),r=Ay(t)?t:_y(t)?[t]:[];for(const e of r)_y(e)&&a.revenue(iT(a,e))}if(!0!==(null==r?void 0:r.silent)){const t=My(null==r?void 0:r.name)?r.name:e.name,n=_y(i)?i:{};a.track(t,n)}l._state=c},on(e,t){var r;if("consent"!==e||!t.data)return;const n=ZO(t.env),i=t.data,o=null==(r=t.config)?void 0:r.consent;if(!o||0===Object.keys(o).length)return;const s=Object.keys(o).every(e=>!0===i[e]);n.setOptOut(!s)}},aT=sT;return oT=yy,d(n({},"__esModule",{value:!0}),oT)})();
|
|
1
|
+
"use strict";var Destination=(()=>{var e,t,r=Object.create,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,s=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,l=(e,t)=>function(){return e&&(t=(0,e[o(e)[0]])(e=0)),t},u=(e,t)=>function(){return t||(0,e[o(e)[0]])((t={exports:{}}).exports,t),t.exports},c=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},d=(e,t,r,s)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))a.call(e,l)||l===r||n(e,l,{get:()=>t[l],enumerable:!(s=i(t,l))||s.enumerable});return e},h=(e,t,i)=>(i=null!=e?r(s(e)):{},d(!t&&e&&e.__esModule?i:n(i,"default",{value:e,enumerable:!0}),e)),p=(e,t,r)=>((e,t,r)=>t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);function f(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}function g(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}function v(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})}function m(e,t){var r,n,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(l){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}function y(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function b(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}function w(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}var S,E,k,x,C,I,O,T,A,_,R,P,M,N,L,D,j,U,F,B,q,z,V,W,H,$,G,K,J,Q,Y,X,Z,ee,te,re,ne,ie,oe,se,ae,le,ue,ce,de,he,pe,fe,ge,ve,me,ye,be,we,Se,Ee,ke,xe,Ce,Ie,Oe,Te,Ae,_e,Re,Pe,Me,Ne=l({"../../../../node_modules/tslib/tslib.es6.mjs"(){e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(t,r)},t=function(){return t=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},t.apply(this,arguments)}}}),Le=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/types/event/event.js"(){var e,t;(e=S||(S={})).SET="$set",e.SET_ONCE="$setOnce",e.ADD="$add",e.APPEND="$append",e.PREPEND="$prepend",e.REMOVE="$remove",e.PREINSERT="$preInsert",e.POSTINSERT="$postInsert",e.UNSET="$unset",e.CLEAR_ALL="$clearAll",(t=E||(E={})).IDENTIFY="$identify",t.GROUP_IDENTIFY="$groupidentify",t.REVENUE="revenue_amount"}}),De=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/types/constants.js"(){k="-",C="".concat(x="AMP","_unsent"),I="$default_instance",O="https://api2.amplitude.com/2/httpapi",T="https://api.eu.amplitude.com/2/httpapi",A="https://api2.amplitude.com/batch",_="https://api.eu.amplitude.com/batch",R="utm_campaign",P="utm_content",M="utm_id",N="utm_medium",L="utm_source",D="utm_term",j="dclid",U="fbclid",F="gbraid",B="gclid",q="ko_click_id",z="li_fat_id",V="msclkid",W="rdt_cid",H="ttclid",$="twclid",G="wbraid",K={utm_campaign:void 0,utm_content:void 0,utm_id:void 0,utm_medium:void 0,utm_source:void 0,utm_term:void 0,referrer:void 0,referring_domain:void 0,dclid:void 0,gbraid:void 0,gclid:void 0,fbclid:void 0,ko_click_id:void 0,li_fat_id:void 0,msclkid:void 0,rdt_cid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0},J=["access-control-allow-origin","access-control-allow-credentials","access-control-expose-headers","access-control-max-age","access-control-allow-methods","access-control-allow-headers","accept-patch","accept-ranges","age","allow","alt-svc","cache-control","connection","content-disposition","content-encoding","content-language","content-length","content-location","content-md5","content-range","content-type","date","delta-base","etag","expires","im","last-modified","link","location","permanent","p3p","pragma","proxy-authenticate","public-key-pins","retry-after","server","status","strict-transport-security","trailer","transfer-encoding","tk","upgrade","vary","via","warning","www-authenticate","x-b3-traceid","x-frame-options"],Q=["authorization","cookie","set-cookie"]}}),je=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/utils/valid-properties.js"(){Ne(),Y=function(e){if(Object.keys(e).length>1e3)return!1;for(var t in e){var r=e[t];if(!X(t,r))return!1}return!0},X=function(e,t){var r,n;if("string"!=typeof e)return!1;if(Array.isArray(t)){var i=!0;try{for(var o=y(t),s=o.next();!s.done;s=o.next()){var a=s.value;if(Array.isArray(a))return!1;if("object"==typeof a)i=i&&Y(a);else if(!["number","string"].includes(typeof a))return!1;if(!i)return!1}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}}else{if(null==t)return!1;if("object"==typeof t)return Y(t);if(!["number","string","boolean"].includes(typeof t))return!1}return!0}}}),Ue=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/identify.js"(){var e;Ne(),De(),je(),Z=function(){function e(){this._propertySet=new Set,this._properties={}}return e.prototype.getUserProperties=function(){return t({},this._properties)},e.prototype.set=function(e,t){return this._safeSet(ee.SET,e,t),this},e.prototype.setOnce=function(e,t){return this._safeSet(ee.SET_ONCE,e,t),this},e.prototype.append=function(e,t){return this._safeSet(ee.APPEND,e,t),this},e.prototype.prepend=function(e,t){return this._safeSet(ee.PREPEND,e,t),this},e.prototype.postInsert=function(e,t){return this._safeSet(ee.POSTINSERT,e,t),this},e.prototype.preInsert=function(e,t){return this._safeSet(ee.PREINSERT,e,t),this},e.prototype.remove=function(e,t){return this._safeSet(ee.REMOVE,e,t),this},e.prototype.add=function(e,t){return this._safeSet(ee.ADD,e,t),this},e.prototype.unset=function(e){return this._safeSet(ee.UNSET,e,k),this},e.prototype.clearAll=function(){return this._properties={},this._properties[ee.CLEAR_ALL]=k,this},e.prototype._safeSet=function(e,t,r){if(this._validate(e,t,r)){var n=this._properties[e];return void 0===n&&(n={},this._properties[e]=n),n[t]=r,this._propertySet.add(t),!0}return!1},e.prototype._validate=function(e,t,r){return void 0===this._properties[ee.CLEAR_ALL]&&(!this._propertySet.has(t)&&(e===ee.ADD?"number"==typeof r:e===ee.UNSET||e===ee.REMOVE||X(t,r)))},e}(),(e=ee||(ee={})).SET="$set",e.SET_ONCE="$setOnce",e.ADD="$add",e.APPEND="$append",e.PREPEND="$prepend",e.REMOVE="$remove",e.PREINSERT="$preInsert",e.POSTINSERT="$postInsert",e.UNSET="$unset",e.CLEAR_ALL="$clearAll",te=[ee.CLEAR_ALL,ee.UNSET,ee.SET,ee.SET_ONCE,ee.ADD,ee.APPEND,ee.PREPEND,ee.PREINSERT,ee.POSTINSERT,ee.REMOVE]}}),Fe=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/types/messages.js"(){re="Event tracked successfully",ne="Unexpected error occurred",ie="Event rejected due to exceeded retry count",oe="Event skipped due to optOut config",se="Event rejected due to missing API key",ae="Invalid API key",le="Client not initialized"}}),Be=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/types/status.js"(){var e;(e=ue||(ue={})).Unknown="unknown",e.Skipped="skipped",e.Success="success",e.RateLimit="rate_limit",e.PayloadTooLarge="payload_too_large",e.Invalid="invalid",e.Failed="failed",e.Timeout="Timeout",e.SystemError="SystemError"}}),qe=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/utils/result-builder.js"(){Be(),ce=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=ue.Unknown),{event:e,code:t,message:r}}}}),ze=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/global-scope.js"(){de=function(){var e="ampIntegrationContext";return"undefined"!=typeof globalThis&&void 0!==globalThis[e]?globalThis[e]:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:void 0}}}),Ve=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/utils/uuid.js"(){Ne(),ze(),he=function(e){return e?(e^16*Math.random()>>e/4).toString(16):(String(1e7)+String(-1e3)+String(-4e3)+String(-8e3)+String(-1e11)).replace(/[018]/g,fe)},pe=w([],b(Array(256).keys()),!1).map(function(e){return e.toString(16).padStart(2,"0")}),fe=function(e){var t,r=de();if(!(null===(t=null==r?void 0:r.crypto)||void 0===t?void 0:t.getRandomValues))return he(e);var n=r.crypto.getRandomValues(new Uint8Array(16));return n[6]=15&n[6]|64,n[8]=63&n[8]|128,w([],b(n.entries()),!1).map(function(e){var t=b(e,2),r=t[0],n=t[1];return[4,6,8,10].includes(r)?"-".concat(pe[n]):pe[n]}).join("")}}}),We=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/timeline.js"(){Ne(),qe(),Ve(),ge=function(){function e(e){this.client=e,this.queue=[],this.applying=!1,this.plugins=[],this.pluginStatus=new Map,this._optOutListeners=[]}return e.prototype.register=function(e,t){var r,n;return v(this,void 0,void 0,function(){var i;return m(this,function(o){switch(o.label){case 0:return void 0===e.name&&(e.name=fe(),this.loggerProvider.warn("Plugin name is undefined.\n Generating a random UUID for plugin name: ".concat(e.name,".\n Set a name for the plugin to prevent it from being added multiple times."))),i=e.name,this.pluginStatus.has(i)?(this.loggerProvider.warn("Plugin with name ".concat(i," already exists, skipping registration")),[2]):(e.type=null!==(r=e.type)&&void 0!==r?r:"enrichment",this.pluginStatus.set(i,"locked"),[4,null===(n=e.setup)||void 0===n?void 0:n.call(e,t,this.client)]);case 1:return o.sent(),"locked"!==this.pluginStatus.get(i)?[2]:(this.plugins.push(e),this.pluginStatus.set(i,"installed"),[2])}})})},e.prototype.deregister=function(e,t){var r;return v(this,void 0,void 0,function(){var n,i;return m(this,function(o){switch(o.label){case 0:return this.pluginStatus.delete(e),-1===(n=this.plugins.findIndex(function(t){return t.name===e}))?(t.loggerProvider.warn("Plugin with name ".concat(e," does not exist, skipping deregistration")),[2]):(i=this.plugins[n],this.plugins.splice(n,1),[4,null===(r=i.teardown)||void 0===r?void 0:r.call(i)]);case 1:return o.sent(),[2]}})})},e.prototype.reset=function(e){this._clearOptOutListeners(),this.applying=!1,this.plugins.map(function(e){var t;return null===(t=e.teardown)||void 0===t?void 0:t.call(e)}),this.plugins=[],this.pluginStatus.clear(),this.client=e},e.prototype.push=function(e){var t=this;return new Promise(function(r){t.queue.push([e,r]),t.scheduleApply(0)})},e.prototype.scheduleApply=function(e){var t=this;this.applying||(this.applying=!0,setTimeout(function(){t.apply(t.queue.shift()).then(function(){t.applying=!1,t.queue.length>0&&t.scheduleApply(0)})},e))},e.prototype.apply=function(e){return v(this,void 0,void 0,function(){var r,n,i,o,s,a,l,u,c,d,h,p,f,g,v,w,S,E,k,x;return m(this,function(m){switch(m.label){case 0:if(!e)return[2];r=b(e,1),n=r[0],i=b(e,2),o=i[1],this.loggerProvider.log("Timeline.apply: Initial event",n),s=this.plugins.filter(function(e){return"before"===e.type}),m.label=1;case 1:m.trys.push([1,6,7,8]),a=y(s),l=a.next(),m.label=2;case 2:return l.done?[3,5]:(p=l.value).execute?[4,p.execute(t({},n))]:[3,4];case 3:if(null===(f=m.sent()))return this.loggerProvider.log("Timeline.apply: Event filtered out by before plugin '".concat(String(p.name),"', event: ").concat(JSON.stringify(n))),o({event:n,code:0,message:""}),[2];n=f,this.loggerProvider.log("Timeline.apply: Event after before plugin '".concat(String(p.name),"', event: ").concat(JSON.stringify(n))),m.label=4;case 4:return l=a.next(),[3,2];case 5:return[3,8];case 6:return u=m.sent(),S={error:u},[3,8];case 7:try{l&&!l.done&&(E=a.return)&&E.call(a)}finally{if(S)throw S.error}return[7];case 8:c=this.plugins.filter(function(e){return"enrichment"===e.type||void 0===e.type}),m.label=9;case 9:m.trys.push([9,14,15,16]),d=y(c),h=d.next(),m.label=10;case 10:return h.done?[3,13]:(p=h.value).execute?[4,p.execute(t({},n))]:[3,12];case 11:if(null===(f=m.sent()))return this.loggerProvider.log("Timeline.apply: Event filtered out by enrichment plugin '".concat(String(p.name),"', event: ").concat(JSON.stringify(n))),o({event:n,code:0,message:""}),[2];n=f,this.loggerProvider.log("Timeline.apply: Event after enrichment plugin '".concat(String(p.name),"', event: ").concat(JSON.stringify(n))),m.label=12;case 12:return h=d.next(),[3,10];case 13:return[3,16];case 14:return g=m.sent(),k={error:g},[3,16];case 15:try{h&&!h.done&&(x=d.return)&&x.call(d)}finally{if(k)throw k.error}return[7];case 16:return v=this.plugins.filter(function(e){return"destination"===e.type}),this.loggerProvider.log("Timeline.apply: Final event before destinations, event: ".concat(JSON.stringify(n))),w=v.map(function(e){var r=t({},n);return e.execute(r).catch(function(e){return ce(r,0,String(e))})}),Promise.all(w).then(function(e){var t=b(e,1)[0]||ce(n,100,"Event not tracked, no destination plugins on the instance");o(t)}),[2]}})})},e.prototype.flush=function(){return v(this,void 0,void 0,function(){var e,t,r,n=this;return m(this,function(i){switch(i.label){case 0:return e=this.queue,this.queue=[],[4,Promise.all(e.map(function(e){return n.apply(e)}))];case 1:return i.sent(),t=this.plugins.filter(function(e){return"destination"===e.type}),r=t.map(function(e){return e.flush&&e.flush()}),[4,Promise.all(r)];case 2:return i.sent(),[2]}})})},e.prototype.addOptOutListener=function(e){this._optOutListeners.push(e)},e.prototype._clearOptOutListeners=function(){this._optOutListeners=[]},e.prototype.onIdentityChanged=function(e){this.plugins.forEach(function(t){var r;null===(r=t.onIdentityChanged)||void 0===r||r.call(t,e)})},e.prototype.onSessionIdChanged=function(e){this.plugins.forEach(function(t){var r;null===(r=t.onSessionIdChanged)||void 0===r||r.call(t,e)})},e.prototype.onOptOutChanged=function(e){this.plugins.forEach(function(t){var r;null===(r=t.onOptOutChanged)||void 0===r||r.call(t,e)}),this._callOptOutListeners(e)},e.prototype._callOptOutListeners=function(e){return v(this,void 0,void 0,function(){var t,r,n,i,o,s,a;return m(this,function(l){switch(l.label){case 0:l.trys.push([0,7,8,9]),t=y(this._optOutListeners),r=t.next(),l.label=1;case 1:if(r.done)return[3,6];n=r.value,l.label=2;case 2:return l.trys.push([2,4,,5]),[4,n(e)];case 3:return l.sent(),[3,5];case 4:return i=l.sent(),this.loggerProvider.error("Error calling optOut listener",i),[3,5];case 5:return r=t.next(),[3,1];case 6:return[3,9];case 7:return o=l.sent(),s={error:o},[3,9];case 8:try{r&&!r.done&&(a=t.return)&&a.call(t)}finally{if(s)throw s.error}return[7];case 9:return[2]}})})},e.prototype.onReset=function(){this.plugins.forEach(function(e){var t;null===(t=e.onReset)||void 0===t||t.call(e)})},e}()}}),He=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/utils/event-builder.js"(){Ne(),Ue(),Le(),ve=function(e,r,n){return t(t(t({},"string"==typeof e?{event_type:e}:e),n),r&&{event_properties:r})},me=function(e,r){return t(t({},r),{event_type:E.IDENTIFY,user_properties:e.getUserProperties()})},ye=function(e,r,n,i){var o;return t(t({},i),{event_type:E.GROUP_IDENTIFY,group_properties:n.getUserProperties(),groups:(o={},o[e]=r,o)})},be=function(e,r,n){var i,o=new Z;return o.set(e,r),t(t({},n),{event_type:E.IDENTIFY,user_properties:o.getUserProperties(),groups:(i={},i[e]=r,i)})},we=function(e,r){return t(t({},r),{event_type:E.REVENUE,event_properties:e.getEventProperties()})}}}),$e=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/utils/return-wrapper.js"(){Se=function(e){return{promise:e||Promise.resolve()}}}}),Ge=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/core-client.js"(){Ne(),Le(),Ue(),Fe(),We(),He(),qe(),$e(),Ee=function(){function e(e){void 0===e&&(e="$default"),this.initializing=!1,this.isReady=!1,this.q=[],this.dispatchQ=[],this.logEvent=this.track.bind(this),this.timeline=new ge(this),this.name=e}return e.prototype._init=function(e){return v(this,void 0,void 0,function(){return m(this,function(t){switch(t.label){case 0:return this.config=e,this.timeline.reset(this),this.timeline.loggerProvider=this.config.loggerProvider,[4,this.runQueuedFunctions("q")];case 1:return t.sent(),this.isReady=!0,[2]}})})},e.prototype.runQueuedFunctions=function(e){return v(this,void 0,void 0,function(){var t,r,n,i,o,s,a,l;return m(this,function(u){switch(u.label){case 0:t=this[e],this[e]=[],u.label=1;case 1:u.trys.push([1,8,9,10]),r=y(t),n=r.next(),u.label=2;case 2:return n.done?[3,7]:(i=n.value,(o=i())&&"promise"in o?[4,o.promise]:[3,4]);case 3:return u.sent(),[3,6];case 4:return[4,o];case 5:u.sent(),u.label=6;case 6:return n=r.next(),[3,2];case 7:return[3,10];case 8:return s=u.sent(),a={error:s},[3,10];case 9:try{n&&!n.done&&(l=r.return)&&l.call(r)}finally{if(a)throw a.error}return[7];case 10:return this[e].length?[4,this.runQueuedFunctions(e)]:[3,12];case 11:u.sent(),u.label=12;case 12:return[2]}})})},e.prototype.track=function(e,t,r){var n=ve(e,t,r);return this.userProperties=this.getOperationAppliedUserProperties(n.user_properties),Se(this.dispatch(n))},e.prototype.identify=function(e,t){var r=me(e,t);return this.userProperties=this.getOperationAppliedUserProperties(r.user_properties),Se(this.dispatch(r))},e.prototype.groupIdentify=function(e,t,r,n){var i=ye(e,t,r,n);return Se(this.dispatch(i))},e.prototype.setGroup=function(e,t,r){var n=be(e,t,r);return this.userProperties=this.getOperationAppliedUserProperties(n.user_properties),Se(this.dispatch(n))},e.prototype.revenue=function(e,t){var r=we(e,t);return Se(this.dispatch(r))},e.prototype.add=function(e){return this.isReady?this._addPlugin(e):(this.q.push(this._addPlugin.bind(this,e)),Se())},e.prototype._addPlugin=function(e){return Se(this.timeline.register(e,this.config))},e.prototype.remove=function(e){return this.isReady?this._removePlugin(e):(this.q.push(this._removePlugin.bind(this,e)),Se())},e.prototype._removePlugin=function(e){return Se(this.timeline.deregister(e,this.config))},e.prototype.dispatchWithCallback=function(e,t){if(!this.isReady)return t(ce(e,0,le));this.process(e).then(t)},e.prototype.dispatch=function(e){return v(this,void 0,void 0,function(){var t=this;return m(this,function(r){return this.isReady?[2,this.process(e)]:[2,new Promise(function(r){t.dispatchQ.push(t.dispatchWithCallback.bind(t,e,r))})]})})},e.prototype.getOperationAppliedUserProperties=function(e){var r,n=null!==(r=this.userProperties)&&void 0!==r?r:{},i=t({},n);if(void 0===e)return i;var o={};return Object.keys(e).forEach(function(t){Object.values(S).includes(t)||(o[t]=e[t])}),te.forEach(function(t){if(Object.keys(e).includes(t)){var r=e[t];switch(t){case S.CLEAR_ALL:Object.keys(i).forEach(function(e){delete i[e]});break;case S.UNSET:Object.keys(r).forEach(function(e){delete i[e]});break;case S.SET:Object.assign(i,r)}}}),Object.assign(i,o),i},e.prototype.process=function(e){return v(this,void 0,void 0,function(){var t,r,n;return m(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),this.config.optOut?[2,ce(e,0,oe)]:(e.event_type===E.IDENTIFY&&this.timeline.onIdentityChanged({userProperties:this.userProperties}),[4,this.timeline.push(e)]);case 1:return 200===(n=i.sent()).code?this.config.loggerProvider.log(n.message):100===n.code?this.config.loggerProvider.warn(n.message):this.config.loggerProvider.error(n.message),[2,n];case 2:return t=i.sent(),r=String(t),this.config.loggerProvider.error(r),[2,n=ce(e,0,r)];case 3:return[2]}})})},e.prototype.setOptOut=function(e){this.isReady?this._setOptOut(e):this.q.push(this._setOptOut.bind(this,Boolean(e)))},e.prototype._setOptOut=function(e){this.config.optOut!==e&&(this.config.optOut=Boolean(e),this.timeline.onOptOutChanged(e))},e.prototype.flush=function(){return Se(this.timeline.flush())},e.prototype.plugin=function(e){var t=this.timeline.plugins.find(function(t){return t.name===e});if(void 0!==t)return t;this.config.loggerProvider.debug("Cannot find plugin with name ".concat(e))},e.prototype.plugins=function(e){return this.timeline.plugins.filter(function(t){return t instanceof e})},e}()}}),Ke=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/revenue.js"(){var e;Ne(),je(),ke=function(){function e(){this.productId="",this.quantity=1,this.price=0}return e.prototype.setProductId=function(e){return this.productId=e,this},e.prototype.setQuantity=function(e){return e>0&&(this.quantity=e),this},e.prototype.setPrice=function(e){return this.price=e,this},e.prototype.setRevenueType=function(e){return this.revenueType=e,this},e.prototype.setCurrency=function(e){return this.currency=e,this},e.prototype.setRevenue=function(e){return this.revenue=e,this},e.prototype.setReceipt=function(e){return this.receipt=e,this},e.prototype.setReceiptSig=function(e){return this.receiptSig=e,this},e.prototype.setEventProperties=function(e){try{var t=JSON.parse(JSON.stringify(e));Y(t)&&(this.properties=t)}catch(e){}return this},e.prototype.getEventProperties=function(){var e=this.properties?t({},this.properties):{};return e[xe.REVENUE_PRODUCT_ID]=this.productId,e[xe.REVENUE_QUANTITY]=this.quantity,e[xe.REVENUE_PRICE]=this.price,e[xe.REVENUE_TYPE]=this.revenueType,e[xe.REVENUE_CURRENCY]=this.currency,e[xe.REVENUE]=this.revenue,e[xe.RECEIPT]=this.receipt,e[xe.RECEIPT_SIG]=this.receiptSig,e},e}(),(e=xe||(xe={})).REVENUE_PRODUCT_ID="$productId",e.REVENUE_QUANTITY="$quantity",e.REVENUE_PRICE="$price",e.REVENUE_TYPE="$revenueType",e.REVENUE_CURRENCY="$currency",e.REVENUE="$revenue",e.RECEIPT="$receipt",e.RECEIPT_SIG="$receiptSig"}}),Je=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/utils/chunk.js"(){Ce=function(e,t){var r=Math.max(t,1);return e.reduce(function(e,t,n){var i=Math.floor(n/r);return e[i]||(e[i]=[]),e[i].push(t),e},[])}}}),Qe=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/types/loglevel.js"(){var e;(e=Ie||(Ie={}))[e.None=0]="None",e[e.Error=1]="Error",e[e.Warn=2]="Warn",e[e.Verbose=3]="Verbose",e[e.Debug=4]="Debug"}}),Ye=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/logger.js"(){Qe(),Oe="Amplitude Logger ",Te=function(){function e(){this.logLevel=Ie.None}return e.prototype.disable=function(){this.logLevel=Ie.None},e.prototype.enable=function(e){void 0===e&&(e=Ie.Warn),this.logLevel=e},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<Ie.Verbose||console.log("".concat(Oe,"[Log]: ").concat(e.join(" ")))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<Ie.Warn||console.warn("".concat(Oe,"[Warn]: ").concat(e.join(" ")))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<Ie.Error||console.error("".concat(Oe,"[Error]: ").concat(e.join(" ")))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<Ie.Debug||console.log("".concat(Oe,"[Debug]: ").concat(e.join(" ")))},e}()}}),Xe=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/config.js"(){De(),Ye(),Qe(),Ae=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,instanceName:I,logLevel:Ie.Warn,loggerProvider:new Te,offline:!1,optOut:!1,serverUrl:O,serverZone:"US",useBatch:!1}},_e=function(){function e(e){var t,r,n,i;this._optOut=!1;var o=Ae();this.apiKey=e.apiKey,this.flushIntervalMillis=null!==(t=e.flushIntervalMillis)&&void 0!==t?t:o.flushIntervalMillis,this.flushMaxRetries=e.flushMaxRetries||o.flushMaxRetries,this.flushQueueSize=e.flushQueueSize||o.flushQueueSize,this.instanceName=e.instanceName||o.instanceName,this.loggerProvider=e.loggerProvider||o.loggerProvider,this.logLevel=null!==(r=e.logLevel)&&void 0!==r?r:o.logLevel,this.minIdLength=e.minIdLength,this.plan=e.plan,this.ingestionMetadata=e.ingestionMetadata,this.offline=void 0!==e.offline?e.offline:o.offline,this.optOut=null!==(n=e.optOut)&&void 0!==n?n:o.optOut,this.serverUrl=e.serverUrl,this.serverZone=e.serverZone||o.serverZone,this.storageProvider=e.storageProvider,this.transportProvider=e.transportProvider,this.useBatch=null!==(i=e.useBatch)&&void 0!==i?i:o.useBatch,this.loggerProvider.enable(this.logLevel);var s=Pe(e.serverUrl,e.serverZone,e.useBatch);this.serverZone=s.serverZone,this.serverUrl=s.serverUrl}return Object.defineProperty(e.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut=e},enumerable:!1,configurable:!0}),e}(),Re=function(e,t){return"EU"===e?t?_:T:t?A:O},Pe=function(e,t,r){if(void 0===e&&(e=""),void 0===t&&(t=Ae().serverZone),void 0===r&&(r=Ae().useBatch),e)return{serverUrl:e,serverZone:void 0};var n=["US","EU"].includes(t)?t:Ae().serverZone;return{serverZone:n,serverUrl:Re(n,r)}},Me=function(){function e(){this.sdk={metrics:{histogram:{}}}}return e.prototype.recordHistogram=function(e,t){this.sdk.metrics.histogram[e]=t},e}()}});function Ze(e){return e>=200&&e<300}var et,tt,rt,nt,it,ot,st,at,lt=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/utils/status-code.js"(){}}),ut=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/utils/debug.js"(){Ne(),Qe(),et=function(e){return void 0===e&&(e=0),((new Error).stack||"").split("\n").slice(2+e).map(function(e){return e.trim()})},tt=function(e){return function(){var r=t({},e.config);return{logger:r.loggerProvider,logLevel:r.logLevel}}},rt=function(e,t){var r,n;t=(t=t.replace(/\[(\w+)\]/g,".$1")).replace(/^\./,"");try{for(var i=y(t.split(".")),o=i.next();!o.done;o=i.next()){var s=o.value;if(!(s in e))return;e=e[s]}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return e},nt=function(e,t){return function(){var r,n,i={};try{for(var o=y(t),s=o.next();!s.done;s=o.next()){var a=s.value;i[a]=rt(e,a)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return i}},it=function(e,t,r,n,i){return void 0===i&&(i=null),function(){for(var o=[],s=0;s<arguments.length;s++)o[s]=arguments[s];var a=r(),l=a.logger,u=a.logLevel;if(u&&u<Ie.Debug||!u||!l)return e.apply(i,o);var c={type:"invoke public method",name:t,args:o,stacktrace:et(1),time:{start:(new Date).toISOString()},states:{}};n&&c.states&&(c.states.before=n());var d=e.apply(i,o);return d&&d.promise?d.promise.then(function(){n&&c.states&&(c.states.after=n()),c.time&&(c.time.end=(new Date).toISOString()),l.debug(JSON.stringify(c,null,2))}):(n&&c.states&&(c.states.after=n()),c.time&&(c.time.end=(new Date).toISOString()),l.debug(JSON.stringify(c,null,2))),d}}}});function ct(e){var t="";try{"body"in e&&(t=JSON.stringify(e.body,null,2))}catch(e){}return t}var dt,ht,pt,ft,gt,vt,mt,yt,bt=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/plugins/destination.js"(){Ne(),Be(),Fe(),De(),Je(),qe(),Xe(),Ve(),lt(),ut(),ot=new Set([O,T,A,_]),st=function(e,t){return void 0===t&&(t=!1),!!ot.has(e)||t},at=function(){function e(e){this.name="amplitude",this.type="destination",this.retryTimeout=1e3,this.throttleTimeout=3e4,this.storageKey="",this.scheduleId=null,this.scheduledTimeout=0,this.flushId=null,this.queue=[],this.diagnosticsClient=null==e?void 0:e.diagnosticsClient}return e.prototype.setup=function(e){var t;return v(this,void 0,void 0,function(){var r,n=this;return m(this,function(i){switch(i.label){case 0:return this.config=e,this.storageKey="".concat(C,"_").concat(this.config.apiKey.substring(0,10)),[4,null===(t=this.config.storageProvider)||void 0===t?void 0:t.get(this.storageKey)];case 1:return(r=i.sent())&&r.length>0&&Promise.all(r.map(function(e){return n.execute(e)})).catch(),[2,Promise.resolve(void 0)]}})})},e.prototype.execute=function(e){var t=this;return e.insert_id||(e.insert_id=fe()),new Promise(function(r){var n={event:e,attempts:0,callback:function(e){return r(e)},timeout:0};t.queue.push(n),t.schedule(t.config.flushIntervalMillis),t.saveEvents()})},e.prototype.removeEventsExceedFlushMaxRetries=function(e){var t=this;return e.filter(function(e){return e.attempts+=1,e.attempts<t.config.flushMaxRetries||(t.fulfillRequest([e],500,ie),!1)})},e.prototype.scheduleEvents=function(e){var t=this;e.forEach(function(e){t.schedule(0===e.timeout?t.config.flushIntervalMillis:e.timeout)})},e.prototype.schedule=function(e){var t=this;if(!this.config.offline)return null===this.scheduleId||this.scheduleId&&e>this.scheduledTimeout?(this.scheduleId&&clearTimeout(this.scheduleId),this.scheduledTimeout=e,void(this.scheduleId=setTimeout(function(){t.queue=t.queue.map(function(e){return e.timeout=0,e}),t.flush(!0)},e))):void 0},e.prototype.resetSchedule=function(){this.scheduleId=null,this.scheduledTimeout=0},e.prototype.flush=function(e){return void 0===e&&(e=!1),v(this,void 0,void 0,function(){var t,r,n=this;return m(this,function(i){switch(i.label){case 0:return this.config.offline?(this.resetSchedule(),this.config.loggerProvider.debug("Skipping flush while offline."),[2]):this.flushId?(this.resetSchedule(),this.config.loggerProvider.debug("Skipping flush because previous flush has not resolved."),[2]):(this.flushId=this.scheduleId,this.resetSchedule(),t=[],r=[],this.queue.forEach(function(e){return 0===e.timeout?t.push(e):r.push(e)}),[4,Ce(t,this.config.flushQueueSize).reduce(function(t,r){return v(n,void 0,void 0,function(){return m(this,function(n){switch(n.label){case 0:return[4,t];case 1:return n.sent(),[4,this.send(r,e)];case 2:return[2,n.sent()]}})})},Promise.resolve())]);case 1:return i.sent(),this.flushId=null,this.scheduleEvents(this.queue),[2]}})})},e.prototype.send=function(e,t){var r;return void 0===t&&(t=!0),v(this,void 0,void 0,function(){var n,i,o,s,a,l;return m(this,function(u){switch(u.label){case 0:if(!this.config.apiKey)return[2,this.fulfillRequest(e,400,se)];n={api_key:this.config.apiKey,events:e.map(function(e){var t=e.event;t.extra;return g(t,["extra"])}),options:{min_id_length:this.config.minIdLength},client_upload_time:(new Date).toISOString(),request_metadata:this.config.requestMetadata},this.config.requestMetadata=new Me,u.label=1;case 1:return u.trys.push([1,3,,4]),i=Pe(this.config.serverUrl,this.config.serverZone,this.config.useBatch).serverUrl,o=st(i,this.config.enableRequestBodyCompression),[4,this.config.transportProvider.send(i,n,o)];case 2:return null===(s=u.sent())?(this.fulfillRequest(e,0,ne),[2]):t?(this.handleResponse(s,e),[3,4]):("body"in s?this.fulfillRequest(e,s.statusCode,"".concat(s.status,": ").concat(ct(s))):this.fulfillRequest(e,s.statusCode,s.status),[2]);case 3:return a=u.sent(),l=(c=a)instanceof Error?c.message:String(c),this.config.loggerProvider.error(l),null===(r=this.diagnosticsClient)||void 0===r||r.recordEvent("analytics.events.unsuccessful.from.catch.error",{events:e.map(function(e){return e.event.event_type}),message:l,stack_trace:et()}),this.handleResponse({status:ue.Failed,statusCode:0},e),[3,4];case 4:return[2]}var c})})},e.prototype.handleResponse=function(e,t){var r;Ze(e.statusCode)||null===(r=this.diagnosticsClient)||void 0===r||r.recordEvent("analytics.events.unsuccessful",{events:t.map(function(e){return e.event.event_type}),code:e.statusCode,status:e.status,body:ct(e),stack_trace:et()});var n=e.status;switch(n){case ue.Success:this.handleSuccessResponse(e,t);break;case ue.Invalid:this.handleInvalidResponse(e,t);break;case ue.PayloadTooLarge:this.handlePayloadTooLargeResponse(e,t);break;case ue.RateLimit:this.handleRateLimitResponse(e,t);break;default:this.config.loggerProvider.warn("{code: 0, error: \"Status '".concat(n,"' provided for ").concat(t.length,' events"}')),this.handleOtherResponse(t)}},e.prototype.handleSuccessResponse=function(e,t){this.fulfillRequest(t,e.statusCode,re)},e.prototype.handleInvalidResponse=function(e,t){var r=this;if(e.body.missingField||e.body.error.startsWith(ae))this.fulfillRequest(t,e.statusCode,e.body.error);else{var n=w(w(w(w([],b(Object.values(e.body.eventsWithInvalidFields)),!1),b(Object.values(e.body.eventsWithMissingFields)),!1),b(Object.values(e.body.eventsWithInvalidIdLengths)),!1),b(e.body.silencedEvents),!1).flat(),i=new Set(n),o=t.filter(function(t,n){if(!i.has(n))return!0;r.fulfillRequest([t],e.statusCode,e.body.error)});o.length>0&&this.config.loggerProvider.warn(ct(e));var s=this.removeEventsExceedFlushMaxRetries(o);this.scheduleEvents(s)}},e.prototype.handlePayloadTooLargeResponse=function(e,t){if(1!==t.length){this.config.loggerProvider.warn(ct(e)),this.config.flushQueueSize/=2;var r=this.removeEventsExceedFlushMaxRetries(t);this.scheduleEvents(r)}else this.fulfillRequest(t,e.statusCode,e.body.error)},e.prototype.handleRateLimitResponse=function(e,t){var r=this,n=Object.keys(e.body.exceededDailyQuotaUsers),i=Object.keys(e.body.exceededDailyQuotaDevices),o=e.body.throttledEvents,s=new Set(n),a=new Set(i),l=new Set(o),u=t.filter(function(t,n){if(!(t.event.user_id&&s.has(t.event.user_id)||t.event.device_id&&a.has(t.event.device_id)))return l.has(n)&&(t.timeout=r.throttleTimeout),!0;r.fulfillRequest([t],e.statusCode,e.body.error)});u.length>0&&this.config.loggerProvider.warn(ct(e));var c=this.removeEventsExceedFlushMaxRetries(u);this.scheduleEvents(c)},e.prototype.handleOtherResponse=function(e){var t=this,r=e.map(function(e){return e.timeout=e.attempts*t.retryTimeout,e}),n=this.removeEventsExceedFlushMaxRetries(r);this.scheduleEvents(n)},e.prototype.fulfillRequest=function(e,t,r){var n,i,o;Ze(t)?null===(o=this.diagnosticsClient)||void 0===o||o.increment("analytics.events.sent",e.length):(null===(n=this.diagnosticsClient)||void 0===n||n.increment("analytics.events.dropped",e.length),null===(i=this.diagnosticsClient)||void 0===i||i.recordEvent("analytics.events.dropped",{events:e.map(function(e){return e.event.event_type}),code:t,message:r,stack_trace:et()})),this.removeEvents(e),e.forEach(function(e){return e.callback(ce(e.event,t,r))})},e.prototype.saveEvents=function(){if(this.config.storageProvider){var e=this.queue.map(function(e){return e.event});this.config.storageProvider.set(this.storageKey,e)}},e.prototype.removeEvents=function(e){this.queue=this.queue.filter(function(t){return!e.some(function(e){return e.event.insert_id===t.event.insert_id})}),this.saveEvents()},e}()}});function wt(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function St(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}var Et,kt,xt,Ct,It,Ot,Tt,At,_t,Rt,Pt,Mt,Nt,Lt,Dt,jt,Ut,Ft,Bt,qt,zt,Vt,Wt,Ht,$t,Gt,Kt,Jt,Qt,Yt,Xt,Zt,er,tr,rr,nr,ir,or,sr=l({"../../../../node_modules/@amplitude/analytics-connector/dist/analytics-connector.esm.js"(){dt=function(){function e(){}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:ht(),platform:"Web",os:void 0,deviceModel:void 0}},e}(),ht=function(){return"undefined"!=typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},pt=function(){function e(){this.queue=[]}return e.prototype.logEvent=function(e){this.receiver?this.receiver(e):this.queue.length<512&&this.queue.push(e)},e.prototype.setEventReceiver=function(e){this.receiver=e,this.queue.length>0&&(this.queue.forEach(function(t){e(t)}),this.queue=[])},e}(),ft=function(){return ft=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},ft.apply(this,arguments)},gt=function(e,t){var r,n,i=typeof e;if(i!==typeof t)return!1;try{for(var o=wt(["string","number","boolean","undefined"]),s=o.next();!s.done;s=o.next()){if(s.value===i)return e===t}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}if(null==e&&null==t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;var a=Array.isArray(e),l=Array.isArray(t);if(a!==l)return!1;if(!a||!l){var u=Object.keys(e).sort(),c=Object.keys(t).sort();if(!gt(u,c))return!1;var d=!0;return Object.keys(e).forEach(function(r){gt(e[r],t[r])||(d=!1)}),d}for(var h=0;h<e.length;h++)if(!gt(e[h],t[h]))return!1;return!0},Object.entries||(Object.entries=function(e){for(var t=Object.keys(e),r=t.length,n=new Array(r);r--;)n[r]=[t[r],e[t[r]]];return n}),vt=function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var e=this,t=ft({},this.identity.userProperties),r=ft(ft({},this.identity),{userProperties:t});return{setUserId:function(e){return r.userId=e,this},setDeviceId:function(e){return r.deviceId=e,this},setUserProperties:function(e){return r.userProperties=e,this},setOptOut:function(e){return r.optOut=e,this},updateUserProperties:function(e){var t,n,i,o,s,a,l=r.userProperties||{};try{for(var u=wt(Object.entries(e)),c=u.next();!c.done;c=u.next()){var d=St(c.value,2),h=d[0],p=d[1];switch(h){case"$set":try{for(var f=(i=void 0,wt(Object.entries(p))),g=f.next();!g.done;g=f.next()){var v=St(g.value,2),m=v[0],y=v[1];l[m]=y}}catch(e){i={error:e}}finally{try{g&&!g.done&&(o=f.return)&&o.call(f)}finally{if(i)throw i.error}}break;case"$unset":try{for(var b=(s=void 0,wt(Object.keys(p))),w=b.next();!w.done;w=b.next()){delete l[m=w.value]}}catch(e){s={error:e}}finally{try{w&&!w.done&&(a=b.return)&&a.call(b)}finally{if(s)throw s.error}}break;case"$clearAll":l={}}}}catch(e){t={error:e}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(t)throw t.error}}return r.userProperties=l,this},commit:function(){return e.setIdentity(r),this}}},e.prototype.getIdentity=function(){return ft({},this.identity)},e.prototype.setIdentity=function(e){var t=ft({},this.identity);this.identity=ft({},e),gt(t,this.identity)||this.listeners.forEach(function(t){t(e)})},e.prototype.addIdentityListener=function(e){this.listeners.add(e)},e.prototype.removeIdentityListener=function(e){this.listeners.delete(e)},e}(),mt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:self,yt=function(){function e(){this.identityStore=new vt,this.eventBridge=new pt,this.applicationContextProvider=new dt}return e.getInstance=function(t){return mt.analyticsConnectorInstances||(mt.analyticsConnectorInstances={}),mt.analyticsConnectorInstances[t]||(mt.analyticsConnectorInstances[t]=new e),mt.analyticsConnectorInstances[t]},e}()}}),ar=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/analytics-connector.js"(){sr(),De(),Et=function(e){return void 0===e&&(e=I),yt.getInstance(e)},kt=function(e,t){Et(t).identityStore.editIdentity().setUserId(e).commit()},xt=function(e,t){Et(t).identityStore.editIdentity().setDeviceId(e).commit()}}}),lr=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/plugins/identity.js"(){Ne(),ar(),Ct=function(){function e(){this.name="identity",this.type="before",this.identityStore=Et().identityStore}return e.prototype.execute=function(e){return v(this,void 0,void 0,function(){var t;return m(this,function(r){return(t=e.user_properties)&&this.identityStore.editIdentity().updateUserProperties(t).commit(),[2,e]})})},e.prototype.setup=function(e){return v(this,void 0,void 0,function(){return m(this,function(t){return e.instanceName&&(this.identityStore=Et(e.instanceName).identityStore),[2]})})},e}()}}),ur=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/session.js"(){It=function(e,t){return void 0===t&&(t=Date.now()),Date.now()-t>e}}}),cr=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/cookie-name.js"(){De(),Ot=function(e,t,r){return void 0===t&&(t=""),void 0===r&&(r=10),[x,t,e.substring(0,r)].filter(Boolean).join("_")},Tt=function(e){return"".concat(x.toLowerCase(),"_").concat(e.substring(0,6))}}}),dr=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/language.js"(){At=function(){var e,t,r,n;if("undefined"==typeof navigator)return"";var i=navigator.userLanguage;return null!==(n=null!==(r=null!==(t=null===(e=navigator.languages)||void 0===e?void 0:e[0])&&void 0!==t?t:navigator.language)&&void 0!==r?r:i)&&void 0!==n?n:""}}}),hr=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/query-params.js"(){ze(),_t=function(){var e,t=de();return(null===(e=null==t?void 0:t.location)||void 0===e?void 0:e.search)?t.location.search.substring(1).split("&").filter(Boolean).reduce(function(e,t){var r=t.split("=",2),n=Rt(r[0]),i=Rt(r[1]);return i?(e[n]=i,e):e},{}):{}},Rt=function(e){void 0===e&&(e="");try{return decodeURIComponent(e)}catch(e){return""}}}}),pr=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/utils/url-utils.js"(){Pt=function(e,t){return!t||!t.length||t.some(function(t){return"string"==typeof t?e===t:e.match(t)})},Mt=function(e,t){var r=e;try{r=decodeURI(e)}catch(e){null==t||t.error("Malformed URI sequence: ",e)}return r}}}),fr=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/utils/sampling.js"(){Nt=function(e){var t=0;if(0===e.length)return t;for(var r=0;r<e.length;r++){t=(t<<5)-t+e.charCodeAt(r),t|=0}return t},Lt=function(e,t){var r=Nt(e.toString());return 31*Math.abs(r)%1e5/1e5<t}}}),gr=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/utils/omit-undefined.js"(){Dt=function(e){var t={};for(var r in e){var n=e[r];n&&(t[r]=n)}return t}}}),vr=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/storage/memory.js"(){Ne(),jt=function(){function e(){this.memoryStorage=new Map}return e.prototype.isEnabled=function(){return v(this,void 0,void 0,function(){return m(this,function(e){return[2,!0]})})},e.prototype.get=function(e){return v(this,void 0,void 0,function(){return m(this,function(t){return[2,this.memoryStorage.get(e)]})})},e.prototype.getRaw=function(e){return v(this,void 0,void 0,function(){var t;return m(this,function(r){switch(r.label){case 0:return[4,this.get(e)];case 1:return[2,(t=r.sent())?JSON.stringify(t):void 0]}})})},e.prototype.set=function(e,t){return v(this,void 0,void 0,function(){return m(this,function(r){return this.memoryStorage.set(e,t),[2]})})},e.prototype.remove=function(e){return v(this,void 0,void 0,function(){return m(this,function(t){return this.memoryStorage.delete(e),[2]})})},e.prototype.reset=function(){return v(this,void 0,void 0,function(){return m(this,function(e){return this.memoryStorage.clear(),[2]})})},e}()}}),mr=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/storage/cookie.js"(){Ne(),ze(),Ut=function(){var e,t=de();return null===(e=null==t?void 0:t.navigator)||void 0===e?void 0:e.locks},Ft=function(){function e(e,r){void 0===r&&(r={}),this.options=t({},e),this.config=r}return e.prototype.isEnabled=function(){return v(this,void 0,void 0,function(){var r,n,i,o,s=this;return m(this,function(a){switch(a.label){case 0:return r="AMP_TEST",n=t({},this.options),i=new e(n),o=String(Date.now()),[4,i.transaction(r,function(e){var t,n;try{e.set(o);var i=e.get()===o;return!i&&s.config.diagnosticsClient&&(null===(t=s.config.diagnosticsClient)||void 0===t||t.recordEvent("cookies.isEnabled.failure",{reason:"Test Value mismatch",testKey:r,testValue:o,sync:!0})),i}catch(e){if(s.config.diagnosticsClient){var a=e instanceof Error?e.message:String(e);null===(n=s.config.diagnosticsClient)||void 0===n||n.recordEvent("cookies.isEnabled.failure",{reason:"Cookie getter/setter failed",testKey:r,testValue:o,error:a,sync:!0})}return!1}finally{e.set(null)}})];case 1:return[2,a.sent()]}})})},e.prototype.get=function(e){return v(this,void 0,void 0,function(){var t;return m(this,function(r){switch(r.label){case 0:return[4,this.getRaw(e)];case 1:return t=r.sent(),[2,this.decodeCookieValue(e,t)]}})})},e.prototype.decodeCookieValue=function(e,t){if(t)try{var r=zt(t);return void 0===r?void console.error("Amplitude Logger [Error]: Failed to decode cookie value for key: ".concat(e,", value: ").concat(t)):JSON.parse(r)}catch(r){return void console.error("Amplitude Logger [Error]: Failed to parse cookie value for key: ".concat(e,", value: ").concat(t))}},e.prototype.getSync=function(e){var t=this.getRawSync(e);return this.decodeCookieValue(e,t)},e.prototype.getRaw=function(e){var t,r;return v(this,void 0,void 0,function(){var n,i,o,s,a,l,u,c,d;return m(this,function(h){switch(h.label){case 0:n=de(),i=n,h.label=1;case 1:return h.trys.push([1,4,,5]),(o=null==i?void 0:i.cookieStore)?[4,o.getAll(e)]:[3,3];case 2:if(s=h.sent()){s.length>1&&(null===(t=this.config.diagnosticsClient)||void 0===t||t.recordEvent("cookies.duplicate",{cookies:s.map(function(e){return e.domain})}),null===(r=this.config.diagnosticsClient)||void 0===r||r.increment("cookies.duplicate.occurrence.cookieStore"));try{for(a=y(s),l=a.next();!l.done;l=a.next())if(u=l.value,Vt(u.domain,this.options.domain))return[2,u.value]}catch(e){c={error:e}}finally{try{l&&!l.done&&(d=a.return)&&d.call(a)}finally{if(c)throw c.error}}}h.label=3;case 3:return[3,5];case 4:return h.sent(),[3,5];case 5:return[2,this.getRawSync(e)]}})})},e.prototype.getRawSync=function(e){var t,r,n=this,i=de(),o=(null!==(r=null===(t=null==i?void 0:i.document)||void 0===t?void 0:t.cookie.split("; "))&&void 0!==r?r:[]).filter(function(t){return 0===t.indexOf(e+"=")}),s=void 0,a=this.config.duplicateResolverFn;if("function"==typeof a&&o.length>1&&(s=o.find(function(t){var r;try{var i=a(t.substring(e.length+1));return i||null===(r=n.config.diagnosticsClient)||void 0===r||r.increment("cookies.duplicate.occurrence.document.cookie"),i}catch(e){return!1}})),s||(s=o[0]),s)return s.substring(e.length+1)},e.prototype.set=function(e,t){return v(this,void 0,void 0,function(){return m(this,function(r){return this.setSync(e,t),[2]})})},e.prototype.setSync=function(e,t){var r;try{var n=null!==(r=this.options.expirationDays)&&void 0!==r?r:0,i=null!==t?n:-1,o=void 0;if(i){var s=new Date;s.setTime(s.getTime()+24*i*60*60*1e3),o=s}var a="".concat(e,"=").concat(btoa(encodeURIComponent(JSON.stringify(t))));o&&(a+="; expires=".concat(o.toUTCString())),a+="; path=/",this.options.domain&&(a+="; domain=".concat(this.options.domain)),this.options.secure&&(a+="; Secure"),this.options.sameSite&&(a+="; SameSite=".concat(this.options.sameSite));var l=de();(null==l?void 0:l.document)&&(l.document.cookie=a)}catch(t){var u=t instanceof Error?t.message:String(t);console.error("Amplitude Logger [Error]: Failed to set cookie for key: ".concat(e,". Error: ").concat(u))}},e.prototype.remove=function(e){return v(this,void 0,void 0,function(){return m(this,function(t){switch(t.label){case 0:return[4,this.set(e,null)];case 1:return t.sent(),[2]}})})},e.prototype.reset=function(){return v(this,void 0,void 0,function(){return m(this,function(e){return[2]})})},e.isDomainWritable=function(t){return v(this,void 0,void 0,function(){var r,n;return m(this,function(i){switch(i.label){case 0:if(e.cachedTlds[t])return[2,!0];r="AMP_TLDTEST",n=new e({domain:"."+t}),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,n.transaction(r,function(r){if(e.cachedTlds[t])return!0;try{r.set(1);var n=!!r.get();return n&&(e.cachedTlds[t]=!0),n}finally{r.set(null)}})];case 2:return[2,!!i.sent()];case 3:return i.sent(),[2,!1];case 4:return[2]}})})},e.prototype.transaction=function(e,t){return v(this,void 0,void 0,function(){var r,n,i=this;return m(this,function(o){switch(o.label){case 0:if(r=Ut(),n=function(){return t({get:function(){return i.getSync(e)},set:function(t){return i.setSync(e,t)}})},!r)return[2,n()];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,r.request("com.amplitude:cookie-lock:".concat(e),n)];case 2:return[2,o.sent()];case 3:return o.sent(),[2,n()];case 4:return[2]}})})},e.cachedTlds={},e}(),Bt=function(e){try{return decodeURIComponent(atob(e))}catch(e){return}},qt=function(e){try{return decodeURIComponent(atob(decodeURIComponent(e)))}catch(e){return}},zt=function(e){var t;return null!==(t=Bt(e))&&void 0!==t?t:qt(e)},Vt=function(e,t){if(""===e&&""===t)return!0;if(!e||!t)return!1;var r=e.startsWith(".")?e.substring(1):e,n=t.startsWith(".")?t.substring(1):t;return r.toLowerCase()===n.toLowerCase()}}}),yr=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/storage/helpers.js"(){De(),Wt=function(e,t,r){return void 0===t&&(t=""),void 0===r&&(r=10),[x,t,e.substring(0,r)].filter(Boolean).join("_")}}}),br=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/storage/browser-storage.js"(){Ne(),Ht=function(){function e(e){this.storage=e}return e.prototype.isEnabled=function(){return v(this,void 0,void 0,function(){var t,r,n;return m(this,function(i){switch(i.label){case 0:if(!this.storage)return[2,!1];t=String(Date.now()),r=new e(this.storage),n="AMP_TEST",i.label=1;case 1:return i.trys.push([1,4,5,7]),[4,r.set(n,t)];case 2:return i.sent(),[4,r.get(n)];case 3:return[2,i.sent()===t];case 4:return i.sent(),[2,!1];case 5:return[4,r.remove(n)];case 6:return i.sent(),[7];case 7:return[2]}})})},e.prototype.get=function(e){return v(this,void 0,void 0,function(){var t;return m(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.getRaw(e)];case 1:return(t=r.sent())?[2,JSON.parse(t)]:[2,void 0];case 2:return r.sent(),console.error("[Amplitude] Error: Could not get value from storage"),[2,void 0];case 3:return[2]}})})},e.prototype.getRaw=function(e){var t;return v(this,void 0,void 0,function(){return m(this,function(r){return[2,(null===(t=this.storage)||void 0===t?void 0:t.getItem(e))||void 0]})})},e.prototype.set=function(e,t){var r;return v(this,void 0,void 0,function(){return m(this,function(n){try{null===(r=this.storage)||void 0===r||r.setItem(e,JSON.stringify(t))}catch(e){}return[2]})})},e.prototype.remove=function(e){var t;return v(this,void 0,void 0,function(){return m(this,function(r){try{null===(t=this.storage)||void 0===t||t.removeItem(e)}catch(e){}return[2]})})},e.prototype.reset=function(){var e;return v(this,void 0,void 0,function(){return m(this,function(t){try{null===(e=this.storage)||void 0===e||e.clear()}catch(e){}return[2]})})},e}()}}),wr=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/diagnostics/diagnostics-storage.js"(){Ne(),ze(),$t={TAGS:"tags",COUNTERS:"counters",HISTOGRAMS:"histograms",EVENTS:"events",INTERNAL:"internal"},Gt={LAST_FLUSH_TIMESTAMP:"last_flush_timestamp"},Kt=function(){function e(e,t){this.dbPromise=null,this.logger=t,this.dbName="AMP_diagnostics_".concat(e.substring(0,10))}return e.isSupported=function(){var e;return void 0!==(null===(e=de())||void 0===e?void 0:e.indexedDB)},e.prototype.getDB=function(){return v(this,void 0,void 0,function(){return m(this,function(e){return this.dbPromise||(this.dbPromise=this.openDB()),[2,this.dbPromise]})})},e.prototype.openDB=function(){var e=this;return new Promise(function(t,r){var n=indexedDB.open(e.dbName,1);n.onerror=function(){e.dbPromise=null,r(new Error("Failed to open IndexedDB"))},n.onsuccess=function(){var r=n.result;r.onclose=function(){e.dbPromise=null,e.logger.debug("DiagnosticsStorage: DB connection closed.")},r.onerror=function(t){e.logger.debug("DiagnosticsStorage: A global database error occurred.",t),r.close()},t(r)},n.onupgradeneeded=function(t){var r=t.target.result;e.createTables(r)}})},e.prototype.createTables=function(e){(e.objectStoreNames.contains($t.TAGS)||e.createObjectStore($t.TAGS,{keyPath:"key"}),e.objectStoreNames.contains($t.COUNTERS)||e.createObjectStore($t.COUNTERS,{keyPath:"key"}),e.objectStoreNames.contains($t.HISTOGRAMS)||e.createObjectStore($t.HISTOGRAMS,{keyPath:"key"}),e.objectStoreNames.contains($t.EVENTS))||e.createObjectStore($t.EVENTS,{keyPath:"id",autoIncrement:!0}).createIndex("time_idx","time",{unique:!1});e.objectStoreNames.contains($t.INTERNAL)||e.createObjectStore($t.INTERNAL,{keyPath:"key"})},e.prototype.setTags=function(e){return v(this,void 0,void 0,function(){var t,r,n,i,o=this;return m(this,function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),0===Object.entries(e).length?[2]:[4,this.getDB()];case 1:return t=s.sent(),r=t.transaction([$t.TAGS],"readwrite"),n=r.objectStore($t.TAGS),[2,new Promise(function(t){var i=Object.entries(e);r.oncomplete=function(){t()},r.onabort=function(e){o.logger.debug("DiagnosticsStorage: Failed to set tags",e),t()},i.forEach(function(e){var t=b(e,2),r=t[0],i=t[1];n.put({key:r,value:i}).onerror=function(e){o.logger.debug("DiagnosticsStorage: Failed to set tag",r,i,e)}})})];case 2:return i=s.sent(),this.logger.debug("DiagnosticsStorage: Failed to set tags",i),[3,3];case 3:return[2]}})})},e.prototype.incrementCounters=function(e){return v(this,void 0,void 0,function(){var t,r,n,i,o=this;return m(this,function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),0===Object.entries(e).length?[2]:[4,this.getDB()];case 1:return t=s.sent(),r=t.transaction([$t.COUNTERS],"readwrite"),n=r.objectStore($t.COUNTERS),[2,new Promise(function(t){var i=Object.entries(e);r.oncomplete=function(){t()},r.onabort=function(e){o.logger.debug("DiagnosticsStorage: Failed to increment counters",e),t()},i.forEach(function(e){var t=b(e,2),r=t[0],i=t[1],s=n.get(r);s.onsuccess=function(){var e=s.result,t=e?e.value:0;n.put({key:r,value:t+i}).onerror=function(e){o.logger.debug("DiagnosticsStorage: Failed to update counter",r,e)}},s.onerror=function(e){o.logger.debug("DiagnosticsStorage: Failed to read existing counter",r,e)}})})];case 2:return i=s.sent(),this.logger.debug("DiagnosticsStorage: Failed to increment counters",i),[3,3];case 3:return[2]}})})},e.prototype.setHistogramStats=function(e){return v(this,void 0,void 0,function(){var t,r,n,i,o=this;return m(this,function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),0===Object.entries(e).length?[2]:[4,this.getDB()];case 1:return t=s.sent(),r=t.transaction([$t.HISTOGRAMS],"readwrite"),n=r.objectStore($t.HISTOGRAMS),[2,new Promise(function(t){var i=Object.entries(e);r.oncomplete=function(){t()},r.onabort=function(e){o.logger.debug("DiagnosticsStorage: Failed to set histogram stats",e),t()},i.forEach(function(e){var t=b(e,2),r=t[0],i=t[1],s=n.get(r);s.onsuccess=function(){var e,t=s.result;e=t?{key:r,count:t.count+i.count,min:Math.min(t.min,i.min),max:Math.max(t.max,i.max),sum:t.sum+i.sum}:{key:r,count:i.count,min:i.min,max:i.max,sum:i.sum},n.put(e).onerror=function(e){o.logger.debug("DiagnosticsStorage: Failed to set histogram stats",r,e)}},s.onerror=function(e){o.logger.debug("DiagnosticsStorage: Failed to read existing histogram stats",r,e)}})})];case 2:return i=s.sent(),this.logger.debug("DiagnosticsStorage: Failed to set histogram stats",i),[3,3];case 3:return[2]}})})},e.prototype.addEventRecords=function(e){return v(this,void 0,void 0,function(){var t,r,n,i,o=this;return m(this,function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),0===e.length?[2]:[4,this.getDB()];case 1:return t=s.sent(),r=t.transaction([$t.EVENTS],"readwrite"),n=r.objectStore($t.EVENTS),[2,new Promise(function(t){r.oncomplete=function(){t()},r.onabort=function(e){o.logger.debug("DiagnosticsStorage: Failed to add event records",e),t()};var i=n.count();i.onsuccess=function(){var t=i.result,r=Math.max(0,10-t);r<e.length&&o.logger.debug("DiagnosticsStorage: Only added ".concat(r," of ").concat(e.length," events due to storage limit")),e.slice(0,r).forEach(function(e){n.add(e).onerror=function(e){o.logger.debug("DiagnosticsStorage: Failed to add event record",e)}})},i.onerror=function(e){o.logger.debug("DiagnosticsStorage: Failed to count existing events",e)}})];case 2:return i=s.sent(),this.logger.debug("DiagnosticsStorage: Failed to add event records",i),[3,3];case 3:return[2]}})})},e.prototype.setInternal=function(e,t){return v(this,void 0,void 0,function(){var r,n,i,o;return m(this,function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),[4,this.getDB()];case 1:return r=s.sent(),n=r.transaction([$t.INTERNAL],"readwrite"),i=n.objectStore($t.INTERNAL),[2,new Promise(function(r,o){n.onabort=function(){return o(new Error("Failed to set internal value"))};var s=i.put({key:e,value:t});s.onsuccess=function(){return r()},s.onerror=function(){return o(new Error("Failed to set internal value"))}})];case 2:return o=s.sent(),this.logger.debug("DiagnosticsStorage: Failed to set internal value",o),[3,3];case 3:return[2]}})})},e.prototype.getInternal=function(e){return v(this,void 0,void 0,function(){var t,r,n,i;return m(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this.getDB()];case 1:return t=o.sent(),r=t.transaction([$t.INTERNAL],"readonly"),n=r.objectStore($t.INTERNAL),[2,new Promise(function(t,i){r.onabort=function(){return i(new Error("Failed to get internal value"))};var o=n.get(e);o.onsuccess=function(){return t(o.result)},o.onerror=function(){return i(new Error("Failed to get internal value"))}})];case 2:return i=o.sent(),this.logger.debug("DiagnosticsStorage: Failed to get internal value",i),[2,void 0];case 3:return[2]}})})},e.prototype.getLastFlushTimestamp=function(){return v(this,void 0,void 0,function(){var e,t;return m(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.getInternal(Gt.LAST_FLUSH_TIMESTAMP)];case 1:return[2,(e=r.sent())?parseInt(e.value,10):void 0];case 2:return t=r.sent(),this.logger.debug("DiagnosticsStorage: Failed to get last flush timestamp",t),[2,void 0];case 3:return[2]}})})},e.prototype.setLastFlushTimestamp=function(e){return v(this,void 0,void 0,function(){var t;return m(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.setInternal(Gt.LAST_FLUSH_TIMESTAMP,e.toString())];case 1:return r.sent(),[3,3];case 2:return t=r.sent(),this.logger.debug("DiagnosticsStorage: Failed to set last flush timestamp",t),[3,3];case 3:return[2]}})})},e.prototype.clearTable=function(e,t){return new Promise(function(r,n){var i=e.objectStore(t).clear();i.onsuccess=function(){return r()},i.onerror=function(){return n(new Error("Failed to clear table ".concat(t)))}})},e.prototype.getAllAndClear=function(){return v(this,void 0,void 0,function(){var e,t,r,n,i,o,s,a;return m(this,function(l){switch(l.label){case 0:return l.trys.push([0,4,,5]),[4,this.getDB()];case 1:return e=l.sent(),t=e.transaction([$t.TAGS,$t.COUNTERS,$t.HISTOGRAMS,$t.EVENTS],"readwrite"),[4,Promise.all([this.getAllFromStore(t,$t.TAGS),this.getAllFromStore(t,$t.COUNTERS),this.getAllFromStore(t,$t.HISTOGRAMS),this.getAllFromStore(t,$t.EVENTS)])];case 2:return r=b.apply(void 0,[l.sent(),4]),n=r[0],i=r[1],o=r[2],s=r[3],[4,Promise.all([this.clearTable(t,$t.COUNTERS),this.clearTable(t,$t.HISTOGRAMS),this.clearTable(t,$t.EVENTS)])];case 3:return l.sent(),[2,{tags:n,counters:i,histogramStats:o,events:s}];case 4:return a=l.sent(),this.logger.debug("DiagnosticsStorage: Failed to get all and clear data",a),[2,{tags:[],counters:[],histogramStats:[],events:[]}];case 5:return[2]}})})},e.prototype.getAllFromStore=function(e,t){return new Promise(function(r,n){var i=e.objectStore(t).getAll();i.onsuccess=function(){return r(i.result)},i.onerror=function(){return n(new Error("Failed to get all from ".concat(t)))}})},e}()}}),Sr=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/diagnostics/uncaught-sdk-errors.js"(){Ne(),ze(),Jt=function(){var e=de();if(!e)return[];var t=e.__AMPLITUDE_SCRIPT_URL__;return Array.isArray(t)?t:"string"==typeof t?[t]:[]},Qt=function(e){var r=de();if(r&&"function"==typeof r.addEventListener){var n=function(r){e.recordEvent("sdk.error.uncaught",t({type:r.type,message:r.message,filename:r.filename,error_name:r.errorName,stack:r.stack},r.metadata))};r.addEventListener("error",function(e){var t=e.error instanceof Error?e.error:void 0,r=null==t?void 0:t.stack,i=Yt({filename:e.filename,stack:r});i&&n({type:"error",message:e.message,stack:r,filename:e.filename,errorName:null==t?void 0:t.name,metadata:{colno:e.colno,lineno:e.lineno,isTrusted:e.isTrusted,matchReason:i}})},!0),r.addEventListener("unhandledrejection",function(e){var t,r=e.reason instanceof Error?e.reason:void 0,i=null==r?void 0:r.stack,o=Xt(i),s=Yt({filename:o,stack:i});s&&n({type:"unhandledrejection",message:null!==(t=null==r?void 0:r.message)&&void 0!==t?t:Zt(e.reason),stack:i,filename:o,errorName:null==r?void 0:r.name,metadata:{isTrusted:e.isTrusted,matchReason:s}})},!0)}},Yt=function(e){var t,r,n=Jt();if(0!==n.length)try{for(var i=y(n),o=i.next();!o.done;o=i.next()){var s=o.value;if(e.filename&&e.filename.includes(s))return"filename";if(e.stack&&e.stack.includes(s))return"stack"}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}},Xt=function(e){if(e){var t=e.match(/(https?:\/\/\S+?)(?=[)\s]|$)/);return t?t[1]:void 0}},Zt=function(e){if("string"==typeof e)return e;try{return JSON.stringify(e)}catch(e){return"[object Object]"}}}}),Er=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/diagnostics/diagnostics-client.js"(){Ne(),wr(),ze(),fr(),Sr(),er=3e5,tr=1e4,rr=function(){function e(e,r,n,i){void 0===n&&(n="US"),this.inMemoryTags={},this.inMemoryCounters={},this.inMemoryHistograms={},this.inMemoryEvents=[],this.saveTimer=null,this.flushTimer=null,this.apiKey=e,this.logger=r,this.serverUrl="US"===n?"https://diagnostics.prod.us-west-2.amplitude.com/v1/capture":"https://diagnostics.prod.eu-central-1.amplitude.com/v1/capture",this.logger.debug("DiagnosticsClient: Initializing with options",JSON.stringify(i,null,2)),this.config=t({enabled:!0,sampleRate:0},i),this.startTimestamp=Date.now(),this.shouldTrack=Lt(this.startTimestamp,this.config.sampleRate)&&this.config.enabled,Kt.isSupported()?this.storage=new Kt(e,r):this.logger.debug("DiagnosticsClient: IndexedDB is not supported"),this.initializeFlushInterval(),this.shouldTrack&&(this.increment("sdk.diagnostics.sampled.in.and.enabled"),Qt(this))}return e.prototype.isStorageAndTrackEnabled=function(){return Boolean(this.storage)&&Boolean(this.shouldTrack)},e.prototype.setTag=function(e,t){this.isStorageAndTrackEnabled()&&(Object.keys(this.inMemoryTags).length>=tr?this.logger.debug("DiagnosticsClient: Early return setTags as reaching memory limit"):(this.inMemoryTags[e]=t,this.startTimersIfNeeded()))},e.prototype.increment=function(e,t){void 0===t&&(t=1),this.isStorageAndTrackEnabled()&&(Object.keys(this.inMemoryCounters).length>=tr?this.logger.debug("DiagnosticsClient: Early return increment as reaching memory limit"):(this.inMemoryCounters[e]=(this.inMemoryCounters[e]||0)+t,this.startTimersIfNeeded()))},e.prototype.recordHistogram=function(e,t){if(this.isStorageAndTrackEnabled())if(Object.keys(this.inMemoryHistograms).length>=tr)this.logger.debug("DiagnosticsClient: Early return recordHistogram as reaching memory limit");else{var r=this.inMemoryHistograms[e];r?(r.count+=1,r.min=Math.min(r.min,t),r.max=Math.max(r.max,t),r.sum+=t):this.inMemoryHistograms[e]={count:1,min:t,max:t,sum:t},this.startTimersIfNeeded()}},e.prototype.recordEvent=function(e,t){this.isStorageAndTrackEnabled()&&(this.inMemoryEvents.length>=10?this.logger.debug("DiagnosticsClient: Early return recordEvent as reaching memory limit"):(this.inMemoryEvents.push({event_name:e,time:Date.now(),event_properties:t}),this.startTimersIfNeeded()))},e.prototype.startTimersIfNeeded=function(){var e=this;this.saveTimer||(this.saveTimer=setTimeout(function(){e.saveAllDataToStorage().catch(function(t){e.logger.debug("DiagnosticsClient: Failed to save all data to storage",t)}).finally(function(){e.saveTimer=null})},1e3)),this.flushTimer||(this.flushTimer=setTimeout(function(){e._flush().catch(function(t){e.logger.debug("DiagnosticsClient: Failed to flush",t)}).finally(function(){e.flushTimer=null})},er))},e.prototype.saveAllDataToStorage=function(){return v(this,void 0,void 0,function(){var e,r,n,i;return m(this,function(o){switch(o.label){case 0:return this.storage?(e=t({},this.inMemoryTags),r=t({},this.inMemoryCounters),n=t({},this.inMemoryHistograms),i=w([],b(this.inMemoryEvents),!1),this.inMemoryEvents=[],this.inMemoryTags={},this.inMemoryCounters={},this.inMemoryHistograms={},[4,Promise.all([this.storage.setTags(e),this.storage.incrementCounters(r),this.storage.setHistogramStats(n),this.storage.addEventRecords(i)])]):[2];case 1:return o.sent(),[2]}})})},e.prototype._flush=function(){return v(this,void 0,void 0,function(){var e,t,r,n,i,o,s,a,l,u;return m(this,function(c){switch(c.label){case 0:return this.storage?[4,this.saveAllDataToStorage()]:[2];case 1:return c.sent(),this.saveTimer=null,this.flushTimer=null,[4,this.storage.getAllAndClear()];case 2:return e=c.sent(),t=e.tags,r=e.counters,n=e.histogramStats,i=e.events,this.storage.setLastFlushTimestamp(Date.now()),o={},t.forEach(function(e){o[e.key]=e.value}),s={},r.forEach(function(e){s[e.key]=e.value}),a={},n.forEach(function(e){a[e.key]={count:e.count,min:e.min,max:e.max,avg:Math.round(e.sum/e.count*100)/100}}),l=i.map(function(e){return{event_name:e.event_name,time:e.time,event_properties:e.event_properties}}),0===Object.keys(s).length&&0===Object.keys(a).length&&0===l.length?[2]:(u={tags:o,histogram:a,counters:s,events:l},this.fetch(u),[2])}})})},e.prototype.fetch=function(e){return v(this,void 0,void 0,function(){var t;return m(this,function(r){switch(r.label){case 0:if(r.trys.push([0,2,,3]),!de())throw new Error("DiagnosticsClient: Fetch is not supported");return[4,fetch(this.serverUrl,{method:"POST",headers:{"X-ApiKey":this.apiKey,"Content-Type":"application/json"},body:JSON.stringify(e)})];case 1:return r.sent().ok?(this.logger.debug("DiagnosticsClient: Successfully sent diagnostics data"),[3,3]):(this.logger.debug("DiagnosticsClient: Failed to send diagnostics data."),[2]);case 2:return t=r.sent(),this.logger.debug("DiagnosticsClient: Failed to send diagnostics data. ",t),[3,3];case 3:return[2]}})})},e.prototype.initializeFlushInterval=function(){return v(this,void 0,void 0,function(){var e,t,r;return m(this,function(n){switch(n.label){case 0:return this.storage?(e=Date.now(),[4,this.storage.getLastFlushTimestamp()]):[2];case 1:return-1===(t=n.sent()||-1)?(this.storage.setLastFlushTimestamp(e),this._setFlushTimer(er),[2]):(r=e-t)>=er?(this._flush(),[2]):(this._setFlushTimer(er-r),[2])}})})},e.prototype._setFlushTimer=function(e){var t=this;this.flushTimer=setTimeout(function(){t._flush().catch(function(e){t.logger.debug("DiagnosticsClient: Failed to flush",e)}).finally(function(){t.flushTimer=null})},e)},e.prototype._setSampleRate=function(e){this.logger.debug("DiagnosticsClient: Setting sample rate to",e),this.config.sampleRate=e,this.shouldTrack=Lt(this.startTimestamp,this.config.sampleRate)&&this.config.enabled,this.logger.debug("DiagnosticsClient: Should track is",this.shouldTrack)},e}()}}),kr=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/transports/base.js"(){Be(),lt(),nr=function(){function e(){}return e.prototype.send=function(e,t,r){return Promise.resolve(null)},e.prototype.buildResponse=function(e){var t,r,n,i,o,s,a,l,u,c,d,h,p,f,g,v,m,y,b,w,S,E;if("object"!=typeof e)return null;var k=e.code||0,x=this.buildStatus(k);switch(x){case ue.Success:return{status:x,statusCode:k,body:{eventsIngested:null!==(t=e.events_ingested)&&void 0!==t?t:0,payloadSizeBytes:null!==(r=e.payload_size_bytes)&&void 0!==r?r:0,serverUploadTime:null!==(n=e.server_upload_time)&&void 0!==n?n:0}};case ue.Invalid:return{status:x,statusCode:k,body:{error:null!==(i=e.error)&&void 0!==i?i:"",missingField:null!==(o=e.missing_field)&&void 0!==o?o:"",eventsWithInvalidFields:null!==(s=e.events_with_invalid_fields)&&void 0!==s?s:{},eventsWithMissingFields:null!==(a=e.events_with_missing_fields)&&void 0!==a?a:{},eventsWithInvalidIdLengths:null!==(l=e.events_with_invalid_id_lengths)&&void 0!==l?l:{},epsThreshold:null!==(u=e.eps_threshold)&&void 0!==u?u:0,exceededDailyQuotaDevices:null!==(c=e.exceeded_daily_quota_devices)&&void 0!==c?c:{},silencedDevices:null!==(d=e.silenced_devices)&&void 0!==d?d:[],silencedEvents:null!==(h=e.silenced_events)&&void 0!==h?h:[],throttledDevices:null!==(p=e.throttled_devices)&&void 0!==p?p:{},throttledEvents:null!==(f=e.throttled_events)&&void 0!==f?f:[]}};case ue.PayloadTooLarge:return{status:x,statusCode:k,body:{error:null!==(g=e.error)&&void 0!==g?g:""}};case ue.RateLimit:return{status:x,statusCode:k,body:{error:null!==(v=e.error)&&void 0!==v?v:"",epsThreshold:null!==(m=e.eps_threshold)&&void 0!==m?m:0,throttledDevices:null!==(y=e.throttled_devices)&&void 0!==y?y:{},throttledUsers:null!==(b=e.throttled_users)&&void 0!==b?b:{},exceededDailyQuotaDevices:null!==(w=e.exceeded_daily_quota_devices)&&void 0!==w?w:{},exceededDailyQuotaUsers:null!==(S=e.exceeded_daily_quota_users)&&void 0!==S?S:{},throttledEvents:null!==(E=e.throttled_events)&&void 0!==E?E:[]}};case ue.Timeout:default:return{status:x,statusCode:k}}},e.prototype.buildStatus=function(e){return Ze(e)?ue.Success:429===e?ue.RateLimit:413===e?ue.PayloadTooLarge:408===e?ue.Timeout:e>=400&&e<500?ue.Invalid:e>=500?ue.Failed:ue.Unknown},e}()}}),xr=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/transports/fetch.js"(){Ne(),kr(),ir=function(e){function r(t){void 0===t&&(t={});var r=e.call(this)||this;return r.customHeaders=t,r}return f(r,e),r.prototype.send=function(e,r){return v(this,void 0,void 0,function(){var n,i,o;return m(this,function(s){switch(s.label){case 0:if("undefined"==typeof fetch)throw new Error("FetchTransport is not supported");return n={headers:t({"Content-Type":"application/json",Accept:"*/*"},this.customHeaders),body:JSON.stringify(r),method:"POST"},[4,fetch(e,n)];case 1:return[4,(i=s.sent()).text()];case 2:o=s.sent();try{return[2,this.buildResponse(JSON.parse(o))]}catch(e){return[2,this.buildResponse({code:i.status})]}return[2]}})})},r}(nr)}});function Cr(){return"undefined"!=typeof CompressionStream}function Ir(e){return v(this,void 0,void 0,function(){var t,r;return m(this,function(n){switch(n.label){case 0:if(void 0===(t=CompressionStream))return[2,void 0];n.label=1;case 1:return n.trys.push([1,3,,4]),r=new Blob([e]).stream().pipeThrough(new t("gzip")),[4,new Response(r).arrayBuffer()];case 2:return[2,n.sent()];case 3:return n.sent(),[2,void 0];case 4:return[2]}})})}var Or,Tr,Ar,_r,Rr,Pr,Mr,Nr,Lr,Dr=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/transports/gzip.js"(){Ne(),or=2048}}),jr=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/remote-config/remote-config-localstorage.js"(){Or=function(){function e(e,t){this.key="AMP_remote_config_".concat(e.substring(0,10)),this.logger=t}return e.prototype.fetchConfig=function(){var e=null,t={remoteConfig:null,lastFetch:new Date};try{e=localStorage.getItem(this.key)}catch(e){return this.logger.debug("Remote config localstorage failed to access: ",e),Promise.resolve(t)}if(null===e)return this.logger.debug("Remote config localstorage gets null because the key does not exist"),Promise.resolve(t);try{var r=JSON.parse(e);return this.logger.debug("Remote config localstorage parsed successfully: ".concat(JSON.stringify(r))),Promise.resolve({remoteConfig:r.remoteConfig,lastFetch:new Date(r.lastFetch)})}catch(e){return this.logger.debug("Remote config localstorage failed to parse: ",e),localStorage.removeItem(this.key),Promise.resolve(t)}},e.prototype.setConfig=function(e){try{return localStorage.setItem(this.key,JSON.stringify(e)),this.logger.debug("Remote config localstorage set successfully."),Promise.resolve(!0)}catch(e){this.logger.debug("Remote config localstorage failed to set: ",e)}return Promise.resolve(!1)},e}()}}),Ur=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/remote-config/remote-config.js"(){Ne(),jr(),Ve(),Tr={INVALID_API_KEY:401,FORBIDDEN:403,RATE_LIMIT:429},Ar=function(){function e(e,t,r,n){void 0===r&&(r="US"),this.callbackInfos=[],this.lastSuccessfulFetch=null,this.fetchPromise=null,this.isLastFetchInvalidApiKey=!1,this.apiKey=e,this.serverUrl=n||("US"===r?"https://sr-client-cfg.amplitude.com/config":"https://sr-client-cfg.eu.amplitude.com/config"),this.logger=t,this.storage=new Or(e,t)}return e.prototype.subscribe=function(e,t,r){var n=fe(),i={id:n,key:e,deliveryMode:t,callback:r};return this.callbackInfos.push(i),"all"===t?this.subscribeAll(i):this.subscribeWaitForRemote(i,t.timeout),n},e.prototype.unsubscribe=function(e){var t=this.callbackInfos.findIndex(function(t){return t.id===e});return-1===t?(this.logger.debug("Remote config client unsubscribe failed because callback with id ".concat(e," doesn't exist.")),!1):(this.callbackInfos.splice(t,1),this.logger.debug("Remote config client unsubscribe succeeded removing callback with id ".concat(e,".")),!0)},e.prototype.updateConfigs=function(){return v(this,void 0,void 0,function(){var e,t=this;return m(this,function(r){switch(r.label){case 0:return this.lastSuccessfulFetch&&Date.now()-this.lastSuccessfulFetch<3e5?(this.logger.debug("Remote config client skipping updateConfigs: Too recent"),[2]):[4,this.getOrCreateFetchPromise()];case 1:return e=r.sent(),this.storage.setConfig(e),this.callbackInfos.forEach(function(r){t.sendCallback(r,e,"remote")}),[2]}})})},e.prototype.getOrCreateFetchPromise=function(){var e=this;return this.fetchPromise?this.fetchPromise:this.isLastFetchInvalidApiKey?(this.logger.debug("Remote config client skipping fetch: Invalid API key"),this.fetchPromise=Promise.resolve({remoteConfig:null,lastFetch:new Date}).finally(function(){e.fetchPromise=null}),this.fetchPromise):(this.fetchPromise=this.fetch().then(function(t){return null!==t.remoteConfig&&(e.lastSuccessfulFetch=Date.now()),t}).finally(function(){e.fetchPromise=null}),this.fetchPromise)},e.prototype.subscribeAll=function(e){return v(this,void 0,void 0,function(){var t,r,n,i=this;return m(this,function(o){switch(o.label){case 0:return t=this.getOrCreateFetchPromise().then(function(t){i.logger.debug("Remote config client subscription all mode fetched from remote: ".concat(JSON.stringify(t))),i.sendCallback(e,t,"remote"),i.storage.setConfig(t)}),r=this.storage.fetchConfig().then(function(e){return e}),[4,Promise.race([t,r])];case 1:return void 0!==(n=o.sent())&&(this.logger.debug("Remote config client subscription all mode fetched from cache: ".concat(JSON.stringify(n))),null!==n.remoteConfig?this.sendCallback(e,n,"cache"):this.logger.debug("Remote config client skips sending callback because cache is empty (first time user).")),[4,t];case 2:return o.sent(),[2]}})})},e.prototype.subscribeWaitForRemote=function(e,t){return v(this,void 0,void 0,function(){var r,n;return m(this,function(i){switch(i.label){case 0:r=new Promise(function(e,r){setTimeout(function(){r("Timeout exceeded")},t)}),i.label=1;case 1:return i.trys.push([1,3,,5]),[4,Promise.race([this.getOrCreateFetchPromise(),r])];case 2:return n=i.sent(),this.logger.debug("Remote config client subscription wait for remote mode returns from remote."),this.sendCallback(e,n,"remote"),this.storage.setConfig(n),[3,5];case 3:return i.sent(),this.logger.debug("Remote config client subscription wait for remote mode exceeded timeout. Try to fetch from cache."),[4,this.storage.fetchConfig()];case 4:return null!==(n=i.sent()).remoteConfig?(this.logger.debug("Remote config client subscription wait for remote mode returns a cached copy."),this.sendCallback(e,n,"cache")):(this.logger.debug("Remote config client subscription wait for remote mode failed to fetch cache."),this.sendCallback(e,n,"remote")),[3,5];case 5:return[2]}})})},e.prototype.sendCallback=function(e,t,r){var n;e.lastCallback=new Date,n=e.key?e.key.split(".").reduce(function(e,t){return null===e?e:t in e?e[t]:null},t.remoteConfig):t.remoteConfig,e.callback(n,r,t.lastFetch)},e.prototype.fetch=function(e,t){return void 0===e&&(e=3),void 0===t&&(t=1e3),v(this,void 0,void 0,function(){var r,n,i,o,s,a,l=this;return m(this,function(u){switch(u.label){case 0:r=t/e,n={remoteConfig:null,lastFetch:new Date},i=function(n){var i,s,a,u,c,d;return m(this,function(h){switch(h.label){case 0:i=!0,s=new AbortController,a=setTimeout(function(){return s.abort()},t),h.label=1;case 1:return h.trys.push([1,7,8,9]),[4,fetch(o.getUrlParams(),{method:"GET",headers:{Accept:"*/*"},signal:s.signal})];case 2:return(u=h.sent()).ok?[3,4]:[4,u.text()];case 3:return c=h.sent(),o.logger.debug("Remote config client fetch with retry time ".concat(e," failed with ").concat(u.status,": ").concat(c)),u.status===Tr.INVALID_API_KEY||u.status===Tr.FORBIDDEN?(o.logger.error("Remote config client fetch failed with ".concat(u.status,". Invalid API key; future fetches will be skipped.")),o.isLastFetchInvalidApiKey=!0,i=!1):u.status>=400&&u.status<500&&u.status!==Tr.RATE_LIMIT&&(i=!1),[3,6];case 4:return[4,u.json()];case 5:return[2,{value:{remoteConfig:h.sent(),lastFetch:new Date}}];case 6:return[3,9];case 7:return(d=h.sent())instanceof Error&&"AbortError"===d.name?o.logger.debug("Remote config client fetch with retry time ".concat(e," timed out after ").concat(t,"ms")):o.logger.debug("Remote config client fetch with retry time ".concat(e," is rejected because: "),d),[3,9];case 8:return clearTimeout(a),[7];case 9:return i?n<e-1?[4,new Promise(function(e){return setTimeout(e,l.getJitterDelay(r))})]:[3,11]:[2,"break"];case 10:h.sent(),h.label=11;case 11:return[2]}})},o=this,s=0,u.label=1;case 1:return s<e?[5,i(s)]:[3,4];case 2:if("object"==typeof(a=u.sent()))return[2,a.value];if("break"===a)return[3,4];u.label=3;case 3:return s++,[3,1];case 4:return[2,n]}})})},e.prototype.getJitterDelay=function(e){return Math.floor(Math.random()*e)},e.prototype.getUrlParams=function(){var t=encodeURIComponent(this.apiKey),r=new URLSearchParams;return r.append("config_group",e.CONFIG_GROUP),"".concat(this.serverUrl,"/").concat(t,"?").concat(r.toString())},e.CONFIG_GROUP="browser",e}()}});function Fr(e,t){var r,n=(r=e,!!Rr&&"function"==typeof Rr[r]&&(Mr[r]||(Mr[r]=Rr[r],Rr[r]=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{if(Pr[r]&&!Nr){Nr=!0;var n=Pr[r];n&&n.forEach(function(t){try{t(r,e)}catch(e){}})}}catch(e){}return Nr=!1,Mr[r].apply(Rr,e)}),!0));if(!n)return new Error("Console override failed");Pr[e]?Pr[e].push(t):Pr[e]=[t]}function Br(e){var t,r;try{for(var n=y(Object.values(Pr)),i=n.next();!i.done;i=n.next())for(var o=i.value,s=o.length-1;s>=0;s--)if(o[s]===e){o.splice(s,1);break}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}}function qr(){var e,t;try{for(var r=y(Object.entries(Mr)),n=r.next();!n.done;n=r.next()){var i=b(n.value,2),o=i[0],s=i[1];s&&(Rr[o]=s)}}catch(t){e={error:t}}finally{try{n&&!n.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}Mr={},Pr={}}var zr,Vr,Wr,Hr,$r,Gr,Kr,Jr,Qr,Yr,Xr,Zr,en,tn=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/observers/console.js"(){Ne(),ze(),_r=de(),Rr=null==_r?void 0:_r.console,Pr={},Mr={},Nr=!1,Lr={addListener:Fr,removeListener:Br,_restoreConsole:qr}}}),rn=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/types/server-zone.js"(){var e;(e=zr||(zr={})).US="US",e.EU="EU",e.STAGING="STAGING"}}),nn=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/types/offline.js"(){Vr=null}}),on=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/types/element-interactions.js"(){Wr=["a","button","input","select","textarea","label","video","audio",'[contenteditable="true" i]',"[data-amp-default-track]",".amp-default-track"],Hr="data-amp-track-",$r=["div","span","h1","h2","h3","h4","h5","h6"],Gr=150}}),sn=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/types/frustration-interactions.js"(){Ne(),Kr=w(['input[type="button"]','input[type="submit"]','input[type="reset"]','input[type="image"]','input[type="file"]'],b(["a","button",'[role="button"]','[role="link"]','[role="menuitem"]','[role="menuitemcheckbox"]','[role="menuitemradio"]','[role="option"]','[role="tab"]','[role="treeitem"]','[contenteditable="true" i]']),!1),Jr=Kr,Qr=Kr,Yr=["*"],Xr=1e3,Zr=4,en=50}});function an(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e||null==e}function ln(e,t,r){e&&un({json:e,allowlist:t.map(cn),excludelist:r.map(cn),ancestors:[]})}function un(e){var t,r,n=e.json,i=e.targetObject,o=e.allowlist,s=e.excludelist,a=e.ancestors,l=e.parentObject,u=e.targetKey;i||(i=n);var c=Object.keys(i);try{for(var d=y(c),h=d.next();!h.done;h=d.next()){var p=h.value,f=w(w([],b(a),!1),[p],!1);an(i[p])?hn(f,o)&&!hn(f,s)||delete i[p]:un({json:n,targetObject:i[p],allowlist:o,excludelist:s,ancestors:f,parentObject:i,targetKey:p})}}catch(e){t={error:e}}finally{try{h&&!h.done&&(r=d.return)&&r.call(d)}finally{if(t)throw t.error}}0===Object.keys(i).length&&l&&u&&delete l[u]}function cn(e){return e.startsWith("/")&&(e=e.slice(1)),e.split("/").map(function(e){return e.replace(/~0/g,"~").replace(/~1/g,"/")})}function dn(e,t,r,n){if(void 0===r&&(r=0),void 0===n&&(n=0),n===t.length)return r===e.length;if(r===e.length){for(;n<t.length&&"**"===t[n];)n++;return n===t.length}var i=t[n];if("**"===i){if(n+1===t.length)return!0;for(var o=r;o<=e.length;o++)if(dn(e,t,o,n+1))return!0;return!1}return("*"===i||i===e[r])&&dn(e,t,r+1,n+1)}function hn(e,t){return t.some(function(t){return dn(e,t)})}var pn,fn,gn,vn,mn,yn,bn,wn,Sn=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/utils/json-query.js"(){Ne()}});function En(e,t){var r,n,i,o=de(),s=null==o?void 0:o.TextEncoder;if(s){var a;if("string"==typeof e)a=e,i=(new s).encode(a).length;else if(e instanceof Blob)i=(a=e).size;else if(e instanceof URLSearchParams)a=e,i=(new s).encode(a.toString()).length;else if(ArrayBuffer.isView(e))i=(a=e).byteLength;else if(e instanceof ArrayBuffer)i=(a=e).byteLength;else if(e instanceof FormData){var l=e,u=0,c=0;try{for(var d=y(l.entries()),h=d.next();!h.done;h=d.next()){var p=b(h.value,2),f=p[0],g=p[1];if(u+=f.length,"string"==typeof g)u+=(new s).encode(g).length;else{if(!(g instanceof Blob))return;u+=g.size}if(++c>=t)return}}catch(e){r={error:e}}finally{try{h&&!h.done&&(n=d.return)&&n.call(d)}finally{if(r)throw r.error}}i=u}else if(e instanceof ReadableStream)return void(a=e);return i}}function kn(e,t,r){if(!e)return null;try{var n=JSON.parse(e);return ln(n,t,r),n}catch(e){return null}}var xn,Cn,In,On=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/network-request-event.js"(){var e;Ne(),ze(),Sn(),De(),pn=function(){function e(e){this.request=e}return e.prototype.headers=function(e){var t,r;void 0===e&&(e=[]);var n=this.request.headers,i={};if(Array.isArray(n))n.forEach(function(e){var t=b(e,2),r=t[0],n=t[1];i[r]=n});else if(n instanceof Headers)n.forEach(function(e,t){i[t]=e});else if("object"==typeof n&&null!==n)try{for(var o=y(Object.entries(n)),s=o.next();!s.done;s=o.next()){var a=b(s.value,2),l=a[0],u=a[1];i[l]=u}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return bn(i,{allow:e})},Object.defineProperty(e.prototype,"bodySize",{get:function(){if("number"==typeof this._bodySize)return this._bodySize;var e=de();if(null==e?void 0:e.TextEncoder){var t=this.request.body;return this._bodySize=En(t,100),this._bodySize}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"method",{get:function(){return this.request.method},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"body",{get:function(){return"string"==typeof this.request.body?this.request.body:null},enumerable:!1,configurable:!0}),e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),v(this,void 0,void 0,function(){return m(this,function(r){return 0===e.length?[2,null]:[2,kn(this.body,e,t)]})})},e}(),fn=function(){function e(e,t){this.bodyRaw=e,this.requestHeaders=t}return e.prototype.headers=function(e){return void 0===e&&(e=[]),bn(this.requestHeaders,{allow:e})},Object.defineProperty(e.prototype,"bodySize",{get:function(){return En(this.bodyRaw,100)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"body",{get:function(){return"string"==typeof this.bodyRaw?this.bodyRaw:null},enumerable:!1,configurable:!0}),e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),v(this,void 0,void 0,function(){return m(this,function(r){return 0===e.length?[2,null]:[2,kn(this.body,e,t)]})})},e}(),gn=function(){function e(e){this.response=e}return e.prototype.headers=function(e){var t;if(void 0===e&&(e=[]),this.response.headers instanceof Headers){var r=this.response.headers,n={};return null===(t=null==r?void 0:r.forEach)||void 0===t||t.call(r,function(e,t){n[t]=e}),bn(n,{allow:e})}},Object.defineProperty(e.prototype,"bodySize",{get:function(){var e,t;if(void 0!==this._bodySize)return this._bodySize;var r=null===(t=null===(e=this.response.headers)||void 0===e?void 0:e.get)||void 0===t?void 0:t.call(e,"content-length"),n=r?parseInt(r,10):void 0;return this._bodySize=n,n},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this.response.status},enumerable:!1,configurable:!0}),e.prototype.text=function(){return v(this,void 0,void 0,function(){var e,t;return m(this,function(r){switch(r.label){case 0:this.clonedResponse||(this.clonedResponse=this.response.clone()),r.label=1;case 1:return r.trys.push([1,3,,4]),e=this.clonedResponse.text(),t=new Promise(function(e){return setTimeout(function(){return e(null)},500)}),[4,Promise.race([e,t])];case 2:return[2,r.sent()];case 3:return r.sent(),[2,null];case 4:return[2]}})})},e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),v(this,void 0,void 0,function(){return m(this,function(r){switch(r.label){case 0:return 0===e.length?[2,null]:[4,this.text()];case 1:return[2,kn(r.sent(),e,t)]}})})},e}(),vn=function(){function e(e,t,r,n){this.statusCode=e,this.headersString=t,this.size=r,this.getJson=n}return Object.defineProperty(e.prototype,"bodySize",{get:function(){return this.size},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this.statusCode},enumerable:!1,configurable:!0}),e.prototype.headers=function(e){var t,r;if(void 0===e&&(e=[]),!this.headersString)return{};var n={},i=this.headersString.split("\r\n");try{for(var o=y(i),s=o.next();!s.done;s=o.next()){var a=b(s.value.split(": "),2),l=a[0],u=a[1];l&&u&&(n[l]=u)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return bn(n,{allow:e})},e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),v(this,void 0,void 0,function(){var r;return m(this,function(n){return 0===e.length?[2,null]:(r=this.getJson())?(ln(r,e,t),[2,r]):[2,null]})})},e}(),(e=mn||(mn={})).REDACT="redact",e.REMOVE="remove",yn="[REDACTED]",bn=function(e,t){var r,n,i=t.allow,o=void 0===i?[]:i,s=t.strategy,a=void 0===s?mn.REMOVE:s,l=w([],b(Q),!1),u={},c=function(t){var r=t.toLowerCase();l.find(function(e){return e.toLowerCase()===r})?a===mn.REDACT&&(u[t]=yn):o.find(function(e){return e.toLowerCase()===r})?u[t]=e[t]:a===mn.REDACT&&(u[t]=yn)};try{for(var d=y(Object.keys(e)),h=d.next();!h.done;h=d.next()){c(h.value)}}catch(e){r={error:e}}finally{try{h&&!h.done&&(n=d.return)&&n.call(d)}finally{if(r)throw r.error}}return u},wn=function(){function e(e,t,r,n,i,o,s,a,l,u,c){void 0===s&&(s=0),this.type=e,this.method=t,this.timestamp=r,this.startTime=n,this.url=i,this.requestWrapper=o,this.status=s,this.duration=a,this.responseWrapper=l,this.error=u,this.endTime=c}return e.prototype.toSerializable=function(){var e,t,r,n,i={type:this.type,method:this.method,url:this.url,timestamp:this.timestamp,status:this.status,duration:this.duration,error:this.error,startTime:this.startTime,endTime:this.endTime,requestHeaders:null===(e=this.requestWrapper)||void 0===e?void 0:e.headers(w([],b(J),!1)),requestBodySize:null===(t=this.requestWrapper)||void 0===t?void 0:t.bodySize,responseHeaders:null===(r=this.responseWrapper)||void 0===r?void 0:r.headers(w([],b(J),!1)),responseBodySize:null===(n=this.responseWrapper)||void 0===n?void 0:n.bodySize};return Object.fromEntries(Object.entries(i).filter(function(e){var t=b(e,2);t[0];return void 0!==t[1]}))},e}()}});function Tn(e){try{e()}catch(e){}}var An,_n,Rn,Pn,Mn,Nn,Ln,Dn,jn,Un=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/observers/network.js"(){Ne(),ze(),Ve(),On(),xn=function(){return function(e,t){void 0===t&&(t=fe()),this.callback=e,this.id=t}}(),Cn=function(){function e(t){this.eventCallbacks=new Map,this.isObserving=!1,this.logger=t;var r=de();e.isSupported()&&(this.globalScope=r)}return e.isSupported=function(){var e=de();return!!e&&!!e.fetch},e.prototype.subscribe=function(e,t){var r,n,i,o,s,a,l,u,c,d;if(this.logger||(this.logger=t),this.eventCallbacks.set(e.id,e),!this.isObserving){var h=null===(i=null===(n=null===(r=this.globalScope)||void 0===r?void 0:r.XMLHttpRequest)||void 0===n?void 0:n.prototype)||void 0===i?void 0:i.open,p=null===(a=null===(s=null===(o=this.globalScope)||void 0===o?void 0:o.XMLHttpRequest)||void 0===s?void 0:s.prototype)||void 0===a?void 0:a.send,f=null===(c=null===(u=null===(l=this.globalScope)||void 0===l?void 0:l.XMLHttpRequest)||void 0===u?void 0:u.prototype)||void 0===c?void 0:c.setRequestHeader;h&&p&&f&&this.observeXhr(h,p,f);var g=null===(d=this.globalScope)||void 0===d?void 0:d.fetch;g&&this.observeFetch(g),this.isObserving=!0}},e.prototype.unsubscribe=function(e){this.eventCallbacks.delete(e.id)},e.prototype.triggerEventCallbacks=function(e){var t=this;this.eventCallbacks.forEach(function(r){try{r.callback(e)}catch(e){Tn(function(){var r;null===(r=t.logger)||void 0===r||r.debug("an unexpected error occurred while triggering event callbacks",e)})}})},e.prototype.handleNetworkRequestEvent=function(e,t,r,n,i,o,s){var a;if(void 0!==o&&void 0!==s){var l,u,c,d="GET";if(!function(e){return"object"==typeof e&&null!==e&&"url"in e&&"method"in e}(t)?l=null===(a=null==t?void 0:t.toString)||void 0===a?void 0:a.call(t):(l=t.url,d=t.method),l)try{var h=new URL(l);l="".concat(h.protocol,"//").concat(h.host).concat(h.pathname).concat(h.search).concat(h.hash)}catch(e){}d=(null==r?void 0:r.method)||d,n&&(u=n.status),i&&(c={name:i.name||"UnknownError",message:i.message||"An unknown error occurred"},u=0);var p=Math.floor(performance.now()-s),f=Math.floor(o+p),g=new wn(e,d,o,o,l,r,u,p,n,c,f);this.triggerEventCallbacks(g)}},e.prototype.getTimestamps=function(){var e,t;return{startTime:null===(e=Date.now)||void 0===e?void 0:e.call(Date),durationStart:null===(t=null===performance||void 0===performance?void 0:performance.now)||void 0===t?void 0:t.call(performance)}},e.prototype.observeFetch=function(e){var t=this;this.globalScope&&e&&(this.globalScope.fetch=function(r,n){return v(t,void 0,void 0,function(){var t,i,o,s,a=this;return m(this,function(l){switch(l.label){case 0:try{t=this.getTimestamps()}catch(e){Tn(function(){var t;return null===(t=a.logger)||void 0===t?void 0:t.debug("an unexpected error occurred while retrieving timestamps",e)})}l.label=1;case 1:return l.trys.push([1,3,,4]),[4,e(r,n)];case 2:return i=l.sent(),[3,4];case 3:return s=l.sent(),o=s,[3,4];case 4:try{this.handleNetworkRequestEvent("fetch",r,n?new pn(n):void 0,i?new gn(i):void 0,o,null==t?void 0:t.startTime,null==t?void 0:t.durationStart)}catch(e){Tn(function(){var t;return null===(t=a.logger)||void 0===t?void 0:t.debug("an unexpected error occurred while handling fetch",e)})}if(i)return[2,i];throw o}})})})},e.createXhrJsonParser=function(e,t){return function(){var r;try{if("json"===e.responseType){if(null===(r=t.globalScope)||void 0===r?void 0:r.structuredClone)return t.globalScope.structuredClone(e.response)}else if(["text",""].includes(e.responseType))return JSON.parse(e.responseText)}catch(r){return r instanceof Error&&"InvalidStateError"===r.name&&Tn(function(){var r;return null===(r=t.logger)||void 0===r?void 0:r.debug("unexpected error when retrieving responseText. responseType='".concat(e.responseType,"'"))}),null}return null}},e.prototype.observeXhr=function(r,n,i){if(this.globalScope&&r&&n){var o=this.globalScope.XMLHttpRequest.prototype,s=this;o.open=function(){for(var e,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var o=b(n,2),a=o[0],l=o[1];try{this.$$AmplitudeAnalyticsEvent=t({method:a,url:null===(e=null==l?void 0:l.toString)||void 0===e?void 0:e.call(l),headers:{}},s.getTimestamps())}catch(e){Tn(function(){var t;return null===(t=s.logger)||void 0===t?void 0:t.debug("an unexpected error occurred while calling xhr open",e)})}return r.apply(this,n)},o.send=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var i=this,o=e.createXhrJsonParser(this,s),a=t[0],l=i.$$AmplitudeAnalyticsEvent;return i.$$AmplitudeAnalyticsEvent&&i.addEventListener("loadend",function(){try{var e=i.getAllResponseHeaders(),t=i.getResponseHeader("content-length"),r=new vn(i.status,e,t?parseInt(t,10):void 0,o),n=i.$$AmplitudeAnalyticsEvent.headers,u=new fn(a,n);l.status=i.status,s.handleNetworkRequestEvent("xhr",{url:l.url,method:l.method},u,r,void 0,l.startTime,l.durationStart)}catch(e){Tn(function(){var t;return null===(t=s.logger)||void 0===t?void 0:t.debug("an unexpected error occurred while handling xhr send",e)})}}),n.apply(i,t)},o.setRequestHeader=function(e,t){try{var r=this.$$AmplitudeAnalyticsEvent;r&&(r.headers[e]=t)}catch(e){Tn(function(){var t;return null===(t=s.logger)||void 0===t?void 0:t.debug("an unexpected error occurred while calling xhr setRequestHeader",e)})}i.apply(this,[e,t])}}},e}(),In=new Cn}}),Fn=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/campaign/campaign-parser.js"(){Ne(),hr(),De(),An=function(){function e(){}return e.prototype.parse=function(){return v(this,void 0,void 0,function(){return m(this,function(e){return[2,t(t(t(t({},K),this.getUtmParam()),this.getReferrer()),this.getClickIds())]})})},e.prototype.getUtmParam=function(){var e=_t();return{utm_campaign:e[R],utm_content:e[P],utm_id:e[M],utm_medium:e[N],utm_source:e[L],utm_term:e[D]}},e.prototype.getReferrer=function(){var e,t,r={referrer:void 0,referring_domain:void 0};try{r.referrer=document.referrer||void 0,r.referring_domain=null!==(t=null===(e=r.referrer)||void 0===e?void 0:e.split("/")[2])&&void 0!==t?t:void 0}catch(e){}return r},e.prototype.getClickIds=function(){var e,t=_t();return(e={})[j]=t[j],e[U]=t[U],e[F]=t[F],e[B]=t[B],e[q]=t[q],e[z]=t[z],e[V]=t[V],e[W]=t[W],e[H]=t[H],e[$]=t[$],e[G]=t[G],e},e}()}}),Bn=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/plugins/helpers.js"(){Ne(),_n="data-amp-mask",Rn="*****",Pn=/\b(?:\d[ -]*?){13,16}\b/,Mn=/(\d{3}-?\d{2}-?\d{4})/g,Nn=/[^\s@]+@[^\s@.]+\.[^\s@]+/g,Ln=function(e,t){var r,n;if(void 0===t&&(t=[]),"string"!=typeof e)return"";var i=e;i=(i=(i=i.replace(Pn,Rn)).replace(Mn,Rn)).replace(Nn,Rn);try{for(var o=y(t),s=o.next();!s.done;s=o.next()){var a=s.value;try{i=i.replace(a,Rn)}catch(e){}}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return i},Dn=function(e){if("undefined"==typeof document||!document.title)return"";var t=document.querySelector("title");return t&&t.hasAttribute(_n)?Rn:e?e(document.title):document.title}}}),qn=u({"../../../../node_modules/zen-observable/lib/Observable.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Observable=void 0;var t=e=>Boolean(Symbol[e]),r=e=>t(e)?Symbol[e]:"@@"+e,n=r("iterator"),i=r("observable"),o=r("species");function s(e,t){let r=e[t];if(null!=r){if("function"!=typeof r)throw new TypeError(r+" is not a function");return r}}function a(e){let t=e.constructor;return void 0!==t&&(t=t[o],null===t&&(t=void 0)),void 0!==t?t:g}function l(e){l.log?l.log(e):setTimeout(()=>{throw e})}function u(e){Promise.resolve().then(()=>{try{e()}catch(e){l(e)}})}function c(e){let t=e._cleanup;if(void 0!==t&&(e._cleanup=void 0,t))try{if("function"==typeof t)t();else{let e=s(t,"unsubscribe");e&&e.call(t)}}catch(e){l(e)}}function d(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function h(e,t,r){e._state="running";let n=e._observer;try{let i=s(n,t);switch(t){case"next":i&&i.call(n,r);break;case"error":if(d(e),!i)throw r;i.call(n,r);break;case"complete":d(e),i&&i.call(n)}}catch(e){l(e)}"closed"===e._state?c(e):"running"===e._state&&(e._state="ready")}function p(e,t,r){if("closed"!==e._state){if("buffering"!==e._state)return"ready"!==e._state?(e._state="buffering",e._queue=[{type:t,value:r}],void u(()=>function(e){let t=e._queue;if(t){e._queue=void 0,e._state="ready";for(let r=0;r<t.length&&(h(e,t[r].type,t[r].value),"closed"!==e._state);++r);}}(e))):void h(e,t,r);e._queue.push({type:t,value:r})}}var f=class{constructor(e,t){this._cleanup=void 0,this._observer=e,this._queue=void 0,this._state="initializing";let r=this,n={get closed(){return"closed"===r._state},next(e){p(r,"next",e)},error(e){p(r,"error",e)},complete(){p(r,"complete")}};try{this._cleanup=t.call(void 0,n)}catch(e){n.error(e)}"initializing"===this._state&&(this._state="ready")}get closed(){return"closed"===this._state}unsubscribe(){"closed"!==this._state&&(d(this),c(this))}},g=class e{constructor(t){if(!(this instanceof e))throw new TypeError("Observable cannot be called as a function");if("function"!=typeof t)throw new TypeError("Observable initializer must be a function");this._subscriber=t}subscribe(e){return"object"==typeof e&&null!==e||(e={next:e,error:arguments[1],complete:arguments[2]}),new f(e,this._subscriber)}forEach(e){return new Promise((t,r)=>{if("function"!=typeof e)return void r(new TypeError(e+" is not a function"));function n(){i.unsubscribe(),t()}let i=this.subscribe({next(t){try{e(t,n)}catch(e){r(e),i.unsubscribe()}},error:r,complete:t})})}map(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(a(this))(t=>this.subscribe({next(r){try{r=e(r)}catch(e){return t.error(e)}t.next(r)},error(e){t.error(e)},complete(){t.complete()}}))}filter(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(a(this))(t=>this.subscribe({next(r){try{if(!e(r))return}catch(e){return t.error(e)}t.next(r)},error(e){t.error(e)},complete(){t.complete()}}))}reduce(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");let t=a(this),r=arguments.length>1,n=!1,i=arguments[1];return new t(t=>this.subscribe({next(o){let s=!n;if(n=!0,!s||r)try{i=e(i,o)}catch(e){return t.error(e)}else i=o},error(e){t.error(e)},complete(){if(!n&&!r)return t.error(new TypeError("Cannot reduce an empty sequence"));t.next(i),t.complete()}}))}async all(){let e=[];return await this.forEach(t=>e.push(t)),e}concat(...e){let t=a(this);return new t(r=>{let n,i=0;return function o(s){n=s.subscribe({next(e){r.next(e)},error(e){r.error(e)},complete(){i===e.length?(n=void 0,r.complete()):o(t.from(e[i++]))}})}(this),()=>{n&&(n.unsubscribe(),n=void 0)}})}flatMap(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");let t=a(this);return new t(r=>{let n=[],i=this.subscribe({next(i){if(e)try{i=e(i)}catch(e){return r.error(e)}let s=t.from(i).subscribe({next(e){r.next(e)},error(e){r.error(e)},complete(){let e=n.indexOf(s);e>=0&&n.splice(e,1),o()}});n.push(s)},error(e){r.error(e)},complete(){o()}});function o(){i.closed&&0===n.length&&r.complete()}return()=>{n.forEach(e=>e.unsubscribe()),i.unsubscribe()}})}[i](){return this}static from(r){let o="function"==typeof this?this:e;if(null==r)throw new TypeError(r+" is not an object");let a=s(r,i);if(a){let e=a.call(r);if(Object(e)!==e)throw new TypeError(e+" is not an object");return function(e){return e instanceof g}(e)&&e.constructor===o?e:new o(t=>e.subscribe(t))}if(t("iterator")&&(a=s(r,n),a))return new o(e=>{u(()=>{if(!e.closed){for(let t of a.call(r))if(e.next(t),e.closed)return;e.complete()}})});if(Array.isArray(r))return new o(e=>{u(()=>{if(!e.closed){for(let t=0;t<r.length;++t)if(e.next(r[t]),e.closed)return;e.complete()}})});throw new TypeError(r+" is not observable")}static of(...t){return new("function"==typeof this?this:e)(e=>{u(()=>{if(!e.closed){for(let r=0;r<t.length;++r)if(e.next(t[r]),e.closed)return;e.complete()}})})}static get[o](){return this}};e.Observable=g,Object.defineProperty(g,Symbol("extensions"),{value:{symbol:i,hostReportError:l},configurable:!0})}}),zn=u({"../../../../node_modules/zen-observable/index.js"(e,t){t.exports=qn().Observable}});function Vn(e,t){return new jn.default(function(r){e.subscribe({next:function(e){t(e).then(function(e){return r.next(e)}).catch(function(e){return r.error(e)})},error:function(e){r.error(e)},complete:function(){r.complete()}})})}function Wn(e,t){return new jn.default(function(r){var n=!1,i=new Set,o=function(){var e,t;n=!0;try{for(var r=y(i),o=r.next();!o.done;o=r.next()){var s=o.value;try{s.unsubscribe()}catch(e){}}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}i.clear()},s=function(e){var t=e.subscribe({next:function(e){n||r.next(e)},error:function(e){n||(n=!0,r.error(e),o())},complete:function(){i.delete(t),n||0!==i.size||(r.complete(),o(),n=!0)}});i.add(t)};return s(e),s(t),o})}function Hn(e){var t=new Set,r=null;function n(){null==r||r.unsubscribe(),r=null,t.clear()}return new jn.default(function(i){return t.add(i),null===r&&(r=e.subscribe({next:function(e){var r,n,i;try{for(var o=y(t),s=o.next();!s.done;s=o.next()){var a=s.value;null===(i=a.next)||void 0===i||i.call(a,e)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}},error:function(e){var r,i,o;try{for(var s=y(t),a=s.next();!a.done;a=s.next()){var l=a.value;null===(o=l.error)||void 0===o||o.call(l,e)}}catch(e){r={error:e}}finally{try{a&&!a.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}n()},complete:function(){var e,r,i;try{for(var o=y(t),s=o.next();!s.done;s=o.next()){var a=s.value;null===(i=a.complete)||void 0===i||i.call(a)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}n()}})),function(){t.delete(i),0===t.size&&r&&(r.unsubscribe(),r=null)}})}var $n,Gn,Kn,Jn,Qn,Yn,Xn=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/utils/observable.js"(){Ne(),jn=h(zn())}}),Zn=u({"../../../../node_modules/safe-json-stringify/index.js"(e,t){var r=Object.prototype.hasOwnProperty;function n(e){return"[Throws: "+(e?e.message:"?")+"]"}function i(e){var t=[];return function e(i){if(null===i||"object"!=typeof i)return i;if(-1!==t.indexOf(i))return"[Circular]";if(t.push(i),"function"==typeof i.toJSON)try{var o=e(i.toJSON());return t.pop(),o}catch(e){return n(e)}if(Array.isArray(i)){var s=i.map(e);return t.pop(),s}var a=Object.keys(i).reduce(function(t,o){return t[o]=e(function(e,t){if(r.call(e,t))try{return e[t]}catch(e){return n(e)}return e[t]}(i,o)),t},{});return t.pop(),a}(e)}t.exports=function(e,t,r){return JSON.stringify(i(e),t,r)},t.exports.ensureProperties=i}}),ei=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/utils/safe-stringify.js"(){$n=h(Zn()),Gn=$n.default||$n}}),ti=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/messenger/constants.js"(){Jn={US:Kn="https://app.amplitude.com",EU:"https://app.eu.amplitude.com",STAGING:"https://apps.stag2.amplitude.com"},Qn="https://cdn.amplitude.com/libs/background-capture-1.0.1.js.gz"}});var ri,ni,ii,oi,si=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/messenger/utils.js"(){Yn=function(e){return document.querySelector('script[src="'.concat(CSS.escape(e),'"]'))?Promise.resolve({status:!0}):new Promise(function(t,r){var n;try{var i=document.createElement("script");i.type="text/javascript",i.async=!0,i.src=e,i.addEventListener("load",function(){t({status:!0})},{once:!0}),i.addEventListener("error",function(){r({status:!1,message:"Failed to load the script ".concat(e)})}),null===(n=document.head)||void 0===n||n.appendChild(i)}catch(e){r(e)}})}}});function ai(e){var t,r=de(),n=null==r?void 0:r[ii];if("object"==typeof(t=n)&&null!==t&&ni in t&&!0===t[ni])return n;var i=new oi(e);return r&&(r[ii]=i),i}var li,ui=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/messenger/base-window-messenger.js"(){Ne(),ze(),ti(),si(),ni="__AMPLITUDE_MESSENGER_INSTANCE__",ii="__AMPLITUDE_MESSENGER__",oi=function(){function e(e){var t=(void 0===e?{}:e).origin,r=void 0===t?Kn:t;this[ri]=!0,this.isSetup=!1,this.messageHandler=null,this.requestCallbacks={},this.actionHandlers=new Map,this.pendingMessages=new Map,this.scriptLoadPromises=new Map,this.endpoint=r}return e.prototype.notify=function(e){var t,r,n,i;null===(r=null===(t=this.logger)||void 0===t?void 0:t.debug)||void 0===r||r.call(t,"Message sent: ",JSON.stringify(e)),null===(i=null===(n=window.opener)||void 0===n?void 0:n.postMessage)||void 0===i||i.call(n,e,this.endpoint)},e.prototype.sendRequest=function(e,t,r){var n=this;void 0===r&&(r={timeout:15e3});var i="".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9)),o={id:i,action:e,args:t};return new Promise(function(t,s){n.requestCallbacks[i]={resolve:t,reject:s},n.notify(o),r.timeout>0&&setTimeout(function(){s(new Error("".concat(e," timed out (id: ").concat(i,")"))),delete n.requestCallbacks[i]},r.timeout)})},e.prototype.handleResponse=function(e){var t;this.requestCallbacks[e.id]?(this.requestCallbacks[e.id].resolve(e.responseData),delete this.requestCallbacks[e.id]):null===(t=this.logger)||void 0===t||t.warn("No callback found for request id: ".concat(e.id))},e.prototype.registerActionHandler=function(e,t){var r,n,i,o;this.actionHandlers.has(e)&&(null===(o=null===(i=this.logger)||void 0===i?void 0:i.warn)||void 0===o||o.call(i,"Overwriting existing action handler for: ".concat(e))),this.actionHandlers.set(e,t);var s=this.pendingMessages.get(e);if(s){this.pendingMessages.delete(e);try{for(var a=y(s),l=a.next();!l.done;l=a.next()){t(l.value)}}catch(e){r={error:e}}finally{try{l&&!l.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}}},e.prototype.loadScriptOnce=function(e){return v(this,void 0,void 0,function(){var t,r,n;return m(this,function(i){switch(i.label){case 0:if(t=this.scriptLoadPromises.get(e))return[2,t];r=Yn(e).then(function(){}),this.scriptLoadPromises.set(e,r),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,r];case 2:return i.sent(),[3,4];case 3:throw n=i.sent(),this.scriptLoadPromises.delete(e),n;case 4:return[2]}})})},e.prototype.setup=function(e){var t,r,n=this,i=void 0===e?{}:e,o=i.logger,s=i.endpoint;o&&(this.logger=o),s&&this.endpoint===Kn&&(this.endpoint=s),this.isSetup||(this.isSetup=!0,null===(r=null===(t=this.logger)||void 0===t?void 0:t.debug)||void 0===r||r.call(t,"Setting up messenger"),this.messageHandler=function(e){var t,r,i,o,s;if(null===(r=null===(t=n.logger)||void 0===t?void 0:t.debug)||void 0===r||r.call(t,"Message received: ",JSON.stringify(e)),n.endpoint===e.origin){var a=e.data,l=null==a?void 0:a.action;if(l)if("id"in a&&a.id)null===(o=null===(i=n.logger)||void 0===i?void 0:i.debug)||void 0===o||o.call(i,"Received Response to previous request: ",JSON.stringify(e)),n.handleResponse(a);else{if("ping"===l)return void n.notify({action:"pong"});var u=n.actionHandlers.get(l);if(u)u(a.data);else{var c=null!==(s=n.pendingMessages.get(l))&&void 0!==s?s:[];c.push(a.data),n.pendingMessages.set(l,c)}}}},window.addEventListener("message",this.messageHandler),this.notify({action:"page-loaded"}))},e.prototype.destroy=function(){this.messageHandler&&(window.removeEventListener("message",this.messageHandler),this.messageHandler=null),this.isSetup=!1,this.actionHandlers.clear(),this.pendingMessages.clear(),this.requestCallbacks={},this.scriptLoadPromises.clear();var e=de();(null==e?void 0:e[ii])===this&&delete e[ii]},e}(),ri=ni}});function ci(e,t){var r,n=e;if(!0!==n[li]){n[li]=!0;var i=null!==(r=null==t?void 0:t.scriptUrl)&&void 0!==r?r:Qn,o=null,s=function(t,r){var n,i;"background-capture-complete"===t&&(null===(i=null===(n=e.logger)||void 0===n?void 0:n.debug)||void 0===i||i.call(n,"Background capture complete"),e.notify({action:"background-capture-complete",data:r}))};e.registerActionHandler("initialize-background-capture",function(){var t,r;null===(r=null===(t=e.logger)||void 0===t?void 0:t.debug)||void 0===r||r.call(t,"Initializing background capture (external script)");var n=new URL(i,e.endpoint).toString();e.loadScriptOnce(n).then(function(){var t,r,n;null===(r=null===(t=e.logger)||void 0===t?void 0:t.debug)||void 0===r||r.call(t,"Background capture script loaded (external)"),o=null===(n=null===window||void 0===window?void 0:window.amplitudeBackgroundCapture)||void 0===n?void 0:n.call(window,{messenger:e,onBackgroundCapture:s}),e.notify({action:"background-capture-loaded"})}).catch(function(){var t;null===(t=e.logger)||void 0===t||t.warn("Failed to initialize background capture")})}),e.registerActionHandler("close-background-capture",function(){var e;null===(e=null==o?void 0:o.close)||void 0===e||e.call(o),o=null})}}var di,hi=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/messenger/background-capture.js"(){ti(),li="__AMPLITUDE_BACKGROUND_CAPTURE__"}}),pi=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/types/config/browser-config.js"(){di={always:"always",ifEmptyCampaign:"ifEmptyCampaign"}}});var fi,gi,vi,mi,yi,bi,wi,Si,Ei,ki,xi,Ci,Ii,Oi,Ti,Ai,_i,Ri,Pi,Mi,Ni,Li,Di,ji,Ui,Fi,Bi,qi,zi,Vi,Wi,Hi,$i,Gi=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/utils/environment.js"(){ze()}}),Ki=l({"../../../../node_modules/@amplitude/analytics-core/lib/esm/index.js"(){Ge(),Ue(),Ke(),bt(),lr(),Xe(),Ye(),ze(),ar(),ur(),cr(),dr(),hr(),$e(),ut(),Ve(),He(),pr(),fr(),gr(),vr(),mr(),yr(),br(),Er(),kr(),xr(),Dr(),Ur(),Qe(),De(),tn(),Le(),rn(),nn(),on(),sn(),Be(),Un(),De(),De(),Fn(),Bn(),Xn(),ei(),ui(),hi(),ti(),pi(),Gi()}}),Ji=l({"../../../../node_modules/@amplitude/session-replay-browser/lib/esm/constants.js"(){var e;Ki(),gi="".concat(fi="[Amplitude]"," Session Replay ID"),vi=0,mi=zr.US,yi={enabled:!0},bi=1e3,wi="".concat(fi," Session Replay Debug"),Si="amp-block",Ei="amp-mask",ki="amp-unmask",xi="https://api-sr.amplitude.com/sessions/v2/track",Ci="https://api-sr.eu.amplitude.com/sessions/v2/track",Ii="https://api-sr.stag2.amplitude.com/sessions/v2/track","".concat(x,"_replay_unsent"),Ti=9e6,Ai=/payload.*exceed/i,_i=3e4,Ri=6e4,Pi=500,Mi=1e4,Ni=1024,Li=1e3,Di=65536,ji="X-Session-Replay-Event-Skipped",Ui="429",Fi="4004",Bi="4005",qi=6e4,zi=2*(Oi=7e5),Vi="amplitude-sr-iframe",(e=Wi||(Wi={})).GET_SR_PROPS="get-sr-props",e.DEBUG_INFO="debug-info",e.FETCH_REQUEST="fetch-request",e.METADATA="metadata",e.TARGETING_DECISION="targeting-decision",e.REPLAY_GATE_DECISION="replay-gate-decision"}}),Qi=l({"../../../../node_modules/@amplitude/session-replay-browser/lib/esm/logger.js"(){Hi=function(){function e(e){this.logger=e,this.log=this.getSafeMethod("log"),this.warn=this.getSafeMethod("warn"),this.error=this.getSafeMethod("error"),this.debug=this.getSafeMethod("debug")}return e.prototype.getSafeMethod=function(e){var t;if(!this.logger)return function(){};var r=this.logger[e];return"function"==typeof r?(null!==(t=r.__rrweb_original__)&&void 0!==t?t:r).bind(this.logger):function(){}},e.prototype.enable=function(e){this.logger.enable(e)},e.prototype.disable=function(){this.logger.disable()},e}()}}),Yi=l({"../../../../node_modules/@amplitude/session-replay-browser/lib/esm/config/types.js"(){$i="medium"}});var Xi=l({"../../../../node_modules/@amplitude/session-replay-browser/lib/esm/utils/get-input-type.js"(){}});function Zi(e,t){return t||("STAGING"===e?Ii:"EU"===e?Ci:xi)}var eo,to,ro,no,io,oo,so,ao,lo,uo,co,ho,po,fo,go,vo,mo,yo=l({"../../../../node_modules/@amplitude/session-replay-browser/lib/esm/utils/server-url.js"(){Ji()}}),bo=l({"../../../../node_modules/@amplitude/session-replay-browser/lib/esm/helpers.js"(){Ne(),Ki(),Yi(),Ji(),Xi(),yo(),eo=function(e,t,r){switch(t){case"light":if("input"!==e)return!1;var n=r?function(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?t.toLowerCase():null}(r):"";return!!n&&(!!["password","hidden","email","tel"].includes(n)||!!r.autocomplete.startsWith("cc-"));case"medium":return"input"===e;case"conservative":return!0;default:return eo(e,$i,r)}},to=function(e,t){var r,n,i;if(e&&t.urlMaskLevels)try{for(var o=y(t.urlMaskLevels),s=o.next();!s.done;s=o.next()){var a=s.value;if(uo(a.match).test(e))return a.maskLevel}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return null!==(i=t.defaultMaskLevel)&&void 0!==i?i:$i},ro=function(e,t,r,n){var i,o;if(void 0===t&&(t={defaultMaskLevel:$i}),r){if(r.closest("."+Ei))return!0;if((null!==(i=t.maskSelector)&&void 0!==i?i:[]).some(function(e){return r.closest(e)}))return!0;if(r.closest("."+ki))return!1;if((null!==(o=t.unmaskSelector)&&void 0!==o?o:[]).some(function(e){return r.closest(e)}))return!1}return eo(e,to(n,t),r)},no=function(e,t,r){return function(n,i){return ro(e,t,i,null==r?void 0:r())?n.replace(/[^\s]/g,"*"):n}},io=function(e,t){return function(r,n,i){var o;if("style"===r)return n;if(!(null!==(o=null==e?void 0:e.maskAttributes)&&void 0!==o?o:[]).includes(r))return n;var s=["INPUT","SELECT","TEXTAREA"].includes(i.tagName)?"input":"text";return ro(s,e,i,null==t?void 0:t())?n.replace(/[^\s]/g,"*"):n}},oo=function(){var e=de();return(null==e?void 0:e.location)?e.location.href:""},so=function(e,t){return"".concat(t,"/").concat(e)},ao=function(e){if("string"!=typeof e||""===e.trim())return!1;return!!/^\/|^https?:\/\/[^\s]+$/.test(e)},lo=new Map,uo=function(e){var t=lo.get(e);if(t)return t;var r="\0TRAIL\0",n="\0MID\0",i="\0DS\0",o="\0ST\0",s="\0QU\0",a=e;a=(a=(a=(a=(a=(a=(a=(a=(a=(a=(a=a.replace(/\/\*\*$/,r)).replace(/\/\*\*\//g,n)).replace(/\*\*/g,i)).replace(/\*/g,o)).replace(/\?/g,s)).replace(/[.+^${}()|[\]\\]/g,"\\$&")).split(r).join("(/.*)?")).split(n).join("/(.*\\/)?")).split(i).join(".*")).split(o).join(".*")).split(s).join(".");var l=new RegExp("^".concat(a,"$"));return lo.set(e,l),l},co=function(e){if(!e.every(function(e){return"string"==typeof e.selector&&"string"==typeof e.replacement}))throw new Error("ugcFilterRules must be an array of objects with selector and replacement properties");if(!e.every(function(e){return ao(e.selector)}))throw new Error("ugcFilterRules must be an array of objects with valid globs")},ho=function(e,t){var r,n;try{for(var i=y(t),o=i.next();!o.done;o=i.next()){var s=o.value,a=uo(s.selector);if(a.test(e))return e.replace(a,s.replacement)}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return e},po=function(){return v(void 0,void 0,void 0,function(){var e,t,r,n,i,o,s;return m(this,function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),(e=de())?[4,e.navigator.storage.estimate()]:[3,2];case 1:return t=a.sent(),r=t.usage,n=t.quota,i=t.usageDetails,o=r?Math.round(r/Ni):0,s=r&&n?Math.round(1e3*(r/n+Number.EPSILON))/1e3:0,[2,{totalStorageSize:o,percentOfQuota:s,usageDetails:JSON.stringify(i)}];case 2:return[3,4];case 3:return a.sent(),[3,4];case 4:return[2,{totalStorageSize:0,percentOfQuota:0,usageDetails:""}]}})})},fo=function(e){var r=t({},e),n=r.apiKey;return r.apiKey="****".concat(n.substring(n.length-4)),r}}});var wo,So,Eo,ko,xo,Co,Io,Oo=l({"../../../../node_modules/@amplitude/session-replay-browser/lib/esm/config/local-config.js"(){Ne(),Ki(),Ji(),Qi(),bo(),go=function(){return{flushMaxRetries:2,logLevel:Ie.Warn,loggerProvider:new Te,transportProvider:new ir}},vo=function(e){function r(r,n){var i,o,s,a,l,u,c,d,h,p,f=this,g=go();if((f=e.call(this,t(t({transportProvider:g.transportProvider,loggerProvider:new Hi(n.loggerProvider||g.loggerProvider)},n),{apiKey:r}))||this).flushMaxRetries=void 0!==n.flushMaxRetries&&n.flushMaxRetries<=g.flushMaxRetries?n.flushMaxRetries:g.flushMaxRetries,f.apiKey=r,f.sampleRate=n.sampleRate||vi,f.serverZone=n.serverZone||mi,f.configServerUrl=n.configServerUrl,f.trackServerUrl=n.trackServerUrl,f.shouldInlineStylesheet=n.shouldInlineStylesheet,f.version=n.version,f.performanceConfig=n.performanceConfig||yi,f.storeType=null!==(i=n.storeType)&&void 0!==i?i:"memory",f.applyBackgroundColorToBlockedElements=null!==(o=n.applyBackgroundColorToBlockedElements)&&void 0!==o&&o,f.enableUrlChangePolling=null!==(s=n.enableUrlChangePolling)&&void 0!==s&&s,f.urlChangePollingInterval=null!==(a=n.urlChangePollingInterval)&&void 0!==a?a:bi,f.captureDocumentTitle=null!==(l=n.captureDocumentTitle)&&void 0!==l&&l,void 0!==n.fullSnapshotIntervalMs&&(f.fullSnapshotIntervalMs=n.fullSnapshotIntervalMs),f.privacyConfig=t(t({},null!==(u=n.privacyConfig)&&void 0!==u?u:{}),{unmaskSelector:Array.from(new Set(w([".".concat(ki)],b(null!==(d=null===(c=n.privacyConfig)||void 0===c?void 0:c.unmaskSelector)&&void 0!==d?d:[]),!1)))}),n.interactionConfig&&(f.interactionConfig=n.interactionConfig,f.interactionConfig.ugcFilterRules&&co(f.interactionConfig.ugcFilterRules)),n.debugMode&&(f.debugMode=n.debugMode),void 0!==n.useWebWorker)f.useWebWorker=n.useWebWorker;else{var v=n;void 0!==(null===(h=v.experimental)||void 0===h?void 0:h.useWebWorker)&&(f.useWebWorker=v.experimental.useWebWorker)}return f.captureAdoptedStyleSheets=null===(p=n.captureAdoptedStyleSheets)||void 0===p||p,n.crossOriginIframes&&(f.crossOriginIframes=n.crossOriginIframes),n.flushIntervalConfig&&(f.flushIntervalConfig=function(e,t){var r,n,i={};if(void 0!==e.minIntervalMs&&(!Number.isFinite(e.minIntervalMs)||e.minIntervalMs<mo?(t.warn("flushIntervalConfig.minIntervalMs ".concat(e.minIntervalMs," is below floor ").concat(mo,"ms; clamping.")),i.minIntervalMs=mo):i.minIntervalMs=e.minIntervalMs),void 0!==e.maxIntervalMs&&(Number.isNaN(e.maxIntervalMs)||e.maxIntervalMs<mo?(t.warn("flushIntervalConfig.maxIntervalMs ".concat(e.maxIntervalMs," is below floor ").concat(mo,"ms; clamping.")),i.maxIntervalMs=mo):i.maxIntervalMs=e.maxIntervalMs),void 0!==i.minIntervalMs||void 0!==i.maxIntervalMs){var o=null!==(r=i.minIntervalMs)&&void 0!==r?r:Pi,s=null!==(n=i.maxIntervalMs)&&void 0!==n?n:Mi;s<o&&(void 0===i.maxIntervalMs?(t.warn("flushIntervalConfig.minIntervalMs (".concat(o,") exceeds the default maxIntervalMs (").concat(Mi,"); raising max to match min.")),i.maxIntervalMs=o):void 0===i.minIntervalMs?(t.warn("flushIntervalConfig.maxIntervalMs (".concat(s,") is below the default minIntervalMs (").concat(Pi,"); lowering min to match max.")),i.minIntervalMs=s):(t.warn("flushIntervalConfig.maxIntervalMs (".concat(i.maxIntervalMs,") is less than minIntervalMs (").concat(i.minIntervalMs,"); raising max to match min.")),i.maxIntervalMs=i.minIntervalMs))}return i}(n.flushIntervalConfig,f.loggerProvider)),f}return f(r,e),r}(_e),mo=100}}),To=l({"../../../../node_modules/@amplitude/session-replay-browser/node_modules/@amplitude/rrweb-types/dist/rrweb-types.js"(){wo=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(wo||{}),So=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(So||{}),Eo=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(Eo||{})}}),Ao=l({"../../../../node_modules/@amplitude/session-replay-browser/lib/esm/config/joined-config.js"(){Ne(),Ki(),bo(),Oo(),ko=function(e,t){var r=document.createDocumentFragment(),n=function(e){if(void 0===e&&(e=[]),"string"==typeof e&&(e=[e]),0!==(e=e.filter(function(e){try{r.querySelector(e)}catch(r){return t.warn('[session-replay-browser] omitting selector "'.concat(e,'" because it is invalid')),!1}return!0})).length)return e};return e.blockSelector=n(e.blockSelector),e.maskSelector=n(e.maskSelector),e.unmaskSelector=n(e.unmaskSelector),e},xo=function(){function e(e,t){this.localConfig=t,this.remoteConfigClient=e}return e.prototype.generateJoinedConfig=function(){var e,r,n,i,o,s,a;return v(this,void 0,void 0,function(){var l,u,c,d,h,p,f,g,v,S,E,k,x,C,I,O,T,A=this;return m(this,function(m){switch(m.label){case 0:(l=t({},this.localConfig)).optOut=this.localConfig.optOut,l.captureEnabled=!0,m.label=1;case 1:return m.trys.push([1,3,,4]),[4,new Promise(function(e,t){A.remoteConfigClient.subscribe("configs.sessionReplay",{timeout:1500},function(r,n){var i;if(A.localConfig.loggerProvider.debug("Session Replay remote configuration received from ".concat(n,":"),JSON.stringify(r,null,2)),r){var o=r,s=o.sr_sampling_config,a=o.sr_privacy_config,c=o.sr_targeting_config,d=null===(i=l.interactionConfig)||void 0===i?void 0:i.ugcFilterRules;l.interactionConfig=o.sr_interaction_config,l.interactionConfig&&d&&(l.interactionConfig.ugcFilterRules=d),l.loggingConfig=o.sr_logging_config,(s||a||c)&&(u={},s&&(u.sr_sampling_config=s),a&&(u.sr_privacy_config=a),c&&(u.sr_targeting_config=c)),e()}else t(new Error("No remote config received"))})})];case 2:return m.sent(),[3,4];case 3:return c=m.sent(),this.localConfig.loggerProvider.error("Failed to generate joined config: ",c),l.captureEnabled=!1,[2,{localConfig:this.localConfig,joinedConfig:l,remoteConfig:void 0}];case 4:if(!u)return[2,{localConfig:this.localConfig,joinedConfig:l,remoteConfig:u}];if(d=u.sr_sampling_config,h=u.sr_privacy_config,p=u.sr_targeting_config,d&&Object.keys(d).length>0?(Object.prototype.hasOwnProperty.call(d,"capture_enabled")?l.captureEnabled=d.capture_enabled:l.captureEnabled=!1,Object.prototype.hasOwnProperty.call(d,"sample_rate")&&(l.sampleRate=d.sample_rate),Object.prototype.hasOwnProperty.call(d,"min_session_duration_ms")&&(l.minSessionDurationMs=this.sanitizeMinSessionDurationMs(d.min_session_duration_ms))):(l.captureEnabled=!0,this.localConfig.loggerProvider.debug("Remote config successfully fetched, but no values set for project, Session Replay capture enabled.")),h){f=null!==(e=l.privacyConfig)&&void 0!==e?e:{},g={defaultMaskLevel:null!==(n=null!==(r=h.defaultMaskLevel)&&void 0!==r?r:f.defaultMaskLevel)&&void 0!==n?n:"medium",blockSelector:[],maskSelector:[],unmaskSelector:[],maskAttributes:w([],b(new Set(w(w([],b(null!==(i=f.maskAttributes)&&void 0!==i?i:[]),!1),b(null!==(o=h.maskAttributes)&&void 0!==o?o:[]),!1))),!1),urlMaskLevels:w(w([],b(null!==(s=h.urlMaskLevels)&&void 0!==s?s:[]),!1),b(null!==(a=f.urlMaskLevels)&&void 0!==a?a:[]),!1)},S=t(t({},(v=function(e){var t,r,n,i,o,s,a,l,u,c={};"string"==typeof e.blockSelector&&(e.blockSelector=[e.blockSelector]);try{for(var d=y(null!==(a=e.blockSelector)&&void 0!==a?a:[]),h=d.next();!h.done;h=d.next()){c[h.value]="block"}}catch(e){t={error:e}}finally{try{h&&!h.done&&(r=d.return)&&r.call(d)}finally{if(t)throw t.error}}try{for(var p=y(null!==(l=e.maskSelector)&&void 0!==l?l:[]),f=p.next();!f.done;f=p.next()){c[f.value]="mask"}}catch(e){n={error:e}}finally{try{f&&!f.done&&(i=p.return)&&i.call(p)}finally{if(n)throw n.error}}try{for(var g=y(null!==(u=e.unmaskSelector)&&void 0!==u?u:[]),v=g.next();!v.done;v=g.next()){c[v.value]="unmask"}}catch(e){o={error:e}}finally{try{v&&!v.done&&(s=g.return)&&s.call(g)}finally{if(o)throw o.error}}return c})(f)),v(h));try{for(E=y(Object.entries(S)),k=E.next();!k.done;k=E.next())x=b(k.value,2),C=x[0],"mask"===(I=x[1])?g.maskSelector.push(C):"block"===I?g.blockSelector.push(C):"unmask"===I&&g.unmaskSelector.push(C)}catch(e){O={error:e}}finally{try{k&&!k.done&&(T=E.return)&&T.call(E)}finally{if(O)throw O.error}}l.privacyConfig=ko(g,this.localConfig.loggerProvider)}return p&&Object.keys(p).length>0&&(l.targetingConfig=p),this.localConfig.loggerProvider.debug(JSON.stringify({name:"session replay joined config",config:fo(l)},null,2)),[2,{localConfig:this.localConfig,joinedConfig:l,remoteConfig:u}]}})})},e.prototype.sanitizeMinSessionDurationMs=function(e){if("number"==typeof e&&Number.isFinite(e)){if(!(e<0))return e>Co?(this.localConfig.loggerProvider.warn("min_session_duration_ms remote value ".concat(e," exceeds ").concat(Co,"ms ceiling; clamping.")),Co):e;this.localConfig.loggerProvider.warn("min_session_duration_ms remote value is negative (".concat(e,"); ignoring."))}else this.localConfig.loggerProvider.warn("min_session_duration_ms remote value is not a finite number (got ".concat(String(e),"); ignoring."))},e}(),Co=6e4,Io=function(e,t){return v(void 0,void 0,void 0,function(){var r,n;return m(this,function(i){return r=new vo(e,t),n=new Ar(e,r.loggerProvider,r.serverZone,t.configServerUrl),[2,new xo(n,r)]})})}}});function _o(e){if(e.type!==wo.IncrementalSnapshot)return!1;var t=e.data;return t.source===So.Mutation&&!t.isAttachIframe}function Ro(e){var r,n,i,o,s=e[0],a=new Map,l=new Map,u=new Map,c=new Map,d=new Map;e.forEach(function(e,t){var r,n,i,o,s=e.data;try{for(var h=y(s.adds),p=h.next();!p.done;p=h.next()){var f=p.value;a.has(f.node.id)||a.set(f.node.id,t),l.set(f.node.id,t),d.set(f.node.id,f.parentId)}}catch(e){r={error:e}}finally{try{p&&!p.done&&(n=h.return)&&n.call(h)}finally{if(r)throw r.error}}try{for(var g=y(s.removes),v=g.next();!v.done;v=g.next()){var m=v.value;u.has(m.id)||u.set(m.id,t),c.set(m.id,t)}}catch(e){i={error:e}}finally{try{v&&!v.done&&(o=g.return)&&o.call(g)}finally{if(i)throw i.error}}});var h=new Set,p=new Set;try{for(var f=y(a),g=f.next();!g.done;g=f.next()){var v=b(g.value,2),m=v[0],w=v[1],S=u.get(m);if(void 0!==S)l.get(m)>=c.get(m)||(w<S?h.add(m):S<w&&p.add(m))}}catch(e){r={error:e}}finally{try{g&&!g.done&&(n=f.return)&&n.call(f)}finally{if(r)throw r.error}}var E=new Set;if(h.size>0||p.size>0)for(var k=!0;k;){k=!1;try{for(var x=(i=void 0,y(d)),C=x.next();!C.done;C=x.next()){var I=b(C.value,2),O=I[0],T=I[1];if(!h.has(O)&&!p.has(O)&&!E.has(O)&&(h.has(T)||p.has(T)||E.has(T))){var A=u.get(O),_=a.get(O);void 0!==A&&void 0!==_&&A<_?p.add(O):void 0!==A&&void 0!==_&&A===_?E.add(O):h.add(O),k=!0}}}catch(e){i={error:e}}finally{try{C&&!C.done&&(o=x.return)&&o.call(x)}finally{if(i)throw i.error}}}var R=h.size>0||p.size>0||E.size>0,P=[];e.forEach(function(e,t){var r,n;try{for(var i=y(e.data.removes),o=i.next();!o.done;o=i.next()){var s=o.value;h.has(s.id)||(p.has(s.id)&&t>=a.get(s.id)||E.has(s.id)&&(h.has(s.parentId)||p.has(s.parentId)||E.has(s.parentId))||P.push(s))}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}});var M=e.flatMap(function(e){return e.data.adds}),N=e.flatMap(function(e){return e.data.texts}),L=e.flatMap(function(e){return e.data.attributes}),D={source:So.Mutation,removes:P,adds:R?M.filter(function(e){return!h.has(e.node.id)&&!p.has(e.node.id)&&!E.has(e.node.id)}):M,texts:R?N.filter(function(e){return!h.has(e.id)&&!p.has(e.id)&&!E.has(e.id)}):N,attributes:R?L.filter(function(e){return!h.has(e.id)&&!p.has(e.id)&&!E.has(e.id)}):L};return t(t({},s),{data:D})}function Po(e){if(e.length<=1)return e;for(var t=[],r=0;r<e.length;)if(_o(e[r])){for(var n=r+1;n<e.length&&_o(e[n]);)n++;t.push(n>r+1?Ro(e.slice(r,n)):e[r]),r=n}else t.push(e[r]),r++;return t}var Mo,No,Lo,Do,jo,Uo,Fo,Bo,qo,zo=l({"../../../../node_modules/@amplitude/session-replay-browser/lib/esm/events/merge-mutation-events.js"(){Ne(),To()}}),Vo=l({"../../../../node_modules/@amplitude/session-replay-browser/lib/esm/events/event-compressor.js"(){Ne(),Ki(),To(),Ji(),zo(),Mo=function(){function e(e,t,r,n,i){var o,s=this;this.taskQueue=[],this.pendingQueue=[],this.isProcessing=!1,this.compressEvent=function(e){var t=e,r=t.type,n=t.timestamp,i=t.delay,o=t.data;return null!=i?JSON.stringify({type:r,timestamp:n,delay:i,data:o}):JSON.stringify({type:r,timestamp:n,data:o})},this.addCompressedEventToManager=function(e,t){var r=new Blob([e]).size;r>Ti?s.config.loggerProvider.warn("Session replay event dropped: serialized size ".concat(Math.round(r/1024)," KB exceeds maximum allowed event size. If this recurs, please open a GitHub issue at https://github.com/amplitude/Amplitude-TypeScript/issues or contact Amplitude support.")):s.eventsManager&&s.deviceId&&s.eventsManager.addEvent({event:{type:"replay",data:e},sessionId:t,deviceId:s.deviceId})},this.addCompressedEvent=function(e,t){if(s.worker)try{s.worker.postMessage({event:e,sessionId:t})}catch(r){"DataCloneError"===r.name?s.worker.postMessage(JSON.stringify({event:e,sessionId:t})):s.config.loggerProvider.warn("Unexpected error while posting message to worker:",r)}else{var r=s.compressEvent(e);s.addCompressedEventToManager(r,t)}},this.flushQueue=function(){var e;for(s.pendingQueue.length>0&&(e=s.taskQueue).push.apply(e,w([],b(s.mergeMutationTasks(s.pendingQueue.splice(0))),!1));s.taskQueue.length>0;){var t=s.taskQueue.shift();if(t){var r=t.event,n=t.sessionId,i=s.compressEvent(r);s.addCompressedEventToManager(i,n)}}s.isProcessing=!1},this.terminate=function(){var e;null===(e=s.worker)||void 0===e||e.terminate()};var a=de();if(this.canUseIdleCallback=a&&"requestIdleCallback"in a,this.eventsManager=e,this.config=t,this.deviceId=r,this.timeout=(null===(o=t.performanceConfig)||void 0===o?void 0:o.timeout)||2e3,this.onFullSnapshotProcessed=i,n){t.loggerProvider.log("Enabling web worker for compression");try{var l=new Blob([n],{type:"application/javascript"}),u=URL.createObjectURL(l),c=new Worker(u);c.onerror=function(e){e.preventDefault(),t.loggerProvider.error("Worker failed, falling back to non-worker compression: ".concat(e.message," (").concat(e.filename,":").concat(e.lineno,")")),c.terminate(),s.worker=void 0},c.onmessage=function(e){var t=e.data,r=t.compressedEvent,n=t.sessionId;s.addCompressedEventToManager(r,n)},this.worker=c}catch(e){t.loggerProvider.error("Failed to create worker, falling back to non-worker compression:",e)}}}return e.prototype.scheduleIdleProcessing=function(){var e=this;this.isProcessing||(this.isProcessing=!0,requestIdleCallback(function(t){e.processQueue(t)},{timeout:this.timeout}))},e.prototype.enqueueEvent=function(e,t){var r,n,i,o;if(e.type===wo.FullSnapshot){if(this.config.loggerProvider.debug("Processing full snapshot immediately."),this.taskQueue.length>0||this.pendingQueue.length>0){var s=w(w([],b(this.taskQueue.splice(0)),!1),b(this.mergeMutationTasks(this.pendingQueue.splice(0))),!1);try{for(var a=y(s),l=a.next();!l.done;l=a.next()){var u=l.value,c=this.compressEvent(u.event);this.addCompressedEventToManager(c,u.sessionId)}}catch(e){r={error:e}}finally{try{l&&!l.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}this.isProcessing=!1}var d=this.compressEvent(e);return this.addCompressedEventToManager(d,t),void(null===(i=this.onFullSnapshotProcessed)||void 0===i||i.call(this))}this.canUseIdleCallback&&(null===(o=this.config.performanceConfig)||void 0===o?void 0:o.enabled)?(this.config.loggerProvider.debug("Enqueuing event for processing during idle time."),this.pendingQueue.push({event:e,sessionId:t}),this.scheduleIdleProcessing()):(this.config.loggerProvider.debug("Processing event without idle callback."),this.addCompressedEvent(e,t))},e.prototype.processQueue=function(e){var t,r=this;for(this.pendingQueue.length>0&&(t=this.taskQueue).push.apply(t,w([],b(this.mergeMutationTasks(this.pendingQueue.splice(0))),!1));this.taskQueue.length>0&&(e.timeRemaining()>0||e.didTimeout);){var n=this.taskQueue.shift();if(n){var i=n.event,o=n.sessionId;this.addCompressedEvent(i,o)}}this.taskQueue.length>0||this.pendingQueue.length>0?requestIdleCallback(function(e){r.processQueue(e)},{timeout:this.timeout}):this.isProcessing=!1},e.prototype.mergeMutationTasks=function(e){var t,r,n;if(!(null===(n=this.config.performanceConfig)||void 0===n?void 0:n.mergeMutations))return e;if(e.length<=1)return e;for(var i=[],o=0;o<e.length;){for(var s=e[o].sessionId,a=o+1;a<e.length&&e[a].sessionId===s;)a++;var l=Po(e.slice(o,a).map(function(e){return e.event}));try{for(var u=(t=void 0,y(l)),c=u.next();!c.done;c=u.next()){var d=c.value;i.push({event:d,sessionId:s})}}catch(e){t={error:e}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(t)throw t.error}}o=a}return i},e}()}}),Wo=l({"../../../../node_modules/@amplitude/session-replay-browser/lib/esm/messages.js"(){No="Unexpected error occurred",Lo="Network error occurred, event batch rejected",Do="Session replay event batch rejected due to exceeded retry count",jo="Failed to store session replay events in IndexedDB",Uo="Session replay event batch not sent due to missing device ID",Fo="Session replay event batch not sent due to missing api key",Bo="Session replay event batch dropped: server signalled capture disabled or session out of valid range for this session"}}),Ho=l({"../../../../node_modules/@amplitude/session-replay-browser/lib/esm/version.js"(){qo="1.44.0"}});function $o(e,t){return v(this,void 0,void 0,function(){var r,n,i,o,s,a,l,u,c,d,h,p,f,g,b=this;return m(this,function(w){switch(w.label){case 0:return w.trys.push([0,4,,5]),r=t.CompressionStream,n=new r("gzip"),i=n.writable.getWriter(),o=n.readable.getReader(),s=[],a=v(b,void 0,void 0,function(){var e,t,r;return m(this,function(n){switch(n.label){case 0:return[4,o.read()];case 1:if(e=n.sent(),t=e.done,r=e.value,t)return[3,3];s.push(r),n.label=2;case 2:return[3,0];case 3:return[2]}})}),[4,i.write((new TextEncoder).encode(e))];case 1:return w.sent(),[4,i.close()];case 2:return w.sent(),[4,a];case 3:w.sent(),l=s.reduce(function(e,t){return e+t.length},0),u=new Uint8Array(l),c=0;try{for(d=y(s),h=d.next();!h.done;h=d.next())p=h.value,u.set(p,c),c+=p.length}catch(e){f={error:e}}finally{try{h&&!h.done&&(g=d.return)&&g.call(d)}finally{if(f)throw f.error}}return[2,u];case 4:return w.sent(),[2,null];case 5:return[2]}})})}var Go,Ko,Jo,Qo,Yo,Xo,Zo,es,ts,rs,ns,is,os,ss,as,ls,us,cs=l({"../../../../node_modules/@amplitude/session-replay-browser/lib/esm/utils/gzip.js"(){Ne()}}),ds=l({"../../../../node_modules/@amplitude/session-replay-browser/lib/esm/track-destination.js"(){Ne(),Ki(),bo(),Wo(),Ho(),Ji(),cs(),Go=function(){function e(e){var t=e.trackServerUrl,r=e.loggerProvider,n=e.payloadBatcher,i=e.workerScript,o=this;if(this.storageKey="",this.retryTimeout=1e3,this.scheduled=null,this.queue=[],this.sendIdCounter=0,this.pendingWorkerRequests=new Map,this.flushPauseUntilMs=0,this.mergeOnNextFlush=!1,this.mergeLogFiredThisPause=!1,this.killedSessions=new Set,this.loggerProvider=r,this.payloadBatcher=n||function(e){return e},this.trackServerUrl=t,i)try{var s=new Blob([i],{type:"application/javascript"}),a=URL.createObjectURL(s),l=new Worker(a);l.onerror=function(e){var t,n;e.preventDefault(),r.error("Track destination worker failed, falling back to main-thread sending: ".concat(e.message," (").concat(e.filename,":").concat(e.lineno,")")),l.terminate(),o.worker=void 0;try{for(var i=y(o.pendingWorkerRequests),s=i.next();!s.done;s=i.next()){var a=b(s.value,2)[1];r.warn("Session replay event send failed due to worker crash: ".concat(e.message)),a.resolve()}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}o.pendingWorkerRequests.clear()},l.onmessage=function(e){var t=e.data;if("log"===t.type)r.log(t.message);else if("warn"===t.type)r.warn(t.message);else if("payload_too_large"===t.type){var n=o.pendingWorkerRequests.get(t.id);n&&(o.handlePayloadTooLargeResponse(n.context,t.isWaf),n.resolve(),o.pendingWorkerRequests.delete(t.id))}else if("complete"===t.type){var i=o.pendingWorkerRequests.get(t.id);i&&(void 0!==t.skipCode&&o.applyServerDirective(i.context.sessionId,t.skipCode),o.completeRequest({context:i.context}),i.resolve(),o.pendingWorkerRequests.delete(t.id))}},this.worker=l}catch(e){r.error("Failed to create track destination worker, falling back to main-thread sending:",e)}}return e.prototype.sendEventsList=function(e){this.addToQueue(t(t({},e),{attempts:0,timeout:0}))},e.prototype.sendBeacon=function(e){var t,r,n=e.events,i=e.sessionId,o=e.deviceId,s=e.apiKey,a=e.serverZone,l=function(e){return new Blob([e]).size},u=n,c=JSON.stringify({version:2,events:u});if(l(c)>65536){for(var d=0,h=u.length;d<h;){var p=Math.floor((d+h+1)/2);l(JSON.stringify({version:2,events:u.slice(0,p)}))<=65536?d=p:h=p-1}u=u.slice(0,d),c=JSON.stringify({version:2,events:u}),this.loggerProvider.warn("sendBeacon payload exceeded 64 KB limit, trimmed from ".concat(n.length," to ").concat(u.length," events"))}if(0!==u.length){var f=new URLSearchParams({device_id:o,session_id:String(i),type:"replay",api_key:s}),g="".concat(Zi(a,this.trackServerUrl),"?").concat(f.toString()),v=de();try{var m=new Blob([c],{type:"application/json"});!1===(null===(r=null===(t=null==v?void 0:v.navigator)||void 0===t?void 0:t.sendBeacon)||void 0===r?void 0:r.call(t,g,m))&&this.loggerProvider.warn("sendBeacon failed to queue session replay payload")}catch(e){}}},e.prototype.addToQueue=function(){for(var e=this,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];t.filter(function(t){return e.killedSessions.has(t.sessionId)?(e.completeRequest({context:t,err:Bo}),!1):t.attempts<(t.flushMaxRetries||0)?(t.attempts+=1,!0):(e.completeRequest({context:t,err:Do}),!1)}).forEach(function(t){e.queue=e.queue.concat(t),e.schedule(0)})},e.prototype.schedule=function(e){var t=this;if(!this.scheduled){var r=this.flushPauseUntilMs-Date.now(),n=r>e?r:e;r>0&&(this.mergeOnNextFlush=!0),this.scheduled=setTimeout(function(){t.flush(!0).then(function(){t.queue.length>0&&t.schedule(e)})},n)}},e.prototype.flush=function(e){return void 0===e&&(e=!1),v(this,void 0,void 0,function(){var t,r,n,i,o,s,a;return m(this,function(l){switch(l.label){case 0:t=this.queue,this.queue=[],this.scheduled&&(clearTimeout(this.scheduled),this.scheduled=null),this.mergeOnNextFlush&&(this.mergeOnNextFlush=!1,t=this.mergeQueueAfterThrottle(t)),l.label=1;case 1:l.trys.push([1,6,7,8]),r=y(t),n=r.next(),l.label=2;case 2:return n.done?[3,5]:(i=n.value,[4,this.send(i,e)]);case 3:l.sent(),l.label=4;case 4:return n=r.next(),[3,2];case 5:return[3,8];case 6:return o=l.sent(),s={error:o},[3,8];case 7:try{n&&!n.done&&(a=r.return)&&a.call(r)}finally{if(s)throw s.error}return[7];case 8:return[2]}})})},e.prototype.mergeQueueAfterThrottle=function(e){var r,n,i,o,s,a,l,u,c,d,h,p=this;if(e.length<=1)return e;var f=new Map;try{for(var g=y(e),S=g.next();!S.done;S=g.next()){var E=S.value,k=[E.sessionId,null!==(s=E.deviceId)&&void 0!==s?s:"",null!==(a=E.apiKey)&&void 0!==a?a:"",E.type,null!==(l=E.serverZone)&&void 0!==l?l:"",E.sampleRate,null!==(c=null===(u=E.version)||void 0===u?void 0:u.type)&&void 0!==c?c:"",null!==(h=null===(d=E.version)||void 0===d?void 0:d.version)&&void 0!==h?h:""].join("|"),x=f.get(k);x?x.push(E):f.set(k,[E])}}catch(e){r={error:e}}finally{try{S&&!S.done&&(n=g.return)&&n.call(g)}finally{if(r)throw r.error}}var C=[],I=function(e){var r,n;if(1===e.length)return C.push(e[0]),"continue";var i=null,o=0,s=function(){i&&C.push(i),i=null,o=0},a=function(e){var r=e.events.reduce(function(e,t){return e+new Blob([t]).size},0);if(null===i)return i=t(t({},e),{events:w([],b(e.events),!1),attempts:0}),o=r,"continue";if(o+r>zi)return s(),i=t(t({},e),{events:w([],b(e.events),!1),attempts:0}),o=r,"continue";var n=i.onComplete,a=e.onComplete;i.events=i.events.concat(e.events),o+=r,i.onComplete=function(){return v(p,void 0,void 0,function(){return m(this,function(e){switch(e.label){case 0:return[4,Promise.allSettled([n(),a()])];case 1:return e.sent(),[2]}})})}};try{for(var l=(r=void 0,y(e)),u=l.next();!u.done;u=l.next()){a(u.value)}}catch(e){r={error:e}}finally{try{u&&!u.done&&(n=l.return)&&n.call(l)}finally{if(r)throw r.error}}s()};try{for(var O=y(f.values()),T=O.next();!T.done;T=O.next()){I(T.value)}}catch(e){i={error:e}}finally{try{T&&!T.done&&(o=O.return)&&o.call(O)}finally{if(i)throw i.error}}return C.length<e.length&&!this.mergeLogFiredThisPause&&(this.mergeLogFiredThisPause=!0,this.loggerProvider.log("Session replay throttle pause ended; merged ".concat(e.length," queued batches into ").concat(C.length," request(s)"))),C},e.prototype.send=function(e,t){return void 0===t&&(t=!0),v(this,void 0,void 0,function(){var r,n,i,o;return m(this,function(s){return this.killedSessions.has(e.sessionId)?[2,this.completeRequest({context:e,err:Bo})]:(r=e.apiKey)?(n=e.deviceId)?0===(i=this.payloadBatcher({version:1,events:e.events})).events.length?(this.completeRequest({context:e}),[2]):(o=this.worker)?[2,this.sendViaWorker(o,e,i,t)]:[2,this.sendOnMainThread(r,n,e,i,t)]:[2,this.completeRequest({context:e,err:Uo})]:[2,this.completeRequest({context:e,err:Fo})]})})},e.prototype.sendViaWorker=function(e,t,r,n){return v(this,void 0,void 0,function(){var i,o=this;return m(this,function(s){return i="".concat(++this.sendIdCounter),[2,new Promise(function(s){var a;o.pendingWorkerRequests.set(i,{context:t,resolve:s}),e.postMessage({type:"send",id:i,payload:r,useRetry:n,context:{apiKey:t.apiKey,deviceId:t.deviceId,sessionId:t.sessionId,events:t.events,eventType:t.type,flushMaxRetries:null!==(a=t.flushMaxRetries)&&void 0!==a?a:0,sampleRate:t.sampleRate,serverZone:t.serverZone,trackServerUrl:o.trackServerUrl,version:t.version,currentUrl:oo(),sdkVersion:qo}})})]})})},e.prototype.sendOnMainThread=function(e,r,n,i,o){var s,a,l,u,c,d,h;return v(this,void 0,void 0,function(){var p,f,g,v,y,b,w,S,E,k,x,C,I,O,T,A;return m(this,function(m){switch(m.label){case 0:p=oo(),f=qo,g=n.sampleRate,v=new URLSearchParams({device_id:r,session_id:"".concat(n.sessionId),type:"".concat(n.type)}),y="".concat(null!==(a=null===(s=n.version)||void 0===s?void 0:s.type)&&void 0!==a?a:"standalone","/").concat(null!==(u=null===(l=n.version)||void 0===l?void 0:l.version)&&void 0!==u?u:f),m.label=1;case 1:return m.trys.push([1,13,,14]),b=JSON.stringify(i),(w=de())&&"CompressionStream"in w?[4,$o(b,w)]:[3,3];case 2:return E=m.sent(),[3,4];case 3:E=null,m.label=4;case 4:return k=(S=E)?S.byteLength:new Blob([b]).size,x={headers:t({"Content-Type":"application/json",Accept:"*/*",Authorization:"Bearer ".concat(e),"X-Client-Version":f,"X-Client-Library":y,"X-Client-Url":p.substring(0,Li),"X-Client-Sample-Rate":"".concat(g),"X-Sampling-Hash-Alg":"xxhash32"},S?{"Content-Encoding":"gzip"}:{}),body:null!=S?S:b,method:"POST",keepalive:k<=Di},C="".concat(Zi(n.serverZone,this.trackServerUrl),"?").concat(v.toString()),0===i.events.length?(this.completeRequest({context:n}),[2]):[4,fetch(C,x)];case 5:if(null===(I=m.sent()))return this.completeRequest({context:n,err:No}),[2];if(I.status>=200&&I.status<300&&(O=null!==(h=null===(d=null===(c=I.headers)||void 0===c?void 0:c.get)||void 0===d?void 0:d.call(c,ji))&&void 0!==h?h:null,this.applyServerDirective(n.sessionId,O)),o)return[3,6];T="";try{T=JSON.stringify(I.body,null,2)}catch(e){}return this.completeRequest({context:n,success:"".concat(I.status,": ").concat(T)}),[3,12];case 6:if(T="",413!==I.status)return[3,10];m.label=7;case 7:return m.trys.push([7,9,,10]),[4,I.text()];case 8:return T=m.sent(),[3,10];case 9:return m.sent(),[3,10];case 10:return[4,this.handleReponse(I.status,n,T)];case 11:m.sent(),m.label=12;case 12:return[3,14];case 13:return A=m.sent(),this.completeRequest({context:n,err:A}),[3,14];case 14:return[2]}})})},e.prototype.handleReponse=function(e,t,r){return void 0===r&&(r=""),v(this,void 0,void 0,function(){var n;return m(this,function(i){switch(i.label){case 0:switch(n=(new nr).buildStatus(e),n){case ue.Success:return[3,1];case ue.Failed:case ue.Timeout:case ue.RateLimit:return[3,2];case ue.PayloadTooLarge:return[3,4]}return[3,5];case 1:return this.handleSuccessResponse(t),[3,8];case 2:return[4,this.handleOtherResponse(t)];case 3:return i.sent(),[3,8];case 4:return this.handlePayloadTooLargeResponse(t,Ai.test(r)),[3,8];case 5:return 499!==e?[3,7]:[4,this.handleOtherResponse(t)];case 6:return i.sent(),[3,8];case 7:this.completeRequest({context:t,err:Lo}),i.label=8;case 8:return[2]}})})},e.prototype.handlePayloadTooLargeResponse=function(e,r){var n=r?"WAF (compressed payload too large)":"server (event too large)",i=Math.round(e.events.reduce(function(e,t){return e+t.length},0)/Ni);if(r)if(1!==e.events.length){this.loggerProvider.warn("Session replay event batch rejected by ".concat(n," (").concat(e.events.length," events, ").concat(i," KB total) — splitting and retrying")),e.onComplete();var o=function(){return Promise.resolve()},s=Math.floor(e.events.length/2);this.sendEventsList(t(t({},e),{events:e.events.slice(0,s),onComplete:o})),this.sendEventsList(t(t({},e),{events:e.events.slice(s),onComplete:o}))}else this.completeRequest({context:e,err:"Session replay event dropped: single event (".concat(i," KB, 1 event) rejected by ").concat(n," — cannot split further")});else this.completeRequest({context:e,err:"Session replay event batch dropped: ".concat(n," rejected payload (").concat(e.events.length," events, ").concat(i," KB) — not retrying non-WAF 413")})},e.prototype.handleSuccessResponse=function(e){var t=Math.round(new Blob(e.events).size/Ni);this.completeRequest({context:e,success:"Session replay event batch tracked successfully for session id ".concat(e.sessionId,", size of events: ").concat(t," KB")})},e.prototype.handleOtherResponse=function(e){return v(this,void 0,void 0,function(){var t;return m(this,function(r){switch(r.label){case 0:return t=Math.random()*e.attempts*this.retryTimeout,e.attempts++,e.attempts>(e.flushMaxRetries||0)?(this.completeRequest({context:e,err:Do}),[2]):[4,new Promise(function(e){return setTimeout(e,t)})];case 1:return r.sent(),[4,this.send(e,!0)];case 2:return r.sent(),[2]}})})},e.prototype.completeRequest=function(e){var t=e.context,r=e.err,n=e.success;t.onComplete(),r?this.loggerProvider.warn(r):n&&this.loggerProvider.log(n)},e.prototype.applyServerDirective=function(e,t){if(null===t)return this.flushPauseUntilMs=0,void(this.mergeLogFiredThisPause=!1);if(t===Ui){var r=this.flushPauseUntilMs>Date.now();return this.flushPauseUntilMs=Date.now()+qi,void(r||this.loggerProvider.log("Session replay throttled by server; pausing flush schedule for ".concat(qi/1e3,"s")))}t!==Bi&&t!==Fi||this.killSession(e,t)},e.prototype.killSession=function(e,t){var r,n,i,o;if(!this.killedSessions.has(e)){if(this.killedSessions.add(e),this.killedSessions.size>256)try{for(var s=y(this.killedSessions),a=s.next();!a.done;a=s.next()){var l=a.value;this.killedSessions.delete(l);break}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}this.loggerProvider.log("Session replay capture stopped for session ".concat(e," by server directive ").concat(t,"; remaining events will be dropped"));var u=[];try{for(var c=y(this.queue),d=c.next();!d.done;d=c.next()){var h=d.value;h.sessionId===e?this.completeRequest({context:h,err:Bo}):u.push(h)}}catch(e){i={error:e}}finally{try{d&&!d.done&&(o=c.return)&&o.call(c)}finally{if(i)throw i.error}}this.queue=u}},e}()}});function hs(e){es=e(es)}function ps(e){return(Qo||(Qo=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(ts(this),t),gs(this.request)}:function(...t){return gs(e.apply(ts(this),t))}}function fs(e){return"function"==typeof e?ps(e):(e instanceof IDBTransaction&&function(e){if(Yo.has(e))return;const t=new Promise((t,r)=>{const n=()=>{e.removeEventListener("complete",i),e.removeEventListener("error",o),e.removeEventListener("abort",o)},i=()=>{t(),n()},o=()=>{r(e.error||new DOMException("AbortError","AbortError")),n()};e.addEventListener("complete",i),e.addEventListener("error",o),e.addEventListener("abort",o)});Yo.set(e,t)}(e),Ko(e,Jo||(Jo=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,es):e)}function gs(e){if(e instanceof IDBRequest)return function(e){const t=new Promise((t,r)=>{const n=()=>{e.removeEventListener("success",i),e.removeEventListener("error",o)},i=()=>{t(gs(e.result)),n()},o=()=>{r(e.error),n()};e.addEventListener("success",i),e.addEventListener("error",o)});return Zo.set(t,e),t}(e);if(Xo.has(e))return Xo.get(e);const t=fs(e);return t!==e&&(Xo.set(e,t),Zo.set(t,e)),t}function vs(e,t,{blocked:r,upgrade:n,blocking:i,terminated:o}={}){const s=indexedDB.open(e,t),a=gs(s);return n&&s.addEventListener("upgradeneeded",e=>{n(gs(s.result),e.oldVersion,e.newVersion,gs(s.transaction),e)}),r&&s.addEventListener("blocked",e=>r(e.oldVersion,e.newVersion,e)),a.then(e=>{o&&e.addEventListener("close",()=>o()),i&&e.addEventListener("versionchange",e=>i(e.oldVersion,e.newVersion,e))}).catch(()=>{}),a}function ms(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(is.get(t))return is.get(t);const r=t.replace(/FromIndex$/,""),n=t!==r,i=ns.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!i&&!rs.includes(r))return;const o=async function(e,...t){const o=this.transaction(e,i?"readwrite":"readonly");let s=o.store;return n&&(s=s.index(t.shift())),(await Promise.all([s[r](...t),i&&o.done]))[0]};return is.set(t,o),o}async function*ys(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;const r=new Proxy(t,us);for(ls.set(r,t),Zo.set(r,ts(t));t;)yield r,t=await(as.get(r)||t.continue()),as.delete(r)}function bs(e,t){return t===Symbol.asyncIterator&&Ko(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===t&&Ko(e,[IDBIndex,IDBObjectStore])}var ws,Ss,Es,ks,xs,Cs,Is,Os,Ts,As=l({"../../../../node_modules/idb/build/index.js"(){Ko=(e,t)=>t.some(t=>e instanceof t),Yo=new WeakMap,Xo=new WeakMap,Zo=new WeakMap,es={get(e,t,r){if(e instanceof IDBTransaction){if("done"===t)return Yo.get(e);if("store"===t)return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return gs(e[t])},set:(e,t,r)=>(e[t]=r,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e},ts=e=>Zo.get(e),rs=["get","getKey","getAll","getAllKeys","count"],ns=["put","add","delete","clear"],is=new Map,hs(e=>({...e,get:(t,r,n)=>ms(t,r)||e.get(t,r,n),has:(t,r)=>!!ms(t,r)||e.has(t,r)})),os=["continue","continuePrimaryKey","advance"],ss={},as=new WeakMap,ls=new WeakMap,us={get(e,t){if(!os.includes(t))return e[t];let r=ss[t];return r||(r=ss[t]=function(...e){as.set(this,ls.get(this)[t](...e))}),r}},hs(e=>({...e,get:(t,r,n)=>bs(t,r)?ys:e.get(t,r,n),has:(t,r)=>bs(t,r)||e.has(t,r)}))}}),_s=l({"../../../../node_modules/@amplitude/session-replay-browser/lib/esm/events/base-events-store.js"(){Ne(),Ji(),ws=function(){function e(e){var t,r,n,i=this;this.minInterval=Pi,this.maxInterval=Mi,this.maxPersistedEventsSize=Oi,this._timeAtLastSplit=Date.now(),this.shouldSplitEventsList=function(e,t){var r=i.getStringSize(t);return i.getEventsArraySize(e)+r>=i.maxPersistedEventsSize||!!(Date.now()-i.timeAtLastSplit>i.interval&&e.length)&&(i.interval=Math.min(i.maxInterval,i.interval+i.minInterval),i._timeAtLastSplit=Date.now(),!0)},this.loggerProvider=e.loggerProvider,this.minInterval=null!==(t=e.minInterval)&&void 0!==t?t:this.minInterval,this.maxInterval=null!==(r=e.maxInterval)&&void 0!==r?r:this.maxInterval,this.maxPersistedEventsSize=null!==(n=e.maxPersistedEventsSize)&&void 0!==n?n:this.maxPersistedEventsSize,this.interval=this.minInterval}return Object.defineProperty(e.prototype,"timeAtLastSplit",{get:function(){return this._timeAtLastSplit},enumerable:!1,configurable:!0}),e.prototype.getStringSize=function(e){for(var t=0,r=0;r<e.length;r++){var n=e.charCodeAt(r);if(n<=127)t++;else if(n<=2047)t+=2;else if(n>=55296&&n<=56319){var i=r+1<e.length?e.charCodeAt(r+1):NaN;i>=56320&&i<=57343?(t+=4,r++):t+=3}else t+=3}return t},e.prototype.getEventsArraySize=function(e){var t,r,n=0;try{for(var i=y(e),o=i.next();!o.done;o=i.next()){var s=o.value;n+=this.getStringSize(s)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return n+(2+Math.max(0,e.length-1)+2*e.length)},e}()}}),Rs=l({"../../../../node_modules/@amplitude/session-replay-browser/lib/esm/utils/is-abort-error.js"(){Ss=function(e){return"object"==typeof e&&null!==e&&"AbortError"===e.name},Es=function(e,t,r){Ss(r)?e.debug(t):e.warn(t)}}});function Ps(e,t,r){var n=setTimeout(r,t);return e.then(function(){return clearTimeout(n)},function(){return clearTimeout(n)}),function(){return clearTimeout(n)}}var Ms,Ns,Ls,Ds,js,Us,Fs=l({"../../../../node_modules/@amplitude/session-replay-browser/lib/esm/events/events-idb-store.js"(){Ne(),As(),Wo(),_s(),Rs(),ks="sessionCurrentSequence",xs="sequencesToSend",Cs=5e3,Is=function(e){var t,r;return e.objectStoreNames.contains(ks)||(r=e.createObjectStore(ks,{keyPath:"sessionId"})),e.objectStoreNames.contains(xs)||(t=e.createObjectStore(xs,{keyPath:"sequenceId",autoIncrement:!0})).createIndex("sessionId","sessionId"),{sequencesStore:t,currentSequenceStore:r}},Os=function(e){return v(void 0,void 0,void 0,function(){return m(this,function(t){switch(t.label){case 0:return[4,(r=vs(e,1,{upgrade:Is}),n=2e3,i="IDB openDB timed out",void 0===i&&(i="IDB operation timed out"),new Promise(function(e,t){var o=setTimeout(function(){return t(new Error("".concat(i," after ").concat(n,"ms")))},n);r.then(function(t){clearTimeout(o),e(t)},function(e){clearTimeout(o),t(e)})}))];case 1:return[2,t.sent()]}var r,n,i})})},Ts=function(e){function r(r){var n,i=this;return(i=e.call(this,r)||this).consecutiveFailures=0,i.hasTriggeredFallback=!1,i.emptyFilteredCount=0,i.getSequencesToSend=function(){return v(i,void 0,void 0,function(){var e,t,r,n,i,o,s,a,l,u,c=this;return m(this,function(d){switch(d.label){case 0:e=!1,t=!1,d.label=1;case 1:return d.trys.push([1,9,,10]),r=[],(n=this.db.transaction("sequencesToSend","readwrite")).done.catch(function(r){e||t||(Es(c.loggerProvider,"".concat(jo,": ").concat(r),r),c.recordFailure())}),i=Ps(n.done,Cs,function(){e||t||(t=!0,Es(c.loggerProvider,"".concat(jo,": transaction timed out")),c.recordFailure())}),[4,n.store.openCursor()];case 2:o=d.sent(),d.label=3;case 3:return o?(s=o.value,a=s.sessionId,0!==(l=s.events).length?[3,5]:(this.maybeLogEmptyFiltered("getSequencesToSend"),[4,o.delete()])):[3,8];case 4:return d.sent(),[3,6];case 5:r.push({events:l,sequenceId:o.key,sessionId:a}),d.label=6;case 6:return[4,o.continue()];case 7:return o=d.sent(),[3,3];case 8:return this.recordSuccess(),i(),[2,r];case 9:return u=d.sent(),t||(e=!0,Es(this.loggerProvider,"".concat(jo,": ").concat(u),u),this.recordFailure()),[3,10];case 10:return[2,void 0]}})})},i.storeCurrentSequence=function(e){return v(i,void 0,void 0,function(){var r,n,i,o,s,a,l,u,c=this;return m(this,function(d){switch(d.label){case 0:r=!1,n=!1,d.label=1;case 1:return d.trys.push([1,5,,6]),(i=this.db.transaction([ks,xs],"readwrite")).done.catch(function(e){r||n||(Es(c.loggerProvider,"".concat(jo,": ").concat(e),e),c.recordFailure())}),o=Ps(i.done,Cs,function(){r||n||(n=!0,Es(c.loggerProvider,"".concat(jo,": transaction timed out")),c.recordFailure())}),[4,i.objectStore(ks).get(e)];case 2:return!(s=d.sent())||s.tabId&&s.tabId!==this.tabId?(o(),[2,void 0]):0===s.events.length?(this.maybeLogEmptyFiltered("storeCurrentSequence"),o(),[2,void 0]):[4,i.objectStore(xs).put({sessionId:e,events:s.events,tabId:this.tabId})];case 3:return a=d.sent(),[4,i.objectStore(ks).put({sessionId:e,events:[],tabId:this.tabId})];case 4:return d.sent(),this.recordSuccess(),o(),s.tabId,l=g(s,["tabId"]),[2,t(t({},l),{sessionId:e,sequenceId:a})];case 5:return u=d.sent(),n||(r=!0,Es(this.loggerProvider,"".concat(jo,": ").concat(u),u),this.recordFailure()),[3,6];case 6:return[2,void 0]}})})},i.addEventToCurrentSequence=function(e,t){return v(i,void 0,void 0,function(){var r,n,i,o,s,a,l,u,c,d=this;return m(this,function(h){switch(h.label){case 0:r=!1,n=!1,h.label=1;case 1:return h.trys.push([1,15,,16]),(i=this.db.transaction([ks,xs],"readwrite")).done.catch(function(e){r||n||(Es(d.loggerProvider,"".concat(jo,": ").concat(e),e),d.recordFailure())}),o=Ps(i.done,Cs,function(){r||n||(n=!0,Es(d.loggerProvider,"".concat(jo,": transaction timed out")),d.recordFailure())}),[4,i.objectStore(ks).get(e)];case 2:return(null==(s=h.sent())?void 0:s.tabId)&&s.tabId!==this.tabId?s.events.length>0?[4,i.objectStore(xs).put({sessionId:e,events:s.events,tabId:s.tabId})]:[3,4]:[3,6];case 3:h.sent(),h.label=4;case 4:return[4,i.objectStore(ks).put({sessionId:e,events:[t],tabId:this.tabId})];case 5:return h.sent(),this.recordSuccess(),o(),[2,void 0];case 6:return(a=s)?[3,8]:[4,i.objectStore(ks).put({sessionId:e,events:[t],tabId:this.tabId})];case 7:return h.sent(),this.recordSuccess(),o(),[2,void 0];case 8:return this.shouldSplitEventsList(a.events,t)?[3,10]:[4,i.objectStore(ks).put({sessionId:e,events:a.events.concat(t),tabId:this.tabId})];case 9:return h.sent(),this.recordSuccess(),o(),[2,void 0];case 10:return 0!==(l=a.events).length?[3,12]:(this.maybeLogEmptyFiltered("addEventToCurrentSequence"),[4,i.objectStore(ks).put({sessionId:e,events:[t],tabId:this.tabId})]);case 11:return h.sent(),this.recordSuccess(),o(),[2,void 0];case 12:return[4,i.objectStore(ks).put({sessionId:e,events:[t],tabId:this.tabId})];case 13:return h.sent(),[4,i.objectStore(xs).put({sessionId:e,events:l,tabId:this.tabId})];case 14:return u=h.sent(),this.recordSuccess(),o(),[2,{events:l,sessionId:e,sequenceId:u}];case 15:return c=h.sent(),n||(r=!0,Es(this.loggerProvider,"".concat(jo,": ").concat(c),c),this.recordFailure()),[3,16];case 16:return[2,void 0]}})})},i.storeSendingEvents=function(e,t){return v(i,void 0,void 0,function(){var r,n;return m(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.db.put(xs,{sessionId:e,events:t,tabId:this.tabId})];case 1:return r=i.sent(),this.recordSuccess(),[2,r];case 2:return n=i.sent(),Es(this.loggerProvider,"".concat(jo,": ").concat(n),n),this.recordFailure(),[3,3];case 3:return[2,void 0]}})})},i.cleanUpSessionEventsStore=function(e,t){return v(i,void 0,void 0,function(){var e;return m(this,function(r){switch(r.label){case 0:if(!t)return[2];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this.db.delete(xs,t)];case 2:return r.sent(),this.recordSuccess(),[3,4];case 3:return e=r.sent(),Es(this.loggerProvider,"".concat(jo,": ").concat(e),e),this.recordFailure(),[3,4];case 4:return[2]}})})},i.db=r.db,i.tabId=r.tabId,i.onPersistentFailure=r.onPersistentFailure,i.consecutiveFailureThreshold=null!==(n=r.consecutiveFailureThreshold)&&void 0!==n?n:1,i}return f(r,e),r.prototype.maybeLogEmptyFiltered=function(e){this.emptyFilteredCount++%100==0&&this.loggerProvider.debug("Filtered empty session replay sequence at ".concat(e," (idb store)"))},r.prototype.recordFailure=function(){var e;this.consecutiveFailures++,!this.hasTriggeredFallback&&this.consecutiveFailures>=this.consecutiveFailureThreshold&&(this.hasTriggeredFallback=!0,null===(e=this.onPersistentFailure)||void 0===e||e.call(this))},r.prototype.recordSuccess=function(){this.consecutiveFailures=0},r.new=function(e,n){var i;return v(this,void 0,void 0,function(){var o,s,a,l,u;return m(this,function(c){switch(c.label){case 0:return c.trys.push([0,2,,3]),o="replay"===e?"":"_".concat(e),s="".concat(n.apiKey.substring(0,10),"_amp_session_replay_events").concat(o),[4,Os(s)];case 1:return a=c.sent(),l=null!==(i=n.tabId)&&void 0!==i?i:function(){try{return crypto.randomUUID()}catch(e){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}}(),[2,new r(t(t({},n),{db:a,tabId:l}))];case 2:return u=c.sent(),Es(n.loggerProvider,"".concat(jo,": ").concat(u),u),[3,3];case 3:return[2]}})})},r.prototype.getCurrentSequenceEvents=function(e){return v(this,void 0,void 0,function(){var t,r,n,i,o,s,a,l;return m(this,function(u){switch(u.label){case 0:return e?[4,this.db.get("sessionCurrentSequence",e)]:[3,2];case 1:return(i=u.sent())?i.tabId&&i.tabId!==this.tabId?[2,void 0]:(i.tabId,[2,[o=g(i,["tabId"])]]):[2,void 0];case 2:t=[],u.label=3;case 3:return u.trys.push([3,8,9,10]),[4,this.db.getAll("sessionCurrentSequence")];case 4:r=y.apply(void 0,[u.sent()]),n=r.next(),u.label=5;case 5:if(n.done)return[3,7];if((i=n.value).tabId&&i.tabId!==this.tabId)return[3,6];i.tabId,o=g(i,["tabId"]),t.push(o),u.label=6;case 6:return n=r.next(),[3,5];case 7:return[3,10];case 8:return s=u.sent(),a={error:s},[3,10];case 9:try{n&&!n.done&&(l=r.return)&&l.call(r)}finally{if(a)throw a.error}return[7];case 10:return[2,t]}})})},r}(ws)}}),Bs=l({"../../../../node_modules/@amplitude/session-replay-browser/lib/esm/events/events-memory-store.js"(){Ne(),_s(),Ms=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.finalizedSequences={},t.sequences={},t.sequenceId=0,t.emptyFilteredCount=0,t}return f(t,e),t.prototype.resetCurrentSequence=function(e){this.sequences[e]=[]},t.prototype.addSequence=function(e){var t=this.sequenceId++,r=w([],b(this.sequences[e]),!1);return this.finalizedSequences[t]={sessionId:e,events:r},this.resetCurrentSequence(e),{sequenceId:t,events:r,sessionId:e}},t.prototype.maybeLogEmptyFiltered=function(e){this.emptyFilteredCount++%100==0&&this.loggerProvider.debug("Filtered empty session replay sequence at ".concat(e," (in-memory store)"))},t.prototype.getSequencesToSend=function(){return v(this,void 0,void 0,function(){var e,t,r,n,i,o,s,a,l,u;return m(this,function(c){e=[];try{for(t=y(Object.entries(this.finalizedSequences)),r=t.next();!r.done;r=t.next())n=b(r.value,2),i=n[0],o=n[1],s=o.sessionId,0!==(a=o.events).length?e.push({sequenceId:Number(i),sessionId:s,events:a}):(this.maybeLogEmptyFiltered("getSequencesToSend"),delete this.finalizedSequences[Number(i)])}catch(e){l={error:e}}finally{try{r&&!r.done&&(u=t.return)&&u.call(t)}finally{if(l)throw l.error}}return[2,e]})})},t.prototype.storeCurrentSequence=function(e){return v(this,void 0,void 0,function(){var t;return m(this,function(r){return(t=this.sequences[e])?0===t.length?(this.maybeLogEmptyFiltered("storeCurrentSequence"),[2,void 0]):[2,this.addSequence(e)]:[2,void 0]})})},t.prototype.addEventToCurrentSequence=function(e,t){return v(this,void 0,void 0,function(){var r;return m(this,function(n){return this.sequences[e]||this.resetCurrentSequence(e),this.shouldSplitEventsList(this.sequences[e],t)&&(0===this.sequences[e].length?this.maybeLogEmptyFiltered("addEventToCurrentSequence"):r=this.addSequence(e)),this.sequences[e].push(t),[2,r]})})},t.prototype.storeSendingEvents=function(e,t){return v(this,void 0,void 0,function(){return m(this,function(r){return this.finalizedSequences[this.sequenceId]={sessionId:e,events:t},[2,this.sequenceId++]})})},t.prototype.cleanUpSessionEventsStore=function(e,t){return v(this,void 0,void 0,function(){return m(this,function(e){return void 0!==t&&delete this.finalizedSequences[t],[2]})})},t}(ws)}}),qs=l({"../../../../node_modules/@amplitude/session-replay-browser/lib/esm/events/events-manager.js"(){Ne(),Ji(),bo(),ds(),Fs(),Bs(),Ns=function(e){var r=e.config,n=e.minInterval,i=e.maxInterval,o=e.type,s=e.payloadBatcher,a=e.storeType,l=e.trackDestinationWorkerScript,u=e.shouldSend;return v(void 0,void 0,void 0,function(){function e(e){return void 0===e&&(e=!1),v(this,void 0,void 0,function(){return m(this,function(t){return[2,c.flush(e)]})})}var c,d,h,p,f,g,y,S,E,k,x,C;return m(this,function(I){switch(I.label){case 0:return c=new Go(t(t({},r),{loggerProvider:r.loggerProvider,payloadBatcher:s,workerScript:l})),d=function(){return new Ms({loggerProvider:r.loggerProvider,maxInterval:i,minInterval:n})},p=!1,g=function(){return v(void 0,void 0,void 0,function(){var e,t,n;return m(this,function(i){switch(i.label){case 0:return p?(p=!1,r.loggerProvider.warn("IDB store is experiencing repeated failures; falling back to in-memory event store."),h?[4,f.getSequencesToSend()]:[3,2]):[2];case 1:return t=i.sent(),[3,3];case 2:t=void 0,i.label=3;case 3:return e=t,f=d(),e&&h&&(n=h,e.forEach(function(e){C({sequenceId:e.sequenceId,events:e.events,sessionId:e.sessionId,deviceId:n})})),[2]}})})},y=function(){return v(void 0,void 0,void 0,function(){var e;return m(this,function(t){switch(t.label){case 0:return[4,Ts.new(o,{loggerProvider:r.loggerProvider,minInterval:n,maxInterval:i,apiKey:r.apiKey,onPersistentFailure:function(){g()}})];case 1:return(e=t.sent())?(p=!0,[2,e]):(r.loggerProvider.log("Failed to initialize idb store, falling back to memory store."),[2,d()])}})})},"idb"!==a?[3,2]:[4,y()];case 1:return S=I.sent(),[3,3];case 2:S=d(),I.label=3;case 3:return f=S,E=[],k=0,x=function(e){if(!(e<=k)){var t=Math.min(e-k,E.length);t>0&&(E.splice(0,t),k=e)}},C=function(e){var t=e.events,n=e.sessionId,i=e.deviceId,s=e.sequenceId,a=t.map(function(e){return{event:e,bytes:new Blob([e]).size}}),l=a.filter(function(e){return e.bytes>Ti});l.length>0&&r.loggerProvider.warn("Dropping ".concat(l.length," oversized event(s) from session replay sequence before send. Sizes: ").concat(l.map(function(e){return"".concat(Math.round(e.bytes/1024)," KB")}).join(", "),". If this recurs, please open a GitHub issue at https://github.com/amplitude/Amplitude-TypeScript/issues or contact Amplitude support."));var u=l.length>0?a.filter(function(e){return e.bytes<=Ti}).map(function(e){return e.event}):t;0!==u.length?(r.debugMode&&po().then(function(e){var t=e.totalStorageSize,n=e.percentOfQuota,i=e.usageDetails;r.loggerProvider.debug("Total storage size: ".concat(t," KB, percentage of quota: ").concat(n,"%, usage details: ").concat(i))}).catch(function(){}),c.sendEventsList({events:u,sessionId:n,flushMaxRetries:r.flushMaxRetries,apiKey:r.apiKey,deviceId:i,sampleRate:r.sampleRate,serverZone:r.serverZone,version:r.version,type:o,onComplete:function(){return v(void 0,void 0,void 0,function(){return m(this,function(e){switch(e.label){case 0:return[4,f.cleanUpSessionEventsStore(n,s)];case 1:return e.sent(),[2]}})})}})):f.cleanUpSessionEventsStore(n,s).catch(function(e){r.loggerProvider.warn("Failed to clean up session replay events store:",e)})},[2,{sendCurrentSequenceEvents:function(e){var t=e.sessionId,n=e.deviceId;if(h=n,!u||u()){var i=k+E.length;f.storeCurrentSequence(t).then(function(e){e&&(x(i),C({sequenceId:e.sequenceId,events:e.events,sessionId:e.sessionId,deviceId:n}))}).catch(function(e){r.loggerProvider.warn("Failed to get current sequence of session replay events for session:",e)})}},addEvent:function(e){var t=e.event,n=e.sessionId,i=e.deviceId;h=i;var o=!u||u(),s=k+E.length;E.push(t.data),f.addEventToCurrentSequence(n,t.data).then(function(e){if(e){if(!o)return f.cleanUpSessionEventsStore(e.sessionId,e.sequenceId).catch(function(e){r.loggerProvider.warn("Failed to clean up dropped session replay sequence:",e)}),void x(s);x(s),C({sequenceId:e.sequenceId,events:e.events,sessionId:e.sessionId,deviceId:i})}}).catch(function(e){r.loggerProvider.warn("Failed to add event to session replay capture:",e)})},sendStoredEvents:function(e){var t=e.deviceId;return v(void 0,void 0,void 0,function(){var e;return m(this,function(n){switch(n.label){case 0:return h=t,[4,f.getSequencesToSend()];case 1:return(null==(e=n.sent())?void 0:e.length)?(r.loggerProvider.log("Draining ".concat(e.length," stored sequence(s) from previous session.")),e.forEach(function(e){C({sequenceId:e.sequenceId,events:e.events,sessionId:e.sessionId,deviceId:t})}),[2]):[2]}})})},flush:e,getBeaconEvents:function(){return w([],b(E),!1)},dropPendingBeaconEvents:function(){x(k+E.length)},trackDestination:c}]}})})}}}),zs=l({"../../../../node_modules/@amplitude/session-replay-browser/lib/esm/events/multi-manager.js"(){Ne(),Ls=function(){function e(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=new Map;e.forEach(function(e){r.set(e.name,e.manager)}),this.managers=r}return e.prototype.sendStoredEvents=function(e){return v(this,void 0,void 0,function(){var t;return m(this,function(r){switch(r.label){case 0:return t=[],this.managers.forEach(function(r){t.push(r.sendStoredEvents(e))}),[4,Promise.all(t)];case 1:return r.sent(),[2]}})})},e.prototype.addEvent=function(e){var t,r=e.sessionId,n=e.event,i=e.deviceId;null===(t=this.managers.get(n.type))||void 0===t||t.addEvent({sessionId:r,event:n,deviceId:i})},e.prototype.sendCurrentSequenceEvents=function(e){var t=e.sessionId,r=e.deviceId;this.managers.forEach(function(e){e.sendCurrentSequenceEvents({sessionId:t,deviceId:r})})},e.prototype.flush=function(e){return v(this,void 0,void 0,function(){var t;return m(this,function(r){switch(r.label){case 0:return t=[],this.managers.forEach(function(r){t.push(r.flush(e))}),[4,Promise.all(t)];case 1:return r.sent(),[2]}})})},e}()}});function Vs(e,r){if(Us=new Date,e.nodeType!==Node.ELEMENT_NODE)throw new Error("Can't generate CSS selector for non-element node type.");if("html"===e.tagName.toLowerCase())return"html";var n={root:document.body,idName:function(e){return!0},className:function(e){return!0},tagName:function(e){return!0},attr:function(e,t){return!1},seedMinLength:1,optimizedMinLength:2,threshold:1e3,maxNumberOfTries:1e4,timeoutMs:void 0};Ds=t(t({},n),r),js=function(e,t){if(e.nodeType===Node.DOCUMENT_NODE)return e;if(e===t.root)return e.ownerDocument;return e}(Ds.root,n);var i=Ws(e,"all",function(){return Ws(e,"two",function(){return Ws(e,"one",function(){return Ws(e,"none")})})});if(i){var o=ea(ta(i,e));return o.length>0&&(i=o[0]),$s(i)}throw new Error("Selector was not found.")}function Ws(e,t,r){for(var n=null,i=[],o=e,s=0,a=function(){var e,a,l=(new Date).getTime()-Us.getTime();if(void 0!==Ds.timeoutMs&&l>Ds.timeoutMs)throw new Error("Timeout: Can't find a unique selector after ".concat(l,"ms"));var u=Ys(function(e){var t=e.getAttribute("id");if(t&&Ds.idName(t))return{name:"#"+CSS.escape(t),penalty:0};return null}(o))||Ys.apply(void 0,w([],b(function(e){var t=Array.from(e.attributes).filter(function(e){return Ds.attr(e.name,e.value)});return t.map(function(e){return{name:"[".concat(CSS.escape(e.name),'="').concat(CSS.escape(e.value),'"]'),penalty:.5}})}(o)),!1))||Ys.apply(void 0,w([],b(function(e){var t=Array.from(e.classList).filter(Ds.className);return t.map(function(e){return{name:"."+CSS.escape(e),penalty:1}})}(o)),!1))||Ys(function(e){var t=e.tagName.toLowerCase();if(Ds.tagName(t))return{name:t,penalty:2};return null}(o))||[{name:"*",penalty:3}],c=function(e){var t=e.parentNode;if(!t)return null;var r=t.firstChild;if(!r)return null;var n=0;for(;r&&(r.nodeType===Node.ELEMENT_NODE&&n++,r!==e);)r=r.nextSibling;return n}(o);if("all"==t)c&&(u=u.concat(u.filter(Qs).map(function(e){return Js(e,c)})));else if("two"==t)u=u.slice(0,1),c&&(u=u.concat(u.filter(Qs).map(function(e){return Js(e,c)})));else if("one"==t){var d=b(u=u.slice(0,1),1)[0];c&&Qs(d)&&(u=[Js(d,c)])}else"none"==t&&(u=[{name:"*",penalty:3}],c&&(u=[Js(u[0],c)]));try{for(var h=(e=void 0,y(u)),p=h.next();!p.done;p=h.next()){(d=p.value).level=s}}catch(t){e={error:t}}finally{try{p&&!p.done&&(a=h.return)&&a.call(h)}finally{if(e)throw e.error}}if(i.push(u),i.length>=Ds.seedMinLength&&(n=Hs(i,r)))return"break";o=o.parentElement,s++};o;){if("break"===a())break}return n||(n=Hs(i,r)),!n&&r?r():n}function Hs(e,t){var r,n,i=ea(Zs(e));if(i.length>Ds.threshold)return t?t():null;try{for(var o=y(i),s=o.next();!s.done;s=o.next()){var a=s.value;if(Ks(a))return a}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return null}function $s(e){for(var t=e[0],r=t.name,n=1;n<e.length;n++){var i=e[n].level||0;r=t.level===i-1?"".concat(e[n].name," > ").concat(r):"".concat(e[n].name," ").concat(r),t=e[n]}return r}function Gs(e){return e.map(function(e){return e.penalty}).reduce(function(e,t){return e+t},0)}function Ks(e){var t=$s(e);switch(js.querySelectorAll(t).length){case 0:throw new Error("Can't select any node with this selector: ".concat(t));case 1:return!0;default:return!1}}function Js(e,t){return{name:e.name+":nth-child(".concat(t,")"),penalty:e.penalty+1}}function Qs(e){return"html"!==e.name&&!e.name.startsWith("#")}function Ys(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e.filter(Xs);return r.length>0?r:null}function Xs(e){return null!=e}function Zs(e,t){var r,n,i,o,s,a;return void 0===t&&(t=[]),m(this,function(l){switch(l.label){case 0:if(!(e.length>0))return[3,9];l.label=1;case 1:l.trys.push([1,6,7,8]),r=y(e[0]),n=r.next(),l.label=2;case 2:return n.done?[3,5]:(i=n.value,[5,y(Zs(e.slice(1,e.length),t.concat(i)))]);case 3:l.sent(),l.label=4;case 4:return n=r.next(),[3,2];case 5:return[3,8];case 6:return o=l.sent(),s={error:o},[3,8];case 7:try{n&&!n.done&&(a=r.return)&&a.call(r)}finally{if(s)throw s.error}return[7];case 8:return[3,11];case 9:return[4,t];case 10:l.sent(),l.label=11;case 11:return[2]}})}function ea(e){return w([],b(e),!1).sort(function(e,t){return Gs(e)-Gs(t)})}function ta(e,t,r){var n,i,o;return void 0===r&&(r={counter:0,visited:new Map}),m(this,function(s){switch(s.label){case 0:if(!(e.length>2&&e.length>Ds.optimizedMinLength))return[3,5];n=1,s.label=1;case 1:return n<e.length-1?r.counter>Ds.maxNumberOfTries?[2]:(r.counter+=1,(i=w([],b(e),!1)).splice(n,1),o=$s(i),r.visited.has(o)?[2]:Ks(i)&&function(e,t){return js.querySelector($s(e))===t}(i,t)?[4,i]:[3,4]):[3,5];case 2:return s.sent(),r.visited.set(o,!0),[5,y(ta(i,t,r))];case 3:s.sent(),s.label=4;case 4:return n++,[3,1];case 5:return[2]}})}var ra,na,ia,oa=l({"../../../../node_modules/@amplitude/session-replay-browser/lib/esm/libs/finder.js"(){Ne()}}),sa=l({"../../../../node_modules/@amplitude/session-replay-browser/lib/esm/hooks/click.js"(){Ne(),To(),oa(),Ki(),bo(),ra=function(e){var t=e.version,r=e.events,n=[];return r.forEach(function(e){var t=JSON.parse(e);t.count=1,"click"===t.type&&n.push(t)}),{version:t,events:n}},na=function(e){var r=e.version,n=e.events,i=[];n.forEach(function(e){var t=JSON.parse(e);"click"===t.type&&i.push(t)});var o=i.reduce(function(e,r){var n=r.x,i=r.y,o=r.selector,s=r.timestamp,a=s-s%36e5,l="".concat(n,":").concat(i,":").concat(null!=o?o:"",":").concat(a);return e[l]?e[l].count+=1:e[l]=t(t({},r),{timestamp:a,count:1}),e},{});return{version:r,events:Object.values(o)}},ia=function(){return function(e,t){var r=this;this.createHook=function(e){var t=e.eventsManager,n=e.sessionId,i=e.deviceIdFn,o=e.mirror,s=e.ugcFilterRules,a=e.performanceOptions;return function(e){if(e.type===Eo.Click){var l=de();if(l){var u=l.location,c=l.innerHeight,d=l.innerWidth;if(u){var h=e.x,p=e.y;if(void 0!==h&&void 0!==p){var f,g=o.getNode(e.id);if(g)try{f=Vs(g,a)}catch(e){r.logger.debug("error resolving selector from finder")}var v=ho(u.href,s),m={x:h+r.scrollWatcher.currentScrollX,y:p+r.scrollWatcher.currentScrollY,selector:f,viewportHeight:c,viewportWidth:d,pageUrl:v,timestamp:Date.now(),type:"click"},y=i();y&&t.addEvent({sessionId:n,event:{type:"interaction",data:JSON.stringify(m)},deviceId:y})}}}}}},this.logger=e,this.scrollWatcher=t}}()}});function aa(){var e=de();return(null==e?void 0:e.innerHeight)||document.documentElement&&document.documentElement.clientHeight||0}function la(){var e=de();return(null==e?void 0:e.innerWidth)||document.documentElement&&document.documentElement.clientWidth||0}var ua,ca,da,ha,pa,fa,ga,va,ma,ya,ba,wa,Sa,Ea,ka,xa,Ca,Ia,Oa,Ta,Aa,_a,Ra,Pa,Ma,Na,La,Da,ja,Ua,Fa,Ba,qa,za,Va,Wa,Ha,$a,Ga,Ka,Ja,Qa,Ya,Xa,Za,el,tl,rl,nl,il,ol,sl,al,ll,ul,cl,dl,hl,pl,fl,gl,vl,ml,yl,bl,wl,Sl,El,kl,xl=l({"../../../../node_modules/@amplitude/session-replay-browser/lib/esm/utils/rrweb.js"(){Ki()}}),Cl=l({"../../../../node_modules/@amplitude/session-replay-browser/lib/esm/beacon-transport.js"(){Ki(),bo(),ua=function(){function e(e,t){var r=de();r&&r.navigator&&"function"==typeof r.navigator.sendBeacon?this.sendBeacon=function(e,t){try{if(r.navigator.sendBeacon(e,JSON.stringify(t)))return!0}catch(e){}return!1}:this.sendBeacon=function(){return!1},this.sendXhr=function(e,t){var r=new XMLHttpRequest;return r.open("POST",e,!0),r.setRequestHeader("Accept","*/*"),r.send(JSON.stringify(t)),!0},this.basePageUrl=Zi(t.serverZone,t.trackServerUrl),this.apiKey=t.apiKey,this.context=e}return e.prototype.send=function(e,t){var r=this.context,n=r.sessionId,i=r.type,o=new URLSearchParams({device_id:e,session_id:String(n),type:String(i),api_key:this.apiKey}),s="".concat(this.basePageUrl,"?").concat(o.toString());this.sendBeacon(s,t)||this.sendXhr(s,t)},e}()}}),Il=l({"../../../../node_modules/@amplitude/session-replay-browser/lib/esm/hooks/scroll.js"(){xl(),Cl(),Ki(),bo(),ca=function(){function e(e,t){var r=this;this.timestamp=Date.now(),this.hook=function(e){r.update(e)},this.send=function(e){return function(t){var n,i,o,s,a=e(),l=de();if(l&&a){var u=null!==(n=l.scrollX)&&void 0!==n?n:0,c=null!==(i=l.scrollY)&&void 0!==i?i:0;(u>0||c>0)&&r.update({id:1,x:u,y:c}),r.transport.send(a,{version:1,events:[{maxScrollX:r._maxScrollX,maxScrollY:r._maxScrollY,maxScrollWidth:r._maxScrollWidth,maxScrollHeight:r._maxScrollHeight,viewportHeight:aa(),viewportWidth:la(),pageUrl:ho(l.location.href,null!==(s=null===(o=r.config.interactionConfig)||void 0===o?void 0:o.ugcFilterRules)&&void 0!==s?s:[]),timestamp:r.timestamp,type:"scroll"}]})}}},this._maxScrollX=0,this._maxScrollY=0,this._currentScrollX=0,this._currentScrollY=0,this._maxScrollWidth=la(),this._maxScrollHeight=aa(),this.config=t,this.transport=e}return e.default=function(t,r){return new e(new ua(t,r),r)},Object.defineProperty(e.prototype,"maxScrollX",{get:function(){return this._maxScrollX},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxScrollY",{get:function(){return this._maxScrollY},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxScrollWidth",{get:function(){return this._maxScrollWidth},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxScrollHeight",{get:function(){return this._maxScrollHeight},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentScrollX",{get:function(){return this._currentScrollX},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentScrollY",{get:function(){return this._currentScrollY},enumerable:!1,configurable:!0}),e.prototype.update=function(e){var t=Date.now();if(this._currentScrollX=e.x,this._currentScrollY=e.y,e.x>this._maxScrollX){var r=la();this._maxScrollX=e.x;var n=e.x+r;n>this._maxScrollWidth&&(this._maxScrollWidth=n),this.timestamp=t}if(e.y>this._maxScrollY){var i=aa();this._maxScrollY=e.y;var o=e.y+i;o>this._maxScrollHeight&&(this._maxScrollHeight=o),this.timestamp=t}},e}()}}),Ol=l({"../../../../node_modules/@amplitude/session-replay-browser/lib/esm/identifiers.js"(){bo(),da=function(){return function(e){var t=e.sessionId,r=e.deviceId;this.deviceId=r,this.sessionId=t,t&&r&&(this.sessionReplayId=so(t,r))}}()}}),Tl=l({"../../../../node_modules/@amplitude/session-replay-browser/lib/esm/replay-start-time-store.js"(){Ne(),Ki(),ha=864e5,pa=function(e){return"".concat("AMP_SR_START_").concat(e.substring(0,10),"_")},fa=function(e,t){return"".concat(pa(e)).concat(t)},ga=function(){try{var e=de();return null==e?void 0:e.localStorage}catch(e){return}},va=function(e,t,r,n){var i=ga();if(i){var o=fa(e,t);try{var s=i.getItem(o);if(null!==s){var a=Number(s);if(Number.isFinite(a)&&a>0&&a<=r&&r-a<ha)return a}return i.setItem(o,String(r)),r}catch(e){return void(null==n||n.debug("Failed to read/write replay start time from storage: ".concat(String(e))))}}},ma=function(e,t,r,n){var i=ga();if(i)try{i.setItem(fa(e,t),String(r))}catch(e){null==n||n.debug("Failed to write replay start time to storage: ".concat(String(e)))}},ya=function(e,t,r){var n=ga();if(n)try{n.removeItem(fa(e,t))}catch(e){null==r||r.debug("Failed to remove replay start time from storage: ".concat(String(e)))}},ba=function(e,t,r){var n,i,o=ga();if(o){var s=pa(e);try{for(var a=[],l=0;l<o.length;l++){if((p=o.key(l))&&p.startsWith(s)){var u=o.getItem(p);if(null!==u){var c=Number(u);(!Number.isFinite(c)||c<=0||t-c>=ha)&&a.push(p)}}}try{for(var d=y(a),h=d.next();!h.done;h=d.next()){var p=h.value;o.removeItem(p)}}catch(e){n={error:e}}finally{try{h&&!h.done&&(i=d.return)&&i.call(d)}finally{if(n)throw n.error}}}catch(e){null==r||r.debug("Failed to prune stale replay start times: ".concat(String(e)))}}}}}),Al=l({"../../../../node_modules/@amplitude/session-replay-browser/lib/esm/targeting/targeting-idb-store.js"(){Ne(),As(),Rs(),wa=new(function(){return function(){var e=this;this.dbs={},this.createStore=function(t){return v(e,void 0,void 0,function(){return m(this,function(e){switch(e.label){case 0:return[4,vs(t,1,{upgrade:function(e){e.objectStoreNames.contains("sessionTargetingMatch")||e.createObjectStore("sessionTargetingMatch",{keyPath:"sessionId"})}})];case 1:return[2,e.sent()]}})})},this.openOrCreateDB=function(t){return v(e,void 0,void 0,function(){var e,r;return m(this,function(n){switch(n.label){case 0:return this.dbs&&this.dbs[t]?[2,this.dbs[t]]:(e="".concat(t.substring(0,10),"_amp_session_replay_targeting"),[4,this.createStore(e)]);case 1:return r=n.sent(),this.dbs[t]=r,[2,r]}})})},this.getTargetingMatchForSession=function(t){var r=t.loggerProvider,n=t.apiKey,i=t.sessionId;return v(e,void 0,void 0,function(){var e,t,o,s;return m(this,function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),[4,this.openOrCreateDB(n)];case 1:return e=a.sent(),t=String(i),[4,e.get("sessionTargetingMatch",t)];case 2:return[2,null==(o=a.sent())?void 0:o.targetingMatch];case 3:return s=a.sent(),Es(r,"Failed to get targeting match for session id ".concat(i,": ").concat(s),s),[3,4];case 4:return[2,void 0]}})})},this.storeTargetingMatchForSession=function(t){var r=t.loggerProvider,n=t.apiKey,i=t.sessionId,o=t.targetingMatch;return v(e,void 0,void 0,function(){var e,t,s;return m(this,function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),[4,this.openOrCreateDB(n)];case 1:return e=a.sent(),t=String(i),[4,e.put("sessionTargetingMatch",{targetingMatch:o,sessionId:t,lastUpdated:Date.now()})];case 2:return[2,a.sent()];case 3:return s=a.sent(),Es(r,"Failed to store targeting match for session id ".concat(i,": ").concat(s),s),[3,4];case 4:return[2,void 0]}})})},this.clearStoreOfOldSessions=function(t){var r=t.loggerProvider,n=t.apiKey,i=t.currentSessionId;return v(e,void 0,void 0,function(){var e,t,o,s,a,l,u,c;return m(this,function(d){switch(d.label){case 0:return d.trys.push([0,8,,9]),[4,this.openOrCreateDB(n)];case 1:return e=d.sent(),t=String(i),[4,(o=e.transaction("sessionTargetingMatch","readwrite")).store.getAll()];case 2:s=d.sent(),a=0,d.label=3;case 3:return a<s.length?(l=s[a],u=Date.now()-l.lastUpdated,l.sessionId!==t&&u>1728e5?[4,o.store.delete(l.sessionId)]:[3,5]):[3,6];case 4:d.sent(),d.label=5;case 5:return a++,[3,3];case 6:return[4,o.done];case 7:return d.sent(),[3,9];case 8:return c=d.sent(),Es(r,"Failed to clear old targeting matches for sessions: ".concat(c),c),[3,9];case 9:return[2]}})})}}}())}});function _l(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})}function Rl(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(l){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}function Pl(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}var Ml,Nl,Ll,Dl,jl=l({"../../../../node_modules/@amplitude/targeting/node_modules/@amplitude/experiment-core/dist/experiment-core.esm.js"(){Sa=function(e,t){return(Sa=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},Ea=function(){return Ea=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Ea.apply(this,arguments)},ka={IS:"is",IS_NOT:"is not",CONTAINS:"contains",DOES_NOT_CONTAIN:"does not contain",LESS_THAN:"less",LESS_THAN_EQUALS:"less or equal",GREATER_THAN:"greater",GREATER_THAN_EQUALS:"greater or equal",VERSION_LESS_THAN:"version less",VERSION_LESS_THAN_EQUALS:"version less or equal",VERSION_GREATER_THAN:"version greater",VERSION_GREATER_THAN_EQUALS:"version greater or equal",SET_IS:"set is",SET_IS_NOT:"set is not",SET_CONTAINS:"set contains",SET_DOES_NOT_CONTAIN:"set does not contain",SET_CONTAINS_ANY:"set contains any",SET_DOES_NOT_CONTAIN_ANY:"set does not contain any",REGEX_MATCH:"regex match",REGEX_DOES_NOT_MATCH:"regex does not match"},xa=function(e){for(var t=[],r=0,n=0;n<e.length;n++){var i=e.charCodeAt(n);i<128?t[r++]=i:i<2048?(t[r++]=i>>6|192,t[r++]=63&i|128):55296==(64512&i)&&n+1<e.length&&56320==(64512&e.charCodeAt(n+1))?(i=65536+((1023&i)<<10)+(1023&e.charCodeAt(++n)),t[r++]=i>>18|240,t[r++]=i>>12&63|128,t[r++]=i>>6&63|128,t[r++]=63&i|128):(t[r++]=i>>12|224,t[r++]=i>>6&63|128,t[r++]=63&i|128)}return Uint8Array.from(t)},Ca=-862048943,Ia=461845907,Oa=function(e,t){void 0===t&&(t=0);for(var r=xa(e),n=r.length,i=n>>2,o=t,s=0;s<i;s++){var a=Ra(r,s<<2);o=Ta(a,o)}var l=i<<2,u=0;switch(n-l){case 3:u^=r[l+2]<<16,u^=r[l+1]<<8,u^=r[l],u=Math.imul(u,Ca),u=_a(u,15),o^=u=Math.imul(u,Ia);break;case 2:u^=r[l+1]<<8,u^=r[l],u=Math.imul(u,Ca),u=_a(u,15),o^=u=Math.imul(u,Ia);break;case 1:u^=r[l],u=Math.imul(u,Ca),u=_a(u,15),o^=u=Math.imul(u,Ia)}return Aa(o^=n)>>>0},Ta=function(e,t){var r=e,n=t;return r=Math.imul(r,Ca),r=_a(r,15),r=Math.imul(r,Ia),n=_a(n^=r,13),(n=Math.imul(n,5))+-430675100|0},Aa=function(e){var t=e;return t^=t>>>16,t=Math.imul(t,-2048144789),t^=t>>>13,t=Math.imul(t,-1028477387),t^=t>>>16},_a=function(e,t,r){return void 0===r&&(r=32),t>r&&(t%=r),(e<<t|(e&4294967295<<r-t>>>0)>>>0>>>r-t>>>0)>>>0},Ra=function(e,t){void 0===t&&(t=0);var r=e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3];return Pa(r)},Pa=function(e){return(-16777216&e)>>>24|(16711680&e)>>>8|(65280&e)<<8|(255&e)<<24},Ma=function(e,t){var r,n;if(t&&0!==t.length){try{for(var i=Pl(t),o=i.next();!o.done;o=i.next()){var s=o.value;if(!s||!e||"object"!=typeof e)return;e=e[s]}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return e||void 0}},Na="^".concat("(\\d+)\\.(\\d+)","(\\.").concat("(\\d+)").concat("(-(([-\\w]+\\.?)*))?",")?$"),La=function(){function e(e,t,r,n){void 0===n&&(n=void 0),this.major=e,this.minor=t,this.patch=r,this.preRelease=n}return e.parse=function(t){if(t){var r=new RegExp(Na).exec(t);if(r){var n=Number(r[1]),i=Number(r[2]);if(!isNaN(n)&&!isNaN(i))return new e(n,i,Number(r[4])||0,r[5]||void 0)}}},e.prototype.compareTo=function(e){return this.major>e.major?1:this.major<e.major?-1:this.minor>e.minor?1:this.minor<e.minor?-1:this.patch>e.patch?1:this.patch<e.patch||this.preRelease&&!e.preRelease?-1:!this.preRelease&&e.preRelease?1:this.preRelease&&e.preRelease?this.preRelease>e.preRelease?1:this.preRelease<e.preRelease?-1:0:0},e}(),Da=function(){function e(){}return e.prototype.evaluate=function(e,t){var r,n,i={},o={context:e,result:i};try{for(var s=Pl(t),a=s.next();!a.done;a=s.next()){var l=a.value,u=this.evaluateFlag(o,l);u&&(i[l.key]=u)}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return i},e.prototype.evaluateFlag=function(e,t){var r,n,i;try{for(var o=Pl(t.segments),s=o.next();!s.done;s=o.next()){var a=s.value;if(i=this.evaluateSegment(e,t,a)){var l=Ea(Ea(Ea({},t.metadata),a.metadata),i.metadata);i=Ea(Ea({},i),{metadata:l});break}}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return i},e.prototype.evaluateSegment=function(e,t,r){var n,i,o,s;if(!r.conditions)return void 0!==(u=this.bucket(e,r))?t.variants[u]:void 0;try{for(var a=Pl(r.conditions),l=a.next();!l.done;l=a.next()){var u,c=l.value,d=!0;try{for(var h=(o=void 0,Pl(c)),p=h.next();!p.done;p=h.next()){var f=p.value;if(!(d=this.matchCondition(e,f)))break}}catch(e){o={error:e}}finally{try{p&&!p.done&&(s=h.return)&&s.call(h)}finally{if(o)throw o.error}}if(d)return void 0!==(u=this.bucket(e,r))?t.variants[u]:void 0}}catch(e){n={error:e}}finally{try{l&&!l.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}},e.prototype.matchCondition=function(e,t){var r=Ma(e,t.selector);if(r){if(this.isSetOperator(t.op)){var n=this.coerceStringArray(r);return!!n&&this.matchSet(n,t.op,t.values)}var i=this.coerceString(r);return void 0!==i&&this.matchString(i,t.op,t.values)}return this.matchNull(t.op,t.values)},e.prototype.getHash=function(e){return Oa(e)},e.prototype.bucket=function(e,t){var r,n,i,o;if(!t.bucket)return t.variant;var s=this.coerceString(Ma(e,t.bucket.selector));if(!s||0===s.length)return t.variant;var a="".concat(t.bucket.salt,"/").concat(s),l=this.getHash(a),u=l%100,c=Math.floor(l/100);try{for(var d=Pl(t.bucket.allocations),h=d.next();!h.done;h=d.next()){var p=h.value,f=p.range[0],g=p.range[1];if(u>=f&&u<g)try{for(var v=(i=void 0,Pl(p.distributions)),m=v.next();!m.done;m=v.next()){var y=m.value,b=y.range[0],w=y.range[1];if(c>=b&&c<w)return y.variant}}catch(e){i={error:e}}finally{try{m&&!m.done&&(o=v.return)&&o.call(v)}finally{if(i)throw i.error}}}}catch(e){r={error:e}}finally{try{h&&!h.done&&(n=d.return)&&n.call(d)}finally{if(r)throw r.error}}return t.variant},e.prototype.matchNull=function(e,t){var r=this.containsNone(t);switch(e){case ka.IS:case ka.CONTAINS:case ka.LESS_THAN:case ka.LESS_THAN_EQUALS:case ka.GREATER_THAN:case ka.GREATER_THAN_EQUALS:case ka.VERSION_LESS_THAN:case ka.VERSION_LESS_THAN_EQUALS:case ka.VERSION_GREATER_THAN:case ka.VERSION_GREATER_THAN_EQUALS:case ka.SET_IS:case ka.SET_CONTAINS:case ka.SET_CONTAINS_ANY:return r;case ka.IS_NOT:case ka.DOES_NOT_CONTAIN:case ka.SET_DOES_NOT_CONTAIN:case ka.SET_DOES_NOT_CONTAIN_ANY:return!r;default:return!1}},e.prototype.matchSet=function(e,t,r){switch(t){case ka.SET_IS:return this.setEquals(e,r);case ka.SET_IS_NOT:return!this.setEquals(e,r);case ka.SET_CONTAINS:return this.matchesSetContainsAll(e,r);case ka.SET_DOES_NOT_CONTAIN:return!this.matchesSetContainsAll(e,r);case ka.SET_CONTAINS_ANY:return this.matchesSetContainsAny(e,r);case ka.SET_DOES_NOT_CONTAIN_ANY:return!this.matchesSetContainsAny(e,r);default:return!1}},e.prototype.matchString=function(e,t,r){var n=this;switch(t){case ka.IS:return this.matchesIs(e,r);case ka.IS_NOT:return!this.matchesIs(e,r);case ka.CONTAINS:return this.matchesContains(e,r);case ka.DOES_NOT_CONTAIN:return!this.matchesContains(e,r);case ka.LESS_THAN:case ka.LESS_THAN_EQUALS:case ka.GREATER_THAN:case ka.GREATER_THAN_EQUALS:return this.matchesComparable(e,t,r,function(e){return n.parseNumber(e)},this.comparator);case ka.VERSION_LESS_THAN:case ka.VERSION_LESS_THAN_EQUALS:case ka.VERSION_GREATER_THAN:case ka.VERSION_GREATER_THAN_EQUALS:return this.matchesComparable(e,t,r,function(e){return La.parse(e)},this.versionComparator);case ka.REGEX_MATCH:return this.matchesRegex(e,r);case ka.REGEX_DOES_NOT_MATCH:return!this.matchesRegex(e,r);default:return!1}},e.prototype.matchesIs=function(e,t){if(this.containsBooleans(t)){var r=e.toLowerCase();if("true"===r||"false"===r)return t.some(function(e){return e.toLowerCase()===r})}return t.some(function(t){return e===t})},e.prototype.matchesContains=function(e,t){var r,n;try{for(var i=Pl(t),o=i.next();!o.done;o=i.next()){var s=o.value;if(e.toLowerCase().includes(s.toLowerCase()))return!0}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return!1},e.prototype.matchesComparable=function(e,t,r,n,i){var o=this,s=n(e),a=r.map(function(e){return n(e)}).filter(function(e){return void 0!==e});return void 0===s||0===a.length?r.some(function(r){return o.comparator(e,t,r)}):a.some(function(e){return i(s,t,e)})},e.prototype.comparator=function(e,t,r){switch(t){case ka.LESS_THAN:case ka.VERSION_LESS_THAN:return e<r;case ka.LESS_THAN_EQUALS:case ka.VERSION_LESS_THAN_EQUALS:return e<=r;case ka.GREATER_THAN:case ka.VERSION_GREATER_THAN:return e>r;case ka.GREATER_THAN_EQUALS:case ka.VERSION_GREATER_THAN_EQUALS:return e>=r;default:return!1}},e.prototype.versionComparator=function(e,t,r){var n=e.compareTo(r);switch(t){case ka.LESS_THAN:case ka.VERSION_LESS_THAN:return n<0;case ka.LESS_THAN_EQUALS:case ka.VERSION_LESS_THAN_EQUALS:return n<=0;case ka.GREATER_THAN:case ka.VERSION_GREATER_THAN:return n>0;case ka.GREATER_THAN_EQUALS:case ka.VERSION_GREATER_THAN_EQUALS:return n>=0;default:return!1}},e.prototype.matchesRegex=function(e,t){return t.some(function(t){return Boolean(new RegExp(t).exec(e))})},e.prototype.containsNone=function(e){return e.some(function(e){return"(none)"===e})},e.prototype.containsBooleans=function(e){return e.some(function(e){switch(e.toLowerCase()){case"true":case"false":return!0;default:return!1}})},e.prototype.parseNumber=function(e){var t;return null!==(t=Number(e))&&void 0!==t?t:void 0},e.prototype.coerceString=function(e){if(e)return"object"==typeof e?JSON.stringify(e):String(e)},e.prototype.coerceStringArray=function(e){var t=this;if(Array.isArray(e))return e.map(function(e){return t.coerceString(e)}).filter(Boolean);var r=String(e);try{var n=JSON.parse(r);return Array.isArray(n)?e.map(function(e){return t.coerceString(e)}).filter(Boolean):void 0}catch(e){return}},e.prototype.isSetOperator=function(e){switch(e){case ka.SET_IS:case ka.SET_IS_NOT:case ka.SET_CONTAINS:case ka.SET_DOES_NOT_CONTAIN:case ka.SET_CONTAINS_ANY:case ka.SET_DOES_NOT_CONTAIN_ANY:return!0;default:return!1}},e.prototype.setEquals=function(e,t){var r=new Set(e),n=new Set(t);return r.size===n.size&&function(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}([],function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}(n),!1).every(function(e){return r.has(e)})},e.prototype.matchesSetContainsAll=function(e,t){var r,n;if(e.length<t.length)return!1;try{for(var i=Pl(t),o=i.next();!o.done;o=i.next()){var s=o.value;if(!this.matchesIs(s,e))return!1}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return!0},e.prototype.matchesSetContainsAny=function(e,t){var r,n;try{for(var i=Pl(t),o=i.next();!o.done;o=i.next()){var s=o.value;if(this.matchesIs(s,e))return!0}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return!1},e}(),Ua=ja="3.7.5",Fa="function"==typeof atob,Ba="function"==typeof btoa,qa="function"==typeof Buffer,za="function"==typeof TextDecoder?new TextDecoder:void 0,Va="function"==typeof TextEncoder?new TextEncoder:void 0,Wa=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),Ha=(e=>{let t={};return e.forEach((e,r)=>t[e]=r),t})(Wa),$a=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,Ga=String.fromCharCode.bind(String),Ka="function"==typeof Uint8Array.from?Uint8Array.from.bind(Uint8Array):e=>new Uint8Array(Array.prototype.slice.call(e,0)),Ja=e=>e.replace(/=/g,"").replace(/[+\/]/g,e=>"+"==e?"-":"_"),Qa=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),Ya=e=>{let t,r,n,i,o="";const s=e.length%3;for(let s=0;s<e.length;){if((r=e.charCodeAt(s++))>255||(n=e.charCodeAt(s++))>255||(i=e.charCodeAt(s++))>255)throw new TypeError("invalid character found");t=r<<16|n<<8|i,o+=Wa[t>>18&63]+Wa[t>>12&63]+Wa[t>>6&63]+Wa[63&t]}return s?o.slice(0,s-3)+"===".substring(s):o},Za=qa?e=>Buffer.from(e).toString("base64"):e=>{let t=[];for(let r=0,n=e.length;r<n;r+=4096)t.push(Ga.apply(null,e.subarray(r,r+4096)));return Xa(t.join(""))},tl=e=>{if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?Ga(192|t>>>6)+Ga(128|63&t):Ga(224|t>>>12&15)+Ga(128|t>>>6&63)+Ga(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return Ga(240|t>>>18&7)+Ga(128|t>>>12&63)+Ga(128|t>>>6&63)+Ga(128|63&t)},rl=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,il=qa?e=>Buffer.from(e,"utf8").toString("base64"):Va?e=>Za(Va.encode(e)):e=>Xa(nl(e)),sl=e=>ol(e,!0),al=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,ll=e=>{switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return Ga((t>>>10)+55296)+Ga(56320+(1023&t));case 3:return Ga((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return Ga((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},cl=e=>{if(e=e.replace(/\s+/g,""),!$a.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(3&e.length));let t,r,n,i="";for(let o=0;o<e.length;)t=Ha[e.charAt(o++)]<<18|Ha[e.charAt(o++)]<<12|(r=Ha[e.charAt(o++)])<<6|(n=Ha[e.charAt(o++)]),i+=64===r?Ga(t>>16&255):64===n?Ga(t>>16&255,t>>8&255):Ga(t>>16&255,t>>8&255,255&t);return i},hl=qa?e=>Ka(Buffer.from(e,"base64")):e=>Ka(dl(e).split("").map(e=>e.charCodeAt(0))),pl=e=>hl(gl(e)),fl=qa?e=>Buffer.from(e,"base64").toString("utf8"):za?e=>za.decode(hl(e)):e=>ul(dl(e)),gl=e=>Qa(e.replace(/[-_]/g,e=>"-"==e?"+":"/")),ml=e=>({value:e,enumerable:!1,writable:!0,configurable:!0}),yl=function(){const e=(e,t)=>Object.defineProperty(String.prototype,e,ml(t));e("fromBase64",function(){return vl(this)}),e("toBase64",function(e){return ol(this,e)}),e("toBase64URI",function(){return ol(this,!0)}),e("toBase64URL",function(){return ol(this,!0)}),e("toUint8Array",function(){return pl(this)})},bl=function(){const e=(e,t)=>Object.defineProperty(Uint8Array.prototype,e,ml(t));e("toBase64",function(e){return el(this,e)}),e("toBase64URI",function(){return el(this,!0)}),e("toBase64URL",function(){return el(this,!0)})},wl=()=>{yl(),bl()},Sl={version:ja,VERSION:Ua,atob:dl=Fa?e=>atob(Qa(e)):qa?e=>Buffer.from(e,"base64").toString("binary"):cl,atobPolyfill:cl,btoa:Xa=Ba?e=>btoa(e):qa?e=>Buffer.from(e,"binary").toString("base64"):Ya,btoaPolyfill:Ya,fromBase64:vl=e=>fl(gl(e)),toBase64:ol=(e,t=!1)=>t?Ja(il(e)):il(e),encode:ol,encodeURI:sl,encodeURL:sl,utob:nl=e=>e.replace(rl,tl),btou:ul=e=>e.replace(al,ll),decode:vl,isValid:e=>{if("string"!=typeof e)return!1;const t=e.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(t)||!/[^\s0-9a-zA-Z\-_]/.test(t)},fromUint8Array:el=(e,t=!1)=>t?Ja(Za(e)):Za(e),toUint8Array:pl,extendString:yl,extendUint8Array:bl,extendBuiltins:wl},El=function(e){function t(r,n){var i=e.call(this,n)||this;return i.statusCode=r,Object.setPrototypeOf(i,t.prototype),i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Sa(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}(t,e),t}(Error),function(){function e(e,t,r){this.deploymentKey=e,this.serverUrl=t,this.httpClient=r}return e.prototype.getVariants=function(e,t){return _l(this,void 0,void 0,function(){var r,n,i;return Rl(this,function(o){switch(o.label){case 0:return r=Sl.encodeURL(JSON.stringify(e)),n={Authorization:"Api-Key ".concat(this.deploymentKey),"X-Amp-Exp-User":r},(null==t?void 0:t.flagKeys)&&(n["X-Amp-Exp-Flag-Keys"]=Sl.encodeURL(JSON.stringify(t.flagKeys))),(null==t?void 0:t.trackingOption)&&(n["X-Amp-Exp-Track"]=t.trackingOption),[4,this.httpClient.request({requestUrl:"".concat(this.serverUrl,"/sdk/v2/vardata?v=0"),method:"GET",headers:n,timeoutMillis:null==t?void 0:t.timeoutMillis})];case 1:if(200!=(i=o.sent()).status)throw new El(i.status,"Fetch error response: status=".concat(i.status));return[2,JSON.parse(i.body)]}})})},e}(),function(){function e(e,t,r){this.deploymentKey=e,this.serverUrl=t,this.httpClient=r}return e.prototype.getFlags=function(e){return _l(this,void 0,void 0,function(){var t,r;return Rl(this,function(n){switch(n.label){case 0:return t={Authorization:"Api-Key ".concat(this.deploymentKey)},(null==e?void 0:e.libraryName)&&(null==e?void 0:e.libraryVersion)&&(t["X-Amp-Exp-Library"]="".concat(e.libraryName,"/").concat(e.libraryVersion)),[4,this.httpClient.request({requestUrl:"".concat(this.serverUrl,"/sdk/v2/flags"),method:"GET",headers:t,timeoutMillis:null==e?void 0:e.timeoutMillis})];case 1:if(200!=(r=n.sent()).status)throw Error("Flags error response: status=".concat(r.status));return[2,JSON.parse(r.body).reduce(function(e,t){return e[t.key]=t,e},{})]}})})},e}(),kl="undefined"!=typeof globalThis?globalThis:global||self,function(){function e(e,t){this.poller=void 0,this.action=e,this.ms=t}return e.prototype.start=function(){this.poller||(this.poller=kl.setInterval(this.action,this.ms),this.action())},e.prototype.stop=function(){this.poller&&(kl.clearInterval(this.poller),this.poller=void 0)},e}()}}),Ul=l({"../../../../node_modules/@amplitude/targeting/lib/esm/targeting-idb-store.js"(){Ne(),As(),Ml=new(function(){return function(){var e=this;this.dbs={},this.createStore=function(t){return v(e,void 0,void 0,function(){return m(this,function(e){switch(e.label){case 0:return[4,vs(t,1,{upgrade:function(e){e.objectStoreNames.contains("eventTypesForSession")||e.createObjectStore("eventTypesForSession",{keyPath:"sessionId"})}})];case 1:return[2,e.sent()]}})})},this.openOrCreateDB=function(t){return v(e,void 0,void 0,function(){var e,r;return m(this,function(n){switch(n.label){case 0:return this.dbs&&this.dbs[t]?[2,this.dbs[t]]:(e="".concat(t.substring(0,10),"_amp_targeting"),[4,this.createStore(e)]);case 1:return r=n.sent(),this.dbs[t]=r,[2,r]}})})},this.updateEventListForSession=function(r){var n=r.sessionId,i=r.eventType,o=r.eventTime,s=r.loggerProvider,a=r.tx;return v(e,void 0,void 0,function(){var e,r,l,u,c,d,h;return m(this,function(p){switch(p.label){case 0:return p.trys.push([0,3,,4]),[4,a.store.get(n)];case 1:return e=p.sent(),r=e?e.eventTypes:{},l=r[i]||{},u=t(t({},r),((d={})[i]=t(t({},l),((h={})[o]={event_type:i},h)),d)),[4,a.store.put({sessionId:n,eventTypes:u})];case 2:return p.sent(),[2,u];case 3:return c=p.sent(),s.warn("Failed to store events for targeting ".concat(n,": ").concat(c)),[3,4];case 4:return[2,void 0]}})})},this.deleteOldSessionEventTypes=function(t){var r=t.currentSessionId,n=t.loggerProvider,i=t.tx;return v(e,void 0,void 0,function(){var e,t,o,s,a;return m(this,function(l){switch(l.label){case 0:return l.trys.push([0,6,,7]),[4,i.store.getAll()];case 1:e=l.sent(),t=0,l.label=2;case 2:return t<e.length?(o=e[t],s=Date.now()-o.sessionId,o.sessionId!==r&&s>1728e5?[4,i.store.delete(o.sessionId)]:[3,4]):[3,5];case 3:l.sent(),l.label=4;case 4:return t++,[3,2];case 5:return[3,7];case 6:return a=l.sent(),n.warn("Failed to clear old session events for targeting: ".concat(a)),[3,7];case 7:return[2]}})})},this.storeEventTypeForSession=function(t){var r=t.loggerProvider,n=t.sessionId,i=t.eventType,o=t.eventTime,s=t.apiKey;return v(e,void 0,void 0,function(){var e,t,a,l;return m(this,function(u){switch(u.label){case 0:return u.trys.push([0,5,,6]),[4,this.openOrCreateDB(s)];case 1:return e=u.sent(),(t=e.transaction("eventTypesForSession","readwrite"))?[4,this.updateEventListForSession({sessionId:n,tx:t,loggerProvider:r,eventType:i,eventTime:o})]:[2];case 2:return a=u.sent(),[4,this.deleteOldSessionEventTypes({currentSessionId:n,tx:t,loggerProvider:r})];case 3:return u.sent(),[4,t.done];case 4:return u.sent(),[2,a];case 5:return l=u.sent(),r.warn("Failed to store events for targeting ".concat(n,": ").concat(l)),[3,6];case 6:return[2,void 0]}})})}}}())}}),Fl=l({"../../../../node_modules/@amplitude/targeting/lib/esm/targeting.js"(){Ne(),jl(),Ul(),Nl=function(){return function(){var e=this;this.evaluateTargeting=function(t){var r=t.apiKey,n=t.loggerProvider,i=t.event,o=t.sessionId,s=t.userProperties,a=t.deviceId,l=t.flag;return v(e,void 0,void 0,function(){var e,t,u,c;return m(this,function(d){switch(d.label){case 0:return i&&i.time?[4,Ml.storeEventTypeForSession({loggerProvider:n,apiKey:r,sessionId:o,eventType:i.event_type,eventTime:i.time})]:[3,2];case 1:return t=d.sent(),[3,3];case 2:t=void 0,d.label=3;case 3:return u=(e=t)&&new Set(Object.keys(e)),c={session_id:o,event:i,event_types:u&&Array.from(u),user:{device_id:a,user_properties:s}},[2,this.evaluationEngine.evaluate(c,[l])]}})})},this.evaluationEngine=new Da}}()}}),Bl=l({"../../../../node_modules/@amplitude/targeting/lib/esm/targeting-factory.js"(){Fl(),Ll=function(){var e=new Nl;return{evaluateTargeting:e.evaluateTargeting.bind(e)}}()}}),ql={};c(ql,{evaluateTargeting:()=>Dl});var zl,Vl,Wl,Hl,$l,Gl,Kl=l({"../../../../node_modules/@amplitude/targeting/lib/esm/index.js"(){Bl(),Dl=Ll.evaluateTargeting}}),Jl=l({"../../../../node_modules/@amplitude/session-replay-browser/lib/esm/targeting/targeting-manager.js"(){Ne(),Al(),zl=function(e){var r=e.sessionId,n=e.targetingConfig,i=e.loggerProvider,o=e.apiKey,s=e.targetingParams,a=e.urlChange,l=void 0!==a&&a;return v(void 0,void 0,void 0,function(){var e,a,u,c,d,h;return m(this,function(p){switch(p.label){case 0:return[4,wa.clearStoreOfOldSessions({loggerProvider:i,apiKey:o,currentSessionId:r})];case 1:return p.sent(),[4,wa.getTargetingMatchForSession({loggerProvider:i,apiKey:o,sessionId:r})];case 2:if(!0===p.sent()&&!l)return[2,!0];e=!0,p.label=3;case 3:return p.trys.push([3,6,,7]),[4,Promise.resolve().then(()=>(Kl(),ql))];case 4:return a=p.sent().evaluateTargeting,u=t(t({},s),{flag:n,sessionId:"string"==typeof r?parseInt(r,10):r,apiKey:o,loggerProvider:i}),[4,a(u)];case 5:return(c=p.sent())&&c.sr_targeting_config&&(e="on"===c.sr_targeting_config.key),wa.storeTargetingMatchForSession({loggerProvider:i,apiKey:o,sessionId:r,targetingMatch:e}),[3,7];case 6:return d=p.sent(),h=d,i.warn(h.message),[3,7];case 7:return[2,e]}})})}}});function Ql(e,t){return(e<<t|e>>>32-t)>>>0}function Yl(e,t){return e=Ql(e=e+Math.imul(t,Wl)>>>0,13),e=Math.imul(e,Vl)>>>0}function Xl(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function Zl(e,t){void 0===t&&(t=0);var r,n=function(e){for(var t=[],r=0;r<e.length;r++){var n=e.charCodeAt(r);if(n>=55296&&n<=56319&&r+1<e.length){var i=e.charCodeAt(r+1);i>=56320&&i<=57343&&(n=i-56320+(n-55296<<10)+65536,r++)}n<128?t.push(n):n<2048?t.push(192|n>>6,128|63&n):n<65536?t.push(224|n>>12,128|n>>6&63,128|63&n):t.push(240|n>>18,128|n>>12&63,128|n>>6&63,128|63&n)}return new Uint8Array(t)}(e),i=n.length,o=0;if(i>=16){for(var s=t+Vl+Wl>>>0,a=t+Wl>>>0,l=t>>>0,u=t-Vl>>>0;o<=i-16;)s=Yl(s,Xl(n,o)),a=Yl(a,Xl(n,o+=4)),l=Yl(l,Xl(n,o+=4)),u=Yl(u,Xl(n,o+=4)),o+=4;r=Ql(s,1)+Ql(a,7)+Ql(l,12)+Ql(u,18)>>>0}else r=t+Gl>>>0;for(r=r+i>>>0;o<=i-4;)r=r+Math.imul(Xl(n,o),Hl)>>>0,r=Math.imul(Ql(r,17),$l)>>>0,o+=4;for(;o<i;)r=r+Math.imul(n[o],Gl)>>>0,r=Math.imul(Ql(r,11),Vl)>>>0,o++;return r^=r>>>15,r=Math.imul(r,Wl)>>>0,r^=r>>>13,r=Math.imul(r,Hl)>>>0,(r^=r>>>16)>>>0}var eu,tu,ru=l({"../../../../node_modules/@amplitude/session-replay-browser/lib/esm/sampling.js"(){Vl=2654435761,Wl=2246822519,Hl=3266489917,$l=668265263,Gl=374761393}});function nu(e,t,r){if(void 0===r&&(r={}),!(null==e?void 0:e.location))return function(){};var n=r.enablePolling,i=void 0!==n&&n,o=r.pollingInterval,s=void 0===o?bi:o;if(i){var a=function(){var t;return null!==(t=e.location.href)&&void 0!==t?t:""},l=a(),u=e.setInterval(function(){var e=a();e!==l&&(l=e,t(e))},s);return function(){null!=u&&e.clearInterval(u)}}var c=tu.get(e);if(!c){var d=void 0,h=new Set,p=function(){var t,r=null!==(t=e.location.href)&&void 0!==t?t:"";void 0!==d&&r===d||(d=r,h.forEach(function(e){return e(r)}))},f=function(e){var t=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=e.apply(this,t);return p(),n};return t[eu]=!0,t},g=e.history;if(null==g?void 0:g.pushState){var v=Reflect.get(g,"pushState");v[eu]||(g.pushState=f(v))}if(null==g?void 0:g.replaceState){var m=Reflect.get(g,"replaceState");m[eu]||(g.replaceState=f(m))}c={callbacks:h,notify:p,onPopStateOrHashChange:function(){return p()},listenersAttached:!1},tu.set(e,c)}var y=c;return y.listenersAttached||(e.addEventListener("popstate",y.onPopStateOrHashChange),e.addEventListener("hashchange",y.onPopStateOrHashChange),y.listenersAttached=!0),y.callbacks.add(t),function(){y.callbacks.delete(t),0===y.callbacks.size&&y.listenersAttached&&(e.removeEventListener("popstate",y.onPopStateOrHashChange),e.removeEventListener("hashchange",y.onPopStateOrHashChange),y.listenersAttached=!1)}}function iu(e){return void 0===e&&(e={}),{name:"amplitude/url-tracking@1",observer:function(r,n,i){var o,s,a,l=t(t({},e),i),u=l.ugcFilterRules||[],c=null!==(o=l.enablePolling)&&void 0!==o&&o,d=null!==(s=l.pollingInterval)&&void 0!==s?s:bi,h=null!==(a=l.captureDocumentTitle)&&void 0!==a&&a;if(!n)return function(){};var p=void 0,f=function(){return n.location&&n.location.href||""},g=function(){var e=f();if(void 0===p||e!==p){p=e;var t=function(){var e=n.innerHeight,t=n.innerWidth,r=n.document,i=f(),o="";return h&&(o=(null==r?void 0:r.title)||""),{href:u.length>0?ho(i,u):i,title:o,viewportHeight:e,viewportWidth:t,type:"url-change-event"}}();r(t)}},v=nu(n,function(){return g()},c?{enablePolling:!0,pollingInterval:d}:{});return g(),function(){return v()}},options:e}}var ou,su=l({"../../../../node_modules/@amplitude/session-replay-browser/lib/esm/plugins/url-tracking-plugin.js"(){Ne(),bo(),Ji(),eu="__amplitude_url_tracking_patched__",tu=new WeakMap,iu()}});var au,lu,uu=l({"../../../../node_modules/@amplitude/session-replay-browser/lib/esm/cross-origin-iframes.js"(){Ne(),Ki(),Ji(),ou=function(){function e(){this.pendingLoadListeners=new Map}return e.prototype.start=function(){var e,t=this;null===(e=this.mutationObserver)||void 0===e||e.disconnect(),de()&&(this.sendToAllIframes({type:Vi,action:"start"}),this.mutationObserver=new MutationObserver(function(e){var r,n,i,o,s,a;try{for(var l=y(e),u=l.next();!u.done;u=l.next()){var c=u.value;try{for(var d=(i=void 0,y(Array.from(c.addedNodes))),h=d.next();!h.done;h=d.next()){(g=h.value)instanceof HTMLIFrameElement?t.sendToIframeAfterLoad(g):g instanceof Element&&g.querySelectorAll("iframe").forEach(function(e){t.sendToIframeAfterLoad(e)})}}catch(e){i={error:e}}finally{try{h&&!h.done&&(o=d.return)&&o.call(d)}finally{if(i)throw i.error}}try{for(var p=(s=void 0,y(Array.from(c.removedNodes))),f=p.next();!f.done;f=p.next()){var g;if((g=f.value)instanceof HTMLIFrameElement){var v=t.pendingLoadListeners.get(g);v&&(g.removeEventListener("load",v),t.pendingLoadListeners.delete(g))}}}catch(e){s={error:e}}finally{try{f&&!f.done&&(a=p.return)&&a.call(p)}finally{if(s)throw s.error}}}}catch(e){r={error:e}}finally{try{u&&!u.done&&(n=l.return)&&n.call(l)}finally{if(r)throw r.error}}}),this.mutationObserver.observe(document.documentElement,{childList:!0,subtree:!0}))},e.prototype.stop=function(){var e;null===(e=this.mutationObserver)||void 0===e||e.disconnect(),this.mutationObserver=void 0,this.pendingLoadListeners.forEach(function(e,t){t.removeEventListener("load",e)}),this.pendingLoadListeners.clear(),this.sendToAllIframes({type:Vi,action:"stop"})},e.prototype.sendToIframeAfterLoad=function(e){var t=this,r=function(){t.pendingLoadListeners.delete(e),t.sendToIframe(e,{type:Vi,action:"start"})};this.pendingLoadListeners.set(e,r),e.addEventListener("load",r,{once:!0})},e.prototype.sendToAllIframes=function(e){var t=this;document.querySelectorAll("iframe").forEach(function(r){return t.sendToIframe(r,e)})},e.prototype.sendToIframe=function(e,t){var r;try{null===(r=e.contentWindow)||void 0===r||r.postMessage(t,"*")}catch(e){}},e}()}}),cu={};c(cu,{compressionScript:()=>au,trackDestinationScript:()=>lu});var du,hu,pu,fu,gu,vu,mu,yu,bu,wu,Su,Eu,ku,xu,Cu,Iu,Ou,Tu,Au,_u,Ru,Pu,Mu,Nu,Lu,Du,ju,Uu,Fu,Bu,qu,zu,Vu,Wu,Hu,$u,Gu,Ku,Ju,Qu,Yu,Xu,Zu,ec,tc,rc,nc,ic,oc,sc,ac,lc,uc,cc,dc,hc,pc,fc,gc,vc,mc,yc,bc,wc,Sc,Ec,kc,xc,Cc,Ic,Oc,Tc,Ac,_c,Rc,Pc,Mc,Nc,Lc,Dc,jc,Uc,Fc,Bc,qc,zc,Vc,Wc,Hc,$c,Gc,Kc,Jc,Qc,Yc,Xc,Zc,ed,td,rd,nd,id,od,sd,ad,ld,ud,cd,dd,hd,pd,fd,gd,vd,md,yd,bd,wd,Sd,Ed,kd,xd,Cd,Id,Od,Td,Ad,_d,Rd,Pd,Md,Nd,Ld,Dd,jd,Ud,Fd,Bd,qd,zd,Vd,Wd,Hd,$d,Gd,Kd,Jd,Qd,Yd,Xd,Zd,eh,th,rh,nh,ih,oh,sh,ah,lh,uh,ch,dh,hh,ph,fh,gh,vh,mh,yh,bh=l({"../../../../node_modules/@amplitude/session-replay-browser/lib/esm/worker/index.js"(){au='var WebWorker=function(e){"use strict";onmessage=function(e){var s="string"==typeof e.data?JSON.parse(e.data):e.data,t=s.event,a=s.sessionId,n=t.type,r=t.timestamp,i=t.delay,o=t.data,d=null!=i?JSON.stringify({type:n,timestamp:r,delay:i,data:o}):JSON.stringify({type:n,timestamp:r,data:o});postMessage({compressedEvent:d,sessionId:a})};var s=onmessage;return e.compressionOnMessage=s,Object.defineProperty(e,"__esModule",{value:!0}),e}({});\n',lu='var WebWorker=function(e){"use strict";var t,r=function(){return r=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var s in t=arguments[r])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},r.apply(this,arguments)};function n(e,t,r,n){return new(r||(r=Promise))(function(s,a){function o(e){try{c(n.next(e))}catch(e){a(e)}}function i(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(o,i)}c((n=n.apply(e,t||[])).next())})}function s(e,t){var r,n,s,a={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return o.next=i(0),o.throw=i(1),o.return=i(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function i(i){return function(c){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,i[0]&&(a=0)),a;)try{if(r=1,n&&(s=2&i[0]?n.return:i[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,i[1])).done)return s;switch(n=0,s&&(i=[2&i[0],s.value]),i[0]){case 0:case 1:s=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(s=a.trys,(s=s.length>0&&s[s.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!s||i[1]>s[0]&&i[1]<s[3])){a.label=i[1];break}if(6===i[0]&&a.label<s[1]){a.label=s[1],s=i;break}if(s&&a.label<s[2]){a.label=s[2],a.ops.push(i);break}s[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=s=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}"function"==typeof SuppressedError&&SuppressedError,function(e){e.US="US",e.EU="EU",e.STAGING="STAGING"}(t||(t={})),t.US;var a,o=/payload.*exceed/i;!function(e){e.GET_SR_PROPS="get-sr-props",e.DEBUG_INFO="debug-info",e.FETCH_REQUEST="fetch-request",e.METADATA="metadata",e.TARGETING_DECISION="targeting-decision",e.REPLAY_GATE_DECISION="replay-gate-decision"}(a||(a={}));var i="Network error occurred, event batch rejected";function c(e,t){return n(this,void 0,void 0,function(){var r,a,o,i,c,u,l,d,p,f,h,v,y,g,b=this;return s(this,function(m){switch(m.label){case 0:return m.trys.push([0,4,,5]),r=t.CompressionStream,a=new r("gzip"),o=a.writable.getWriter(),i=a.readable.getReader(),c=[],u=n(b,void 0,void 0,function(){var e,t,r;return s(this,function(n){switch(n.label){case 0:return[4,i.read()];case 1:if(e=n.sent(),t=e.done,r=e.value,t)return[3,3];c.push(r),n.label=2;case 2:return[3,0];case 3:return[2]}})}),[4,o.write((new TextEncoder).encode(e))];case 1:return m.sent(),[4,o.close()];case 2:return m.sent(),[4,u];case 3:m.sent(),l=c.reduce(function(e,t){return e+t.length},0),d=new Uint8Array(l),p=0;try{for(f=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(c),h=f.next();!h.done;h=f.next())v=h.value,d.set(v,p),p+=v.length}catch(e){y={error:e}}finally{try{h&&!h.done&&(g=f.return)&&g.call(f)}finally{if(y)throw y.error}}return[2,d];case 4:return m.sent(),[2,null];case 5:return[2]}})})}function u(e,t){var a,u,l,d,p,f,h;return n(this,void 0,void 0,function(){var n,v,y,g,b,m,S,w,T,E,R,k;return s(this,function(s){switch(s.label){case 0:return s.trys.push([0,10,,11]),"CompressionStream"in self?[4,c(e,self)]:[3,2];case 1:return v=s.sent(),[3,3];case 2:v=null,s.label=3;case 3:return n=v,y="".concat(null!==(u=null===(a=t.version)||void 0===a?void 0:a.type)&&void 0!==u?u:"standalone","/").concat(null!==(d=null===(l=t.version)||void 0===l?void 0:l.version)&&void 0!==d?d:t.sdkVersion),g=new URLSearchParams({device_id:t.deviceId,session_id:"".concat(t.sessionId),type:t.eventType}),b="".concat((x=t.serverZone,C=t.trackServerUrl,C||("STAGING"===x?"https://api-sr.stag2.amplitude.com/sessions/v2/track":"EU"===x?"https://api-sr.eu.amplitude.com/sessions/v2/track":"https://api-sr.amplitude.com/sessions/v2/track")),"?").concat(g.toString()),m=r({"Content-Type":"application/json",Accept:"*/*",Authorization:"Bearer ".concat(t.apiKey),"X-Client-Version":t.sdkVersion,"X-Client-Library":y,"X-Client-Url":t.currentUrl.substring(0,1e3),"X-Client-Sample-Rate":"".concat(t.sampleRate),"X-Sampling-Hash-Alg":"xxhash32"},n?{"Content-Encoding":"gzip"}:{}),S=n?n.byteLength:new Blob([e]).size,[4,fetch(b,{method:"POST",headers:m,body:null!=n?n:e,keepalive:S<=65536})];case 4:if(null===(w=s.sent()))return[2,{shouldRetry:!1,success:!1,message:"Unexpected error occurred"}];if(w.status>=200&&w.status<300)return T=Math.round(new Blob(t.events).size/1024),E=null!==(h=null===(f=null===(p=w.headers)||void 0===p?void 0:p.get)||void 0===f?void 0:f.call(p,"X-Session-Replay-Event-Skipped"))&&void 0!==h?h:null,[2,{shouldRetry:!1,success:!0,message:"Session replay event batch tracked successfully for session id ".concat(t.sessionId,", size of events: ").concat(T," KB"),skipCode:E}];if(413!==w.status)return[3,9];R="",s.label=5;case 5:return s.trys.push([5,7,,8]),[4,w.text()];case 6:return R=s.sent(),[3,8];case 7:return s.sent(),[3,8];case 8:return[2,{shouldRetry:!1,success:!1,message:i,payloadTooLarge:!0,isWaf:o.test(R)}];case 9:return w.status>=500||408===w.status||429===w.status||499===w.status?[2,{shouldRetry:!0,success:!1,message:"HTTP ".concat(w.status)}]:[2,{shouldRetry:!1,success:!1,message:i}];case 10:return k=s.sent(),[2,{shouldRetry:!1,success:!1,message:String(k)}];case 11:return[2]}var x,C})})}function l(e,t,r,a){var o;return n(this,void 0,void 0,function(){var n,i,c;return s(this,function(s){switch(s.label){case 0:n=1,s.label=1;case 1:return[4,u(t,r)];case 2:return(i=s.sent()).success?(postMessage({type:"log",id:e,message:i.message}),postMessage({type:"complete",id:e,skipCode:null!==(o=i.skipCode)&&void 0!==o?o:null}),[2]):i.payloadTooLarge&&a?(postMessage({type:"payload_too_large",id:e,isWaf:!0===i.isWaf}),[2]):a&&i.shouldRetry&&n<r.flushMaxRetries?[4,new Promise(function(e){return setTimeout(e,Math.random()*n*1e3)})]:[3,4];case 3:return s.sent(),n++,[3,5];case 4:return c=n>=r.flushMaxRetries?"Session replay event batch rejected due to exceeded retry count":i.message,postMessage({type:"warn",id:e,message:c}),postMessage({type:"complete",id:e}),[2];case 5:return[3,1];case 6:return[2]}})})}onmessage=function(e){return n(void 0,void 0,void 0,function(){var t,r,n,a,o,i,c;return s(this,function(s){switch(s.label){case 0:return t=e.data,r=t.type,n=t.id,a=t.payload,o=t.context,i=t.useRetry,"send"!==r?[3,2]:(c=JSON.stringify(a),[4,l(n,c,o,i)]);case 1:s.sent(),s.label=2;case 2:return[2]}})})};var d=onmessage;return e.trackDestinationOnMessage=d,Object.defineProperty(e,"__esModule",{value:!0}),e}({});\n'}}),wh={};function Sh(e){if(ku[e])return ku[e];const t=function(e){var t,r;const n=null==(r=null==(t=null==globalThis?void 0:globalThis.Zone)?void 0:t.__symbol__)?void 0:r.call(t,e);return n&&globalThis[n]?globalThis[n]:void 0}(e)||globalThis[e],r=t.prototype,n=e in Su?Su[e]:void 0,i=Boolean(n&&n.every(e=>{var t,n;return Boolean(null==(n=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:n.toString().includes("[native code]"))})),o=e in Eu?Eu[e]:void 0,s=Boolean(o&&o.every(e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))}));if(i&&s)return ku[e]=t.prototype,t.prototype;try{const n=document.createElement("iframe");document.body.appendChild(n);const i=n.contentWindow;if(!i)return t.prototype;const o=i[e].prototype;return document.body.removeChild(n),o?ku[e]=o:r}catch(e){return r}}function Eh(e,t,r){var n;const i=`${e}.${String(r)}`;if(xu[i])return xu[i].call(t);const o=Sh(e),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(xu[i]=s,s.call(t)):t[r]}function kh(e,t,r){const n=`${e}.${String(r)}`;if(Cu[n])return Cu[n].bind(t);const i=Sh(e)[r];return"function"!=typeof i?t[r]:(Cu[n]=i,i.bind(t))}function xh(e){return Eh("Node",e,"childNodes")}function Ch(e){return Eh("Node",e,"parentNode")}function Ih(e){return Eh("Node",e,"parentElement")}function Oh(e){return Eh("Node",e,"textContent")}function Th(e,t){return kh("Node",e,"contains")(t)}function Ah(e){return kh("Node",e,"getRootNode")()}function _h(e){return e&&"host"in e?Eh("ShadowRoot",e,"host"):null}function Rh(e){return e.styleSheets}function Ph(e){return e&&"shadowRoot"in e?Eh("Element",e,"shadowRoot"):null}function Mh(e,t){return Eh("Element",e,"querySelector")(t)}function Nh(e,t){return Eh("Element",e,"querySelectorAll")(t)}function Lh(){return Sh("MutationObserver").constructor}function Dh(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&Dh(Iu.parentNode(e),t,r);for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!!r&&Dh(Iu.parentNode(e),t,r)}function jh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Uh(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if("function"==typeof t){var r=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}),r}function Fh(){if(_u)return Au.exports;_u=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e}};return Au.exports=t(),Au.exports.createColors=t,Au.exports}function Bh(){if(Lu)return Nu;Lu=1;let e=Fh(),t=Mu;class r extends Error{constructor(e,t,n,i,o,s){super(e),this.name="CssSyntaxError",this.reason=e,o&&(this.file=o),i&&(this.source=i),s&&(this.plugin=s),void 0!==t&&void 0!==n&&("number"==typeof t?(this.line=t,this.column=n):(this.line=t.line,this.column=t.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,r)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(r){if(!this.source)return"";let n=this.source;null==r&&(r=e.isColorSupported),t&&r&&(n=t(n));let i,o,s=n.split(/\r?\n/),a=Math.max(this.line-3,0),l=Math.min(this.line+2,s.length),u=String(l).length;if(r){let{bold:t,gray:r,red:n}=e.createColors(!0);i=e=>t(n(e)),o=e=>r(e)}else i=o=e=>e;return s.slice(a,l).map((e,t)=>{let r=a+1+t,n=" "+(" "+r).slice(-u)+" | ";if(r===this.line){let t=o(n.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return i(">")+o(n)+e+"\n "+t+i("^")}return" "+o(n)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}return Nu=r,r.default=r,Nu}function qh(){return ju||(ju=1,Du.isClean=Symbol("isClean"),Du.my=Symbol("my")),Du}function zh(){if(Fu)return Uu;Fu=1;const e={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};class t{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name,n=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?r+=e.raws.afterName:n&&(r+=" "),e.nodes)this.block(e,r+n);else{let i=(e.raws.between||"")+(t?";":"");this.builder(r+n+i,e)}}beforeAfter(e,t){let r;r="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let n=e.parent,i=0;for(;n&&"root"!==n.type;)i+=1,n=n.parent;if(r.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<i;e++)r+=t}return r}block(e,t){let r,n=this.raw(e,"between","beforeOpen");this.builder(t+n+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),r=this.raw(e,"after")):r=this.raw(e,"after","emptyBody"),r&&this.builder(r),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let r=this.raw(e,"semicolon");for(let n=0;n<e.nodes.length;n++){let i=e.nodes[n],o=this.raw(i,"before");o&&this.builder(o),this.stringify(i,t!==n||r)}}comment(e){let t=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)}decl(e,t){let r=this.raw(e,"between","colon"),n=e.prop+r+this.rawValue(e,"value");e.important&&(n+=e.raws.important||" !important"),t&&(n+=";"),this.builder(n,e)}document(e){this.body(e)}raw(t,r,n){let i;if(n||(n=r),r&&(i=t.raws[r],void 0!==i))return i;let o=t.parent;if("before"===n){if(!o||"root"===o.type&&o.first===t)return"";if(o&&"document"===o.type)return""}if(!o)return e[n];let s=t.root();if(s.rawCache||(s.rawCache={}),void 0!==s.rawCache[n])return s.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(t,n);{let e="raw"+((a=n)[0].toUpperCase()+a.slice(1));this[e]?i=this[e](s,t):s.walk(e=>{if(i=e.raws[r],void 0!==i)return!1})}var a;return void 0===i&&(i=e[n]),s.rawCache[n]=i,i}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let r;return e.walkComments(e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),void 0===r?r=this.raw(t,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(e,t){let r;return e.walkDecls(e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),void 0===r?r=this.raw(t,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(e){let t;return e.walk(r=>{if(r.nodes&&(r.parent!==e||e.first!==r)&&void 0!==r.raws.before)return t=r.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(r=>{let n=r.parent;if(n&&n!==e&&n.parent&&n.parent===e&&void 0!==r.raws.before){let e=r.raws.before.split("\n");return t=e[e.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){let r=e[t],n=e.raws[t];return n&&n.value===r?n.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}}return Uu=t,t.default=t,Uu}function Vh(){if(qu)return Bu;qu=1;let e=zh();function t(t,r){new e(r).stringify(t)}return Bu=t,t.default=t,Bu}function Wh(){if(Vu)return zu;Vu=1;let{isClean:e,my:t}=qh(),r=Bh(),n=zh(),i=Vh();function o(e,t){let r=new e.constructor;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if("proxyCache"===n)continue;let i=e[n],s=typeof i;"parent"===n&&"object"===s?t&&(r[n]=t):"source"===n?r[n]=i:Array.isArray(i)?r[n]=i.map(e=>o(e,r)):("object"===s&&null!==i&&(i=o(i)),r[n]=i)}return r}class s{constructor(r={}){this.raws={},this[e]=!1,this[t]=!0;for(let e in r)if("nodes"===e){this.nodes=[];for(let t of r[e])"function"==typeof t.clone?this.append(t.clone()):this.append(t)}else this[e]=r[e]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=o(this);for(let r in e)t[r]=e[r];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:r,start:n}=this.rangeBy(t);return this.source.input.error(e,{column:n.column,line:n.line},{column:r.column,line:r.line},t)}return new r(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markDirty(){if(this[e]){this[e]=!1;let t=this;for(;t=t.parent;)t[e]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){let n=(t=this.toString()).indexOf(e.word);-1!==n&&(r=this.positionInside(n,t))}return r}positionInside(e,t){let r=t||this.toString(),n=this.source.start.column,i=this.source.start.line;for(let t=0;t<e;t++)"\n"===r[t]?(n=1,i+=1):n+=1;return{column:n,line:i}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let n=this.toString(),i=n.indexOf(e.word);-1!==i&&(t=this.positionInside(i,n),r=this.positionInside(i+e.word.length,n))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return(new n).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let n of e)n===this?r=!0:r?(this.parent.insertAfter(t,n),t=n):this.parent.insertBefore(t,n);r||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let r={},n=null==t;t=t||new Map;let i=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let n=this[e];if(Array.isArray(n))r[e]=n.map(e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e);else if("object"==typeof n&&n.toJSON)r[e]=n.toJSON(null,t);else if("source"===e){let o=t.get(n.input);null==o&&(o=i,t.set(n.input,i),i++),r[e]={end:n.end,inputId:o,start:n.start}}else r[e]=n}return n&&(r.inputs=[...t.keys()].map(e=>e.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=i){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){let n={node:this};for(let e in r)n[e]=r[e];return e.warn(t,n)}get proxyOf(){return this}}return zu=s,s.default=s,zu}function Hh(){if(Hu)return Wu;Hu=1;let e=Wh();class t extends e{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}}return Wu=t,t.default=t,Wu}function $h(){if(Gu)return $u;Gu=1;return $u={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(r=t)=>{let n="",i=r;for(;i--;)n+=e[Math.random()*e.length|0];return n}}}function Gh(){if(Ju)return Ku;Ju=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Mu,{existsSync:r,readFileSync:n}=Mu,{dirname:i,join:o}=Mu;class s{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,n=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=i(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new e(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t;let r=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+r)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let r=e.lastIndexOf(t.pop()),n=e.indexOf("*/",r);r>-1&&n>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,n)))}loadFile(e){if(this.root=i(e),r(e))return this.mapFile=e,n(e,"utf-8").toString().trim()}loadMap(r,n){if(!1===n)return!1;if(n){if("string"==typeof n)return n;if("function"!=typeof n){if(n instanceof e)return t.fromSourceMap(n).toString();if(n instanceof t)return n.toString();if(this.isMap(n))return JSON.stringify(n);throw new Error("Unsupported previous source map format: "+n.toString())}{let e=n(r);if(e){let t=this.loadFile(e);if(!t)throw new Error("Unable to load previous source map: "+e.toString());return t}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let e=this.annotation;return r&&(e=o(i(r),e)),this.loadFile(e)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return Ku=s,s.default=s,Ku}function Kh(){if(Yu)return Qu;Yu=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Mu,{fileURLToPath:r,pathToFileURL:n}=Mu,{isAbsolute:i,resolve:o}=Mu,{nanoid:s}=$h(),a=Mu,l=Bh(),u=Gh(),c=Symbol("fromOffsetCache"),d=Boolean(e&&t),h=Boolean(o&&i);class p{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||""===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!h||/^\w+:\/\//.test(t.from)||i(t.from)?this.file=t.from:this.file=o(t.from)),h&&d){let e=new u(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+s(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,i={}){let o,s,a;if(t&&"object"==typeof t){let e=t,n=r;if("number"==typeof e.offset){let n=this.fromOffset(e.offset);t=n.line,r=n.col}else t=e.line,r=e.column;if("number"==typeof n.offset){let e=this.fromOffset(n.offset);s=e.line,a=e.col}else s=n.line,a=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let u=this.origin(t,r,s,a);return o=u?new l(e,void 0===u.endLine?u.line:{column:u.column,line:u.line},void 0===u.endLine?u.column:{column:u.endColumn,line:u.endLine},u.source,u.file,i.plugin):new l(e,void 0===s?t:{column:r,line:t},void 0===s?r:{column:a,line:s},this.css,this.file,i.plugin),o.input={column:r,endColumn:a,endLine:s,line:t,source:this.css},this.file&&(n&&(o.input.url=n(this.file).toString()),o.input.file=this.file),o}fromOffset(e){let t,r;if(this[c])r=this[c];else{let e=this.css.split("\n");r=new Array(e.length);let t=0;for(let n=0,i=e.length;n<i;n++)r[n]=t,t+=e[n].length+1;this[c]=r}t=r[r.length-1];let n=0;if(e>=t)n=r.length-1;else{let t,i=r.length-2;for(;n<i;)if(t=n+(i-n>>1),e<r[t])i=t-1;else{if(!(e>=r[t+1])){n=t;break}n=t+1}}return{col:e-r[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:o(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,o,s){if(!this.map)return!1;let a,l,u=this.map.consumer(),c=u.originalPositionFor({column:t,line:e});if(!c.source)return!1;"number"==typeof o&&(a=u.originalPositionFor({column:s,line:o})),l=i(c.source)?n(c.source):new URL(c.source,this.map.consumer().sourceRoot||n(this.map.mapFile));let d={column:c.column,endColumn:a&&a.column,endLine:a&&a.line,line:c.line,url:l.toString()};if("file:"===l.protocol){if(!r)throw new Error("file: protocol is not available in this PostCSS build");d.file=r(l)}let h=u.sourceContentFor(c.source);return h&&(d.source=h),d}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}}return Qu=p,p.default=p,a&&a.registerInput&&a.registerInput(p),Qu}function Jh(){if(Zu)return Xu;Zu=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Mu,{dirname:r,relative:n,resolve:i,sep:o}=Mu,{pathToFileURL:s}=Mu,a=Kh(),l=Boolean(e&&t),u=Boolean(r&&i&&n&&o);return Xu=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let t of this.previous()){let n,i=this.toUrl(this.path(t.file)),o=t.root||r(t.file);!1===this.mapOpts.sourcesContent?(n=new e(t.text),n.sourcesContent&&(n.sourcesContent=null)):n=t.consumer(),this.map.applySourceMap(n,i,this.toUrl(this.path(o)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),u&&l&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=t.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0});let e,r,n=1,i=1,o="<no source>",s={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(t,a,l)=>{if(this.css+=t,a&&"end"!==l&&(s.generated.line=n,s.generated.column=i-1,a.source&&a.source.start?(s.source=this.sourcePath(a),s.original.line=a.source.start.line,s.original.column=a.source.start.column-1,this.map.addMapping(s)):(s.source=o,s.original.line=1,s.original.column=0,this.map.addMapping(s))),e=t.match(/\n/g),e?(n+=e.length,r=t.lastIndexOf("\n"),i=t.length-r):i+=t.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(s.source=this.sourcePath(a),s.original.line=a.source.end.line,s.original.column=a.source.end.column-1,s.generated.line=n,s.generated.column=i-2,this.map.addMapping(s)):(s.source=o,s.original.line=1,s.original.column=0,s.generated.line=n,s.generated.column=i-1,this.map.addMapping(s)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let o=this.opts.to?r(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(o=r(i(o,this.mapOpts.annotation)));let s=n(o,e);return this.memoizedPaths.set(e,s),s}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new a(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let r=t.source.input.from;if(r&&!e[r]){e[r]=!0;let n=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(n,t.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(s){let t=s(e).toString();return this.memoizedFileURLs.set(e,t),t}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;"\\"===o&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}}}function Qh(){if(tc)return ec;tc=1;let e=Wh();class t extends e{constructor(e){super(e),this.type="comment"}}return ec=t,t.default=t,ec}function Yh(){if(nc)return rc;nc=1;let e,t,r,n,{isClean:i,my:o}=qh(),s=Hh(),a=Qh(),l=Wh();function u(e){return e.map(e=>(e.nodes&&(e.nodes=u(e.nodes)),delete e.source,e))}function c(e){if(e[i]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)c(t)}class d extends l{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,r,n=this.getIterator();for(;this.indexes[n]<this.proxyOf.nodes.length&&(t=this.indexes[n],r=e(this.proxyOf.nodes[t],t),!1!==r);)this.indexes[n]+=1;return delete this.indexes[n],r}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...r)=>e[t](...r.map(e=>"function"==typeof e?(t,r)=>e(t.toProxy(),r):e)):"every"===t||"some"===t?r=>e[t]((e,...t)=>r(e.toProxy(),...t)):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map(e=>e.toProxy()):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let r,n=this.index(e),i=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let e of i)this.proxyOf.nodes.splice(n+1,0,e);for(let e in this.indexes)r=this.indexes[e],n<r&&(this.indexes[e]=r+i.length);return this.markDirty(),this}insertBefore(e,t){let r,n=this.index(e),i=0===n&&"prepend",o=this.normalize(t,this.proxyOf.nodes[n],i).reverse();n=this.index(e);for(let e of o)this.proxyOf.nodes.splice(n,0,e);for(let e in this.indexes)r=this.indexes[e],n<=r&&(this.indexes[e]=r+o.length);return this.markDirty(),this}normalize(n,l){if("string"==typeof n)n=u(e(n).nodes);else if(void 0===n)n=[];else if(Array.isArray(n)){n=n.slice(0);for(let e of n)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===n.type&&"document"!==this.type){n=n.nodes.slice(0);for(let e of n)e.parent&&e.parent.removeChild(e,"ignore")}else if(n.type)n=[n];else if(n.prop){if(void 0===n.value)throw new Error("Value field is missed in node creation");"string"!=typeof n.value&&(n.value=String(n.value)),n=[new s(n)]}else if(n.selector)n=[new t(n)];else if(n.name)n=[new r(n)];else{if(!n.text)throw new Error("Unknown node type in node creation");n=[new a(n)]}return n.map(e=>(e[o]||d.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[i]&&c(e),void 0===e.raws.before&&l&&void 0!==l.raws.before&&(e.raws.before=l.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls(n=>{t.props&&!t.props.includes(n.prop)||t.fast&&!n.value.includes(t.fast)||(n.value=n.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,r)=>{let n;try{n=e(t,r)}catch(e){throw t.addToError(e)}return!1!==n&&t.walk&&(n=t.walk(e)),n})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("atrule"===r.type&&e.test(r.name))return t(r,n)}):this.walk((r,n)=>{if("atrule"===r.type&&r.name===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("atrule"===e.type)return t(e,r)}))}walkComments(e){return this.walk((t,r)=>{if("comment"===t.type)return e(t,r)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("decl"===r.type&&e.test(r.prop))return t(r,n)}):this.walk((r,n)=>{if("decl"===r.type&&r.prop===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("decl"===e.type)return t(e,r)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("rule"===r.type&&e.test(r.selector))return t(r,n)}):this.walk((r,n)=>{if("rule"===r.type&&r.selector===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("rule"===e.type)return t(e,r)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}return d.registerParse=t=>{e=t},d.registerRule=e=>{t=e},d.registerAtRule=e=>{r=e},d.registerRoot=e=>{n=e},rc=d,d.default=d,d.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,r.prototype):"rule"===e.type?Object.setPrototypeOf(e,t.prototype):"decl"===e.type?Object.setPrototypeOf(e,s.prototype):"comment"===e.type?Object.setPrototypeOf(e,a.prototype):"root"===e.type&&Object.setPrototypeOf(e,n.prototype),e[o]=!0,e.nodes&&e.nodes.forEach(e=>{d.rebuild(e)})},rc}function Xh(){if(oc)return ic;oc=1;let e,t,r=Yh();class n extends r{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(r={}){return new e(new t,this,r).stringify()}}return n.registerLazyResult=t=>{e=t},n.registerProcessor=e=>{t=e},ic=n,n.default=n,ic}function Zh(){if(ac)return sc;ac=1;let e={};return sc=function(t){e[t]||(e[t]=!0,"undefined"!=typeof console&&console.warn&&console.warn(t))}}function ep(){if(uc)return lc;uc=1;class e{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}return lc=e,e.default=e,lc}function tp(){if(dc)return cc;dc=1;let e=ep();class t{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(t,r={}){r.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(r.plugin=this.lastPlugin.postcssPlugin);let n=new e(t,r);return this.messages.push(n),n}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}}return cc=t,t.default=t,cc}function rp(){if(gc)return fc;gc=1;let e=Yh();class t extends e{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}}return fc=t,t.default=t,e.registerAtRule(t),fc}function np(){if(mc)return vc;mc=1;let e,t,r=Yh();class n extends r{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){let n=super.normalize(e);if(t)if("prepend"===r)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of n)e.raws.before=t.raws.before;return n}removeChild(e,t){let r=this.index(e);return!t&&0===r&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(r={}){return new e(new t,this,r).stringify()}}return n.registerLazyResult=t=>{e=t},n.registerProcessor=e=>{t=e},vc=n,n.default=n,r.registerRoot(n),vc}function ip(){if(bc)return yc;bc=1;let e={comma:t=>e.split(t,[","],!0),space:t=>e.split(t,[" ","\n","\t"]),split(e,t,r){let n=[],i="",o=!1,s=0,a=!1,l="",u=!1;for(let r of e)u?u=!1:"\\"===r?u=!0:a?r===l&&(a=!1):'"'===r||"'"===r?(a=!0,l=r):"("===r?s+=1:")"===r?s>0&&(s-=1):0===s&&t.includes(r)&&(o=!0),o?(""!==i&&n.push(i.trim()),i="",o=!1):i+=r;return(r||""!==i)&&n.push(i.trim()),n}};return yc=e,e.default=e,yc}function op(){if(Sc)return wc;Sc=1;let e=Yh(),t=ip();class r extends e{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return t.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}}return wc=r,r.default=r,e.registerRule(r),wc}function sp(){if(kc)return Ec;kc=1;let e=Hh(),t=function(){if(pc)return hc;pc=1;const e="'".charCodeAt(0),t='"'.charCodeAt(0),r="\\".charCodeAt(0),n="/".charCodeAt(0),i="\n".charCodeAt(0),o=" ".charCodeAt(0),s="\f".charCodeAt(0),a="\t".charCodeAt(0),l="\r".charCodeAt(0),u="[".charCodeAt(0),c="]".charCodeAt(0),d="(".charCodeAt(0),h=")".charCodeAt(0),p="{".charCodeAt(0),f="}".charCodeAt(0),g=";".charCodeAt(0),v="*".charCodeAt(0),m=":".charCodeAt(0),y="@".charCodeAt(0),b=/[\t\n\f\r "#'()/;[\\\]{}]/g,w=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,S=/.[\r\n"'(/\\]/,E=/[\da-f]/i;return hc=function(k,x={}){let C,I,O,T,A,_,R,P,M,N,L=k.css.valueOf(),D=x.ignoreErrors,j=L.length,U=0,F=[],B=[];function q(e){throw k.error("Unclosed "+e,U)}return{back:function(e){B.push(e)},endOfFile:function(){return 0===B.length&&U>=j},nextToken:function(k){if(B.length)return B.pop();if(U>=j)return;let x=!!k&&k.ignoreUnclosed;switch(C=L.charCodeAt(U),C){case i:case o:case a:case l:case s:I=U;do{I+=1,C=L.charCodeAt(I)}while(C===o||C===i||C===a||C===l||C===s);N=["space",L.slice(U,I)],U=I-1;break;case u:case c:case p:case f:case m:case g:case h:{let e=String.fromCharCode(C);N=[e,e,U];break}case d:if(P=F.length?F.pop()[1]:"",M=L.charCodeAt(U+1),"url"===P&&M!==e&&M!==t&&M!==o&&M!==i&&M!==a&&M!==s&&M!==l){I=U;do{if(_=!1,I=L.indexOf(")",I+1),-1===I){if(D||x){I=U;break}q("bracket")}for(R=I;L.charCodeAt(R-1)===r;)R-=1,_=!_}while(_);N=["brackets",L.slice(U,I+1),U,I],U=I}else I=L.indexOf(")",U+1),T=L.slice(U,I+1),-1===I||S.test(T)?N=["(","(",U]:(N=["brackets",T,U,I],U=I);break;case e:case t:O=C===e?"'":'"',I=U;do{if(_=!1,I=L.indexOf(O,I+1),-1===I){if(D||x){I=U+1;break}q("string")}for(R=I;L.charCodeAt(R-1)===r;)R-=1,_=!_}while(_);N=["string",L.slice(U,I+1),U,I],U=I;break;case y:b.lastIndex=U+1,b.test(L),I=0===b.lastIndex?L.length-1:b.lastIndex-2,N=["at-word",L.slice(U,I+1),U,I],U=I;break;case r:for(I=U,A=!0;L.charCodeAt(I+1)===r;)I+=1,A=!A;if(C=L.charCodeAt(I+1),A&&C!==n&&C!==o&&C!==i&&C!==a&&C!==l&&C!==s&&(I+=1,E.test(L.charAt(I)))){for(;E.test(L.charAt(I+1));)I+=1;L.charCodeAt(I+1)===o&&(I+=1)}N=["word",L.slice(U,I+1),U,I],U=I;break;default:C===n&&L.charCodeAt(U+1)===v?(I=L.indexOf("*/",U+2)+1,0===I&&(D||x?I=L.length:q("comment")),N=["comment",L.slice(U,I+1),U,I],U=I):(w.lastIndex=U+1,w.test(L),I=0===w.lastIndex?L.length-1:w.lastIndex-2,N=["word",L.slice(U,I+1),U,I],F.push(N),U=I)}return U++,N},position:function(){return U}}}}(),r=Qh(),n=rp(),i=np(),o=op();const s={empty:!0,space:!0};return Ec=class{constructor(e){this.input=e,this.root=new i,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,r,i,o=new n;o.name=e[1].slice(1),""===o.name&&this.unnamedAtrule(o,e),this.init(o,e[2]);let s=!1,a=!1,l=[],u=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?u.push("("===t?")":"]"):"{"===t&&u.length>0?u.push("}"):t===u[u.length-1]&&u.pop(),0===u.length){if(";"===t){o.source.end=this.getPosition(e[2]),o.source.end.offset++,this.semicolon=!0;break}if("{"===t){a=!0;break}if("}"===t){if(l.length>0){for(i=l.length-1,r=l[i];r&&"space"===r[0];)r=l[--i];r&&(o.source.end=this.getPosition(r[3]||r[2]),o.source.end.offset++)}this.end(e);break}l.push(e)}else l.push(e);if(this.tokenizer.endOfFile()){s=!0;break}}o.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(o.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(o,"params",l),s&&(e=l[l.length-1],o.source.end=this.getPosition(e[3]||e[2]),o.source.end.offset++,this.spaces=o.raws.between,o.raws.between="")):(o.raws.afterName="",o.params=""),a&&(o.nodes=[],this.current=o)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let r,n=0;for(let i=t-1;i>=0&&(r=e[i],"space"===r[0]||(n+=1,2!==n));i--);throw this.input.error("Missed semicolon","word"===r[0]?r[3]+1:r[2])}colon(e){let t,r,n,i=0;for(let[o,s]of e.entries()){if(t=s,r=t[0],"("===r&&(i+=1),")"===r&&(i-=1),0===i&&":"===r){if(n){if("word"===n[0]&&"progid"===n[1])continue;return o}this.doubleColon(t)}n=t}return!1}comment(e){let t=new r;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=t(this.input)}decl(t,r){let n=new e;this.init(n,t[0][2]);let i,o=t[t.length-1];for(";"===o[0]&&(this.semicolon=!0,t.pop()),n.source.end=this.getPosition(o[3]||o[2]||function(e){for(let t=e.length-1;t>=0;t--){let r=e[t],n=r[3]||r[2];if(n)return n}}(t)),n.source.end.offset++;"word"!==t[0][0];)1===t.length&&this.unknownWord(t),n.raws.before+=t.shift()[1];for(n.source.start=this.getPosition(t[0][2]),n.prop="";t.length;){let e=t[0][0];if(":"===e||"space"===e||"comment"===e)break;n.prop+=t.shift()[1]}for(n.raws.between="";t.length;){if(i=t.shift(),":"===i[0]){n.raws.between+=i[1];break}"word"===i[0]&&/\w/.test(i[1])&&this.unknownWord([i]),n.raws.between+=i[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let s,a=[];for(;t.length&&(s=t[0][0],"space"===s||"comment"===s);)a.push(t.shift());this.precheckMissedSemicolon(t);for(let e=t.length-1;e>=0;e--){if(i=t[e],"!important"===i[1].toLowerCase()){n.important=!0;let r=this.stringFrom(t,e);r=this.spacesFromEnd(t)+r," !important"!==r&&(n.raws.important=r);break}if("important"===i[1].toLowerCase()){let r=t.slice(0),i="";for(let t=e;t>0;t--){let e=r[t][0];if(0===i.trim().indexOf("!")&&"space"!==e)break;i=r.pop()[1]+i}0===i.trim().indexOf("!")&&(n.important=!0,n.raws.important=i,t=r)}if("space"!==i[0]&&"comment"!==i[0])break}t.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(n,"value",a.concat(t),r),n.value.includes(":")&&!r&&this.checkMissedSemicolon(t)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new o;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,r=null,n=!1,i=null,o=[],s=e[1].startsWith("--"),a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)i||(i=l),o.push("("===r?")":"]");else if(s&&n&&"{"===r)i||(i=l),o.push("}");else if(0===o.length){if(";"===r){if(n)return void this.decl(a,s);break}if("{"===r)return void this.rule(a);if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}":"===r&&(n=!0)}else r===o[o.length-1]&&(o.pop(),0===o.length&&(i=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(i),t&&n){if(!s)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,s)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,r,n){let i,o,a,l,u=r.length,c="",d=!0;for(let e=0;e<u;e+=1)i=r[e],o=i[0],"space"!==o||e!==u-1||n?"comment"===o?(l=r[e-1]?r[e-1][0]:"empty",a=r[e+1]?r[e+1][0]:"empty",s[l]||s[a]||","===c.slice(-1)?d=!1:c+=i[1]):c+=i[1]:d=!1;if(!d){let n=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:n,value:c}}e[t]=c}rule(e){e.pop();let t=new o;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let n=t;n<e.length;n++)r+=e[n][1];return e.splice(t,e.length-t),r}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}}}function ap(){if(Cc)return xc;Cc=1;let e=Yh(),t=sp(),r=Kh();function n(e,n){let i=new r(e,n),o=new t(i);try{o.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&n&&n.from&&(/\.scss$/i.test(n.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(n.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(n.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return o.root}return xc=n,n.default=n,e.registerParse(n),xc}function lp(){if(Oc)return Ic;Oc=1;let{isClean:e,my:t}=qh(),r=Jh(),n=Vh(),i=Yh(),o=Xh(),s=Zh(),a=tp(),l=ap(),u=np();const c={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},d={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},h={Once:!0,postcssPlugin:!0,prepare:!0};function p(e){return"object"==typeof e&&"function"==typeof e.then}function f(e){let t=!1,r=c[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[r,r+"-"+t,0,r+"Exit",r+"Exit-"+t]:t?[r,r+"-"+t,r+"Exit",r+"Exit-"+t]:e.append?[r,0,r+"Exit"]:[r,r+"Exit"]}function g(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:f(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function v(t){return t[e]=!1,t.nodes&&t.nodes.forEach(e=>v(e)),t}let m={};class y{constructor(e,r,n){let o;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof y||r instanceof a)o=v(r.root),r.map&&(void 0===n.map&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=r.map);else{let e=l;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{o=e(r,n)}catch(e){this.processed=!0,this.error=e}o&&!o[t]&&i.rebuild(o)}else o=v(r);this.result=new a(e,o,n),this.helpers={...m,postcss:m,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let r=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(r.postcssVersion&&"production"!==process.env.NODE_ENV){let e=r.postcssPlugin,t=r.postcssVersion,n=this.result.processor.version,i=t.split("."),o=n.split(".");(i[0]!==o[0]||parseInt(i[1])>parseInt(o[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+n+", but "+e+" uses "+t+". Perhaps this is the source of the error below.")}}else e.plugin=r.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,r)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,r])};for(let t of this.plugins)if("object"==typeof t)for(let r in t){if(!d[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!h[r])if("object"==typeof t[r])for(let n in t[r])e(t,"*"===n?r:r+"-"+n.toLowerCase(),t[r][n]);else"function"==typeof t[r]&&e(t,r,t[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],r=this.runOnRoot(t);if(p(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];){t[e]=!0;let r=[g(t)];for(;r.length>0;){let e=this.visitTick(r);if(p(e))try{await e}catch(e){let t=r[r.length-1].node;throw this.handleError(e,t)}}}if(this.listeners.OnceExit)for(let[e,r]of this.listeners.OnceExit){this.result.lastPlugin=e;try{if("document"===t.type){let e=t.nodes.map(e=>r(e,this.helpers));await Promise.all(e)}else await r(t,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return p(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=n;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let i=new r(t,this.result.root,this.result.opts).generate();return this.result.css=i[0],this.result.map=i[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins){if(p(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];)t[e]=!0,this.walkSync(t);if(this.listeners.OnceExit)if("document"===t.type)for(let e of t.nodes)this.visitSync(this.listeners.OnceExit,e);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||s("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[r,n]of e){let e;this.result.lastPlugin=r;try{e=n(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(p(e))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:n,visitors:i}=r;if("root"!==n.type&&"document"!==n.type&&!n.parent)return void t.pop();if(i.length>0&&r.visitorIndex<i.length){let[e,t]=i[r.visitorIndex];r.visitorIndex+=1,r.visitorIndex===i.length&&(r.visitors=[],r.visitorIndex=0),this.result.lastPlugin=e;try{return t(n.toProxy(),this.helpers)}catch(e){throw this.handleError(e,n)}}if(0!==r.iterator){let i,o=r.iterator;for(;i=n.nodes[n.indexes[o]];)if(n.indexes[o]+=1,!i[e])return i[e]=!0,void t.push(g(i));r.iterator=0,delete n.indexes[o]}let o=r.events;for(;r.eventIndex<o.length;){let t=o[r.eventIndex];if(r.eventIndex+=1,0===t)return void(n.nodes&&n.nodes.length&&(n[e]=!0,r.iterator=n.getIterator()));if(this.listeners[t])return void(r.visitors=this.listeners[t])}t.pop()}walkSync(t){t[e]=!0;let r=f(t);for(let n of r)if(0===n)t.nodes&&t.each(t=>{t[e]||this.walkSync(t)});else{let e=this.listeners[n];if(e&&this.visitSync(e,t.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}}return y.registerPostcss=e=>{m=e},Ic=y,y.default=y,u.registerLazyResult(y),o.registerLazyResult(y),Ic}function up(){if(Rc)return _c;Rc=1;let e=function(){if(Ac)return Tc;Ac=1;let e=Jh(),t=Vh(),r=Zh(),n=ap();const i=tp();class o{constructor(r,n,o){let s;n=n.toString(),this.stringified=!1,this._processor=r,this._css=n,this._opts=o,this._map=void 0;let a=t;this.result=new i(this._processor,s,this._opts),this.result.css=n;let l=this;Object.defineProperty(this.result,"root",{get:()=>l.root});let u=new e(a,s,this._opts,n);if(u.isMap()){let[e,t]=u.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else u.clearAnnotation(),this.result.css=u.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this._opts||r("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=n;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}}return Tc=o,o.default=o,Tc}(),t=lp(),r=Xh(),n=np();class i{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(r,n={}){return this.plugins.length||n.parser||n.stringifier||n.syntax?new t(this,r,n):new e(this,r,n)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}return _c=i,i.default=i,n.registerProcessor(i),r.registerProcessor(i),_c}function cp(){if(Lc)return Nc;Lc=1;let e=Bh(),t=Hh(),r=lp(),n=Yh(),i=up(),o=Vh(),s=function(){if(Mc)return Pc;Mc=1;let e=Hh(),t=Gh(),r=Qh(),n=rp(),i=Kh(),o=np(),s=op();function a(l,u){if(Array.isArray(l))return l.map(e=>a(e));let{inputs:c,...d}=l;if(c){u=[];for(let e of c){let r={...e,__proto__:i.prototype};r.map&&(r.map={...r.map,__proto__:t.prototype}),u.push(r)}}if(d.nodes&&(d.nodes=l.nodes.map(e=>a(e,u))),d.source){let{inputId:e,...t}=d.source;d.source=t,null!=e&&(d.source.input=u[e])}if("root"===d.type)return new o(d);if("decl"===d.type)return new e(d);if("rule"===d.type)return new s(d);if("comment"===d.type)return new r(d);if("atrule"===d.type)return new n(d);throw new Error("Unknown node type: "+l.type)}return Pc=a,a.default=a,Pc}(),a=Xh(),l=ep(),u=Qh(),c=rp(),d=tp(),h=Kh(),p=ap(),f=ip(),g=op(),v=np(),m=Wh();function y(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new i(e)}return y.plugin=function(e,t){let r,n=!1;function o(...r){console&&console.warn&&!n&&(n=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let o=t(...r);return o.postcssPlugin=e,o.postcssVersion=(new i).version,o}return Object.defineProperty(o,"postcss",{get:()=>(r||(r=o()),r)}),o.process=function(e,t,r){return y([o(r)]).process(e,t)},o},y.stringify=o,y.parse=p,y.fromJSON=s,y.list=f,y.comment=e=>new u(e),y.atRule=e=>new c(e),y.decl=e=>new t(e),y.rule=e=>new g(e),y.root=e=>new v(e),y.document=e=>new a(e),y.CssSyntaxError=e,y.Declaration=t,y.Container=n,y.Processor=i,y.Document=a,y.Comment=u,y.Warning=l,y.AtRule=c,y.Result=d,y.Input=h,y.Rule=g,y.Root=v,y.Node=m,r.registerPostcss(y),Nc=y,y.default=y,Nc}function dp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function hp(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if("function"==typeof t){var r=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}),r}function pp(){if(zc)return qc.exports;zc=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e}};return qc.exports=t(),qc.exports.createColors=t,qc.exports}function fp(){if(Gc)return $c;Gc=1;let e=pp(),t=Hc;class r extends Error{constructor(e,t,n,i,o,s){super(e),this.name="CssSyntaxError",this.reason=e,o&&(this.file=o),i&&(this.source=i),s&&(this.plugin=s),void 0!==t&&void 0!==n&&("number"==typeof t?(this.line=t,this.column=n):(this.line=t.line,this.column=t.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,r)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(r){if(!this.source)return"";let n=this.source;null==r&&(r=e.isColorSupported),t&&r&&(n=t(n));let i,o,s=n.split(/\r?\n/),a=Math.max(this.line-3,0),l=Math.min(this.line+2,s.length),u=String(l).length;if(r){let{bold:t,gray:r,red:n}=e.createColors(!0);i=e=>t(n(e)),o=e=>r(e)}else i=o=e=>e;return s.slice(a,l).map((e,t)=>{let r=a+1+t,n=" "+(" "+r).slice(-u)+" | ";if(r===this.line){let t=o(n.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return i(">")+o(n)+e+"\n "+t+i("^")}return" "+o(n)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}return $c=r,r.default=r,$c}function gp(){return Jc||(Jc=1,Kc.isClean=Symbol("isClean"),Kc.my=Symbol("my")),Kc}function vp(){if(Yc)return Qc;Yc=1;const e={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};class t{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name,n=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?r+=e.raws.afterName:n&&(r+=" "),e.nodes)this.block(e,r+n);else{let i=(e.raws.between||"")+(t?";":"");this.builder(r+n+i,e)}}beforeAfter(e,t){let r;r="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let n=e.parent,i=0;for(;n&&"root"!==n.type;)i+=1,n=n.parent;if(r.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<i;e++)r+=t}return r}block(e,t){let r,n=this.raw(e,"between","beforeOpen");this.builder(t+n+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),r=this.raw(e,"after")):r=this.raw(e,"after","emptyBody"),r&&this.builder(r),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let r=this.raw(e,"semicolon");for(let n=0;n<e.nodes.length;n++){let i=e.nodes[n],o=this.raw(i,"before");o&&this.builder(o),this.stringify(i,t!==n||r)}}comment(e){let t=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)}decl(e,t){let r=this.raw(e,"between","colon"),n=e.prop+r+this.rawValue(e,"value");e.important&&(n+=e.raws.important||" !important"),t&&(n+=";"),this.builder(n,e)}document(e){this.body(e)}raw(t,r,n){let i;if(n||(n=r),r&&(i=t.raws[r],void 0!==i))return i;let o=t.parent;if("before"===n){if(!o||"root"===o.type&&o.first===t)return"";if(o&&"document"===o.type)return""}if(!o)return e[n];let s=t.root();if(s.rawCache||(s.rawCache={}),void 0!==s.rawCache[n])return s.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(t,n);{let e="raw"+((a=n)[0].toUpperCase()+a.slice(1));this[e]?i=this[e](s,t):s.walk(e=>{if(i=e.raws[r],void 0!==i)return!1})}var a;return void 0===i&&(i=e[n]),s.rawCache[n]=i,i}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let r;return e.walkComments(e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),void 0===r?r=this.raw(t,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(e,t){let r;return e.walkDecls(e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),void 0===r?r=this.raw(t,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(e){let t;return e.walk(r=>{if(r.nodes&&(r.parent!==e||e.first!==r)&&void 0!==r.raws.before)return t=r.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(r=>{let n=r.parent;if(n&&n!==e&&n.parent&&n.parent===e&&void 0!==r.raws.before){let e=r.raws.before.split("\n");return t=e[e.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){let r=e[t],n=e.raws[t];return n&&n.value===r?n.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}}return Qc=t,t.default=t,Qc}function mp(){if(Zc)return Xc;Zc=1;let e=vp();function t(t,r){new e(r).stringify(t)}return Xc=t,t.default=t,Xc}function yp(){if(td)return ed;td=1;let{isClean:e,my:t}=gp(),r=fp(),n=vp(),i=mp();function o(e,t){let r=new e.constructor;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if("proxyCache"===n)continue;let i=e[n],s=typeof i;"parent"===n&&"object"===s?t&&(r[n]=t):"source"===n?r[n]=i:Array.isArray(i)?r[n]=i.map(e=>o(e,r)):("object"===s&&null!==i&&(i=o(i)),r[n]=i)}return r}class s{constructor(r={}){this.raws={},this[e]=!1,this[t]=!0;for(let e in r)if("nodes"===e){this.nodes=[];for(let t of r[e])"function"==typeof t.clone?this.append(t.clone()):this.append(t)}else this[e]=r[e]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=o(this);for(let r in e)t[r]=e[r];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:r,start:n}=this.rangeBy(t);return this.source.input.error(e,{column:n.column,line:n.line},{column:r.column,line:r.line},t)}return new r(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markDirty(){if(this[e]){this[e]=!1;let t=this;for(;t=t.parent;)t[e]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){let n=(t=this.toString()).indexOf(e.word);-1!==n&&(r=this.positionInside(n,t))}return r}positionInside(e,t){let r=t||this.toString(),n=this.source.start.column,i=this.source.start.line;for(let t=0;t<e;t++)"\n"===r[t]?(n=1,i+=1):n+=1;return{column:n,line:i}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let n=this.toString(),i=n.indexOf(e.word);-1!==i&&(t=this.positionInside(i,n),r=this.positionInside(i+e.word.length,n))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return(new n).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let n of e)n===this?r=!0:r?(this.parent.insertAfter(t,n),t=n):this.parent.insertBefore(t,n);r||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let r={},n=null==t;t=t||new Map;let i=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let n=this[e];if(Array.isArray(n))r[e]=n.map(e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e);else if("object"==typeof n&&n.toJSON)r[e]=n.toJSON(null,t);else if("source"===e){let o=t.get(n.input);null==o&&(o=i,t.set(n.input,i),i++),r[e]={end:n.end,inputId:o,start:n.start}}else r[e]=n}return n&&(r.inputs=[...t.keys()].map(e=>e.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=i){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){let n={node:this};for(let e in r)n[e]=r[e];return e.warn(t,n)}get proxyOf(){return this}}return ed=s,s.default=s,ed}function bp(){if(nd)return rd;nd=1;let e=yp();class t extends e{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}}return rd=t,t.default=t,rd}function wp(){if(od)return id;od=1;return id={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(r=t)=>{let n="",i=r;for(;i--;)n+=e[Math.random()*e.length|0];return n}}}function Sp(){if(ad)return sd;ad=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Hc,{existsSync:r,readFileSync:n}=Hc,{dirname:i,join:o}=Hc;class s{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,n=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=i(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new e(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t;let r=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+r)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let r=e.lastIndexOf(t.pop()),n=e.indexOf("*/",r);r>-1&&n>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,n)))}loadFile(e){if(this.root=i(e),r(e))return this.mapFile=e,n(e,"utf-8").toString().trim()}loadMap(r,n){if(!1===n)return!1;if(n){if("string"==typeof n)return n;if("function"!=typeof n){if(n instanceof e)return t.fromSourceMap(n).toString();if(n instanceof t)return n.toString();if(this.isMap(n))return JSON.stringify(n);throw new Error("Unsupported previous source map format: "+n.toString())}{let e=n(r);if(e){let t=this.loadFile(e);if(!t)throw new Error("Unable to load previous source map: "+e.toString());return t}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let e=this.annotation;return r&&(e=o(i(r),e)),this.loadFile(e)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return sd=s,s.default=s,sd}function Ep(){if(ud)return ld;ud=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Hc,{fileURLToPath:r,pathToFileURL:n}=Hc,{isAbsolute:i,resolve:o}=Hc,{nanoid:s}=wp(),a=Hc,l=fp(),u=Sp(),c=Symbol("fromOffsetCache"),d=Boolean(e&&t),h=Boolean(o&&i);class p{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||""===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!h||/^\w+:\/\//.test(t.from)||i(t.from)?this.file=t.from:this.file=o(t.from)),h&&d){let e=new u(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+s(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,i={}){let o,s,a;if(t&&"object"==typeof t){let e=t,n=r;if("number"==typeof e.offset){let n=this.fromOffset(e.offset);t=n.line,r=n.col}else t=e.line,r=e.column;if("number"==typeof n.offset){let e=this.fromOffset(n.offset);s=e.line,a=e.col}else s=n.line,a=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let u=this.origin(t,r,s,a);return o=u?new l(e,void 0===u.endLine?u.line:{column:u.column,line:u.line},void 0===u.endLine?u.column:{column:u.endColumn,line:u.endLine},u.source,u.file,i.plugin):new l(e,void 0===s?t:{column:r,line:t},void 0===s?r:{column:a,line:s},this.css,this.file,i.plugin),o.input={column:r,endColumn:a,endLine:s,line:t,source:this.css},this.file&&(n&&(o.input.url=n(this.file).toString()),o.input.file=this.file),o}fromOffset(e){let t,r;if(this[c])r=this[c];else{let e=this.css.split("\n");r=new Array(e.length);let t=0;for(let n=0,i=e.length;n<i;n++)r[n]=t,t+=e[n].length+1;this[c]=r}t=r[r.length-1];let n=0;if(e>=t)n=r.length-1;else{let t,i=r.length-2;for(;n<i;)if(t=n+(i-n>>1),e<r[t])i=t-1;else{if(!(e>=r[t+1])){n=t;break}n=t+1}}return{col:e-r[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:o(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,o,s){if(!this.map)return!1;let a,l,u=this.map.consumer(),c=u.originalPositionFor({column:t,line:e});if(!c.source)return!1;"number"==typeof o&&(a=u.originalPositionFor({column:s,line:o})),l=i(c.source)?n(c.source):new URL(c.source,this.map.consumer().sourceRoot||n(this.map.mapFile));let d={column:c.column,endColumn:a&&a.column,endLine:a&&a.line,line:c.line,url:l.toString()};if("file:"===l.protocol){if(!r)throw new Error("file: protocol is not available in this PostCSS build");d.file=r(l)}let h=u.sourceContentFor(c.source);return h&&(d.source=h),d}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}}return ld=p,p.default=p,a&&a.registerInput&&a.registerInput(p),ld}function kp(){if(dd)return cd;dd=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Hc,{dirname:r,relative:n,resolve:i,sep:o}=Hc,{pathToFileURL:s}=Hc,a=Ep(),l=Boolean(e&&t),u=Boolean(r&&i&&n&&o);return cd=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let t of this.previous()){let n,i=this.toUrl(this.path(t.file)),o=t.root||r(t.file);!1===this.mapOpts.sourcesContent?(n=new e(t.text),n.sourcesContent&&(n.sourcesContent=null)):n=t.consumer(),this.map.applySourceMap(n,i,this.toUrl(this.path(o)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),u&&l&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=t.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0});let e,r,n=1,i=1,o="<no source>",s={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(t,a,l)=>{if(this.css+=t,a&&"end"!==l&&(s.generated.line=n,s.generated.column=i-1,a.source&&a.source.start?(s.source=this.sourcePath(a),s.original.line=a.source.start.line,s.original.column=a.source.start.column-1,this.map.addMapping(s)):(s.source=o,s.original.line=1,s.original.column=0,this.map.addMapping(s))),e=t.match(/\n/g),e?(n+=e.length,r=t.lastIndexOf("\n"),i=t.length-r):i+=t.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(s.source=this.sourcePath(a),s.original.line=a.source.end.line,s.original.column=a.source.end.column-1,s.generated.line=n,s.generated.column=i-2,this.map.addMapping(s)):(s.source=o,s.original.line=1,s.original.column=0,s.generated.line=n,s.generated.column=i-1,this.map.addMapping(s)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let o=this.opts.to?r(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(o=r(i(o,this.mapOpts.annotation)));let s=n(o,e);return this.memoizedPaths.set(e,s),s}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new a(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let r=t.source.input.from;if(r&&!e[r]){e[r]=!0;let n=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(n,t.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(s){let t=s(e).toString();return this.memoizedFileURLs.set(e,t),t}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;"\\"===o&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}}}function xp(){if(pd)return hd;pd=1;let e=yp();class t extends e{constructor(e){super(e),this.type="comment"}}return hd=t,t.default=t,hd}function Cp(){if(gd)return fd;gd=1;let e,t,r,n,{isClean:i,my:o}=gp(),s=bp(),a=xp(),l=yp();function u(e){return e.map(e=>(e.nodes&&(e.nodes=u(e.nodes)),delete e.source,e))}function c(e){if(e[i]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)c(t)}class d extends l{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,r,n=this.getIterator();for(;this.indexes[n]<this.proxyOf.nodes.length&&(t=this.indexes[n],r=e(this.proxyOf.nodes[t],t),!1!==r);)this.indexes[n]+=1;return delete this.indexes[n],r}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...r)=>e[t](...r.map(e=>"function"==typeof e?(t,r)=>e(t.toProxy(),r):e)):"every"===t||"some"===t?r=>e[t]((e,...t)=>r(e.toProxy(),...t)):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map(e=>e.toProxy()):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let r,n=this.index(e),i=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let e of i)this.proxyOf.nodes.splice(n+1,0,e);for(let e in this.indexes)r=this.indexes[e],n<r&&(this.indexes[e]=r+i.length);return this.markDirty(),this}insertBefore(e,t){let r,n=this.index(e),i=0===n&&"prepend",o=this.normalize(t,this.proxyOf.nodes[n],i).reverse();n=this.index(e);for(let e of o)this.proxyOf.nodes.splice(n,0,e);for(let e in this.indexes)r=this.indexes[e],n<=r&&(this.indexes[e]=r+o.length);return this.markDirty(),this}normalize(n,l){if("string"==typeof n)n=u(e(n).nodes);else if(void 0===n)n=[];else if(Array.isArray(n)){n=n.slice(0);for(let e of n)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===n.type&&"document"!==this.type){n=n.nodes.slice(0);for(let e of n)e.parent&&e.parent.removeChild(e,"ignore")}else if(n.type)n=[n];else if(n.prop){if(void 0===n.value)throw new Error("Value field is missed in node creation");"string"!=typeof n.value&&(n.value=String(n.value)),n=[new s(n)]}else if(n.selector)n=[new t(n)];else if(n.name)n=[new r(n)];else{if(!n.text)throw new Error("Unknown node type in node creation");n=[new a(n)]}return n.map(e=>(e[o]||d.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[i]&&c(e),void 0===e.raws.before&&l&&void 0!==l.raws.before&&(e.raws.before=l.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls(n=>{t.props&&!t.props.includes(n.prop)||t.fast&&!n.value.includes(t.fast)||(n.value=n.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,r)=>{let n;try{n=e(t,r)}catch(e){throw t.addToError(e)}return!1!==n&&t.walk&&(n=t.walk(e)),n})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("atrule"===r.type&&e.test(r.name))return t(r,n)}):this.walk((r,n)=>{if("atrule"===r.type&&r.name===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("atrule"===e.type)return t(e,r)}))}walkComments(e){return this.walk((t,r)=>{if("comment"===t.type)return e(t,r)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("decl"===r.type&&e.test(r.prop))return t(r,n)}):this.walk((r,n)=>{if("decl"===r.type&&r.prop===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("decl"===e.type)return t(e,r)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("rule"===r.type&&e.test(r.selector))return t(r,n)}):this.walk((r,n)=>{if("rule"===r.type&&r.selector===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("rule"===e.type)return t(e,r)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}return d.registerParse=t=>{e=t},d.registerRule=e=>{t=e},d.registerAtRule=e=>{r=e},d.registerRoot=e=>{n=e},fd=d,d.default=d,d.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,r.prototype):"rule"===e.type?Object.setPrototypeOf(e,t.prototype):"decl"===e.type?Object.setPrototypeOf(e,s.prototype):"comment"===e.type?Object.setPrototypeOf(e,a.prototype):"root"===e.type&&Object.setPrototypeOf(e,n.prototype),e[o]=!0,e.nodes&&e.nodes.forEach(e=>{d.rebuild(e)})},fd}function Ip(){if(md)return vd;md=1;let e,t,r=Cp();class n extends r{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(r={}){return new e(new t,this,r).stringify()}}return n.registerLazyResult=t=>{e=t},n.registerProcessor=e=>{t=e},vd=n,n.default=n,vd}function Op(){if(bd)return yd;bd=1;let e={};return yd=function(t){e[t]||(e[t]=!0,"undefined"!=typeof console&&console.warn&&console.warn(t))}}function Tp(){if(Sd)return wd;Sd=1;class e{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}return wd=e,e.default=e,wd}function Ap(){if(kd)return Ed;kd=1;let e=Tp();class t{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(t,r={}){r.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(r.plugin=this.lastPlugin.postcssPlugin);let n=new e(t,r);return this.messages.push(n),n}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}}return Ed=t,t.default=t,Ed}function _p(){if(Od)return Id;Od=1;let e=Cp();class t extends e{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}}return Id=t,t.default=t,e.registerAtRule(t),Id}function Rp(){if(Ad)return Td;Ad=1;let e,t,r=Cp();class n extends r{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){let n=super.normalize(e);if(t)if("prepend"===r)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of n)e.raws.before=t.raws.before;return n}removeChild(e,t){let r=this.index(e);return!t&&0===r&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(r={}){return new e(new t,this,r).stringify()}}return n.registerLazyResult=t=>{e=t},n.registerProcessor=e=>{t=e},Td=n,n.default=n,r.registerRoot(n),Td}function Pp(){if(Rd)return _d;Rd=1;let e={comma:t=>e.split(t,[","],!0),space:t=>e.split(t,[" ","\n","\t"]),split(e,t,r){let n=[],i="",o=!1,s=0,a=!1,l="",u=!1;for(let r of e)u?u=!1:"\\"===r?u=!0:a?r===l&&(a=!1):'"'===r||"'"===r?(a=!0,l=r):"("===r?s+=1:")"===r?s>0&&(s-=1):0===s&&t.includes(r)&&(o=!0),o?(""!==i&&n.push(i.trim()),i="",o=!1):i+=r;return(r||""!==i)&&n.push(i.trim()),n}};return _d=e,e.default=e,_d}function Mp(){if(Md)return Pd;Md=1;let e=Cp(),t=Pp();class r extends e{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return t.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}}return Pd=r,r.default=r,e.registerRule(r),Pd}function Np(){if(Ld)return Nd;Ld=1;let e=bp(),t=function(){if(Cd)return xd;Cd=1;const e="'".charCodeAt(0),t='"'.charCodeAt(0),r="\\".charCodeAt(0),n="/".charCodeAt(0),i="\n".charCodeAt(0),o=" ".charCodeAt(0),s="\f".charCodeAt(0),a="\t".charCodeAt(0),l="\r".charCodeAt(0),u="[".charCodeAt(0),c="]".charCodeAt(0),d="(".charCodeAt(0),h=")".charCodeAt(0),p="{".charCodeAt(0),f="}".charCodeAt(0),g=";".charCodeAt(0),v="*".charCodeAt(0),m=":".charCodeAt(0),y="@".charCodeAt(0),b=/[\t\n\f\r "#'()/;[\\\]{}]/g,w=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,S=/.[\r\n"'(/\\]/,E=/[\da-f]/i;return xd=function(k,x={}){let C,I,O,T,A,_,R,P,M,N,L=k.css.valueOf(),D=x.ignoreErrors,j=L.length,U=0,F=[],B=[];function q(e){throw k.error("Unclosed "+e,U)}return{back:function(e){B.push(e)},endOfFile:function(){return 0===B.length&&U>=j},nextToken:function(k){if(B.length)return B.pop();if(U>=j)return;let x=!!k&&k.ignoreUnclosed;switch(C=L.charCodeAt(U),C){case i:case o:case a:case l:case s:I=U;do{I+=1,C=L.charCodeAt(I)}while(C===o||C===i||C===a||C===l||C===s);N=["space",L.slice(U,I)],U=I-1;break;case u:case c:case p:case f:case m:case g:case h:{let e=String.fromCharCode(C);N=[e,e,U];break}case d:if(P=F.length?F.pop()[1]:"",M=L.charCodeAt(U+1),"url"===P&&M!==e&&M!==t&&M!==o&&M!==i&&M!==a&&M!==s&&M!==l){I=U;do{if(_=!1,I=L.indexOf(")",I+1),-1===I){if(D||x){I=U;break}q("bracket")}for(R=I;L.charCodeAt(R-1)===r;)R-=1,_=!_}while(_);N=["brackets",L.slice(U,I+1),U,I],U=I}else I=L.indexOf(")",U+1),T=L.slice(U,I+1),-1===I||S.test(T)?N=["(","(",U]:(N=["brackets",T,U,I],U=I);break;case e:case t:O=C===e?"'":'"',I=U;do{if(_=!1,I=L.indexOf(O,I+1),-1===I){if(D||x){I=U+1;break}q("string")}for(R=I;L.charCodeAt(R-1)===r;)R-=1,_=!_}while(_);N=["string",L.slice(U,I+1),U,I],U=I;break;case y:b.lastIndex=U+1,b.test(L),I=0===b.lastIndex?L.length-1:b.lastIndex-2,N=["at-word",L.slice(U,I+1),U,I],U=I;break;case r:for(I=U,A=!0;L.charCodeAt(I+1)===r;)I+=1,A=!A;if(C=L.charCodeAt(I+1),A&&C!==n&&C!==o&&C!==i&&C!==a&&C!==l&&C!==s&&(I+=1,E.test(L.charAt(I)))){for(;E.test(L.charAt(I+1));)I+=1;L.charCodeAt(I+1)===o&&(I+=1)}N=["word",L.slice(U,I+1),U,I],U=I;break;default:C===n&&L.charCodeAt(U+1)===v?(I=L.indexOf("*/",U+2)+1,0===I&&(D||x?I=L.length:q("comment")),N=["comment",L.slice(U,I+1),U,I],U=I):(w.lastIndex=U+1,w.test(L),I=0===w.lastIndex?L.length-1:w.lastIndex-2,N=["word",L.slice(U,I+1),U,I],F.push(N),U=I)}return U++,N},position:function(){return U}}}}(),r=xp(),n=_p(),i=Rp(),o=Mp();const s={empty:!0,space:!0};return Nd=class{constructor(e){this.input=e,this.root=new i,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,r,i,o=new n;o.name=e[1].slice(1),""===o.name&&this.unnamedAtrule(o,e),this.init(o,e[2]);let s=!1,a=!1,l=[],u=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?u.push("("===t?")":"]"):"{"===t&&u.length>0?u.push("}"):t===u[u.length-1]&&u.pop(),0===u.length){if(";"===t){o.source.end=this.getPosition(e[2]),o.source.end.offset++,this.semicolon=!0;break}if("{"===t){a=!0;break}if("}"===t){if(l.length>0){for(i=l.length-1,r=l[i];r&&"space"===r[0];)r=l[--i];r&&(o.source.end=this.getPosition(r[3]||r[2]),o.source.end.offset++)}this.end(e);break}l.push(e)}else l.push(e);if(this.tokenizer.endOfFile()){s=!0;break}}o.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(o.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(o,"params",l),s&&(e=l[l.length-1],o.source.end=this.getPosition(e[3]||e[2]),o.source.end.offset++,this.spaces=o.raws.between,o.raws.between="")):(o.raws.afterName="",o.params=""),a&&(o.nodes=[],this.current=o)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let r,n=0;for(let i=t-1;i>=0&&(r=e[i],"space"===r[0]||(n+=1,2!==n));i--);throw this.input.error("Missed semicolon","word"===r[0]?r[3]+1:r[2])}colon(e){let t,r,n,i=0;for(let[o,s]of e.entries()){if(t=s,r=t[0],"("===r&&(i+=1),")"===r&&(i-=1),0===i&&":"===r){if(n){if("word"===n[0]&&"progid"===n[1])continue;return o}this.doubleColon(t)}n=t}return!1}comment(e){let t=new r;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=t(this.input)}decl(t,r){let n=new e;this.init(n,t[0][2]);let i,o=t[t.length-1];for(";"===o[0]&&(this.semicolon=!0,t.pop()),n.source.end=this.getPosition(o[3]||o[2]||function(e){for(let t=e.length-1;t>=0;t--){let r=e[t],n=r[3]||r[2];if(n)return n}}(t)),n.source.end.offset++;"word"!==t[0][0];)1===t.length&&this.unknownWord(t),n.raws.before+=t.shift()[1];for(n.source.start=this.getPosition(t[0][2]),n.prop="";t.length;){let e=t[0][0];if(":"===e||"space"===e||"comment"===e)break;n.prop+=t.shift()[1]}for(n.raws.between="";t.length;){if(i=t.shift(),":"===i[0]){n.raws.between+=i[1];break}"word"===i[0]&&/\w/.test(i[1])&&this.unknownWord([i]),n.raws.between+=i[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let s,a=[];for(;t.length&&(s=t[0][0],"space"===s||"comment"===s);)a.push(t.shift());this.precheckMissedSemicolon(t);for(let e=t.length-1;e>=0;e--){if(i=t[e],"!important"===i[1].toLowerCase()){n.important=!0;let r=this.stringFrom(t,e);r=this.spacesFromEnd(t)+r," !important"!==r&&(n.raws.important=r);break}if("important"===i[1].toLowerCase()){let r=t.slice(0),i="";for(let t=e;t>0;t--){let e=r[t][0];if(0===i.trim().indexOf("!")&&"space"!==e)break;i=r.pop()[1]+i}0===i.trim().indexOf("!")&&(n.important=!0,n.raws.important=i,t=r)}if("space"!==i[0]&&"comment"!==i[0])break}t.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(n,"value",a.concat(t),r),n.value.includes(":")&&!r&&this.checkMissedSemicolon(t)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new o;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,r=null,n=!1,i=null,o=[],s=e[1].startsWith("--"),a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)i||(i=l),o.push("("===r?")":"]");else if(s&&n&&"{"===r)i||(i=l),o.push("}");else if(0===o.length){if(";"===r){if(n)return void this.decl(a,s);break}if("{"===r)return void this.rule(a);if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}":"===r&&(n=!0)}else r===o[o.length-1]&&(o.pop(),0===o.length&&(i=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(i),t&&n){if(!s)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,s)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,r,n){let i,o,a,l,u=r.length,c="",d=!0;for(let e=0;e<u;e+=1)i=r[e],o=i[0],"space"!==o||e!==u-1||n?"comment"===o?(l=r[e-1]?r[e-1][0]:"empty",a=r[e+1]?r[e+1][0]:"empty",s[l]||s[a]||","===c.slice(-1)?d=!1:c+=i[1]):c+=i[1]:d=!1;if(!d){let n=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:n,value:c}}e[t]=c}rule(e){e.pop();let t=new o;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let n=t;n<e.length;n++)r+=e[n][1];return e.splice(t,e.length-t),r}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}}}function Lp(){if(jd)return Dd;jd=1;let e=Cp(),t=Np(),r=Ep();function n(e,n){let i=new r(e,n),o=new t(i);try{o.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&n&&n.from&&(/\.scss$/i.test(n.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(n.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(n.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return o.root}return Dd=n,n.default=n,e.registerParse(n),Dd}function Dp(){if(Fd)return Ud;Fd=1;let{isClean:e,my:t}=gp(),r=kp(),n=mp(),i=Cp(),o=Ip(),s=Op(),a=Ap(),l=Lp(),u=Rp();const c={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},d={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},h={Once:!0,postcssPlugin:!0,prepare:!0};function p(e){return"object"==typeof e&&"function"==typeof e.then}function f(e){let t=!1,r=c[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[r,r+"-"+t,0,r+"Exit",r+"Exit-"+t]:t?[r,r+"-"+t,r+"Exit",r+"Exit-"+t]:e.append?[r,0,r+"Exit"]:[r,r+"Exit"]}function g(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:f(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function v(t){return t[e]=!1,t.nodes&&t.nodes.forEach(e=>v(e)),t}let m={};class y{constructor(e,r,n){let o;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof y||r instanceof a)o=v(r.root),r.map&&(void 0===n.map&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=r.map);else{let e=l;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{o=e(r,n)}catch(e){this.processed=!0,this.error=e}o&&!o[t]&&i.rebuild(o)}else o=v(r);this.result=new a(e,o,n),this.helpers={...m,postcss:m,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let r=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(r.postcssVersion&&"production"!==process.env.NODE_ENV){let e=r.postcssPlugin,t=r.postcssVersion,n=this.result.processor.version,i=t.split("."),o=n.split(".");(i[0]!==o[0]||parseInt(i[1])>parseInt(o[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+n+", but "+e+" uses "+t+". Perhaps this is the source of the error below.")}}else e.plugin=r.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,r)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,r])};for(let t of this.plugins)if("object"==typeof t)for(let r in t){if(!d[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!h[r])if("object"==typeof t[r])for(let n in t[r])e(t,"*"===n?r:r+"-"+n.toLowerCase(),t[r][n]);else"function"==typeof t[r]&&e(t,r,t[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],r=this.runOnRoot(t);if(p(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];){t[e]=!0;let r=[g(t)];for(;r.length>0;){let e=this.visitTick(r);if(p(e))try{await e}catch(e){let t=r[r.length-1].node;throw this.handleError(e,t)}}}if(this.listeners.OnceExit)for(let[e,r]of this.listeners.OnceExit){this.result.lastPlugin=e;try{if("document"===t.type){let e=t.nodes.map(e=>r(e,this.helpers));await Promise.all(e)}else await r(t,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return p(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=n;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let i=new r(t,this.result.root,this.result.opts).generate();return this.result.css=i[0],this.result.map=i[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins){if(p(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];)t[e]=!0,this.walkSync(t);if(this.listeners.OnceExit)if("document"===t.type)for(let e of t.nodes)this.visitSync(this.listeners.OnceExit,e);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||s("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[r,n]of e){let e;this.result.lastPlugin=r;try{e=n(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(p(e))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:n,visitors:i}=r;if("root"!==n.type&&"document"!==n.type&&!n.parent)return void t.pop();if(i.length>0&&r.visitorIndex<i.length){let[e,t]=i[r.visitorIndex];r.visitorIndex+=1,r.visitorIndex===i.length&&(r.visitors=[],r.visitorIndex=0),this.result.lastPlugin=e;try{return t(n.toProxy(),this.helpers)}catch(e){throw this.handleError(e,n)}}if(0!==r.iterator){let i,o=r.iterator;for(;i=n.nodes[n.indexes[o]];)if(n.indexes[o]+=1,!i[e])return i[e]=!0,void t.push(g(i));r.iterator=0,delete n.indexes[o]}let o=r.events;for(;r.eventIndex<o.length;){let t=o[r.eventIndex];if(r.eventIndex+=1,0===t)return void(n.nodes&&n.nodes.length&&(n[e]=!0,r.iterator=n.getIterator()));if(this.listeners[t])return void(r.visitors=this.listeners[t])}t.pop()}walkSync(t){t[e]=!0;let r=f(t);for(let n of r)if(0===n)t.nodes&&t.each(t=>{t[e]||this.walkSync(t)});else{let e=this.listeners[n];if(e&&this.visitSync(e,t.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}}return y.registerPostcss=e=>{m=e},Ud=y,y.default=y,u.registerLazyResult(y),o.registerLazyResult(y),Ud}function jp(){if(Vd)return zd;Vd=1;let e=function(){if(qd)return Bd;qd=1;let e=kp(),t=mp(),r=Op(),n=Lp();const i=Ap();class o{constructor(r,n,o){let s;n=n.toString(),this.stringified=!1,this._processor=r,this._css=n,this._opts=o,this._map=void 0;let a=t;this.result=new i(this._processor,s,this._opts),this.result.css=n;let l=this;Object.defineProperty(this.result,"root",{get:()=>l.root});let u=new e(a,s,this._opts,n);if(u.isMap()){let[e,t]=u.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else u.clearAnnotation(),this.result.css=u.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this._opts||r("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=n;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}}return Bd=o,o.default=o,Bd}(),t=Dp(),r=Ip(),n=Rp();class i{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(r,n={}){return this.plugins.length||n.parser||n.stringifier||n.syntax?new t(this,r,n):new e(this,r,n)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}return zd=i,i.default=i,n.registerProcessor(i),r.registerProcessor(i),zd}function Up(){if(Gd)return $d;Gd=1;let e=fp(),t=bp(),r=Dp(),n=Cp(),i=jp(),o=mp(),s=function(){if(Hd)return Wd;Hd=1;let e=bp(),t=Sp(),r=xp(),n=_p(),i=Ep(),o=Rp(),s=Mp();function a(l,u){if(Array.isArray(l))return l.map(e=>a(e));let{inputs:c,...d}=l;if(c){u=[];for(let e of c){let r={...e,__proto__:i.prototype};r.map&&(r.map={...r.map,__proto__:t.prototype}),u.push(r)}}if(d.nodes&&(d.nodes=l.nodes.map(e=>a(e,u))),d.source){let{inputId:e,...t}=d.source;d.source=t,null!=e&&(d.source.input=u[e])}if("root"===d.type)return new o(d);if("decl"===d.type)return new e(d);if("rule"===d.type)return new s(d);if("comment"===d.type)return new r(d);if("atrule"===d.type)return new n(d);throw new Error("Unknown node type: "+l.type)}return Wd=a,a.default=a,Wd}(),a=Ip(),l=Tp(),u=xp(),c=_p(),d=Ap(),h=Ep(),p=Lp(),f=Pp(),g=Mp(),v=Rp(),m=yp();function y(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new i(e)}return y.plugin=function(e,t){let r,n=!1;function o(...r){console&&console.warn&&!n&&(n=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let o=t(...r);return o.postcssPlugin=e,o.postcssVersion=(new i).version,o}return Object.defineProperty(o,"postcss",{get:()=>(r||(r=o()),r)}),o.process=function(e,t,r){return y([o(r)]).process(e,t)},o},y.stringify=o,y.parse=p,y.fromJSON=s,y.list=f,y.comment=e=>new u(e),y.atRule=e=>new c(e),y.decl=e=>new t(e),y.rule=e=>new g(e),y.root=e=>new v(e),y.document=e=>new a(e),y.CssSyntaxError=e,y.Declaration=t,y.Container=n,y.Processor=i,y.Document=a,y.Comment=u,y.Warning=l,y.AtRule=c,y.Result=d,y.Input=h,y.Rule=g,y.Root=v,y.Node=m,r.registerPostcss(y),$d=y,y.default=y,$d}function Fp(e){if(Zd[e])return Zd[e];const t=function(e){var t,r;const n=null==(r=null==(t=null==globalThis?void 0:globalThis.Zone)?void 0:t.__symbol__)?void 0:r.call(t,e);return n&&globalThis[n]?globalThis[n]:void 0}(e)||globalThis[e],r=t.prototype,n=e in Yd?Yd[e]:void 0,i=Boolean(n&&n.every(e=>{var t,n;return Boolean(null==(n=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:n.toString().includes("[native code]"))})),o=e in Xd?Xd[e]:void 0,s=Boolean(o&&o.every(e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))}));if(i&&s)return Zd[e]=t.prototype,t.prototype;try{const n=document.createElement("iframe");document.body.appendChild(n);const i=n.contentWindow;if(!i)return t.prototype;const o=i[e].prototype;return document.body.removeChild(n),o?Zd[e]=o:r}catch(e){return r}}function Bp(e,t,r){var n;const i=`${e}.${String(r)}`;if(eh[i])return eh[i].call(t);const o=Fp(e),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(eh[i]=s,s.call(t)):t[r]}function qp(e,t,r){const n=`${e}.${String(r)}`;if(th[n])return th[n].bind(t);const i=Fp(e)[r];return"function"!=typeof i?t[r]:(th[n]=i,i.bind(t))}function zp(e){return Bp("Node",e,"childNodes")}function Vp(e){return Bp("Node",e,"parentNode")}function Wp(e){return Bp("Node",e,"parentElement")}function Hp(e){return Bp("Node",e,"textContent")}function $p(e,t){return qp("Node",e,"contains")(t)}function Gp(e){return qp("Node",e,"getRootNode")()}function Kp(e){return e&&"host"in e?Bp("ShadowRoot",e,"host"):null}function Jp(e){return e.styleSheets}function Qp(e){return e&&"shadowRoot"in e?Bp("Element",e,"shadowRoot"):null}function Yp(e,t){return Bp("Element",e,"querySelector")(t)}function Xp(e,t){return Bp("Element",e,"querySelectorAll")(t)}function Zp(){return Fp("MutationObserver").constructor}function ef(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}function tf(e,t,r={}){let n=null,i=0;return function(...o){const s=Date.now();i||!1!==r.leading||(i=s);const a=t-(s-i),l=this;a<=0||a>t?(n&&(clearTimeout(n),n=null),i=s,e.apply(l,o)):n||!1===r.trailing||(n=setTimeout(()=>{i=!1===r.leading?0:Date.now(),n=null,e.apply(l,o)},a))}}function rf(e,t,r,n,i=window){const o=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,n?r:{set(e){setTimeout(()=>{r.set.call(this,e)},0),o&&o.set&&o.set.call(this,e)}}),()=>rf(e,t,o||{},!0)}function nf(e,t,r){try{if(!(t in e))return()=>{};const n=e[t],i=r(n);return"function"==typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=i,()=>{e[t]=n}}catch(e){return()=>{}}}function of(e){var t,r,n,i;const o=e.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(t=rh.parentElement(o.body))?void 0:t.scrollLeft)||(null==(r=null==o?void 0:o.body)?void 0:r.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(n=rh.parentElement(o.body))?void 0:n.scrollTop)||(null==(i=null==o?void 0:o.body)?void 0:i.scrollTop)||0}}function sf(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function af(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function lf(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:rh.parentElement(e)}function uf(e,t,r,n){if(!e)return!1;const i=lf(e);if(!i)return!1;try{if("string"==typeof t){if(i.classList.contains(t))return!0;if(n&&null!==i.closest("."+t))return!0}else if(Dh(i,t,n))return!0}catch(e){}if(r){if(i.matches(r))return!0;if(n&&null!==i.closest(r))return!0}return!1}function cf(e,t){return-1!==t.getId(e)}function df(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||t.getId(e)===Tu}function hf(e,t){if(function(e){const t=e&&"host"in e&&"mode"in e&&Iu.host(e)||null;return Boolean(t&&"shadowRoot"in t&&Iu.shadowRoot(t)===e)}(e))return!1;const r=t.getId(e);if(!t.has(r))return!0;const n=rh.parentNode(e);return(!n||n.nodeType!==e.DOCUMENT_NODE)&&(!n||hf(n,t))}function pf(e){return Boolean(e.changedTouches)}function ff(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}function gf(e){const t={},r=(e,r)=>{const n={value:e,parent:r,children:[]};return t[e.node.id]=n,n},n=[];for(const i of e){const{nextId:e,parentId:o}=i;if(e&&e in t){const o=t[e];if(o.parent){const e=o.parent.children.indexOf(o);o.parent.children.splice(e,0,r(i,o.parent))}else{const e=n.indexOf(o);n.splice(e,0,r(i,null))}continue}if(o in t){const e=t[o];e.children.push(r(i,e));continue}n.push(r(i,null))}return n}function vf(e,t){t(e.value);for(let r=e.children.length-1;r>=0;r--)vf(e.children[r],t)}function mf(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function yf(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function bf(e,t){var r,n;const i=null==(n=null==(r=e.ownerDocument)?void 0:r.defaultView)?void 0:n.frameElement;if(!i||i===t)return{x:0,y:0,relativeScale:1,absoluteScale:1};const o=i.getBoundingClientRect(),s=bf(i,t),a=o.height/i.clientHeight;return{x:o.x*s.relativeScale+s.x,y:o.y*s.relativeScale+s.y,relativeScale:a,absoluteScale:s.absoluteScale*a}}function wf(e){return!!e&&(e instanceof Qd&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(rh.shadowRoot(e)))}function Sf(e,t){const r=e[t[0]];return 1===t.length?r:Sf(r.cssRules[t[1]].cssRules,t.slice(2))}function Ef(e){const t=[...e],r=t.pop();return{positions:t,index:r}}function kf(e){const t=new Set,r=[];for(let n=e.length;n--;){const i=e[n];t.has(i.id)||(r.push(i),t.add(i.id))}return r}function xf(e){var t;let r=null;return"getRootNode"in e&&(null==(t=rh.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&rh.host(rh.getRootNode(e))&&(r=rh.host(rh.getRootNode(e))),r}function Cf(e){let t,r=e;for(;t=xf(r);)r=t;return r}function If(e){const t=e.ownerDocument;if(!t)return!1;const r=Cf(e);return rh.contains(t,r)}function Of(e){const t=e.ownerDocument;return!!t&&(rh.contains(t,e)||If(e))}function Tf(e){if(!e||!e.outerHTML)return"";let t="";for(;e.parentElement;){let r=e.localName;if(!r)break;r=r.toLowerCase();const n=e.parentElement,i=[];if(n.children&&n.children.length>0)for(let e=0;e<n.children.length;e++){const t=n.children[e];t.localName&&t.localName.toLowerCase&&t.localName.toLowerCase()===r&&i.push(t)}i.length>1&&(r+=`:eq(${i.indexOf(e)})`),t=r+(t?">"+t:""),e=n}return t}function Af(e){return"[object Object]"===Object.prototype.toString.call(e)}function _f(e,t){if(0===t)return!0;const r=Object.keys(e);for(const n of r)if(Af(e[n])&&_f(e[n],t-1))return!0;return!1}function Rf(e,t){const r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,t);const n=[],i=[];return JSON.stringify(e,function(e,t){if(n.length>0){const r=n.indexOf(this);~r?n.splice(r+1):n.push(this),~r?i.splice(r,1/0,e):i.push(e),~n.indexOf(t)&&(t=n[0]===t?"[Circular ~]":"[Circular ~."+i.slice(0,n.indexOf(t)).join(".")+"]")}else n.push(t);if(null===t)return t;if(void 0===t)return"undefined";if(function(e){if(Af(e)&&Object.keys(e).length>r.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(Af(e)&&_f(e,r.depthOfLimit))return!0;return!1}(t))return function(e){let t=e.toString();r.stringLengthLimit&&t.length>r.stringLengthLimit&&(t=`${t.slice(0,r.stringLengthLimit)}...`);return t}(t);if("bigint"==typeof t)return t.toString()+"n";if(t instanceof Event){const e={};for(const r in t){const n=t[r];Array.isArray(n)?e[r]=Tf(n.length?n[0]:null):e[r]=n}return e}return t instanceof Node?t instanceof HTMLElement?t?t.outerHTML:"":t.nodeName:t instanceof Error?t.stack?t.stack+"\nEnd of stack for Error object":t.name+": "+t.message:t})}function Pf(e,t,r){const n=r?Object.assign({},vh,r):vh,i=n.logger;if(!i)return()=>{};let o;o="string"==typeof i?t[i]:i;let s=0,a=!1;const l=[];if(n.level.includes("error")){const r=t=>{const r=t.message,i=t.error,o=gh.parse(i).map(e=>e.toString()),s=[Rf(r,n.stringifyOptions)];e({level:"error",trace:o,payload:s})};t.addEventListener("error",r),l.push(()=>{t.removeEventListener("error",r)});const i=t=>{let r,i;t.reason instanceof Error?(r=t.reason,i=[Rf(`Uncaught (in promise) ${r.name}: ${r.message}`,n.stringifyOptions)]):(r=new Error,i=[Rf("Uncaught (in promise)",n.stringifyOptions),Rf(t.reason,n.stringifyOptions)]);const o=gh.parse(r).map(e=>e.toString());e({level:"error",trace:o,payload:i})};t.addEventListener("unhandledrejection",i),l.push(()=>{t.removeEventListener("unhandledrejection",i)})}for(const e of n.level)l.push(u(o,e));return()=>{l.forEach(e=>e())};function u(t,r){return t[r]?ah.patch(t,r,t=>(...i)=>{if(t.apply(this,i),!("assert"===r&&i[0]||a)){a=!0;try{const t=gh.parse(new Error).map(e=>e.toString()).splice(1),o=("assert"===r?i.slice(1):i).map(e=>Rf(e,n.stringifyOptions));s++,s<n.lengthThreshold?e({level:r,trace:t,payload:o}):s===n.lengthThreshold&&e({level:"warn",trace:[],payload:[Rf("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...i)}finally{a=!1}}}):()=>{}}}c(wh,{PLUGIN_NAME:()=>mh,getRecordConsolePlugin:()=>yh});var Mf,Nf,Lf,Df,jf,Uf,Ff,Bf,qf,zf,Vf,Wf,Hf,$f,Gf,Kf,Jf,Qf,Yf,Xf,Zf,eg,tg,rg,ng,ig,og,sg,ag,lg,ug,cg,dg,hg,pg,fg,gg,vg,mg,yg,bg,wg,Sg,Eg,kg,xg,Cg,Ig,Og,Tg,Ag,_g,Rg,Pg,Mg,Ng,Lg,Dg,jg,Ug,Fg,Bg,qg,zg,Vg,Wg,Hg,$g,Gg,Kg,Jg,Qg,Yg,Xg,Zg,ev,tv,rv,nv,iv,ov,sv,av,lv,uv,cv,dv,hv,pv,fv,gv,vv,mv,yv,bv,wv,Sv,Ev,kv,xv,Cv,Iv,Ov,Tv,Av,_v,Rv,Pv,Mv,Nv,Lv,Dv,jv,Uv,Fv,Bv,qv,zv,Vv,Wv,Hv,$v,Gv,Kv,Jv,Qv,Yv,Xv,Zv,em,tm,rm,nm,im,om,sm,am,lm,um,cm,dm,hm,pm,fm,gm,vm,mm,ym,bm,wm,Sm,Em,km,xm,Cm,Im,Om,Tm,Am,_m,Rm,Pm,Mm,Nm,Lm,Dm,jm,Um,Fm,Bm,qm,zm,Vm,Wm,Hm,$m,Gm,Km,Jm,Qm,Ym,Xm,Zm,ey,ty,ry,ny,iy,oy,sy,ay,ly,uy,cy,dy,hy,py,fy,gy,vy,my,yy,by,wy,Sy,Ey,ky,xy,Cy,Iy=l({"../../../../node_modules/@amplitude/rrweb-plugin-console-record/dist/rrweb-plugin-console-record.js"(){for((du=Object.defineProperty,hu=(e,t,r)=>t in e?du(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,pu=(e,t,r)=>hu(e,"symbol"!=typeof t?t+"":t,r),fu=Object.defineProperty,gu=(e,t,r)=>t in e?fu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,vu=(e,t,r)=>gu(e,"symbol"!=typeof t?t+"":t,r),yu=Object.defineProperty,bu=(e,t,r)=>t in e?yu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,wu=(e,t,r)=>bu(e,"symbol"!=typeof t?t+"":t,r),Su={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Eu={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},ku={},xu={},Cu={},Iu={childNodes:xh,parentNode:Ch,parentElement:Ih,textContent:Oh,contains:Th,getRootNode:Ah,host:_h,styleSheets:Rh,shadowRoot:Ph,querySelector:Mh,querySelectorAll:Nh,mutationObserver:Lh},Ou=class{constructor(){wu(this,"idNodeMap",new Map),wu(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;const r=null==(t=this.getMeta(e))?void 0:t.id;return null!=r?r:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(e=>this.removeNodeFromMap(e))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)}replace(e,t){const r=this.getNode(e);if(r){const e=this.nodeMetaMap.get(r);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}},Tu=-2,Au={exports:{}},Ru={},Pu=Object.freeze(Object.defineProperty({__proto__:null,default:Ru},Symbol.toStringTag,{value:"Module"})),Mu=Uh(Pu),Du={},Dc=cp(),(jc=jh(Dc)).stringify,jc.fromJSON,jc.plugin,jc.parse,jc.list,jc.document,jc.comment,jc.atRule,jc.rule,jc.decl,jc.root,jc.CssSyntaxError,jc.Declaration,jc.Container,jc.Processor,jc.Document,jc.Comment,jc.Warning,jc.AtRule,jc.Result,jc.Input,jc.Rule,jc.Root,jc.Node,Uc=Object.defineProperty,Fc=(e,t,r)=>t in e?Uc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Bc=(e,t,r)=>Fc(e,"symbol"!=typeof t?t+"":t,r),qc={exports:{}},Vc={},Wc=Object.freeze(Object.defineProperty({__proto__:null,default:Vc},Symbol.toStringTag,{value:"Module"})),Hc=hp(Wc),Kc={},Kd=Up(),(Jd=dp(Kd)).stringify,Jd.fromJSON,Jd.plugin,Jd.parse,Jd.list,Jd.document,Jd.comment,Jd.atRule,Jd.rule,Jd.decl,Jd.root,Jd.CssSyntaxError,Jd.Declaration,Jd.Container,Jd.Processor,Jd.Document,Jd.Comment,Jd.Warning,Jd.AtRule,Jd.Result,Jd.Input,Jd.Rule,Jd.Root,Jd.Node,Qd=class e{constructor(...e){Bc(this,"parentElement",null),Bc(this,"parentNode",null),Bc(this,"ownerDocument"),Bc(this,"firstChild",null),Bc(this,"lastChild",null),Bc(this,"previousSibling",null),Bc(this,"nextSibling",null),Bc(this,"ELEMENT_NODE",1),Bc(this,"TEXT_NODE",3),Bc(this,"nodeType"),Bc(this,"nodeName"),Bc(this,"RRNodeType")}get childNodes(){const e=[];let t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(t){if(!(t instanceof e))return!1;if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}},Yd={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Xd={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Zd={},eh={},th={},rh={childNodes:zp,parentNode:Vp,parentElement:Wp,textContent:Hp,contains:$p,getRootNode:Gp,host:Kp,styleSheets:Jp,shadowRoot:Qp,querySelector:Yp,querySelectorAll:Xp,mutationObserver:Zp},nh="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.",ih={map:{},getId:()=>(console.error(nh),-1),getNode:()=>(console.error(nh),null),removeNodeFromMap(){console.error(nh)},has:()=>(console.error(nh),!1),reset(){console.error(nh)}},"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(ih=new Proxy(ih,{get:(e,t,r)=>("map"===t&&console.error(nh),Reflect.get(e,t,r))})),oh=Date.now,/[1-9][0-9]{12}/.test(Date.now().toString())||(oh=()=>(new Date).getTime()),sh=class{constructor(){vu(this,"id",1),vu(this,"styleIDMap",new WeakMap),vu(this,"idStyleMap",new Map)}getId(e){var t;return null!=(t=this.styleIDMap.get(e))?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let r;return r=void 0===t?this.id++:t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}},ah=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:sh,get _mirror(){return ih},closestElementOfNode:lf,getBaseDimension:bf,getNestedRule:Sf,getPositionsAndIndex:Ef,getRootShadowHost:Cf,getShadowHost:xf,getWindowHeight:sf,getWindowScroll:of,getWindowWidth:af,hasShadowRoot:wf,hookSetter:rf,inDom:Of,isAncestorRemoved:hf,isBlocked:uf,isIgnored:df,isSerialized:cf,isSerializedIframe:mf,isSerializedStylesheet:yf,iterateResolveTree:vf,legacy_isTouchEvent:pf,get nowTimestamp(){return oh},on:ef,patch:nf,polyfill:ff,queueToResolveTrees:gf,shadowHostInDom:If,throttle:tf,uniqueTextMutations:kf},Symbol.toStringTag,{value:"Module"})),lh="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",uh="undefined"==typeof Uint8Array?[]:new Uint8Array(256),sy=0);sy<64;sy++)uh[lh.charCodeAt(sy)]=sy;"undefined"!=typeof self&&self.Blob&&new Blob(['(function() {\n "use strict";\n var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);\n for (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n var encode = function(arraybuffer) {\n var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = "";\n for (i2 = 0; i2 < len; i2 += 3) {\n base64 += chars[bytes[i2] >> 2];\n base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];\n base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];\n base64 += chars[bytes[i2 + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + "=";\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + "==";\n }\n return base64;\n };\n const lastBlobMap = /* @__PURE__ */ new Map();\n const transparentBlobMap = /* @__PURE__ */ new Map();\n async function getTransparentBlobFor(width, height, dataURLOptions) {\n const id = `${width}-${height}`;\n if ("OffscreenCanvas" in globalThis) {\n if (transparentBlobMap.has(id)) return transparentBlobMap.get(id);\n const offscreen = new OffscreenCanvas(width, height);\n offscreen.getContext("2d");\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n transparentBlobMap.set(id, base64);\n return base64;\n } else {\n return "";\n }\n }\n const worker = self;\n worker.onmessage = async function(e) {\n if ("OffscreenCanvas" in globalThis) {\n const { id, bitmap, width, height, dataURLOptions } = e.data;\n const transparentBase64 = getTransparentBlobFor(\n width,\n height,\n dataURLOptions\n );\n const offscreen = new OffscreenCanvas(width, height);\n const ctx = offscreen.getContext("2d");\n ctx.drawImage(bitmap, 0, 0);\n bitmap.close();\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const type = blob.type;\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n if (!lastBlobMap.has(id) && await transparentBase64 === base64) {\n lastBlobMap.set(id, base64);\n return worker.postMessage({ id });\n }\n if (lastBlobMap.get(id) === base64) return worker.postMessage({ id });\n worker.postMessage({\n id,\n type,\n base64,\n width,\n height\n });\n lastBlobMap.set(id, base64);\n } else {\n return worker.postMessage({ id: e.data.id });\n }\n };\n})();\n//# sourceMappingURL=image-bitmap-data-url-worker-IJpC7g_b.js.map\n'],{type:"text/javascript;charset=utf-8"});try{if(2!==Array.from([1],e=>2*e)[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(mu=e.contentWindow)?void 0:mu.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}var e;new Ou,(e=ch||(ch={}))[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped",dh=class{constructor(e){pu(this,"fileName"),pu(this,"functionName"),pu(this,"lineNumber"),pu(this,"columnNumber"),this.fileName=e.fileName||"",this.functionName=e.functionName||"",this.lineNumber=e.lineNumber,this.columnNumber=e.columnNumber}toString(){const e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?`${this.functionName} (${this.fileName}:${e}:${t})`:`${this.fileName}:${e}:${t}`}},hh=/(^|@)\S+:\d+/,ph=/^\s*at .*(\S+:\d+|\(native\))/m,fh=/^(eval@)?(\[native code])?$/,gh={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(ph)?this.parseV8OrIE(e):e.stack?this.parseFFOrSafari(e):(console.warn("[console-record-plugin]: Failed to parse error object:",e),[]):[]},extractLocation:function(e){if(-1===e.indexOf(":"))return[e];const t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error(`Cannot parse given url: ${e}`);return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function(e){return e.stack.split("\n").filter(function(e){return!!e.match(ph)},this).map(function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));let t=e.replace(/^\s+/,"").replace(/\(eval code/g,"(");const r=t.match(/ (\((.+):(\d+):(\d+)\)$)/);t=r?t.replace(r[0],""):t;const n=t.split(/\s+/).slice(1),i=this.extractLocation(r?r[1]:n.pop()),o=n.join(" ")||void 0,s=["eval","<anonymous>"].indexOf(i[0])>-1?void 0:i[0];return new dh({functionName:o,fileName:s,lineNumber:i[1],columnNumber:i[2]})},this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter(function(e){return!e.match(fh)},this).map(function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new dh({functionName:e});{const t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),n=r&&r[1]?r[1]:void 0,i=this.extractLocation(e.replace(t,""));return new dh({functionName:n,fileName:i[0],lineNumber:i[1],columnNumber:i[2]})}},this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){const t=/Line (\d+).*script (?:in )?(\S+)/i,r=e.message.split("\n"),n=[];for(let e=2,i=r.length;e<i;e+=2){const i=t.exec(r[e]);i&&n.push(new dh({fileName:i[2],lineNumber:parseFloat(i[1])}))}return n},parseOpera10:function(e){const t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=e.stacktrace.split("\n"),n=[];for(let e=0,i=r.length;e<i;e+=2){const i=t.exec(r[e]);i&&n.push(new dh({functionName:i[3]||void 0,fileName:i[2],lineNumber:parseFloat(i[1])}))}return n},parseOpera11:function(e){return e.stack.split("\n").filter(function(e){return!!e.match(hh)&&!e.match(/^Error created at/)},this).map(function(e){const t=e.split("@"),r=this.extractLocation(t.pop()),n=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new dh({functionName:n,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})},this)}},vh={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"},mh="rrweb/console@1",yh=e=>({name:mh,observer:Pf,options:e})}}),Oy={};function Ty(e){if(Vf[e])return Vf[e];const t=function(e){var t,r;const n=null==(r=null==(t=null==globalThis?void 0:globalThis.Zone)?void 0:t.__symbol__)?void 0:r.call(t,e);return n&&globalThis[n]?globalThis[n]:void 0}(e)||globalThis[e],r=t.prototype,n=e in qf?qf[e]:void 0,i=Boolean(n&&n.every(e=>{var t,n;return Boolean(null==(n=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:n.toString().includes("[native code]"))})),o=e in zf?zf[e]:void 0,s=Boolean(o&&o.every(e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))}));if(i&&s)return Vf[e]=t.prototype,t.prototype;try{const n=document.createElement("iframe");document.body.appendChild(n);const i=n.contentWindow;if(!i)return t.prototype;const o=i[e].prototype;return document.body.removeChild(n),o?Vf[e]=o:r}catch(e){return r}}function Ay(e,t,r){var n;const i=`${e}.${String(r)}`;if(Wf[i])return Wf[i].call(t);const o=Ty(e),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(Wf[i]=s,s.call(t)):t[r]}function _y(e,t,r){const n=`${e}.${String(r)}`;if(Hf[n])return Hf[n].bind(t);const i=Ty(e)[r];return"function"!=typeof i?t[r]:(Hf[n]=i,i.bind(t))}function Ry(e){return Ay("Node",e,"childNodes")}function Py(e){return Ay("Node",e,"parentNode")}function My(e){return Ay("Node",e,"parentElement")}function Ny(e){return Ay("Node",e,"textContent")}function Ly(e,t){return _y("Node",e,"contains")(t)}function Dy(e){return _y("Node",e,"getRootNode")()}function jy(e){return e&&"host"in e?Ay("ShadowRoot",e,"host"):null}function Uy(e){return e.styleSheets}function Fy(e){return e&&"shadowRoot"in e?Ay("Element",e,"shadowRoot"):null}function By(e,t){return Ay("Element",e,"querySelector")(t)}function qy(e,t){return Ay("Element",e,"querySelectorAll")(t)}function zy(){return Ty("MutationObserver").constructor}function Vy(e){return e.nodeType===e.ELEMENT_NODE}function Wy(e){const t=e&&"host"in e&&"mode"in e&&$f.host(e)||null;return Boolean(t&&"shadowRoot"in t&&$f.shadowRoot(t)===e)}function Hy(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function $y(e){try{const r=e.rules||e.cssRules;if(!r)return null;let n=e.href;!n&&e.ownerNode&&e.ownerNode.ownerDocument&&(n=e.ownerNode.ownerDocument.location.href);const i=Array.from(r,e=>Gy(e,n)).join("");return(t=i).includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t}catch(e){return null}var t}function Gy(e,t){if(function(e){return"styleSheet"in e}(e)){let t;try{t=$y(e.styleSheet)||function(e){const{cssText:t}=e;if(t.split('"').length<3)return t;const r=["@import",`url(${JSON.stringify(e.href)})`];return""===e.layerName?r.push("layer"):e.layerName&&r.push(`layer(${e.layerName})`),e.supportsText&&r.push(`supports(${e.supportsText})`),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}(e)}catch(r){t=e.cssText}return e.styleSheet.href?Xy(t,e.styleSheet.href):t}{let r=e.cssText;return function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":")&&(r=function(e){const t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}(r)),t?Xy(r,t):r}}function Ky({element:e,maskInputOptions:t,tagName:r,type:n,value:i,maskInputFn:o}){let s=i||"";const a=n&&Jy(n);return(t[r.toLowerCase()]||a&&t[a])&&(s=o?o(s,e):"*".repeat(s.length)),s}function Jy(e){return e.toLowerCase()}function Qy(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Jy(t):null}function Yy(e,t){var r;let n;try{n=new URL(e,null!=t?t:window.location.href)}catch(e){return null}const i=n.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!=(r=null==i?void 0:i[1])?r:null}function Xy(e,t){return(e||"").replace(Jf,(e,r,n,i,o,s)=>{const a=n||o||s,l=r||i||"";if(!a)return e;if(Qf.test(a)||Yf.test(a))return`url(${l}${a}${l})`;if(Xf.test(a))return`url(${l}${a}${l})`;if("/"===a[0])return`url(${l}${function(e){let t="";return t=e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0],t=t.split("?")[0],t}(t)+a}${l})`;const u=t.split("/"),c=a.split("/");u.pop();for(const e of c)"."!==e&&(".."===e?u.pop():u.push(e));return`url(${l}${u.join("/")}${l})`})}function Zy(e,t=!1){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function eb(e,t){return function(e,t,r=!1){const n=Array.from(t.childNodes),i=[];let o=0;if(n.length>1&&e&&"string"==typeof e){let t=Zy(e,r);const s=t.length/e.length;for(let a=1;a<n.length;a++)if(n[a].textContent&&"string"==typeof n[a].textContent){const l=Zy(n[a].textContent,r),u=100;let c=3;for(;c<l.length&&(l[c].match(/[a-zA-Z0-9]/)||-1!==l.indexOf(l.substring(0,c),1));c++);for(;c<l.length;c++){let d=l.substring(0,c),h=t.split(d),p=-1;if(2===h.length)p=h[0].length;else if(h.length>2&&""===h[0]&&""!==n[a-1].textContent)p=t.indexOf(d,1);else if(1===h.length){if(d=d.substring(0,d.length-1),h=t.split(d),h.length<=1)return i.push(e),i;c=u+1}else c===l.length-1&&(p=t.indexOf(d));if(h.length>=2&&c>u){const e=n[a-1].textContent;if(e&&"string"==typeof e){const r=Zy(e).length;p=t.indexOf(d,r)}-1===p&&(p=h[0].length)}if(-1!==p){let a=Math.floor(p/s);for(;a>0&&a<e.length;){if(o+=1,o>50*n.length)return i.push(e),i;const l=Zy(e.substring(0,a),r);if(l.length===p){i.push(e.substring(0,a)),e=e.substring(a),t=t.substring(p);break}l.length<p?a+=Math.max(1,Math.floor((p-l.length)/s)):a-=Math.max(1,Math.floor((l.length-p)*s))}break}}}}return i.push(e),i}(e,t).join("/* rr_split */")}function tb(){return eg++}function rb(e,t){return t&&""!==t.trim()?ib(e,t):t}function nb(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function ib(e,t){let r=ag.get(e);if(r||(r=e.createElement("a"),ag.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function ob(e,t,r,n){return n?"src"===r||"href"===r&&("use"!==t||"#"!==n[0])||"xlink:href"===r&&"#"!==n[0]?rb(e,n):"background"!==r||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===r?function(e,t){if(""===t.trim())return t;let r=0;function n(e){let n;const i=e.exec(t.substring(r));return i?(n=i[0],r+=n.length,n):""}const i=[];for(;n(sg),!(r>=t.length);){let o=n(og);if(","===o.slice(-1))o=rb(e,o.substring(0,o.length-1)),i.push(o);else{let n="";o=rb(e,o);let s=!1;for(;;){const e=t.charAt(r);if(""===e){i.push((o+n).trim());break}if(s)")"===e&&(s=!1);else{if(","===e){r+=1,i.push((o+n).trim());break}"("===e&&(s=!0)}n+=e,r+=1}}}return i.join(", ")}(e,n):"style"===r?Xy(n,ib(e)):"object"===t&&"data"===r?rb(e,n):n:rb(e,n):n}function sb(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function ab(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&ab($f.parentNode(e),t,r);for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!!r&&ab($f.parentNode(e),t,r)}function lb(e,t,r,n){let i;if(Vy(e)){if(i=e,!$f.childNodes(i).length)return!1}else{if(null===$f.parentElement(e))return!1;i=$f.parentElement(e)}try{if("string"==typeof t){if(n){if(i.closest(`.${t}`))return!0}else if(i.classList.contains(t))return!0}else if(ab(i,t,n))return!0;if(r)if(n){if(i.closest(r))return!0}else if(i.matches(r))return!0}catch(e){}return!1}function ub(e,t){const{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:s,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:u,maskInputFn:c,maskAttributeFn:d,dataURLOptions:h={},inlineImages:p,recordCanvas:f,keepIframeSrcFn:g,newlyAddedElement:v=!1,cssCaptured:m=!1,applyBackgroundColorToBlockedElements:y=!1}=t,b=function(e,t){if(!t.hasNode(e))return;const r=t.getId(e);return 1===r?void 0:r}(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:Bf.Document,childNodes:[],compatMode:e.compatMode}:{type:Bf.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:Bf.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:b};case e.ELEMENT_NODE:return function(e,t){const{doc:r,blockClass:n,blockSelector:i,inlineStylesheet:o,maskInputOptions:s={},maskInputFn:a,maskAttributeFn:l,dataURLOptions:u={},inlineImages:c,recordCanvas:d,keepIframeSrcFn:h,newlyAddedElement:p=!1,rootId:f,applyBackgroundColorToBlockedElements:g=!1}=t,v=function(e,t,r){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}if(r)return e.matches(r)}catch(e){}return!1}(e,n,i),m=function(e){if(e instanceof HTMLFormElement)return"form";const t=Jy(e.tagName);return tg.test(t)?"div":t}(e);let y={};const b=e.attributes.length;for(let t=0;t<b;t++){const n=e.attributes[t];if(!sb(m,n.name,n.value)){const t=ob(r,m,Jy(n.name),n.value);if(l&&null!==t){const r=l(n.name,t,e);null!==r&&(y[n.name]=r)}else y[n.name]=t}}if("link"===m&&o){const t=Array.from(r.styleSheets).find(t=>t.href===e.href);let n=null;t&&(n=$y(t)),n&&(delete y.rel,delete y.href,y._cssText=n)}if("style"===m&&e.sheet){let t=$y(e.sheet);t&&(e.childNodes.length>1&&(t=eb(t,e)),y._cssText=t)}if("input"===m||"textarea"===m||"select"===m){const t=e.value,r=e.checked;"radio"!==y.type&&"checkbox"!==y.type&&"submit"!==y.type&&"button"!==y.type&&t?y.value=Ky({element:e,type:Qy(e),tagName:m,value:t,maskInputOptions:s,maskInputFn:a}):r&&(y.checked=r)}"option"===m&&(e.selected&&!s.select?y.selected=!0:delete y.selected);"dialog"===m&&e.open&&(y.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal");if("canvas"===m&&d)if("2d"===e.__context)(function(e){const t=e.getContext("2d");if(!t)return!0;for(let r=0;r<e.width;r+=50)for(let n=0;n<e.height;n+=50){const i=t.getImageData,o=Kf in i?i[Kf]:i;if(new Uint32Array(o.call(t,r,n,Math.min(50,e.width-r),Math.min(50,e.height-n)).data.buffer).some(e=>0!==e))return!1}return!0})(e)||(y.rr_dataURL=e.toDataURL(u.type,u.quality));else if(!("__context"in e)){const t=e.toDataURL(u.type,u.quality),n=r.createElement("canvas");n.width=e.width,n.height=e.height;t!==n.toDataURL(u.type,u.quality)&&(y.rr_dataURL=t)}if("img"===m&&c){ng||(ng=r.createElement("canvas"),ig=ng.getContext("2d"));const t=e,n=t.currentSrc||t.getAttribute("src")||"<unknown-src>",i=t.crossOrigin,o=()=>{t.removeEventListener("load",o);try{ng.width=t.naturalWidth,ng.height=t.naturalHeight,ig.drawImage(t,0,0),y.rr_dataURL=ng.toDataURL(u.type,u.quality)}catch(e){if("anonymous"!==t.crossOrigin)return t.crossOrigin="anonymous",void(t.complete&&0!==t.naturalWidth?o():t.addEventListener("load",o));console.warn(`Cannot inline img src=${n}! Error: ${e}`)}"anonymous"===t.crossOrigin&&(i?y.crossOrigin=i:t.removeAttribute("crossorigin"))};t.complete&&0!==t.naturalWidth?o():t.addEventListener("load",o)}if("audio"===m||"video"===m){const t=y;t.rr_mediaState=e.paused?"paused":"played",t.rr_mediaCurrentTime=e.currentTime,t.rr_mediaPlaybackRate=e.playbackRate,t.rr_mediaMuted=e.muted,t.rr_mediaLoop=e.loop,t.rr_mediaVolume=e.volume}p||(e.scrollLeft&&(y.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(y.rr_scrollTop=e.scrollTop));if(v){const{width:t,height:r}=e.getBoundingClientRect();y={class:y.class,rr_width:`${t}px`,rr_height:`${r}px`,...g?{rr_background_color:Zf}:{}}}"iframe"!==m||h(y.src)||(e.contentDocument||(y.rr_src=y.src),delete y.src);let w;try{customElements.get(m)&&(w=!0)}catch(e){}return{type:Bf.Element,tagName:m,attributes:y,childNodes:[],isSVG:nb(e)||void 0,needBlock:v,rootId:f,isCustom:w}}(e,{doc:r,blockClass:i,blockSelector:o,inlineStylesheet:a,maskInputOptions:l,maskInputFn:c,maskAttributeFn:d,dataURLOptions:h,inlineImages:p,recordCanvas:f,keepIframeSrcFn:g,newlyAddedElement:v,rootId:b,applyBackgroundColorToBlockedElements:y});case e.TEXT_NODE:return function(e,t){const{needsMask:r,maskTextFn:n,rootId:i,cssCaptured:o}=t,s=$f.parentNode(e),a=s&&s.tagName;let l="";const u="STYLE"===a||void 0,c="SCRIPT"===a||void 0;c?l="SCRIPT_PLACEHOLDER":o||(l=$f.textContent(e),u&&l&&(l=Xy(l,ib(t.doc))));!u&&!c&&l&&r&&(l=n?n(l,$f.parentElement(e)):l.replace(/[\S]/g,"*"));return{type:Bf.Text,textContent:l||"",rootId:i}}(e,{doc:r,needsMask:s,maskTextFn:u,rootId:b,cssCaptured:m});case e.CDATA_SECTION_NODE:return{type:Bf.CDATA,textContent:"",rootId:b};case e.COMMENT_NODE:return{type:Bf.Comment,textContent:$f.textContent(e)||"",rootId:b};default:return!1}}function cb(e){return null==e?"":e.toLowerCase()}function db(e,t,r){return Array.from(e).map(e=>{const n=t(e);let i=[];if(!r.has(n)){r.add(n);try{i=Array.from(e.cssRules,(t,r)=>({rule:Gy(t,e.href),index:r}))}catch(e){if(!(e instanceof DOMException&&"SecurityError"===e.name))throw e}}return{styleId:n,rules:i}})}function hb(e,t){var r,n,i;const{doc:o,mirror:s,blockClass:a,blockSelector:l,maskTextClass:u,maskTextSelector:c,skipChild:d=!1,inlineStylesheet:h=!0,maskInputOptions:p={},maskTextFn:f,maskInputFn:g,maskAttributeFn:v,slimDOMOptions:m,dataURLOptions:y={},inlineImages:b=!1,recordCanvas:w=!1,onSerialize:S,onAdoptedStyleSheet:E,onIframeLoad:k,iframeLoadTimeout:x=5e3,onStylesheetLoad:C,stylesheetLoadTimeout:I=5e3,keepIframeSrcFn:O=()=>!1,newlyAddedElement:T=!1,cssCaptured:A=!1,applyBackgroundColorToBlockedElements:_=!1}=t,R=null!=(r=t._emittedStyleIds)?r:new Set;let{needsMask:P}=t,{preserveWhiteSpace:M=!0}=t;if(!P){P=lb(e,u,c,void 0===P)}const N=ub(e,{doc:o,mirror:s,blockClass:a,blockSelector:l,needsMask:P,inlineStylesheet:h,maskInputOptions:p,maskTextFn:f,maskInputFn:g,maskAttributeFn:v,dataURLOptions:y,inlineImages:b,recordCanvas:w,keepIframeSrcFn:O,newlyAddedElement:T,cssCaptured:A,applyBackgroundColorToBlockedElements:_});if(!N)return console.warn(e,"not serialized"),null;let L;L=s.hasNode(e)?s.getId(e):function(e,t){if(t.comment&&e.type===Bf.Comment)return!0;if(e.type===Bf.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel||"modulepreload"===e.attributes.rel)&&"script"===e.attributes.as||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===Yy(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(cb(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===cb(e.attributes.name)||"icon"===cb(e.attributes.rel)||"apple-touch-icon"===cb(e.attributes.rel)||"shortcut icon"===cb(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&cb(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(cb(e.attributes.property).match(/^(og|twitter|fb):/)||cb(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===cb(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===cb(e.attributes.name)||"googlebot"===cb(e.attributes.name)||"bingbot"===cb(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===cb(e.attributes.name)||"generator"===cb(e.attributes.name)||"framework"===cb(e.attributes.name)||"publisher"===cb(e.attributes.name)||"progid"===cb(e.attributes.name)||cb(e.attributes.property).match(/^article:/)||cb(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===cb(e.attributes.name)||"yandex-verification"===cb(e.attributes.name)||"csrf-token"===cb(e.attributes.name)||"p:domain_verify"===cb(e.attributes.name)||"verify-v1"===cb(e.attributes.name)||"verification"===cb(e.attributes.name)||"shopify-checkout-api-token"===cb(e.attributes.name)))return!0}}return!1}(N,m)||!M&&N.type===Bf.Text&&!N.textContent.replace(/^\s+|\s+$/gm,"").length?rg:tb();const D=Object.assign(N,{id:L});if(s.add(e,D),L===rg)return null;S&&S(e);let j=!d;if(D.type===Bf.Element){j=j&&!D.needBlock,delete D.needBlock;const t=$f.shadowRoot(e);t&&Hy(t)&&(D.isShadowHost=!0,E&&(null==(n=t.adoptedStyleSheets)?void 0:n.length)&&(D.adoptedStyleSheets=db(t.adoptedStyleSheets,E,R)))}if(D.type===Bf.Document&&E){const t=e;(null==(i=t.adoptedStyleSheets)?void 0:i.length)&&(D.adoptedStyleSheets=db(t.adoptedStyleSheets,E,R))}if((D.type===Bf.Document||D.type===Bf.Element)&&j){m.headWhitespace&&D.type===Bf.Element&&"head"===D.tagName&&(M=!1);const t={doc:o,mirror:s,blockClass:a,blockSelector:l,needsMask:P,maskTextClass:u,maskTextSelector:c,skipChild:d,inlineStylesheet:h,maskInputOptions:p,maskTextFn:f,maskInputFn:g,maskAttributeFn:v,slimDOMOptions:m,dataURLOptions:y,inlineImages:b,recordCanvas:w,preserveWhiteSpace:M,onSerialize:S,onAdoptedStyleSheet:E,_emittedStyleIds:R,onIframeLoad:k,iframeLoadTimeout:x,onStylesheetLoad:C,stylesheetLoadTimeout:I,keepIframeSrcFn:O,cssCaptured:!1,applyBackgroundColorToBlockedElements:_};if(D.type===Bf.Element&&"textarea"===D.tagName&&void 0!==D.attributes.value);else{D.type===Bf.Element&&void 0!==D.attributes._cssText&&"string"==typeof D.attributes._cssText&&(t.cssCaptured=!0);for(const r of Array.from($f.childNodes(e))){const e=hb(r,t);e&&D.childNodes.push(e)}}let r=null;if(Vy(e)&&(r=$f.shadowRoot(e)))for(const e of Array.from($f.childNodes(r))){const n=hb(e,t);n&&(Hy(r)&&(n.isShadow=!0),D.childNodes.push(n))}}const U=$f.parentNode(e);return U&&Wy(U)&&Hy(U)&&(D.isShadow=!0),D.type===Bf.Element&&"iframe"===D.tagName&&function(e,t,r){const n=e.contentWindow;if(!n)return;let i,o=!1;try{i=n.document.readyState}catch(e){return}if("complete"!==i){const n=setTimeout(()=>{o||(t(),o=!0)},r);return void e.addEventListener("load",()=>{clearTimeout(n),o=!0,t()})}const s="about:blank";if(n.location.href!==s||e.src===s||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}(e,()=>{const t=e.contentDocument;if(t&&k){const r=hb(t,{doc:t,mirror:s,blockClass:a,blockSelector:l,needsMask:P,maskTextClass:u,maskTextSelector:c,skipChild:!1,inlineStylesheet:h,maskInputOptions:p,maskTextFn:f,maskInputFn:g,maskAttributeFn:v,slimDOMOptions:m,dataURLOptions:y,inlineImages:b,recordCanvas:w,preserveWhiteSpace:M,onSerialize:S,onAdoptedStyleSheet:E,onIframeLoad:k,iframeLoadTimeout:x,onStylesheetLoad:C,stylesheetLoadTimeout:I,keepIframeSrcFn:O});r&&k(e,r)}},x),D.type===Bf.Element&&"link"===D.tagName&&"string"==typeof D.attributes.rel&&("stylesheet"===D.attributes.rel||"preload"===D.attributes.rel&&"string"==typeof D.attributes.href&&"css"===Yy(D.attributes.href))&&function(e,t,r){let n,i=!1;try{n=e.sheet}catch(e){return}if(n)return;const o=setTimeout(()=>{i||(t(),i=!0)},r);e.addEventListener("load",()=>{clearTimeout(o),i=!0,t()})}(e,()=>{if(C){const t=hb(e,{doc:o,mirror:s,blockClass:a,blockSelector:l,needsMask:P,maskTextClass:u,maskTextSelector:c,skipChild:!1,inlineStylesheet:h,maskInputOptions:p,maskTextFn:f,maskInputFn:g,maskAttributeFn:v,slimDOMOptions:m,dataURLOptions:y,inlineImages:b,recordCanvas:w,preserveWhiteSpace:M,onSerialize:S,onIframeLoad:k,iframeLoadTimeout:x,onStylesheetLoad:C,stylesheetLoadTimeout:I,keepIframeSrcFn:O});t&&C(e,t)}},I),D}function pb(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function fb(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if("function"==typeof t){var r=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}),r}function gb(){if(ug)return lg.exports;ug=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e}};return lg.exports=t(),lg.exports.createColors=t,lg.exports}function vb(){if(fg)return pg;fg=1;let e=gb(),t=hg;class r extends Error{constructor(e,t,n,i,o,s){super(e),this.name="CssSyntaxError",this.reason=e,o&&(this.file=o),i&&(this.source=i),s&&(this.plugin=s),void 0!==t&&void 0!==n&&("number"==typeof t?(this.line=t,this.column=n):(this.line=t.line,this.column=t.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,r)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(r){if(!this.source)return"";let n=this.source;null==r&&(r=e.isColorSupported),t&&r&&(n=t(n));let i,o,s=n.split(/\r?\n/),a=Math.max(this.line-3,0),l=Math.min(this.line+2,s.length),u=String(l).length;if(r){let{bold:t,gray:r,red:n}=e.createColors(!0);i=e=>t(n(e)),o=e=>r(e)}else i=o=e=>e;return s.slice(a,l).map((e,t)=>{let r=a+1+t,n=" "+(" "+r).slice(-u)+" | ";if(r===this.line){let t=o(n.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return i(">")+o(n)+e+"\n "+t+i("^")}return" "+o(n)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}return pg=r,r.default=r,pg}function mb(){return vg||(vg=1,gg.isClean=Symbol("isClean"),gg.my=Symbol("my")),gg}function yb(){if(yg)return mg;yg=1;const e={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};class t{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name,n=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?r+=e.raws.afterName:n&&(r+=" "),e.nodes)this.block(e,r+n);else{let i=(e.raws.between||"")+(t?";":"");this.builder(r+n+i,e)}}beforeAfter(e,t){let r;r="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let n=e.parent,i=0;for(;n&&"root"!==n.type;)i+=1,n=n.parent;if(r.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<i;e++)r+=t}return r}block(e,t){let r,n=this.raw(e,"between","beforeOpen");this.builder(t+n+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),r=this.raw(e,"after")):r=this.raw(e,"after","emptyBody"),r&&this.builder(r),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let r=this.raw(e,"semicolon");for(let n=0;n<e.nodes.length;n++){let i=e.nodes[n],o=this.raw(i,"before");o&&this.builder(o),this.stringify(i,t!==n||r)}}comment(e){let t=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)}decl(e,t){let r=this.raw(e,"between","colon"),n=e.prop+r+this.rawValue(e,"value");e.important&&(n+=e.raws.important||" !important"),t&&(n+=";"),this.builder(n,e)}document(e){this.body(e)}raw(t,r,n){let i;if(n||(n=r),r&&(i=t.raws[r],void 0!==i))return i;let o=t.parent;if("before"===n){if(!o||"root"===o.type&&o.first===t)return"";if(o&&"document"===o.type)return""}if(!o)return e[n];let s=t.root();if(s.rawCache||(s.rawCache={}),void 0!==s.rawCache[n])return s.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(t,n);{let e="raw"+((a=n)[0].toUpperCase()+a.slice(1));this[e]?i=this[e](s,t):s.walk(e=>{if(i=e.raws[r],void 0!==i)return!1})}var a;return void 0===i&&(i=e[n]),s.rawCache[n]=i,i}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let r;return e.walkComments(e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),void 0===r?r=this.raw(t,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(e,t){let r;return e.walkDecls(e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),void 0===r?r=this.raw(t,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(e){let t;return e.walk(r=>{if(r.nodes&&(r.parent!==e||e.first!==r)&&void 0!==r.raws.before)return t=r.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(r=>{let n=r.parent;if(n&&n!==e&&n.parent&&n.parent===e&&void 0!==r.raws.before){let e=r.raws.before.split("\n");return t=e[e.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){let r=e[t],n=e.raws[t];return n&&n.value===r?n.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}}return mg=t,t.default=t,mg}function bb(){if(wg)return bg;wg=1;let e=yb();function t(t,r){new e(r).stringify(t)}return bg=t,t.default=t,bg}function wb(){if(Eg)return Sg;Eg=1;let{isClean:e,my:t}=mb(),r=vb(),n=yb(),i=bb();function o(e,t){let r=new e.constructor;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if("proxyCache"===n)continue;let i=e[n],s=typeof i;"parent"===n&&"object"===s?t&&(r[n]=t):"source"===n?r[n]=i:Array.isArray(i)?r[n]=i.map(e=>o(e,r)):("object"===s&&null!==i&&(i=o(i)),r[n]=i)}return r}class s{constructor(r={}){this.raws={},this[e]=!1,this[t]=!0;for(let e in r)if("nodes"===e){this.nodes=[];for(let t of r[e])"function"==typeof t.clone?this.append(t.clone()):this.append(t)}else this[e]=r[e]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=o(this);for(let r in e)t[r]=e[r];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:r,start:n}=this.rangeBy(t);return this.source.input.error(e,{column:n.column,line:n.line},{column:r.column,line:r.line},t)}return new r(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markDirty(){if(this[e]){this[e]=!1;let t=this;for(;t=t.parent;)t[e]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){let n=(t=this.toString()).indexOf(e.word);-1!==n&&(r=this.positionInside(n,t))}return r}positionInside(e,t){let r=t||this.toString(),n=this.source.start.column,i=this.source.start.line;for(let t=0;t<e;t++)"\n"===r[t]?(n=1,i+=1):n+=1;return{column:n,line:i}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let n=this.toString(),i=n.indexOf(e.word);-1!==i&&(t=this.positionInside(i,n),r=this.positionInside(i+e.word.length,n))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return(new n).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let n of e)n===this?r=!0:r?(this.parent.insertAfter(t,n),t=n):this.parent.insertBefore(t,n);r||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let r={},n=null==t;t=t||new Map;let i=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let n=this[e];if(Array.isArray(n))r[e]=n.map(e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e);else if("object"==typeof n&&n.toJSON)r[e]=n.toJSON(null,t);else if("source"===e){let o=t.get(n.input);null==o&&(o=i,t.set(n.input,i),i++),r[e]={end:n.end,inputId:o,start:n.start}}else r[e]=n}return n&&(r.inputs=[...t.keys()].map(e=>e.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=i){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){let n={node:this};for(let e in r)n[e]=r[e];return e.warn(t,n)}get proxyOf(){return this}}return Sg=s,s.default=s,Sg}function Sb(){if(xg)return kg;xg=1;let e=wb();class t extends e{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}}return kg=t,t.default=t,kg}function Eb(){if(Ig)return Cg;Ig=1;return Cg={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(r=t)=>{let n="",i=r;for(;i--;)n+=e[Math.random()*e.length|0];return n}}}function kb(){if(Tg)return Og;Tg=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=hg,{existsSync:r,readFileSync:n}=hg,{dirname:i,join:o}=hg;class s{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,n=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=i(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new e(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t;let r=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+r)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let r=e.lastIndexOf(t.pop()),n=e.indexOf("*/",r);r>-1&&n>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,n)))}loadFile(e){if(this.root=i(e),r(e))return this.mapFile=e,n(e,"utf-8").toString().trim()}loadMap(r,n){if(!1===n)return!1;if(n){if("string"==typeof n)return n;if("function"!=typeof n){if(n instanceof e)return t.fromSourceMap(n).toString();if(n instanceof t)return n.toString();if(this.isMap(n))return JSON.stringify(n);throw new Error("Unsupported previous source map format: "+n.toString())}{let e=n(r);if(e){let t=this.loadFile(e);if(!t)throw new Error("Unable to load previous source map: "+e.toString());return t}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let e=this.annotation;return r&&(e=o(i(r),e)),this.loadFile(e)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return Og=s,s.default=s,Og}function xb(){if(_g)return Ag;_g=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=hg,{fileURLToPath:r,pathToFileURL:n}=hg,{isAbsolute:i,resolve:o}=hg,{nanoid:s}=Eb(),a=hg,l=vb(),u=kb(),c=Symbol("fromOffsetCache"),d=Boolean(e&&t),h=Boolean(o&&i);class p{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||""===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!h||/^\w+:\/\//.test(t.from)||i(t.from)?this.file=t.from:this.file=o(t.from)),h&&d){let e=new u(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+s(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,i={}){let o,s,a;if(t&&"object"==typeof t){let e=t,n=r;if("number"==typeof e.offset){let n=this.fromOffset(e.offset);t=n.line,r=n.col}else t=e.line,r=e.column;if("number"==typeof n.offset){let e=this.fromOffset(n.offset);s=e.line,a=e.col}else s=n.line,a=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let u=this.origin(t,r,s,a);return o=u?new l(e,void 0===u.endLine?u.line:{column:u.column,line:u.line},void 0===u.endLine?u.column:{column:u.endColumn,line:u.endLine},u.source,u.file,i.plugin):new l(e,void 0===s?t:{column:r,line:t},void 0===s?r:{column:a,line:s},this.css,this.file,i.plugin),o.input={column:r,endColumn:a,endLine:s,line:t,source:this.css},this.file&&(n&&(o.input.url=n(this.file).toString()),o.input.file=this.file),o}fromOffset(e){let t,r;if(this[c])r=this[c];else{let e=this.css.split("\n");r=new Array(e.length);let t=0;for(let n=0,i=e.length;n<i;n++)r[n]=t,t+=e[n].length+1;this[c]=r}t=r[r.length-1];let n=0;if(e>=t)n=r.length-1;else{let t,i=r.length-2;for(;n<i;)if(t=n+(i-n>>1),e<r[t])i=t-1;else{if(!(e>=r[t+1])){n=t;break}n=t+1}}return{col:e-r[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:o(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,o,s){if(!this.map)return!1;let a,l,u=this.map.consumer(),c=u.originalPositionFor({column:t,line:e});if(!c.source)return!1;"number"==typeof o&&(a=u.originalPositionFor({column:s,line:o})),l=i(c.source)?n(c.source):new URL(c.source,this.map.consumer().sourceRoot||n(this.map.mapFile));let d={column:c.column,endColumn:a&&a.column,endLine:a&&a.line,line:c.line,url:l.toString()};if("file:"===l.protocol){if(!r)throw new Error("file: protocol is not available in this PostCSS build");d.file=r(l)}let h=u.sourceContentFor(c.source);return h&&(d.source=h),d}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}}return Ag=p,p.default=p,a&&a.registerInput&&a.registerInput(p),Ag}function Cb(){if(Pg)return Rg;Pg=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=hg,{dirname:r,relative:n,resolve:i,sep:o}=hg,{pathToFileURL:s}=hg,a=xb(),l=Boolean(e&&t),u=Boolean(r&&i&&n&&o);return Rg=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let t of this.previous()){let n,i=this.toUrl(this.path(t.file)),o=t.root||r(t.file);!1===this.mapOpts.sourcesContent?(n=new e(t.text),n.sourcesContent&&(n.sourcesContent=null)):n=t.consumer(),this.map.applySourceMap(n,i,this.toUrl(this.path(o)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),u&&l&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=t.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0});let e,r,n=1,i=1,o="<no source>",s={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(t,a,l)=>{if(this.css+=t,a&&"end"!==l&&(s.generated.line=n,s.generated.column=i-1,a.source&&a.source.start?(s.source=this.sourcePath(a),s.original.line=a.source.start.line,s.original.column=a.source.start.column-1,this.map.addMapping(s)):(s.source=o,s.original.line=1,s.original.column=0,this.map.addMapping(s))),e=t.match(/\n/g),e?(n+=e.length,r=t.lastIndexOf("\n"),i=t.length-r):i+=t.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(s.source=this.sourcePath(a),s.original.line=a.source.end.line,s.original.column=a.source.end.column-1,s.generated.line=n,s.generated.column=i-2,this.map.addMapping(s)):(s.source=o,s.original.line=1,s.original.column=0,s.generated.line=n,s.generated.column=i-1,this.map.addMapping(s)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let o=this.opts.to?r(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(o=r(i(o,this.mapOpts.annotation)));let s=n(o,e);return this.memoizedPaths.set(e,s),s}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new a(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let r=t.source.input.from;if(r&&!e[r]){e[r]=!0;let n=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(n,t.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(s){let t=s(e).toString();return this.memoizedFileURLs.set(e,t),t}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;"\\"===o&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}}}function Ib(){if(Ng)return Mg;Ng=1;let e=wb();class t extends e{constructor(e){super(e),this.type="comment"}}return Mg=t,t.default=t,Mg}function Ob(){if(Dg)return Lg;Dg=1;let e,t,r,n,{isClean:i,my:o}=mb(),s=Sb(),a=Ib(),l=wb();function u(e){return e.map(e=>(e.nodes&&(e.nodes=u(e.nodes)),delete e.source,e))}function c(e){if(e[i]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)c(t)}class d extends l{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,r,n=this.getIterator();for(;this.indexes[n]<this.proxyOf.nodes.length&&(t=this.indexes[n],r=e(this.proxyOf.nodes[t],t),!1!==r);)this.indexes[n]+=1;return delete this.indexes[n],r}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...r)=>e[t](...r.map(e=>"function"==typeof e?(t,r)=>e(t.toProxy(),r):e)):"every"===t||"some"===t?r=>e[t]((e,...t)=>r(e.toProxy(),...t)):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map(e=>e.toProxy()):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let r,n=this.index(e),i=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let e of i)this.proxyOf.nodes.splice(n+1,0,e);for(let e in this.indexes)r=this.indexes[e],n<r&&(this.indexes[e]=r+i.length);return this.markDirty(),this}insertBefore(e,t){let r,n=this.index(e),i=0===n&&"prepend",o=this.normalize(t,this.proxyOf.nodes[n],i).reverse();n=this.index(e);for(let e of o)this.proxyOf.nodes.splice(n,0,e);for(let e in this.indexes)r=this.indexes[e],n<=r&&(this.indexes[e]=r+o.length);return this.markDirty(),this}normalize(n,l){if("string"==typeof n)n=u(e(n).nodes);else if(void 0===n)n=[];else if(Array.isArray(n)){n=n.slice(0);for(let e of n)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===n.type&&"document"!==this.type){n=n.nodes.slice(0);for(let e of n)e.parent&&e.parent.removeChild(e,"ignore")}else if(n.type)n=[n];else if(n.prop){if(void 0===n.value)throw new Error("Value field is missed in node creation");"string"!=typeof n.value&&(n.value=String(n.value)),n=[new s(n)]}else if(n.selector)n=[new t(n)];else if(n.name)n=[new r(n)];else{if(!n.text)throw new Error("Unknown node type in node creation");n=[new a(n)]}return n.map(e=>(e[o]||d.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[i]&&c(e),void 0===e.raws.before&&l&&void 0!==l.raws.before&&(e.raws.before=l.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls(n=>{t.props&&!t.props.includes(n.prop)||t.fast&&!n.value.includes(t.fast)||(n.value=n.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,r)=>{let n;try{n=e(t,r)}catch(e){throw t.addToError(e)}return!1!==n&&t.walk&&(n=t.walk(e)),n})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("atrule"===r.type&&e.test(r.name))return t(r,n)}):this.walk((r,n)=>{if("atrule"===r.type&&r.name===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("atrule"===e.type)return t(e,r)}))}walkComments(e){return this.walk((t,r)=>{if("comment"===t.type)return e(t,r)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("decl"===r.type&&e.test(r.prop))return t(r,n)}):this.walk((r,n)=>{if("decl"===r.type&&r.prop===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("decl"===e.type)return t(e,r)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("rule"===r.type&&e.test(r.selector))return t(r,n)}):this.walk((r,n)=>{if("rule"===r.type&&r.selector===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("rule"===e.type)return t(e,r)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}return d.registerParse=t=>{e=t},d.registerRule=e=>{t=e},d.registerAtRule=e=>{r=e},d.registerRoot=e=>{n=e},Lg=d,d.default=d,d.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,r.prototype):"rule"===e.type?Object.setPrototypeOf(e,t.prototype):"decl"===e.type?Object.setPrototypeOf(e,s.prototype):"comment"===e.type?Object.setPrototypeOf(e,a.prototype):"root"===e.type&&Object.setPrototypeOf(e,n.prototype),e[o]=!0,e.nodes&&e.nodes.forEach(e=>{d.rebuild(e)})},Lg}function Tb(){if(Ug)return jg;Ug=1;let e,t,r=Ob();class n extends r{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(r={}){return new e(new t,this,r).stringify()}}return n.registerLazyResult=t=>{e=t},n.registerProcessor=e=>{t=e},jg=n,n.default=n,jg}function Ab(){if(Bg)return Fg;Bg=1;let e={};return Fg=function(t){e[t]||(e[t]=!0,"undefined"!=typeof console&&console.warn&&console.warn(t))}}function _b(){if(zg)return qg;zg=1;class e{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}return qg=e,e.default=e,qg}function Rb(){if(Wg)return Vg;Wg=1;let e=_b();class t{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(t,r={}){r.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(r.plugin=this.lastPlugin.postcssPlugin);let n=new e(t,r);return this.messages.push(n),n}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}}return Vg=t,t.default=t,Vg}function Pb(){if(Kg)return Gg;Kg=1;let e=Ob();class t extends e{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}}return Gg=t,t.default=t,e.registerAtRule(t),Gg}function Mb(){if(Qg)return Jg;Qg=1;let e,t,r=Ob();class n extends r{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){let n=super.normalize(e);if(t)if("prepend"===r)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of n)e.raws.before=t.raws.before;return n}removeChild(e,t){let r=this.index(e);return!t&&0===r&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(r={}){return new e(new t,this,r).stringify()}}return n.registerLazyResult=t=>{e=t},n.registerProcessor=e=>{t=e},Jg=n,n.default=n,r.registerRoot(n),Jg}function Nb(){if(Xg)return Yg;Xg=1;let e={comma:t=>e.split(t,[","],!0),space:t=>e.split(t,[" ","\n","\t"]),split(e,t,r){let n=[],i="",o=!1,s=0,a=!1,l="",u=!1;for(let r of e)u?u=!1:"\\"===r?u=!0:a?r===l&&(a=!1):'"'===r||"'"===r?(a=!0,l=r):"("===r?s+=1:")"===r?s>0&&(s-=1):0===s&&t.includes(r)&&(o=!0),o?(""!==i&&n.push(i.trim()),i="",o=!1):i+=r;return(r||""!==i)&&n.push(i.trim()),n}};return Yg=e,e.default=e,Yg}function Lb(){if(ev)return Zg;ev=1;let e=Ob(),t=Nb();class r extends e{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return t.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}}return Zg=r,r.default=r,e.registerRule(r),Zg}function Db(){if(rv)return tv;rv=1;let e=Sb(),t=function(){if($g)return Hg;$g=1;const e="'".charCodeAt(0),t='"'.charCodeAt(0),r="\\".charCodeAt(0),n="/".charCodeAt(0),i="\n".charCodeAt(0),o=" ".charCodeAt(0),s="\f".charCodeAt(0),a="\t".charCodeAt(0),l="\r".charCodeAt(0),u="[".charCodeAt(0),c="]".charCodeAt(0),d="(".charCodeAt(0),h=")".charCodeAt(0),p="{".charCodeAt(0),f="}".charCodeAt(0),g=";".charCodeAt(0),v="*".charCodeAt(0),m=":".charCodeAt(0),y="@".charCodeAt(0),b=/[\t\n\f\r "#'()/;[\\\]{}]/g,w=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,S=/.[\r\n"'(/\\]/,E=/[\da-f]/i;return Hg=function(k,x={}){let C,I,O,T,A,_,R,P,M,N,L=k.css.valueOf(),D=x.ignoreErrors,j=L.length,U=0,F=[],B=[];function q(e){throw k.error("Unclosed "+e,U)}return{back:function(e){B.push(e)},endOfFile:function(){return 0===B.length&&U>=j},nextToken:function(k){if(B.length)return B.pop();if(U>=j)return;let x=!!k&&k.ignoreUnclosed;switch(C=L.charCodeAt(U),C){case i:case o:case a:case l:case s:I=U;do{I+=1,C=L.charCodeAt(I)}while(C===o||C===i||C===a||C===l||C===s);N=["space",L.slice(U,I)],U=I-1;break;case u:case c:case p:case f:case m:case g:case h:{let e=String.fromCharCode(C);N=[e,e,U];break}case d:if(P=F.length?F.pop()[1]:"",M=L.charCodeAt(U+1),"url"===P&&M!==e&&M!==t&&M!==o&&M!==i&&M!==a&&M!==s&&M!==l){I=U;do{if(_=!1,I=L.indexOf(")",I+1),-1===I){if(D||x){I=U;break}q("bracket")}for(R=I;L.charCodeAt(R-1)===r;)R-=1,_=!_}while(_);N=["brackets",L.slice(U,I+1),U,I],U=I}else I=L.indexOf(")",U+1),T=L.slice(U,I+1),-1===I||S.test(T)?N=["(","(",U]:(N=["brackets",T,U,I],U=I);break;case e:case t:O=C===e?"'":'"',I=U;do{if(_=!1,I=L.indexOf(O,I+1),-1===I){if(D||x){I=U+1;break}q("string")}for(R=I;L.charCodeAt(R-1)===r;)R-=1,_=!_}while(_);N=["string",L.slice(U,I+1),U,I],U=I;break;case y:b.lastIndex=U+1,b.test(L),I=0===b.lastIndex?L.length-1:b.lastIndex-2,N=["at-word",L.slice(U,I+1),U,I],U=I;break;case r:for(I=U,A=!0;L.charCodeAt(I+1)===r;)I+=1,A=!A;if(C=L.charCodeAt(I+1),A&&C!==n&&C!==o&&C!==i&&C!==a&&C!==l&&C!==s&&(I+=1,E.test(L.charAt(I)))){for(;E.test(L.charAt(I+1));)I+=1;L.charCodeAt(I+1)===o&&(I+=1)}N=["word",L.slice(U,I+1),U,I],U=I;break;default:C===n&&L.charCodeAt(U+1)===v?(I=L.indexOf("*/",U+2)+1,0===I&&(D||x?I=L.length:q("comment")),N=["comment",L.slice(U,I+1),U,I],U=I):(w.lastIndex=U+1,w.test(L),I=0===w.lastIndex?L.length-1:w.lastIndex-2,N=["word",L.slice(U,I+1),U,I],F.push(N),U=I)}return U++,N},position:function(){return U}}}}(),r=Ib(),n=Pb(),i=Mb(),o=Lb();const s={empty:!0,space:!0};return tv=class{constructor(e){this.input=e,this.root=new i,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,r,i,o=new n;o.name=e[1].slice(1),""===o.name&&this.unnamedAtrule(o,e),this.init(o,e[2]);let s=!1,a=!1,l=[],u=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?u.push("("===t?")":"]"):"{"===t&&u.length>0?u.push("}"):t===u[u.length-1]&&u.pop(),0===u.length){if(";"===t){o.source.end=this.getPosition(e[2]),o.source.end.offset++,this.semicolon=!0;break}if("{"===t){a=!0;break}if("}"===t){if(l.length>0){for(i=l.length-1,r=l[i];r&&"space"===r[0];)r=l[--i];r&&(o.source.end=this.getPosition(r[3]||r[2]),o.source.end.offset++)}this.end(e);break}l.push(e)}else l.push(e);if(this.tokenizer.endOfFile()){s=!0;break}}o.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(o.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(o,"params",l),s&&(e=l[l.length-1],o.source.end=this.getPosition(e[3]||e[2]),o.source.end.offset++,this.spaces=o.raws.between,o.raws.between="")):(o.raws.afterName="",o.params=""),a&&(o.nodes=[],this.current=o)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let r,n=0;for(let i=t-1;i>=0&&(r=e[i],"space"===r[0]||(n+=1,2!==n));i--);throw this.input.error("Missed semicolon","word"===r[0]?r[3]+1:r[2])}colon(e){let t,r,n,i=0;for(let[o,s]of e.entries()){if(t=s,r=t[0],"("===r&&(i+=1),")"===r&&(i-=1),0===i&&":"===r){if(n){if("word"===n[0]&&"progid"===n[1])continue;return o}this.doubleColon(t)}n=t}return!1}comment(e){let t=new r;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=t(this.input)}decl(t,r){let n=new e;this.init(n,t[0][2]);let i,o=t[t.length-1];for(";"===o[0]&&(this.semicolon=!0,t.pop()),n.source.end=this.getPosition(o[3]||o[2]||function(e){for(let t=e.length-1;t>=0;t--){let r=e[t],n=r[3]||r[2];if(n)return n}}(t)),n.source.end.offset++;"word"!==t[0][0];)1===t.length&&this.unknownWord(t),n.raws.before+=t.shift()[1];for(n.source.start=this.getPosition(t[0][2]),n.prop="";t.length;){let e=t[0][0];if(":"===e||"space"===e||"comment"===e)break;n.prop+=t.shift()[1]}for(n.raws.between="";t.length;){if(i=t.shift(),":"===i[0]){n.raws.between+=i[1];break}"word"===i[0]&&/\w/.test(i[1])&&this.unknownWord([i]),n.raws.between+=i[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let s,a=[];for(;t.length&&(s=t[0][0],"space"===s||"comment"===s);)a.push(t.shift());this.precheckMissedSemicolon(t);for(let e=t.length-1;e>=0;e--){if(i=t[e],"!important"===i[1].toLowerCase()){n.important=!0;let r=this.stringFrom(t,e);r=this.spacesFromEnd(t)+r," !important"!==r&&(n.raws.important=r);break}if("important"===i[1].toLowerCase()){let r=t.slice(0),i="";for(let t=e;t>0;t--){let e=r[t][0];if(0===i.trim().indexOf("!")&&"space"!==e)break;i=r.pop()[1]+i}0===i.trim().indexOf("!")&&(n.important=!0,n.raws.important=i,t=r)}if("space"!==i[0]&&"comment"!==i[0])break}t.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(n,"value",a.concat(t),r),n.value.includes(":")&&!r&&this.checkMissedSemicolon(t)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new o;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,r=null,n=!1,i=null,o=[],s=e[1].startsWith("--"),a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)i||(i=l),o.push("("===r?")":"]");else if(s&&n&&"{"===r)i||(i=l),o.push("}");else if(0===o.length){if(";"===r){if(n)return void this.decl(a,s);break}if("{"===r)return void this.rule(a);if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}":"===r&&(n=!0)}else r===o[o.length-1]&&(o.pop(),0===o.length&&(i=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(i),t&&n){if(!s)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,s)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,r,n){let i,o,a,l,u=r.length,c="",d=!0;for(let e=0;e<u;e+=1)i=r[e],o=i[0],"space"!==o||e!==u-1||n?"comment"===o?(l=r[e-1]?r[e-1][0]:"empty",a=r[e+1]?r[e+1][0]:"empty",s[l]||s[a]||","===c.slice(-1)?d=!1:c+=i[1]):c+=i[1]:d=!1;if(!d){let n=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:n,value:c}}e[t]=c}rule(e){e.pop();let t=new o;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let n=t;n<e.length;n++)r+=e[n][1];return e.splice(t,e.length-t),r}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}}}function jb(){if(iv)return nv;iv=1;let e=Ob(),t=Db(),r=xb();function n(e,n){let i=new r(e,n),o=new t(i);try{o.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&n&&n.from&&(/\.scss$/i.test(n.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(n.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(n.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return o.root}return nv=n,n.default=n,e.registerParse(n),nv}function Ub(){if(sv)return ov;sv=1;let{isClean:e,my:t}=mb(),r=Cb(),n=bb(),i=Ob(),o=Tb(),s=Ab(),a=Rb(),l=jb(),u=Mb();const c={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},d={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},h={Once:!0,postcssPlugin:!0,prepare:!0};function p(e){return"object"==typeof e&&"function"==typeof e.then}function f(e){let t=!1,r=c[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[r,r+"-"+t,0,r+"Exit",r+"Exit-"+t]:t?[r,r+"-"+t,r+"Exit",r+"Exit-"+t]:e.append?[r,0,r+"Exit"]:[r,r+"Exit"]}function g(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:f(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function v(t){return t[e]=!1,t.nodes&&t.nodes.forEach(e=>v(e)),t}let m={};class y{constructor(e,r,n){let o;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof y||r instanceof a)o=v(r.root),r.map&&(void 0===n.map&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=r.map);else{let e=l;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{o=e(r,n)}catch(e){this.processed=!0,this.error=e}o&&!o[t]&&i.rebuild(o)}else o=v(r);this.result=new a(e,o,n),this.helpers={...m,postcss:m,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let r=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(r.postcssVersion&&"production"!==process.env.NODE_ENV){let e=r.postcssPlugin,t=r.postcssVersion,n=this.result.processor.version,i=t.split("."),o=n.split(".");(i[0]!==o[0]||parseInt(i[1])>parseInt(o[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+n+", but "+e+" uses "+t+". Perhaps this is the source of the error below.")}}else e.plugin=r.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,r)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,r])};for(let t of this.plugins)if("object"==typeof t)for(let r in t){if(!d[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!h[r])if("object"==typeof t[r])for(let n in t[r])e(t,"*"===n?r:r+"-"+n.toLowerCase(),t[r][n]);else"function"==typeof t[r]&&e(t,r,t[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],r=this.runOnRoot(t);if(p(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];){t[e]=!0;let r=[g(t)];for(;r.length>0;){let e=this.visitTick(r);if(p(e))try{await e}catch(e){let t=r[r.length-1].node;throw this.handleError(e,t)}}}if(this.listeners.OnceExit)for(let[e,r]of this.listeners.OnceExit){this.result.lastPlugin=e;try{if("document"===t.type){let e=t.nodes.map(e=>r(e,this.helpers));await Promise.all(e)}else await r(t,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return p(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=n;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let i=new r(t,this.result.root,this.result.opts).generate();return this.result.css=i[0],this.result.map=i[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins){if(p(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];)t[e]=!0,this.walkSync(t);if(this.listeners.OnceExit)if("document"===t.type)for(let e of t.nodes)this.visitSync(this.listeners.OnceExit,e);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||s("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[r,n]of e){let e;this.result.lastPlugin=r;try{e=n(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(p(e))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:n,visitors:i}=r;if("root"!==n.type&&"document"!==n.type&&!n.parent)return void t.pop();if(i.length>0&&r.visitorIndex<i.length){let[e,t]=i[r.visitorIndex];r.visitorIndex+=1,r.visitorIndex===i.length&&(r.visitors=[],r.visitorIndex=0),this.result.lastPlugin=e;try{return t(n.toProxy(),this.helpers)}catch(e){throw this.handleError(e,n)}}if(0!==r.iterator){let i,o=r.iterator;for(;i=n.nodes[n.indexes[o]];)if(n.indexes[o]+=1,!i[e])return i[e]=!0,void t.push(g(i));r.iterator=0,delete n.indexes[o]}let o=r.events;for(;r.eventIndex<o.length;){let t=o[r.eventIndex];if(r.eventIndex+=1,0===t)return void(n.nodes&&n.nodes.length&&(n[e]=!0,r.iterator=n.getIterator()));if(this.listeners[t])return void(r.visitors=this.listeners[t])}t.pop()}walkSync(t){t[e]=!0;let r=f(t);for(let n of r)if(0===n)t.nodes&&t.each(t=>{t[e]||this.walkSync(t)});else{let e=this.listeners[n];if(e&&this.visitSync(e,t.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}}return y.registerPostcss=e=>{m=e},ov=y,y.default=y,u.registerLazyResult(y),o.registerLazyResult(y),ov}function Fb(){if(cv)return uv;cv=1;let e=function(){if(lv)return av;lv=1;let e=Cb(),t=bb(),r=Ab(),n=jb();const i=Rb();class o{constructor(r,n,o){let s;n=n.toString(),this.stringified=!1,this._processor=r,this._css=n,this._opts=o,this._map=void 0;let a=t;this.result=new i(this._processor,s,this._opts),this.result.css=n;let l=this;Object.defineProperty(this.result,"root",{get:()=>l.root});let u=new e(a,s,this._opts,n);if(u.isMap()){let[e,t]=u.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else u.clearAnnotation(),this.result.css=u.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this._opts||r("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=n;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}}return av=o,o.default=o,av}(),t=Ub(),r=Tb(),n=Mb();class i{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(r,n={}){return this.plugins.length||n.parser||n.stringifier||n.syntax?new t(this,r,n):new e(this,r,n)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}return uv=i,i.default=i,n.registerProcessor(i),r.registerProcessor(i),uv}function Bb(){if(fv)return pv;fv=1;let e=vb(),t=Sb(),r=Ub(),n=Ob(),i=Fb(),o=bb(),s=function(){if(hv)return dv;hv=1;let e=Sb(),t=kb(),r=Ib(),n=Pb(),i=xb(),o=Mb(),s=Lb();function a(l,u){if(Array.isArray(l))return l.map(e=>a(e));let{inputs:c,...d}=l;if(c){u=[];for(let e of c){let r={...e,__proto__:i.prototype};r.map&&(r.map={...r.map,__proto__:t.prototype}),u.push(r)}}if(d.nodes&&(d.nodes=l.nodes.map(e=>a(e,u))),d.source){let{inputId:e,...t}=d.source;d.source=t,null!=e&&(d.source.input=u[e])}if("root"===d.type)return new o(d);if("decl"===d.type)return new e(d);if("rule"===d.type)return new s(d);if("comment"===d.type)return new r(d);if("atrule"===d.type)return new n(d);throw new Error("Unknown node type: "+l.type)}return dv=a,a.default=a,dv}(),a=Tb(),l=_b(),u=Ib(),c=Pb(),d=Rb(),h=xb(),p=jb(),f=Nb(),g=Lb(),v=Mb(),m=wb();function y(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new i(e)}return y.plugin=function(e,t){let r,n=!1;function o(...r){console&&console.warn&&!n&&(n=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let o=t(...r);return o.postcssPlugin=e,o.postcssVersion=(new i).version,o}return Object.defineProperty(o,"postcss",{get:()=>(r||(r=o()),r)}),o.process=function(e,t,r){return y([o(r)]).process(e,t)},o},y.stringify=o,y.parse=p,y.fromJSON=s,y.list=f,y.comment=e=>new u(e),y.atRule=e=>new c(e),y.decl=e=>new t(e),y.rule=e=>new g(e),y.root=e=>new v(e),y.document=e=>new a(e),y.CssSyntaxError=e,y.Declaration=t,y.Container=n,y.Processor=i,y.Document=a,y.Comment=u,y.Warning=l,y.AtRule=c,y.Result=d,y.Input=h,y.Rule=g,y.Root=v,y.Node=m,r.registerPostcss(y),pv=y,y.default=y,pv}function qb(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function zb(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if("function"==typeof t){var r=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}),r}function Vb(){if(Sv)return wv.exports;Sv=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e}};return wv.exports=t(),wv.exports.createColors=t,wv.exports}function Wb(){if(Iv)return Cv;Iv=1;let e=Vb(),t=xv;class r extends Error{constructor(e,t,n,i,o,s){super(e),this.name="CssSyntaxError",this.reason=e,o&&(this.file=o),i&&(this.source=i),s&&(this.plugin=s),void 0!==t&&void 0!==n&&("number"==typeof t?(this.line=t,this.column=n):(this.line=t.line,this.column=t.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,r)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(r){if(!this.source)return"";let n=this.source;null==r&&(r=e.isColorSupported),t&&r&&(n=t(n));let i,o,s=n.split(/\r?\n/),a=Math.max(this.line-3,0),l=Math.min(this.line+2,s.length),u=String(l).length;if(r){let{bold:t,gray:r,red:n}=e.createColors(!0);i=e=>t(n(e)),o=e=>r(e)}else i=o=e=>e;return s.slice(a,l).map((e,t)=>{let r=a+1+t,n=" "+(" "+r).slice(-u)+" | ";if(r===this.line){let t=o(n.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return i(">")+o(n)+e+"\n "+t+i("^")}return" "+o(n)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}return Cv=r,r.default=r,Cv}function Hb(){return Tv||(Tv=1,Ov.isClean=Symbol("isClean"),Ov.my=Symbol("my")),Ov}function $b(){if(_v)return Av;_v=1;const e={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};class t{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name,n=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?r+=e.raws.afterName:n&&(r+=" "),e.nodes)this.block(e,r+n);else{let i=(e.raws.between||"")+(t?";":"");this.builder(r+n+i,e)}}beforeAfter(e,t){let r;r="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let n=e.parent,i=0;for(;n&&"root"!==n.type;)i+=1,n=n.parent;if(r.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<i;e++)r+=t}return r}block(e,t){let r,n=this.raw(e,"between","beforeOpen");this.builder(t+n+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),r=this.raw(e,"after")):r=this.raw(e,"after","emptyBody"),r&&this.builder(r),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let r=this.raw(e,"semicolon");for(let n=0;n<e.nodes.length;n++){let i=e.nodes[n],o=this.raw(i,"before");o&&this.builder(o),this.stringify(i,t!==n||r)}}comment(e){let t=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)}decl(e,t){let r=this.raw(e,"between","colon"),n=e.prop+r+this.rawValue(e,"value");e.important&&(n+=e.raws.important||" !important"),t&&(n+=";"),this.builder(n,e)}document(e){this.body(e)}raw(t,r,n){let i;if(n||(n=r),r&&(i=t.raws[r],void 0!==i))return i;let o=t.parent;if("before"===n){if(!o||"root"===o.type&&o.first===t)return"";if(o&&"document"===o.type)return""}if(!o)return e[n];let s=t.root();if(s.rawCache||(s.rawCache={}),void 0!==s.rawCache[n])return s.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(t,n);{let e="raw"+((a=n)[0].toUpperCase()+a.slice(1));this[e]?i=this[e](s,t):s.walk(e=>{if(i=e.raws[r],void 0!==i)return!1})}var a;return void 0===i&&(i=e[n]),s.rawCache[n]=i,i}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let r;return e.walkComments(e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),void 0===r?r=this.raw(t,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(e,t){let r;return e.walkDecls(e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),void 0===r?r=this.raw(t,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(e){let t;return e.walk(r=>{if(r.nodes&&(r.parent!==e||e.first!==r)&&void 0!==r.raws.before)return t=r.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(r=>{let n=r.parent;if(n&&n!==e&&n.parent&&n.parent===e&&void 0!==r.raws.before){let e=r.raws.before.split("\n");return t=e[e.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){let r=e[t],n=e.raws[t];return n&&n.value===r?n.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}}return Av=t,t.default=t,Av}function Gb(){if(Pv)return Rv;Pv=1;let e=$b();function t(t,r){new e(r).stringify(t)}return Rv=t,t.default=t,Rv}function Kb(){if(Nv)return Mv;Nv=1;let{isClean:e,my:t}=Hb(),r=Wb(),n=$b(),i=Gb();function o(e,t){let r=new e.constructor;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if("proxyCache"===n)continue;let i=e[n],s=typeof i;"parent"===n&&"object"===s?t&&(r[n]=t):"source"===n?r[n]=i:Array.isArray(i)?r[n]=i.map(e=>o(e,r)):("object"===s&&null!==i&&(i=o(i)),r[n]=i)}return r}class s{constructor(r={}){this.raws={},this[e]=!1,this[t]=!0;for(let e in r)if("nodes"===e){this.nodes=[];for(let t of r[e])"function"==typeof t.clone?this.append(t.clone()):this.append(t)}else this[e]=r[e]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=o(this);for(let r in e)t[r]=e[r];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:r,start:n}=this.rangeBy(t);return this.source.input.error(e,{column:n.column,line:n.line},{column:r.column,line:r.line},t)}return new r(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markDirty(){if(this[e]){this[e]=!1;let t=this;for(;t=t.parent;)t[e]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){let n=(t=this.toString()).indexOf(e.word);-1!==n&&(r=this.positionInside(n,t))}return r}positionInside(e,t){let r=t||this.toString(),n=this.source.start.column,i=this.source.start.line;for(let t=0;t<e;t++)"\n"===r[t]?(n=1,i+=1):n+=1;return{column:n,line:i}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let n=this.toString(),i=n.indexOf(e.word);-1!==i&&(t=this.positionInside(i,n),r=this.positionInside(i+e.word.length,n))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return(new n).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let n of e)n===this?r=!0:r?(this.parent.insertAfter(t,n),t=n):this.parent.insertBefore(t,n);r||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let r={},n=null==t;t=t||new Map;let i=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let n=this[e];if(Array.isArray(n))r[e]=n.map(e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e);else if("object"==typeof n&&n.toJSON)r[e]=n.toJSON(null,t);else if("source"===e){let o=t.get(n.input);null==o&&(o=i,t.set(n.input,i),i++),r[e]={end:n.end,inputId:o,start:n.start}}else r[e]=n}return n&&(r.inputs=[...t.keys()].map(e=>e.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=i){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){let n={node:this};for(let e in r)n[e]=r[e];return e.warn(t,n)}get proxyOf(){return this}}return Mv=s,s.default=s,Mv}function Jb(){if(Dv)return Lv;Dv=1;let e=Kb();class t extends e{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}}return Lv=t,t.default=t,Lv}function Qb(){if(Uv)return jv;Uv=1;return jv={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(r=t)=>{let n="",i=r;for(;i--;)n+=e[Math.random()*e.length|0];return n}}}function Yb(){if(Bv)return Fv;Bv=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=xv,{existsSync:r,readFileSync:n}=xv,{dirname:i,join:o}=xv;class s{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,n=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=i(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new e(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t;let r=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+r)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let r=e.lastIndexOf(t.pop()),n=e.indexOf("*/",r);r>-1&&n>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,n)))}loadFile(e){if(this.root=i(e),r(e))return this.mapFile=e,n(e,"utf-8").toString().trim()}loadMap(r,n){if(!1===n)return!1;if(n){if("string"==typeof n)return n;if("function"!=typeof n){if(n instanceof e)return t.fromSourceMap(n).toString();if(n instanceof t)return n.toString();if(this.isMap(n))return JSON.stringify(n);throw new Error("Unsupported previous source map format: "+n.toString())}{let e=n(r);if(e){let t=this.loadFile(e);if(!t)throw new Error("Unable to load previous source map: "+e.toString());return t}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let e=this.annotation;return r&&(e=o(i(r),e)),this.loadFile(e)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return Fv=s,s.default=s,Fv}function Xb(){if(zv)return qv;zv=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=xv,{fileURLToPath:r,pathToFileURL:n}=xv,{isAbsolute:i,resolve:o}=xv,{nanoid:s}=Qb(),a=xv,l=Wb(),u=Yb(),c=Symbol("fromOffsetCache"),d=Boolean(e&&t),h=Boolean(o&&i);class p{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||""===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!h||/^\w+:\/\//.test(t.from)||i(t.from)?this.file=t.from:this.file=o(t.from)),h&&d){let e=new u(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+s(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,i={}){let o,s,a;if(t&&"object"==typeof t){let e=t,n=r;if("number"==typeof e.offset){let n=this.fromOffset(e.offset);t=n.line,r=n.col}else t=e.line,r=e.column;if("number"==typeof n.offset){let e=this.fromOffset(n.offset);s=e.line,a=e.col}else s=n.line,a=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let u=this.origin(t,r,s,a);return o=u?new l(e,void 0===u.endLine?u.line:{column:u.column,line:u.line},void 0===u.endLine?u.column:{column:u.endColumn,line:u.endLine},u.source,u.file,i.plugin):new l(e,void 0===s?t:{column:r,line:t},void 0===s?r:{column:a,line:s},this.css,this.file,i.plugin),o.input={column:r,endColumn:a,endLine:s,line:t,source:this.css},this.file&&(n&&(o.input.url=n(this.file).toString()),o.input.file=this.file),o}fromOffset(e){let t,r;if(this[c])r=this[c];else{let e=this.css.split("\n");r=new Array(e.length);let t=0;for(let n=0,i=e.length;n<i;n++)r[n]=t,t+=e[n].length+1;this[c]=r}t=r[r.length-1];let n=0;if(e>=t)n=r.length-1;else{let t,i=r.length-2;for(;n<i;)if(t=n+(i-n>>1),e<r[t])i=t-1;else{if(!(e>=r[t+1])){n=t;break}n=t+1}}return{col:e-r[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:o(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,o,s){if(!this.map)return!1;let a,l,u=this.map.consumer(),c=u.originalPositionFor({column:t,line:e});if(!c.source)return!1;"number"==typeof o&&(a=u.originalPositionFor({column:s,line:o})),l=i(c.source)?n(c.source):new URL(c.source,this.map.consumer().sourceRoot||n(this.map.mapFile));let d={column:c.column,endColumn:a&&a.column,endLine:a&&a.line,line:c.line,url:l.toString()};if("file:"===l.protocol){if(!r)throw new Error("file: protocol is not available in this PostCSS build");d.file=r(l)}let h=u.sourceContentFor(c.source);return h&&(d.source=h),d}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}}return qv=p,p.default=p,a&&a.registerInput&&a.registerInput(p),qv}function Zb(){if(Wv)return Vv;Wv=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=xv,{dirname:r,relative:n,resolve:i,sep:o}=xv,{pathToFileURL:s}=xv,a=Xb(),l=Boolean(e&&t),u=Boolean(r&&i&&n&&o);return Vv=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let t of this.previous()){let n,i=this.toUrl(this.path(t.file)),o=t.root||r(t.file);!1===this.mapOpts.sourcesContent?(n=new e(t.text),n.sourcesContent&&(n.sourcesContent=null)):n=t.consumer(),this.map.applySourceMap(n,i,this.toUrl(this.path(o)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),u&&l&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=t.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0});let e,r,n=1,i=1,o="<no source>",s={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(t,a,l)=>{if(this.css+=t,a&&"end"!==l&&(s.generated.line=n,s.generated.column=i-1,a.source&&a.source.start?(s.source=this.sourcePath(a),s.original.line=a.source.start.line,s.original.column=a.source.start.column-1,this.map.addMapping(s)):(s.source=o,s.original.line=1,s.original.column=0,this.map.addMapping(s))),e=t.match(/\n/g),e?(n+=e.length,r=t.lastIndexOf("\n"),i=t.length-r):i+=t.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(s.source=this.sourcePath(a),s.original.line=a.source.end.line,s.original.column=a.source.end.column-1,s.generated.line=n,s.generated.column=i-2,this.map.addMapping(s)):(s.source=o,s.original.line=1,s.original.column=0,s.generated.line=n,s.generated.column=i-1,this.map.addMapping(s)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let o=this.opts.to?r(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(o=r(i(o,this.mapOpts.annotation)));let s=n(o,e);return this.memoizedPaths.set(e,s),s}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new a(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let r=t.source.input.from;if(r&&!e[r]){e[r]=!0;let n=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(n,t.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(s){let t=s(e).toString();return this.memoizedFileURLs.set(e,t),t}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;"\\"===o&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}}}function ew(){if($v)return Hv;$v=1;let e=Kb();class t extends e{constructor(e){super(e),this.type="comment"}}return Hv=t,t.default=t,Hv}function tw(){if(Kv)return Gv;Kv=1;let e,t,r,n,{isClean:i,my:o}=Hb(),s=Jb(),a=ew(),l=Kb();function u(e){return e.map(e=>(e.nodes&&(e.nodes=u(e.nodes)),delete e.source,e))}function c(e){if(e[i]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)c(t)}class d extends l{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,r,n=this.getIterator();for(;this.indexes[n]<this.proxyOf.nodes.length&&(t=this.indexes[n],r=e(this.proxyOf.nodes[t],t),!1!==r);)this.indexes[n]+=1;return delete this.indexes[n],r}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...r)=>e[t](...r.map(e=>"function"==typeof e?(t,r)=>e(t.toProxy(),r):e)):"every"===t||"some"===t?r=>e[t]((e,...t)=>r(e.toProxy(),...t)):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map(e=>e.toProxy()):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let r,n=this.index(e),i=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let e of i)this.proxyOf.nodes.splice(n+1,0,e);for(let e in this.indexes)r=this.indexes[e],n<r&&(this.indexes[e]=r+i.length);return this.markDirty(),this}insertBefore(e,t){let r,n=this.index(e),i=0===n&&"prepend",o=this.normalize(t,this.proxyOf.nodes[n],i).reverse();n=this.index(e);for(let e of o)this.proxyOf.nodes.splice(n,0,e);for(let e in this.indexes)r=this.indexes[e],n<=r&&(this.indexes[e]=r+o.length);return this.markDirty(),this}normalize(n,l){if("string"==typeof n)n=u(e(n).nodes);else if(void 0===n)n=[];else if(Array.isArray(n)){n=n.slice(0);for(let e of n)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===n.type&&"document"!==this.type){n=n.nodes.slice(0);for(let e of n)e.parent&&e.parent.removeChild(e,"ignore")}else if(n.type)n=[n];else if(n.prop){if(void 0===n.value)throw new Error("Value field is missed in node creation");"string"!=typeof n.value&&(n.value=String(n.value)),n=[new s(n)]}else if(n.selector)n=[new t(n)];else if(n.name)n=[new r(n)];else{if(!n.text)throw new Error("Unknown node type in node creation");n=[new a(n)]}return n.map(e=>(e[o]||d.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[i]&&c(e),void 0===e.raws.before&&l&&void 0!==l.raws.before&&(e.raws.before=l.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls(n=>{t.props&&!t.props.includes(n.prop)||t.fast&&!n.value.includes(t.fast)||(n.value=n.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,r)=>{let n;try{n=e(t,r)}catch(e){throw t.addToError(e)}return!1!==n&&t.walk&&(n=t.walk(e)),n})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("atrule"===r.type&&e.test(r.name))return t(r,n)}):this.walk((r,n)=>{if("atrule"===r.type&&r.name===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("atrule"===e.type)return t(e,r)}))}walkComments(e){return this.walk((t,r)=>{if("comment"===t.type)return e(t,r)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("decl"===r.type&&e.test(r.prop))return t(r,n)}):this.walk((r,n)=>{if("decl"===r.type&&r.prop===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("decl"===e.type)return t(e,r)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("rule"===r.type&&e.test(r.selector))return t(r,n)}):this.walk((r,n)=>{if("rule"===r.type&&r.selector===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("rule"===e.type)return t(e,r)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}return d.registerParse=t=>{e=t},d.registerRule=e=>{t=e},d.registerAtRule=e=>{r=e},d.registerRoot=e=>{n=e},Gv=d,d.default=d,d.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,r.prototype):"rule"===e.type?Object.setPrototypeOf(e,t.prototype):"decl"===e.type?Object.setPrototypeOf(e,s.prototype):"comment"===e.type?Object.setPrototypeOf(e,a.prototype):"root"===e.type&&Object.setPrototypeOf(e,n.prototype),e[o]=!0,e.nodes&&e.nodes.forEach(e=>{d.rebuild(e)})},Gv}function rw(){if(Qv)return Jv;Qv=1;let e,t,r=tw();class n extends r{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(r={}){return new e(new t,this,r).stringify()}}return n.registerLazyResult=t=>{e=t},n.registerProcessor=e=>{t=e},Jv=n,n.default=n,Jv}function nw(){if(Xv)return Yv;Xv=1;let e={};return Yv=function(t){e[t]||(e[t]=!0,"undefined"!=typeof console&&console.warn&&console.warn(t))}}function iw(){if(em)return Zv;em=1;class e{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}return Zv=e,e.default=e,Zv}function ow(){if(rm)return tm;rm=1;let e=iw();class t{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(t,r={}){r.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(r.plugin=this.lastPlugin.postcssPlugin);let n=new e(t,r);return this.messages.push(n),n}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}}return tm=t,t.default=t,tm}function sw(){if(sm)return om;sm=1;let e=tw();class t extends e{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}}return om=t,t.default=t,e.registerAtRule(t),om}function aw(){if(lm)return am;lm=1;let e,t,r=tw();class n extends r{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){let n=super.normalize(e);if(t)if("prepend"===r)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of n)e.raws.before=t.raws.before;return n}removeChild(e,t){let r=this.index(e);return!t&&0===r&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(r={}){return new e(new t,this,r).stringify()}}return n.registerLazyResult=t=>{e=t},n.registerProcessor=e=>{t=e},am=n,n.default=n,r.registerRoot(n),am}function lw(){if(cm)return um;cm=1;let e={comma:t=>e.split(t,[","],!0),space:t=>e.split(t,[" ","\n","\t"]),split(e,t,r){let n=[],i="",o=!1,s=0,a=!1,l="",u=!1;for(let r of e)u?u=!1:"\\"===r?u=!0:a?r===l&&(a=!1):'"'===r||"'"===r?(a=!0,l=r):"("===r?s+=1:")"===r?s>0&&(s-=1):0===s&&t.includes(r)&&(o=!0),o?(""!==i&&n.push(i.trim()),i="",o=!1):i+=r;return(r||""!==i)&&n.push(i.trim()),n}};return um=e,e.default=e,um}function uw(){if(hm)return dm;hm=1;let e=tw(),t=lw();class r extends e{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return t.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}}return dm=r,r.default=r,e.registerRule(r),dm}function cw(){if(fm)return pm;fm=1;let e=Jb(),t=function(){if(im)return nm;im=1;const e="'".charCodeAt(0),t='"'.charCodeAt(0),r="\\".charCodeAt(0),n="/".charCodeAt(0),i="\n".charCodeAt(0),o=" ".charCodeAt(0),s="\f".charCodeAt(0),a="\t".charCodeAt(0),l="\r".charCodeAt(0),u="[".charCodeAt(0),c="]".charCodeAt(0),d="(".charCodeAt(0),h=")".charCodeAt(0),p="{".charCodeAt(0),f="}".charCodeAt(0),g=";".charCodeAt(0),v="*".charCodeAt(0),m=":".charCodeAt(0),y="@".charCodeAt(0),b=/[\t\n\f\r "#'()/;[\\\]{}]/g,w=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,S=/.[\r\n"'(/\\]/,E=/[\da-f]/i;return nm=function(k,x={}){let C,I,O,T,A,_,R,P,M,N,L=k.css.valueOf(),D=x.ignoreErrors,j=L.length,U=0,F=[],B=[];function q(e){throw k.error("Unclosed "+e,U)}return{back:function(e){B.push(e)},endOfFile:function(){return 0===B.length&&U>=j},nextToken:function(k){if(B.length)return B.pop();if(U>=j)return;let x=!!k&&k.ignoreUnclosed;switch(C=L.charCodeAt(U),C){case i:case o:case a:case l:case s:I=U;do{I+=1,C=L.charCodeAt(I)}while(C===o||C===i||C===a||C===l||C===s);N=["space",L.slice(U,I)],U=I-1;break;case u:case c:case p:case f:case m:case g:case h:{let e=String.fromCharCode(C);N=[e,e,U];break}case d:if(P=F.length?F.pop()[1]:"",M=L.charCodeAt(U+1),"url"===P&&M!==e&&M!==t&&M!==o&&M!==i&&M!==a&&M!==s&&M!==l){I=U;do{if(_=!1,I=L.indexOf(")",I+1),-1===I){if(D||x){I=U;break}q("bracket")}for(R=I;L.charCodeAt(R-1)===r;)R-=1,_=!_}while(_);N=["brackets",L.slice(U,I+1),U,I],U=I}else I=L.indexOf(")",U+1),T=L.slice(U,I+1),-1===I||S.test(T)?N=["(","(",U]:(N=["brackets",T,U,I],U=I);break;case e:case t:O=C===e?"'":'"',I=U;do{if(_=!1,I=L.indexOf(O,I+1),-1===I){if(D||x){I=U+1;break}q("string")}for(R=I;L.charCodeAt(R-1)===r;)R-=1,_=!_}while(_);N=["string",L.slice(U,I+1),U,I],U=I;break;case y:b.lastIndex=U+1,b.test(L),I=0===b.lastIndex?L.length-1:b.lastIndex-2,N=["at-word",L.slice(U,I+1),U,I],U=I;break;case r:for(I=U,A=!0;L.charCodeAt(I+1)===r;)I+=1,A=!A;if(C=L.charCodeAt(I+1),A&&C!==n&&C!==o&&C!==i&&C!==a&&C!==l&&C!==s&&(I+=1,E.test(L.charAt(I)))){for(;E.test(L.charAt(I+1));)I+=1;L.charCodeAt(I+1)===o&&(I+=1)}N=["word",L.slice(U,I+1),U,I],U=I;break;default:C===n&&L.charCodeAt(U+1)===v?(I=L.indexOf("*/",U+2)+1,0===I&&(D||x?I=L.length:q("comment")),N=["comment",L.slice(U,I+1),U,I],U=I):(w.lastIndex=U+1,w.test(L),I=0===w.lastIndex?L.length-1:w.lastIndex-2,N=["word",L.slice(U,I+1),U,I],F.push(N),U=I)}return U++,N},position:function(){return U}}}}(),r=ew(),n=sw(),i=aw(),o=uw();const s={empty:!0,space:!0};return pm=class{constructor(e){this.input=e,this.root=new i,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,r,i,o=new n;o.name=e[1].slice(1),""===o.name&&this.unnamedAtrule(o,e),this.init(o,e[2]);let s=!1,a=!1,l=[],u=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?u.push("("===t?")":"]"):"{"===t&&u.length>0?u.push("}"):t===u[u.length-1]&&u.pop(),0===u.length){if(";"===t){o.source.end=this.getPosition(e[2]),o.source.end.offset++,this.semicolon=!0;break}if("{"===t){a=!0;break}if("}"===t){if(l.length>0){for(i=l.length-1,r=l[i];r&&"space"===r[0];)r=l[--i];r&&(o.source.end=this.getPosition(r[3]||r[2]),o.source.end.offset++)}this.end(e);break}l.push(e)}else l.push(e);if(this.tokenizer.endOfFile()){s=!0;break}}o.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(o.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(o,"params",l),s&&(e=l[l.length-1],o.source.end=this.getPosition(e[3]||e[2]),o.source.end.offset++,this.spaces=o.raws.between,o.raws.between="")):(o.raws.afterName="",o.params=""),a&&(o.nodes=[],this.current=o)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let r,n=0;for(let i=t-1;i>=0&&(r=e[i],"space"===r[0]||(n+=1,2!==n));i--);throw this.input.error("Missed semicolon","word"===r[0]?r[3]+1:r[2])}colon(e){let t,r,n,i=0;for(let[o,s]of e.entries()){if(t=s,r=t[0],"("===r&&(i+=1),")"===r&&(i-=1),0===i&&":"===r){if(n){if("word"===n[0]&&"progid"===n[1])continue;return o}this.doubleColon(t)}n=t}return!1}comment(e){let t=new r;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=t(this.input)}decl(t,r){let n=new e;this.init(n,t[0][2]);let i,o=t[t.length-1];for(";"===o[0]&&(this.semicolon=!0,t.pop()),n.source.end=this.getPosition(o[3]||o[2]||function(e){for(let t=e.length-1;t>=0;t--){let r=e[t],n=r[3]||r[2];if(n)return n}}(t)),n.source.end.offset++;"word"!==t[0][0];)1===t.length&&this.unknownWord(t),n.raws.before+=t.shift()[1];for(n.source.start=this.getPosition(t[0][2]),n.prop="";t.length;){let e=t[0][0];if(":"===e||"space"===e||"comment"===e)break;n.prop+=t.shift()[1]}for(n.raws.between="";t.length;){if(i=t.shift(),":"===i[0]){n.raws.between+=i[1];break}"word"===i[0]&&/\w/.test(i[1])&&this.unknownWord([i]),n.raws.between+=i[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let s,a=[];for(;t.length&&(s=t[0][0],"space"===s||"comment"===s);)a.push(t.shift());this.precheckMissedSemicolon(t);for(let e=t.length-1;e>=0;e--){if(i=t[e],"!important"===i[1].toLowerCase()){n.important=!0;let r=this.stringFrom(t,e);r=this.spacesFromEnd(t)+r," !important"!==r&&(n.raws.important=r);break}if("important"===i[1].toLowerCase()){let r=t.slice(0),i="";for(let t=e;t>0;t--){let e=r[t][0];if(0===i.trim().indexOf("!")&&"space"!==e)break;i=r.pop()[1]+i}0===i.trim().indexOf("!")&&(n.important=!0,n.raws.important=i,t=r)}if("space"!==i[0]&&"comment"!==i[0])break}t.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(n,"value",a.concat(t),r),n.value.includes(":")&&!r&&this.checkMissedSemicolon(t)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new o;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,r=null,n=!1,i=null,o=[],s=e[1].startsWith("--"),a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)i||(i=l),o.push("("===r?")":"]");else if(s&&n&&"{"===r)i||(i=l),o.push("}");else if(0===o.length){if(";"===r){if(n)return void this.decl(a,s);break}if("{"===r)return void this.rule(a);if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}":"===r&&(n=!0)}else r===o[o.length-1]&&(o.pop(),0===o.length&&(i=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(i),t&&n){if(!s)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,s)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,r,n){let i,o,a,l,u=r.length,c="",d=!0;for(let e=0;e<u;e+=1)i=r[e],o=i[0],"space"!==o||e!==u-1||n?"comment"===o?(l=r[e-1]?r[e-1][0]:"empty",a=r[e+1]?r[e+1][0]:"empty",s[l]||s[a]||","===c.slice(-1)?d=!1:c+=i[1]):c+=i[1]:d=!1;if(!d){let n=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:n,value:c}}e[t]=c}rule(e){e.pop();let t=new o;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let n=t;n<e.length;n++)r+=e[n][1];return e.splice(t,e.length-t),r}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}}}function dw(){if(vm)return gm;vm=1;let e=tw(),t=cw(),r=Xb();function n(e,n){let i=new r(e,n),o=new t(i);try{o.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&n&&n.from&&(/\.scss$/i.test(n.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(n.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(n.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return o.root}return gm=n,n.default=n,e.registerParse(n),gm}function hw(){if(ym)return mm;ym=1;let{isClean:e,my:t}=Hb(),r=Zb(),n=Gb(),i=tw(),o=rw(),s=nw(),a=ow(),l=dw(),u=aw();const c={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},d={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},h={Once:!0,postcssPlugin:!0,prepare:!0};function p(e){return"object"==typeof e&&"function"==typeof e.then}function f(e){let t=!1,r=c[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[r,r+"-"+t,0,r+"Exit",r+"Exit-"+t]:t?[r,r+"-"+t,r+"Exit",r+"Exit-"+t]:e.append?[r,0,r+"Exit"]:[r,r+"Exit"]}function g(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:f(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function v(t){return t[e]=!1,t.nodes&&t.nodes.forEach(e=>v(e)),t}let m={};class y{constructor(e,r,n){let o;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof y||r instanceof a)o=v(r.root),r.map&&(void 0===n.map&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=r.map);else{let e=l;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{o=e(r,n)}catch(e){this.processed=!0,this.error=e}o&&!o[t]&&i.rebuild(o)}else o=v(r);this.result=new a(e,o,n),this.helpers={...m,postcss:m,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let r=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(r.postcssVersion&&"production"!==process.env.NODE_ENV){let e=r.postcssPlugin,t=r.postcssVersion,n=this.result.processor.version,i=t.split("."),o=n.split(".");(i[0]!==o[0]||parseInt(i[1])>parseInt(o[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+n+", but "+e+" uses "+t+". Perhaps this is the source of the error below.")}}else e.plugin=r.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,r)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,r])};for(let t of this.plugins)if("object"==typeof t)for(let r in t){if(!d[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!h[r])if("object"==typeof t[r])for(let n in t[r])e(t,"*"===n?r:r+"-"+n.toLowerCase(),t[r][n]);else"function"==typeof t[r]&&e(t,r,t[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],r=this.runOnRoot(t);if(p(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];){t[e]=!0;let r=[g(t)];for(;r.length>0;){let e=this.visitTick(r);if(p(e))try{await e}catch(e){let t=r[r.length-1].node;throw this.handleError(e,t)}}}if(this.listeners.OnceExit)for(let[e,r]of this.listeners.OnceExit){this.result.lastPlugin=e;try{if("document"===t.type){let e=t.nodes.map(e=>r(e,this.helpers));await Promise.all(e)}else await r(t,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return p(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=n;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let i=new r(t,this.result.root,this.result.opts).generate();return this.result.css=i[0],this.result.map=i[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins){if(p(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];)t[e]=!0,this.walkSync(t);if(this.listeners.OnceExit)if("document"===t.type)for(let e of t.nodes)this.visitSync(this.listeners.OnceExit,e);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||s("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[r,n]of e){let e;this.result.lastPlugin=r;try{e=n(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(p(e))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:n,visitors:i}=r;if("root"!==n.type&&"document"!==n.type&&!n.parent)return void t.pop();if(i.length>0&&r.visitorIndex<i.length){let[e,t]=i[r.visitorIndex];r.visitorIndex+=1,r.visitorIndex===i.length&&(r.visitors=[],r.visitorIndex=0),this.result.lastPlugin=e;try{return t(n.toProxy(),this.helpers)}catch(e){throw this.handleError(e,n)}}if(0!==r.iterator){let i,o=r.iterator;for(;i=n.nodes[n.indexes[o]];)if(n.indexes[o]+=1,!i[e])return i[e]=!0,void t.push(g(i));r.iterator=0,delete n.indexes[o]}let o=r.events;for(;r.eventIndex<o.length;){let t=o[r.eventIndex];if(r.eventIndex+=1,0===t)return void(n.nodes&&n.nodes.length&&(n[e]=!0,r.iterator=n.getIterator()));if(this.listeners[t])return void(r.visitors=this.listeners[t])}t.pop()}walkSync(t){t[e]=!0;let r=f(t);for(let n of r)if(0===n)t.nodes&&t.each(t=>{t[e]||this.walkSync(t)});else{let e=this.listeners[n];if(e&&this.visitSync(e,t.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}}return y.registerPostcss=e=>{m=e},mm=y,y.default=y,u.registerLazyResult(y),o.registerLazyResult(y),mm}function pw(){if(Em)return Sm;Em=1;let e=function(){if(wm)return bm;wm=1;let e=Zb(),t=Gb(),r=nw(),n=dw();const i=ow();class o{constructor(r,n,o){let s;n=n.toString(),this.stringified=!1,this._processor=r,this._css=n,this._opts=o,this._map=void 0;let a=t;this.result=new i(this._processor,s,this._opts),this.result.css=n;let l=this;Object.defineProperty(this.result,"root",{get:()=>l.root});let u=new e(a,s,this._opts,n);if(u.isMap()){let[e,t]=u.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else u.clearAnnotation(),this.result.css=u.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this._opts||r("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=n;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}}return bm=o,o.default=o,bm}(),t=hw(),r=rw(),n=aw();class i{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(r,n={}){return this.plugins.length||n.parser||n.stringifier||n.syntax?new t(this,r,n):new e(this,r,n)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}return Sm=i,i.default=i,n.registerProcessor(i),r.registerProcessor(i),Sm}function fw(){if(Im)return Cm;Im=1;let e=Wb(),t=Jb(),r=hw(),n=tw(),i=pw(),o=Gb(),s=function(){if(xm)return km;xm=1;let e=Jb(),t=Yb(),r=ew(),n=sw(),i=Xb(),o=aw(),s=uw();function a(l,u){if(Array.isArray(l))return l.map(e=>a(e));let{inputs:c,...d}=l;if(c){u=[];for(let e of c){let r={...e,__proto__:i.prototype};r.map&&(r.map={...r.map,__proto__:t.prototype}),u.push(r)}}if(d.nodes&&(d.nodes=l.nodes.map(e=>a(e,u))),d.source){let{inputId:e,...t}=d.source;d.source=t,null!=e&&(d.source.input=u[e])}if("root"===d.type)return new o(d);if("decl"===d.type)return new e(d);if("rule"===d.type)return new s(d);if("comment"===d.type)return new r(d);if("atrule"===d.type)return new n(d);throw new Error("Unknown node type: "+l.type)}return km=a,a.default=a,km}(),a=rw(),l=iw(),u=ew(),c=sw(),d=ow(),h=Xb(),p=dw(),f=lw(),g=uw(),v=aw(),m=Kb();function y(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new i(e)}return y.plugin=function(e,t){let r,n=!1;function o(...r){console&&console.warn&&!n&&(n=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let o=t(...r);return o.postcssPlugin=e,o.postcssVersion=(new i).version,o}return Object.defineProperty(o,"postcss",{get:()=>(r||(r=o()),r)}),o.process=function(e,t,r){return y([o(r)]).process(e,t)},o},y.stringify=o,y.parse=p,y.fromJSON=s,y.list=f,y.comment=e=>new u(e),y.atRule=e=>new c(e),y.decl=e=>new t(e),y.rule=e=>new g(e),y.root=e=>new v(e),y.document=e=>new a(e),y.CssSyntaxError=e,y.Declaration=t,y.Container=n,y.Processor=i,y.Document=a,y.Comment=u,y.Warning=l,y.AtRule=c,y.Result=d,y.Input=h,y.Rule=g,y.Root=v,y.Node=m,r.registerPostcss(y),Cm=y,y.default=y,Cm}function gw(e){if(Pm[e])return Pm[e];const t=function(e){var t,r;const n=null==(r=null==(t=null==globalThis?void 0:globalThis.Zone)?void 0:t.__symbol__)?void 0:r.call(t,e);return n&&globalThis[n]?globalThis[n]:void 0}(e)||globalThis[e],r=t.prototype,n=e in _m?_m[e]:void 0,i=Boolean(n&&n.every(e=>{var t,n;return Boolean(null==(n=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:n.toString().includes("[native code]"))})),o=e in Rm?Rm[e]:void 0,s=Boolean(o&&o.every(e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))}));if(i&&s)return Pm[e]=t.prototype,t.prototype;try{const n=document.createElement("iframe");document.body.appendChild(n);const i=n.contentWindow;if(!i)return t.prototype;const o=i[e].prototype;return document.body.removeChild(n),o?Pm[e]=o:r}catch(e){return r}}function vw(e,t,r){var n;const i=`${e}.${String(r)}`;if(Mm[i])return Mm[i].call(t);const o=gw(e),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(Mm[i]=s,s.call(t)):t[r]}function mw(e,t,r){const n=`${e}.${String(r)}`;if(Nm[n])return Nm[n].bind(t);const i=gw(e)[r];return"function"!=typeof i?t[r]:(Nm[n]=i,i.bind(t))}function yw(e){return vw("Node",e,"childNodes")}function bw(e){return vw("Node",e,"parentNode")}function ww(e){return vw("Node",e,"parentElement")}function Sw(e){return vw("Node",e,"textContent")}function Ew(e,t){return mw("Node",e,"contains")(t)}function kw(e){return mw("Node",e,"getRootNode")()}function xw(e){return e&&"host"in e?vw("ShadowRoot",e,"host"):null}function Cw(e){return e.styleSheets}function Iw(e){return e&&"shadowRoot"in e?vw("Element",e,"shadowRoot"):null}function Ow(e,t){return vw("Element",e,"querySelector")(t)}function Tw(e,t){return vw("Element",e,"querySelectorAll")(t)}function Aw(){return gw("MutationObserver").constructor}function _w(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}function Rw(e,t,r={}){let n=null,i=0;return function(...o){const s=Date.now();i||!1!==r.leading||(i=s);const a=t-(s-i),l=this;a<=0||a>t?(n&&(clearTimeout(n),n=null),i=s,e.apply(l,o)):n||!1===r.trailing||(n=setTimeout(()=>{i=!1===r.leading?0:Date.now(),n=null,e.apply(l,o)},a))}}function Pw(e,t,r,n,i=window){const o=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,n?r:{set(e){setTimeout(()=>{r.set.call(this,e)},0),o&&o.set&&o.set.call(this,e)}}),()=>Pw(e,t,o||{},!0)}function Mw(e,t,r){try{if(!(t in e))return()=>{};const n=e[t],i=r(n);return"function"==typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=i,()=>{e[t]=n}}catch(e){return()=>{}}}function Nw(e){var t,r,n,i;const o=e.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(t=Lm.parentElement(o.body))?void 0:t.scrollLeft)||(null==(r=null==o?void 0:o.body)?void 0:r.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(n=Lm.parentElement(o.body))?void 0:n.scrollTop)||(null==(i=null==o?void 0:o.body)?void 0:i.scrollTop)||0}}function Lw(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Dw(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function jw(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:Lm.parentElement(e)}function Uw(e,t,r,n){if(!e)return!1;const i=jw(e);if(!i)return!1;try{if("string"==typeof t){if(i.classList.contains(t))return!0;if(n&&null!==i.closest("."+t))return!0}else if(ab(i,t,n))return!0}catch(e){}if(r){if(i.matches(r))return!0;if(n&&null!==i.closest(r))return!0}return!1}function Fw(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||t.getId(e)===rg}function Bw(e,t){if(Wy(e))return!1;const r=t.getId(e);if(!t.has(r))return!0;const n=Lm.parentNode(e);return(!n||n.nodeType!==e.DOCUMENT_NODE)&&(!n||Bw(n,t))}function qw(e){return Boolean(e.changedTouches)}function zw(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Vw(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Ww(e){return!!e&&(e instanceof Am&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(Lm.shadowRoot(e)))}function Hw(e){var t;let r=null;return"getRootNode"in e&&(null==(t=Lm.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&Lm.host(Lm.getRootNode(e))&&(r=Lm.host(Lm.getRootNode(e))),r}function $w(e){const t=e.ownerDocument;if(!t)return!1;const r=function(e){let t,r=e;for(;t=Hw(r);)r=t;return r}(e);return Lm.contains(t,r)}function Gw(e){const t=e.ownerDocument;return!!t&&(Lm.contains(t,e)||$w(e))}function Kw(e){return"__ln"in e}function Jw(e,t){e.delete(t),Lm.childNodes(t).forEach(t=>Jw(e,t))}function Qw(e,t,r){return 0!==e.size&&function(e,t){const r=Lm.parentNode(t);return!!r&&e.has(r)}(e,t)}function Yw(e,t){return 0!==e.size&&Xw(e,t)}function Xw(e,t){const r=Lm.parentNode(t);return!!r&&(!!e.has(r)||Xw(e,r))}function Zw(e){return(...t)=>{try{return e(...t)}catch(e){try{e._external_=!0}catch(e){}throw e}}}function eS(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch(e){}return e&&e.target}function tS(e,t){const r=new Jm;Xm.push(r),r.init(e);const n=new(Aw())(Ym(r.processMutations.bind(r)));return n.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),n}function rS({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,blockSelector:i,sampling:o}){if(!1===o.mouseInteraction)return()=>{};const s=!0===o.mouseInteraction||void 0===o.mouseInteraction?{}:o.mouseInteraction,a=[];let l=null;return Object.keys(zm).filter(e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==s[e]).forEach(o=>{let s=Jy(o);const u=(t=>o=>{const s=eS(o);if(Uw(s,n,i,!0))return;let a=null,u=t;if("pointerType"in o){switch(o.pointerType){case"mouse":a=Vm.Mouse;break;case"touch":a=Vm.Touch;break;case"pen":a=Vm.Pen}a===Vm.Touch?zm[t]===zm.MouseDown?u="TouchStart":zm[t]===zm.MouseUp&&(u="TouchEnd"):Vm.Pen}else qw(o)&&(a=Vm.Touch);null!==a?(l=a,(u.startsWith("Touch")&&a===Vm.Touch||u.startsWith("Mouse")&&a===Vm.Mouse)&&(a=null)):zm[t]===zm.Click&&(a=l,l=null);const c=qw(o)?o.changedTouches[0]:o;if(!c)return;const d=r.getId(s),{clientX:h,clientY:p}=c;Ym(e)({type:zm[u],id:d,x:h,y:p,...null!==a&&{pointerType:a}})})(o);if(window.PointerEvent)switch(zm[o]){case zm.MouseDown:case zm.MouseUp:s=s.replace("mouse","pointer");break;case zm.TouchStart:case zm.TouchEnd:return}a.push(_w(s,u,t))}),Ym(()=>{a.forEach(e=>e())})}function nS({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:i,sampling:o}){return _w("scroll",Ym(Rw(Ym(o=>{const s=eS(o);if(!s||Uw(s,n,i,!0))return;const a=r.getId(s);if(s===t&&t.defaultView){const r=Nw(t.defaultView);e({id:a,x:r.left,y:r.top})}else e({id:a,x:s.scrollLeft,y:s.scrollTop})}),o.scroll||100)),t)}function iS(e){return function(e,t){if(lS("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||lS("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||lS("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||lS("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){const r=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(r)}else if(e.parentStyleSheet){const r=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(r)}return t}(e,[])}function oS(e,t,r){let n,i;return e?(e.ownerNode?n=t.getId(e.ownerNode):i=r.getId(e),{styleId:i,id:n}):{}}function sS({mirror:e,stylesheetManager:t},r){var n,i,o;let s=null;s="#document"===r.nodeName?e.getId(r):e.getId(Lm.host(r));const a="#document"===r.nodeName?null==(n=r.defaultView)?void 0:n.Document:null==(o=null==(i=r.ownerDocument)?void 0:i.defaultView)?void 0:o.ShadowRoot,l=(null==a?void 0:a.prototype)?Object.getOwnPropertyDescriptor(null==a?void 0:a.prototype,"adoptedStyleSheets"):void 0;return null!==s&&-1!==s&&a&&l?(Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var e;return null==(e=l.get)?void 0:e.call(this)},set(e){var r;const n=null==(r=l.set)?void 0:r.call(this,e);if(null!==s&&-1!==s)try{t.adoptStyleSheets(e,s)}catch(e){}return n}}),Ym(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})})):()=>{}}function aS(e,t={}){const r=e.doc.defaultView;if(!r)return()=>{};let n;!function(e,t){const{mutationCb:r,mousemoveCb:n,mouseInteractionCb:i,scrollCb:o,viewportResizeCb:s,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:u,styleDeclarationCb:c,canvasMutationCb:d,fontCb:h,selectionCb:p,customElementCb:f}=e;e.mutationCb=(...e)=>{t.mutation&&t.mutation(...e),r(...e)},e.mousemoveCb=(...e)=>{t.mousemove&&t.mousemove(...e),n(...e)},e.mouseInteractionCb=(...e)=>{t.mouseInteraction&&t.mouseInteraction(...e),i(...e)},e.scrollCb=(...e)=>{t.scroll&&t.scroll(...e),o(...e)},e.viewportResizeCb=(...e)=>{t.viewportResize&&t.viewportResize(...e),s(...e)},e.inputCb=(...e)=>{t.input&&t.input(...e),a(...e)},e.mediaInteractionCb=(...e)=>{t.mediaInteaction&&t.mediaInteaction(...e),l(...e)},e.styleSheetRuleCb=(...e)=>{t.styleSheetRule&&t.styleSheetRule(...e),u(...e)},e.styleDeclarationCb=(...e)=>{t.styleDeclaration&&t.styleDeclaration(...e),c(...e)},e.canvasMutationCb=(...e)=>{t.canvasMutation&&t.canvasMutation(...e),d(...e)},e.fontCb=(...e)=>{t.font&&t.font(...e),h(...e)},e.selectionCb=(...e)=>{t.selection&&t.selection(...e),p(...e)},e.customElementCb=(...e)=>{t.customElement&&t.customElement(...e),f(...e)}}(e,t),e.recordDOM&&(n=tS(e,e.doc));const i=function({mousemoveCb:e,sampling:t,doc:r,mirror:n}){if(!1===t.mousemove)return()=>{};const i="number"==typeof t.mousemove?t.mousemove:50,o="number"==typeof t.mousemoveCallback?t.mousemoveCallback:500;let s,a=[];const l=Rw(Ym(t=>{const r=Date.now()-s;e(a.map(e=>(e.timeOffset-=r,e)),t),a=[],s=null}),o),u=Ym(Rw(Ym(e=>{const t=eS(e),{clientX:r,clientY:i}=qw(e)?e.changedTouches[0]:e;s||(s=Um()),a.push({x:r,y:i,id:n.getId(t),timeOffset:Um()-s}),l("undefined"!=typeof DragEvent&&e instanceof DragEvent?qm.Drag:e instanceof MouseEvent?qm.MouseMove:qm.TouchMove)}),i,{trailing:!1})),c=[_w("mousemove",u,r),_w("touchmove",u,r),_w("drag",u,r)];return Ym(()=>{c.forEach(e=>e())})}(e),o=rS(e),s=nS(e),a=function({viewportResizeCb:e},{win:t}){let r=-1,n=-1;return _w("resize",Ym(Rw(Ym(()=>{const t=Lw(),i=Dw();r===t&&n===i||(e({width:Number(i),height:Number(t)}),r=t,n=i)}),200)),t)}(e,{win:r}),l=function({inputCb:e,doc:t,mirror:r,blockClass:n,blockSelector:i,ignoreClass:o,ignoreSelector:s,maskInputOptions:a,maskInputFn:l,sampling:u,userTriggeredOnInput:c}){function d(e){let r=eS(e);const u=e.isTrusted,d=r&&r.tagName;if(r&&"OPTION"===d&&(r=Lm.parentElement(r)),!r||!d||Zm.indexOf(d)<0||Uw(r,n,i,!0))return;if(r.classList.contains(o)||s&&r.matches(s))return;let p=r.value,f=!1;const g=Qy(r)||"";"radio"===g||"checkbox"===g?f=r.checked:(a[d.toLowerCase()]||a[g])&&(p=Ky({element:r,maskInputOptions:a,tagName:d,type:g,value:p,maskInputFn:l})),h(r,c?{text:p,isChecked:f,userTriggered:u}:{text:p,isChecked:f});const v=r.name;"radio"===g&&v&&f&&t.querySelectorAll(`input[type="radio"][name="${v}"]`).forEach(e=>{if(e!==r){const t=e.value;h(e,c?{text:t,isChecked:!f,userTriggered:!1}:{text:t,isChecked:!f})}})}function h(t,n){const i=ey.get(t);if(!i||i.text!==n.text||i.isChecked!==n.isChecked){ey.set(t,n);const i=r.getId(t);Ym(e)({...n,id:i})}}const p=("last"===u.input?["change"]:["input","change"]).map(e=>_w(e,Ym(d),t)),f=t.defaultView;if(!f)return()=>{p.forEach(e=>e())};const g=f.Object.getOwnPropertyDescriptor(f.HTMLInputElement.prototype,"value"),v=[[f.HTMLInputElement.prototype,"value"],[f.HTMLInputElement.prototype,"checked"],[f.HTMLSelectElement.prototype,"value"],[f.HTMLTextAreaElement.prototype,"value"],[f.HTMLSelectElement.prototype,"selectedIndex"],[f.HTMLOptionElement.prototype,"selected"]];return g&&g.set&&p.push(...v.map(e=>Pw(e[0],e[1],{set(){Ym(d)({target:this,isTrusted:!1})}},!1,f))),Ym(()=>{p.forEach(e=>e())})}(e),u=function({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:i,doc:o}){const s=Ym(o=>Rw(Ym(i=>{const s=eS(i);if(!s||Uw(s,t,r,!0))return;const{currentTime:a,volume:l,muted:u,playbackRate:c,loop:d}=s;e({type:o,id:n.getId(s),currentTime:a,volume:l,muted:u,playbackRate:c,loop:d})}),i.media||500)),a=[_w("play",s(Hm.Play),o),_w("pause",s(Hm.Pause),o),_w("seeked",s(Hm.Seeked),o),_w("volumechange",s(Hm.VolumeChange),o),_w("ratechange",s(Hm.RateChange),o)];return Ym(()=>{a.forEach(e=>e())})}(e);let c=()=>{},d=()=>{},h=()=>{},p=()=>{};e.recordDOM&&(c=function({styleSheetRuleCb:e,mirror:t,stylesheetManager:r},{win:n}){if(!n.CSSStyleSheet||!n.CSSStyleSheet.prototype)return()=>{};const i=n.CSSStyleSheet.prototype.insertRule;n.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:Ym((n,i,o)=>{const[s,a]=o,{id:l,styleId:u}=oS(i,t,r.styleMirror);return(l&&-1!==l||u&&-1!==u)&&e({id:l,styleId:u,adds:[{rule:s,index:a}]}),Zw(()=>n.apply(i,o))()})}),n.CSSStyleSheet.prototype.addRule=function(e,t,r=this.cssRules.length){const i=`${e} { ${t} }`;return n.CSSStyleSheet.prototype.insertRule.apply(this,[i,r])};const o=n.CSSStyleSheet.prototype.deleteRule;let s,a;n.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:Ym((n,i,o)=>{const[s]=o,{id:a,styleId:l}=oS(i,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:s}]}),Zw(()=>n.apply(i,o))()})}),n.CSSStyleSheet.prototype.removeRule=function(e){return n.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},n.CSSStyleSheet.prototype.replace&&(s=n.CSSStyleSheet.prototype.replace,n.CSSStyleSheet.prototype.replace=new Proxy(s,{apply:Ym((n,i,o)=>{const[s]=o,{id:a,styleId:l}=oS(i,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,replace:s}),n.apply(i,o)})})),n.CSSStyleSheet.prototype.replaceSync&&(a=n.CSSStyleSheet.prototype.replaceSync,n.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:Ym((n,i,o)=>{const[s]=o,{id:a,styleId:l}=oS(i,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,replaceSync:s}),n.apply(i,o)})}));const l={};uS("CSSGroupingRule")?l.CSSGroupingRule=n.CSSGroupingRule:(uS("CSSMediaRule")&&(l.CSSMediaRule=n.CSSMediaRule),uS("CSSConditionRule")&&(l.CSSConditionRule=n.CSSConditionRule),uS("CSSSupportsRule")&&(l.CSSSupportsRule=n.CSSSupportsRule));const u={};return Object.entries(l).forEach(([n,i])=>{u[n]={insertRule:i.prototype.insertRule,deleteRule:i.prototype.deleteRule},i.prototype.insertRule=new Proxy(u[n].insertRule,{apply:Ym((n,i,o)=>{const[s,a]=o,{id:l,styleId:u}=oS(i.parentStyleSheet,t,r.styleMirror);return(l&&-1!==l||u&&-1!==u)&&e({id:l,styleId:u,adds:[{rule:s,index:[...iS(i),a||0]}]}),n.apply(i,o)})}),i.prototype.deleteRule=new Proxy(u[n].deleteRule,{apply:Ym((n,i,o)=>{const[s]=o,{id:a,styleId:l}=oS(i.parentStyleSheet,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:[...iS(i),s]}]}),n.apply(i,o)})})}),Ym(()=>{n.CSSStyleSheet.prototype.insertRule=i,n.CSSStyleSheet.prototype.deleteRule=o,s&&(n.CSSStyleSheet.prototype.replace=s),a&&(n.CSSStyleSheet.prototype.replaceSync=a),Object.entries(l).forEach(([e,t])=>{t.prototype.insertRule=u[e].insertRule,t.prototype.deleteRule=u[e].deleteRule})})}(e,{win:r}),d=sS(e,e.doc),h=function({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:r,stylesheetManager:n},{win:i}){const o=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:Ym((i,s,a)=>{var l;const[u,c,d]=a;if(r.has(u))return o.apply(s,[u,c,d]);const{id:h,styleId:p}=oS(null==(l=s.parentRule)?void 0:l.parentStyleSheet,t,n.styleMirror);return(h&&-1!==h||p&&-1!==p)&&e({id:h,styleId:p,set:{property:u,value:c,priority:d},index:iS(s.parentRule)}),i.apply(s,a)})});const s=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(s,{apply:Ym((i,o,a)=>{var l;const[u]=a;if(r.has(u))return s.apply(o,[u]);const{id:c,styleId:d}=oS(null==(l=o.parentRule)?void 0:l.parentStyleSheet,t,n.styleMirror);return(c&&-1!==c||d&&-1!==d)&&e({id:c,styleId:d,remove:{property:u},index:iS(o.parentRule)}),i.apply(o,a)})}),Ym(()=>{i.CSSStyleDeclaration.prototype.setProperty=o,i.CSSStyleDeclaration.prototype.removeProperty=s})}(e,{win:r}),e.collectFonts&&(p=function({fontCb:e,doc:t}){const r=t.defaultView;if(!r)return()=>{};const n=[],i=new WeakMap,o=r.FontFace;r.FontFace=function(e,t,r){const n=new o(e,t,r);return i.set(n,{family:e,buffer:"string"!=typeof t,descriptors:r,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),n};const s=Mw(t.fonts,"add",function(t){return function(r){return setTimeout(Ym(()=>{const t=i.get(r);t&&(e(t),i.delete(r))}),0),t.apply(this,[r])}});return n.push(()=>{r.FontFace=o}),n.push(s),Ym(()=>{n.forEach(e=>e())})}(e)));const f=function(e){const{doc:t,mirror:r,blockClass:n,blockSelector:i,selectionCb:o}=e;let s=!0;const a=Ym(()=>{const e=t.getSelection();if(!e||s&&(null==e?void 0:e.isCollapsed))return;s=e.isCollapsed||!1;const a=[],l=e.rangeCount||0;for(let t=0;t<l;t++){const o=e.getRangeAt(t),{startContainer:s,startOffset:l,endContainer:u,endOffset:c}=o;Uw(s,n,i,!0)||Uw(u,n,i,!0)||a.push({start:r.getId(s),startOffset:l,end:r.getId(u),endOffset:c})}o({ranges:a})});return a(),_w("selectionchange",a)}(e),g=function({doc:e,customElementCb:t}){const r=e.defaultView;return r&&r.customElements?Mw(r.customElements,"define",function(e){return function(r,n,i){try{t({define:{name:r}})}catch(e){console.warn(`Custom element callback failed for ${r}`)}return e.apply(this,[r,n,i])}}):()=>{}}(e),v=[];for(const t of e.plugins)v.push(t.observer(t.callback,r,t.options));return Ym(()=>{Xm.forEach(e=>e.reset()),null==n||n.disconnect(),i(),o(),s(),a(),l(),u(),c(),d(),h(),p(),f(),g(),v.forEach(e=>e())})}function lS(e){return void 0!==window[e]}function uS(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}function cS(e,t,r){if(e instanceof Array)return e.map(e=>cS(e,t,r));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray){return{rr_type:e.constructor.name,args:[Object.values(e)]}}if(e instanceof ArrayBuffer){return{rr_type:e.constructor.name,base64:ay(e)}}if(e instanceof DataView){return{rr_type:e.constructor.name,args:[cS(e.buffer,t,r),e.byteOffset,e.byteLength]}}if(e instanceof HTMLImageElement){const t=e.constructor.name,{src:r}=e;return{rr_type:t,src:r}}if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}if(e instanceof ImageData){return{rr_type:e.constructor.name,args:[cS(e.data,t,r),e.width,e.height]}}if(dy(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:uy(e,t,r)}}return e}function dS(e,t,r,n){const i=[];try{const o=Mw(e.HTMLCanvasElement.prototype,"getContext",function(e){return function(i,...o){if(!Uw(this,t,r,!0)){const e=function(e){return"experimental-webgl"===e?"webgl":e}(i);if("__context"in this||(this.__context=e),n&&["webgl","webgl2"].includes(e))if(o[0]&&"object"==typeof o[0]){const e=o[0];e.preserveDrawingBuffer||(e.preserveDrawingBuffer=!0)}else o.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[i,...o])}});i.push(o)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{i.forEach(e=>e())}}function hS(e,t,r,n,i,o){const s=[],a=Object.getOwnPropertyNames(e);for(const l of a)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))try{if("function"!=typeof e[l])continue;const a=Mw(e,l,function(e){return function(...s){const a=e.apply(this,s);if(uy(a,o,this),"tagName"in this.canvas&&!Uw(this.canvas,n,i,!0)){const e=cy(s,o,this),n={type:t,property:l,args:e};r(this.canvas,n)}return a}});s.push(a)}catch(n){const i=Pw(e,l,{set(e){r(this.canvas,{type:t,property:l,args:[e],setter:!0})}});s.push(i)}return s}function pS(e){let t;try{if(t=py&&(self.URL||self.webkitURL).createObjectURL(py),!t)throw"";const r=new Worker(t,{name:null==e?void 0:e.name});return r.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),r}catch(t){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(hy),{name:null==e?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}function fS(e={}){const{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:i="rr-block",blockSelector:o=null,ignoreClass:s="rr-ignore",ignoreSelector:a=null,maskTextClass:l="rr-mask",maskTextSelector:u=null,inlineStylesheet:c=!0,maskAllInputs:d,maskInputOptions:h,slimDOMOptions:p,maskInputFn:f,maskTextFn:g,maskAttributeFn:v,hooks:m,packFn:y,sampling:b={},dataURLOptions:w={},mousemoveWait:S,recordDOM:E=!0,recordCanvas:k=!1,recordCrossOriginIframes:x=!1,recordAfter:C=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:I=!1,collectFonts:O=!1,inlineImages:T=!1,captureAdoptedStyleSheets:A=!0,plugins:_,keepIframeSrcFn:R=()=>!1,ignoreCSSAttributes:P=new Set([]),errorHandler:M,applyBackgroundColorToBlockedElements:N=!1}=e;Qm=M;const L=!x||window.parent===window;let D=!1;if(!L)try{window.parent.document&&(D=!1)}catch(e){D=!0}if(L&&!t)throw new Error("emit function is required");if(!L&&!D)return()=>{};void 0!==S&&void 0===b.mousemove&&(b.mousemove=S),Sy.reset();const j=!0===d?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==h?h:{password:!0},U=!0===p||"all"===p?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===p,headMetaDescKeywords:"all"===p,headTitleMutations:"all"===p}:p||{};let F;!function(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}();let B=0;const q=e=>{for(const t of _||[])t.eventProcessor&&(e=t.eventProcessor(e));return y&&!D&&(e=y(e)),e};my=(e,i)=>{var o;const s=e;if(s.timestamp=Um(),!(null==(o=Xm[0])?void 0:o.isFrozen())||s.type===Bm.FullSnapshot||s.type===Bm.IncrementalSnapshot&&s.data.source===qm.Mutation||Xm.forEach(e=>e.unfreeze()),L)null==t||t(q(s),i);else if(D){const e={type:"rrweb",event:q(s),origin:window.location.origin,isCheckout:i};window.parent.postMessage(e,"*")}if(s.type===Bm.FullSnapshot)F=s,B=0;else if(s.type===Bm.IncrementalSnapshot){if(s.data.source===qm.Mutation&&s.data.isAttachIframe)return;B++;const e=n&&B>=n,t=r&&s.timestamp-F.timestamp>r;(e||t)&&yy(!0)}};const z=e=>{my({type:Bm.IncrementalSnapshot,data:{source:qm.Mutation,...e}})},V=e=>my({type:Bm.IncrementalSnapshot,data:{source:qm.Scroll,...e}}),W=e=>my({type:Bm.IncrementalSnapshot,data:{source:qm.CanvasMutation,...e}}),H=new gy({mutationCb:z,adoptedStyleSheetCb:e=>my({type:Bm.IncrementalSnapshot,data:{source:qm.AdoptedStyleSheet,...e}})}),$=new ry({mirror:Sy,mutationCb:z,stylesheetManager:H,recordCrossOriginIframes:x,wrappedEmit:my});for(const e of _||[])e.getMirror&&e.getMirror({nodeMirror:Sy,crossOriginIframeMirror:$.crossOriginIframeMirror,crossOriginIframeStyleMirror:$.crossOriginIframeStyleMirror});const G=new vy;by=new fy({recordCanvas:k,mutationCb:W,win:window,blockClass:i,blockSelector:o,mirror:Sy,sampling:b.canvas,dataURLOptions:w});const K=new ny({mutationCb:z,scrollCb:V,bypassOptions:{blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:u,inlineStylesheet:c,maskInputOptions:j,dataURLOptions:w,maskTextFn:g,maskInputFn:f,maskAttributeFn:v,recordCanvas:k,inlineImages:T,sampling:b,slimDOMOptions:U,iframeManager:$,stylesheetManager:H,canvasManager:by,keepIframeSrcFn:R,processedNodeManager:G},mirror:Sy});yy=(e=!1)=>{if(!E)return;my({type:Bm.Meta,data:{href:window.location.href,width:Dw(),height:Lw()}},e),H.reset(),K.init(),Xm.forEach(e=>e.lock());const t=function(e,t){const{mirror:r=new Gf,blockClass:n="rr-block",blockSelector:i=null,maskTextClass:o="rr-mask",maskTextSelector:s=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:u=!1,maskAllInputs:c=!1,maskTextFn:d,maskInputFn:h,maskAttributeFn:p,slimDOM:f=!1,dataURLOptions:g,preserveWhiteSpace:v,onSerialize:m,onAdoptedStyleSheet:y,onIframeLoad:b,iframeLoadTimeout:w,onStylesheetLoad:S,stylesheetLoadTimeout:E,keepIframeSrcFn:k=()=>!1,applyBackgroundColorToBlockedElements:x=!1}=t||{};return hb(e,{doc:e,mirror:r,blockClass:n,blockSelector:i,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:a,maskInputOptions:!0===c?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===c?{password:!0}:c,maskTextFn:d,maskInputFn:h,maskAttributeFn:p,slimDOMOptions:!0===f||"all"===f?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===f,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===f?{}:f,dataURLOptions:g,inlineImages:l,recordCanvas:u,preserveWhiteSpace:v,onSerialize:m,onAdoptedStyleSheet:y,onIframeLoad:b,iframeLoadTimeout:w,onStylesheetLoad:S,stylesheetLoadTimeout:E,keepIframeSrcFn:k,newlyAddedElement:!1,applyBackgroundColorToBlockedElements:x})}(document,{mirror:Sy,blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:u,inlineStylesheet:c,maskAllInputs:j,maskTextFn:g,maskInputFn:f,maskAttributeFn:v,slimDOM:U,dataURLOptions:w,recordCanvas:k,inlineImages:T,applyBackgroundColorToBlockedElements:N,onSerialize:e=>{zw(e,Sy)&&$.addIframe(e),Vw(e,Sy)&&H.trackLinkElement(e),Ww(e)&&K.addShadowRoot(Lm.shadowRoot(e),document)},onAdoptedStyleSheet:A?e=>H.styleMirror.add(e):void 0,onIframeLoad:(e,t)=>{$.attachIframe(e,t),K.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{H.attachLinkElement(e,t)},keepIframeSrcFn:R});if(!t)return console.warn("Failed to snapshot the document");my({type:Bm.FullSnapshot,data:{node:t,initialOffset:Nw(window)}},e),Xm.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&H.adoptStyleSheets(document.adoptedStyleSheets,Sy.getId(document))};try{const e=[],t=e=>{var t;return Ym(aS)({mutationCb:z,mousemoveCb:(e,t)=>my({type:Bm.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>my({type:Bm.IncrementalSnapshot,data:{source:qm.MouseInteraction,...e}}),scrollCb:V,viewportResizeCb:e=>my({type:Bm.IncrementalSnapshot,data:{source:qm.ViewportResize,...e}}),inputCb:e=>my({type:Bm.IncrementalSnapshot,data:{source:qm.Input,...e}}),mediaInteractionCb:e=>my({type:Bm.IncrementalSnapshot,data:{source:qm.MediaInteraction,...e}}),styleSheetRuleCb:e=>my({type:Bm.IncrementalSnapshot,data:{source:qm.StyleSheetRule,...e}}),styleDeclarationCb:e=>my({type:Bm.IncrementalSnapshot,data:{source:qm.StyleDeclaration,...e}}),canvasMutationCb:W,fontCb:e=>my({type:Bm.IncrementalSnapshot,data:{source:qm.Font,...e}}),selectionCb:e=>{my({type:Bm.IncrementalSnapshot,data:{source:qm.Selection,...e}})},customElementCb:e=>{my({type:Bm.IncrementalSnapshot,data:{source:qm.CustomElement,...e}})},blockClass:i,ignoreClass:s,ignoreSelector:a,maskTextClass:l,maskTextSelector:u,maskInputOptions:j,inlineStylesheet:c,sampling:b,recordDOM:E,recordCanvas:k,inlineImages:T,userTriggeredOnInput:I,collectFonts:O,doc:e,maskInputFn:f,maskTextFn:g,maskAttributeFn:v,keepIframeSrcFn:R,blockSelector:o,slimDOMOptions:U,dataURLOptions:w,mirror:Sy,iframeManager:$,stylesheetManager:H,shadowDomManager:K,processedNodeManager:G,canvasManager:by,ignoreCSSAttributes:P,plugins:(null==(t=null==_?void 0:_.filter(e=>e.observer))?void 0:t.map(e=>({observer:e.observer,options:e.options,callback:t=>my({type:Bm.Plugin,data:{plugin:e.name,payload:t}})})))||[]},m)};$.addLoadListener(r=>{try{e.push(t(r.contentDocument))}catch(e){console.warn(e)}});const r=()=>{yy(),e.push(t(document)),wy=!0};return"interactive"===document.readyState||"complete"===document.readyState?r():(e.push(_w("DOMContentLoaded",()=>{my({type:Bm.DomContentLoaded,data:{}}),"DOMContentLoaded"===C&&r()})),e.push(_w("load",()=>{my({type:Bm.Load,data:{}}),"load"===C&&r()},window))),()=>{e.forEach(e=>e()),G.destroy(),wy=!1,Qm=void 0}}catch(e){console.warn(e)}}c(Oy,{record:()=>fS});var gS,vS,mS=l({"../../../../node_modules/@amplitude/rrweb-record/dist/rrweb-record.js"(){for((Mf=Object.defineProperty,Nf=(e,t,r)=>t in e?Mf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Lf=(e,t,r)=>Nf(e,"symbol"!=typeof t?t+"":t,r),jf=Object.defineProperty,Uf=(e,t,r)=>t in e?jf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ff=(e,t,r)=>Uf(e,"symbol"!=typeof t?t+"":t,r),Bf=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(Bf||{}),qf={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},zf={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Vf={},Wf={},Hf={},$f={childNodes:Ry,parentNode:Py,parentElement:My,textContent:Ny,contains:Ly,getRootNode:Dy,host:jy,styleSheets:Uy,shadowRoot:Fy,querySelector:By,querySelectorAll:qy,mutationObserver:zy},Gf=class{constructor(){Ff(this,"idNodeMap",new Map),Ff(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;const r=null==(t=this.getMeta(e))?void 0:t.id;return null!=r?r:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(e=>this.removeNodeFromMap(e))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)}replace(e,t){const r=this.getNode(e);if(r){const e=this.nodeMetaMap.get(r);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}},Kf="__rrweb_original__",Jf=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Qf=/^(?:[a-z+]+:)?\/\//i,Yf=/^www\..*/i,Xf=/^(data:)([^,]*),(.*)/i,Zf="lightgrey",eg=1,tg=new RegExp("[^a-z0-9-_:]"),rg=-2,og=/^[^ \t\n\r\u000c]+/,sg=/^[, \t\n\r\u000c]+/,ag=new WeakMap,lg={exports:{}},cg={},dg=Object.freeze(Object.defineProperty({__proto__:null,default:cg},Symbol.toStringTag,{value:"Module"})),hg=fb(dg),gg={},gv=Bb(),(vv=pb(gv)).stringify,vv.fromJSON,vv.plugin,vv.parse,vv.list,vv.document,vv.comment,vv.atRule,vv.rule,vv.decl,vv.root,vv.CssSyntaxError,vv.Declaration,vv.Container,vv.Processor,vv.Document,vv.Comment,vv.Warning,vv.AtRule,vv.Result,vv.Input,vv.Rule,vv.Root,vv.Node,mv=Object.defineProperty,yv=(e,t,r)=>t in e?mv(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,bv=(e,t,r)=>yv(e,"symbol"!=typeof t?t+"":t,r),wv={exports:{}},Ev={},kv=Object.freeze(Object.defineProperty({__proto__:null,default:Ev},Symbol.toStringTag,{value:"Module"})),xv=zb(kv),Ov={},Om=fw(),(Tm=qb(Om)).stringify,Tm.fromJSON,Tm.plugin,Tm.parse,Tm.list,Tm.document,Tm.comment,Tm.atRule,Tm.rule,Tm.decl,Tm.root,Tm.CssSyntaxError,Tm.Declaration,Tm.Container,Tm.Processor,Tm.Document,Tm.Comment,Tm.Warning,Tm.AtRule,Tm.Result,Tm.Input,Tm.Rule,Tm.Root,Tm.Node,Am=class e{constructor(...e){bv(this,"parentElement",null),bv(this,"parentNode",null),bv(this,"ownerDocument"),bv(this,"firstChild",null),bv(this,"lastChild",null),bv(this,"previousSibling",null),bv(this,"nextSibling",null),bv(this,"ELEMENT_NODE",1),bv(this,"TEXT_NODE",3),bv(this,"nodeType"),bv(this,"nodeName"),bv(this,"RRNodeType")}get childNodes(){const e=[];let t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(t){if(!(t instanceof e))return!1;if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}},_m={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Rm={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Pm={},Mm={},Nm={},Lm={childNodes:yw,parentNode:bw,parentElement:ww,textContent:Sw,contains:Ew,getRootNode:kw,host:xw,styleSheets:Cw,shadowRoot:Iw,querySelector:Ow,querySelectorAll:Tw,mutationObserver:Aw},Dm="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.",jm={map:{},getId:()=>(console.error(Dm),-1),getNode:()=>(console.error(Dm),null),removeNodeFromMap(){console.error(Dm)},has:()=>(console.error(Dm),!1),reset(){console.error(Dm)}},"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(jm=new Proxy(jm,{get:(e,t,r)=>("map"===t&&console.error(Dm),Reflect.get(e,t,r))})),Um=Date.now,/[1-9][0-9]{12}/.test(Date.now().toString())||(Um=()=>(new Date).getTime()),Fm=class{constructor(){Lf(this,"id",1),Lf(this,"styleIDMap",new WeakMap),Lf(this,"idStyleMap",new Map)}getId(e){var t;return null!=(t=this.styleIDMap.get(e))?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let r;return r=void 0===t?this.id++:t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}},Bm=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(Bm||{}),qm=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(qm||{}),zm=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(zm||{}),Vm=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Vm||{}),Wm=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Wm||{}),Hm=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(Hm||{}),$m=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))($m||{}),Gm=class{constructor(){Lf(this,"length",0),Lf(this,"head",null),Lf(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let r=0;r<e;r++)t=(null==t?void 0:t.next)||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&Kw(e.previousSibling)){const r=e.previousSibling.__ln.next;t.next=r,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,r&&(r.previous=t)}else if(e.nextSibling&&Kw(e.nextSibling)&&e.nextSibling.__ln.previous){const r=e.nextSibling.__ln.previous;t.previous=r,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,r&&(r.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;null===t.next&&(this.tail=t),this.length++}removeNode(e){const t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}},Km=(e,t)=>`${e}@${t}`,Jm=class{constructor(){Lf(this,"frozen",!1),Lf(this,"locked",!1),Lf(this,"texts",[]),Lf(this,"attributes",[]),Lf(this,"attributeMap",new WeakMap),Lf(this,"removes",[]),Lf(this,"mapRemoves",[]),Lf(this,"movedMap",{}),Lf(this,"addedSet",new Set),Lf(this,"movedSet",new Set),Lf(this,"droppedSet",new Set),Lf(this,"removesSubTreeCache",new Set),Lf(this,"mutationCb"),Lf(this,"blockClass"),Lf(this,"blockSelector"),Lf(this,"maskTextClass"),Lf(this,"maskTextSelector"),Lf(this,"inlineStylesheet"),Lf(this,"maskInputOptions"),Lf(this,"maskTextFn"),Lf(this,"maskInputFn"),Lf(this,"maskAttributeFn"),Lf(this,"keepIframeSrcFn"),Lf(this,"recordCanvas"),Lf(this,"inlineImages"),Lf(this,"slimDOMOptions"),Lf(this,"dataURLOptions"),Lf(this,"doc"),Lf(this,"mirror"),Lf(this,"iframeManager"),Lf(this,"stylesheetManager"),Lf(this,"shadowDomManager"),Lf(this,"canvasManager"),Lf(this,"processedNodeManager"),Lf(this,"unattachedDoc"),Lf(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),Lf(this,"emit",()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,r=new Gm,n=e=>{let t=e,r=rg;for(;r===rg;)t=t&&t.nextSibling,r=t&&this.mirror.getId(t);return r},i=i=>{const o=Lm.parentNode(i);if(!o||!Gw(i))return;let s=!1;if(i.nodeType===Node.TEXT_NODE){const e=o.tagName;if("TEXTAREA"===e)return;"STYLE"===e&&this.addedSet.has(o)&&(s=!0)}const a=Wy(o)?this.mirror.getId(Hw(i)):this.mirror.getId(o),l=n(i);if(-1===a||-1===l)return r.addNode(i);const u=hb(i,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:e=>{zw(e,this.mirror)&&this.iframeManager.addIframe(e),Vw(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Ww(i)&&this.shadowDomManager.addShadowRoot(Lm.shadowRoot(i),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)},cssCaptured:s});u&&(e.push({parentId:a,nextId:l,node:u}),t.add(u.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const e of this.movedSet)Qw(this.removesSubTreeCache,e,this.mirror)&&!this.movedSet.has(Lm.parentNode(e))||i(e);for(const e of this.addedSet)Yw(this.droppedSet,e)||Qw(this.removesSubTreeCache,e,this.mirror)?Yw(this.movedSet,e)?i(e):this.droppedSet.add(e):i(e);let o=null;for(;r.length;){let e=null;if(o){const t=this.mirror.getId(Lm.parentNode(o.value)),r=n(o.value);-1!==t&&-1!==r&&(e=o)}if(!e){let t=r.tail;for(;t;){const r=t;if(t=t.previous,r){const t=this.mirror.getId(Lm.parentNode(r.value));if(-1===n(r.value))continue;if(-1!==t){e=r;break}{const t=r.value,n=Lm.parentNode(t);if(n&&n.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const t=Lm.host(n);if(-1!==this.mirror.getId(t)){e=r;break}}}}}}if(!e){for(;r.head;)r.removeNode(r.head.value);break}o=e.previous,r.removeNode(e.value),i(e.value)}const s={texts:this.texts.map(e=>{const t=e.node,r=Lm.parentNode(t);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{id:this.mirror.getId(t),value:e.value}}).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),attributes:this.attributes.map(e=>{const{attributes:t}=e;if("string"==typeof t.style){const r=JSON.stringify(e.styleDiff),n=JSON.stringify(e._unchangedStyles);r.length<t.style.length&&(r+n).split("var(").length===t.style.split("var(").length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}}).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),removes:this.removes,adds:e};(s.texts.length||s.attributes.length||s.removes.length||s.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(s))}),Lf(this,"genTextAreaValueMutation",e=>{let t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t));const r=Array.from(Lm.childNodes(e),e=>Lm.textContent(e)||"").join("");t.attributes.value=Ky({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:Qy(e),value:r,maskInputFn:this.maskInputFn})}),Lf(this,"processMutation",e=>{if(!Fw(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=Lm.textContent(e.target);Uw(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:lb(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,jw(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const t=e.target;let r=e.attributeName,n=e.target.getAttribute(r);if("value"===r){const e=Qy(t);n=Ky({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:e,value:n,maskInputFn:this.maskInputFn})}if(Uw(e.target,this.blockClass,this.blockSelector,!1)||n===e.oldValue)return;let i=this.attributeMap.get(e.target);if("IFRAME"===t.tagName&&"src"===r&&!this.keepIframeSrcFn(n)){if(t.contentDocument)return;r="rr_src"}if(i||(i={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(i),this.attributeMap.set(e.target,i)),"type"===r&&"INPUT"===t.tagName&&"password"===(e.oldValue||"").toLowerCase()&&t.setAttribute("data-rr-is-password","true"),!sb(t.tagName,r)){if(i.attributes[r]=ob(this.doc,Jy(t.tagName),Jy(r),n),this.maskAttributeFn&&"string"==typeof i.attributes[r]){const e=this.maskAttributeFn(r,i.attributes[r],t);null!==e?i.attributes[r]=e:delete i.attributes[r]}if("style"===r){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(e){this.unattachedDoc=this.doc}const r=this.unattachedDoc.createElement("span");e.oldValue&&r.setAttribute("style",e.oldValue);for(const e of Array.from(t.style)){const n=t.style.getPropertyValue(e),o=t.style.getPropertyPriority(e);n!==r.style.getPropertyValue(e)||o!==r.style.getPropertyPriority(e)?i.styleDiff[e]=""===o?n:[n,o]:i._unchangedStyles[e]=[n,o]}for(const e of Array.from(r.style))""===t.style.getPropertyValue(e)&&(i.styleDiff[e]=!1)}else"open"===r&&"DIALOG"===t.tagName&&(t.matches("dialog:modal")?i.attributes.rr_open_mode="modal":i.attributes.rr_open_mode="non-modal")}break}case"childList":if(Uw(e.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===e.target.tagName)return void this.genTextAreaValueMutation(e.target);e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{const r=this.mirror.getId(t),n=Wy(e.target)?this.mirror.getId(Lm.host(e.target)):this.mirror.getId(e.target);Uw(e.target,this.blockClass,this.blockSelector,!1)||Fw(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(Jw(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||Bw(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Km(r,n)]?Jw(this.movedSet,t):(this.removes.push({parentId:n,id:r,isShadow:!(!Wy(e.target)||!Hy(e.target))||void 0}),function(e,t){const r=[e];for(;r.length;){const e=r.pop();t.has(e)||(t.add(e),Lm.childNodes(e).forEach(e=>r.push(e)))}}(t,this.removesSubTreeCache))),this.mapRemoves.push(t))})}}),Lf(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(Fw(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let r=null;t&&this.mirror.hasNode(t)&&(r=this.mirror.getId(t)),r&&-1!==r&&(this.movedMap[Km(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Uw(e,this.blockClass,this.blockSelector,!1)||(Lm.childNodes(e).forEach(e=>this.genAdds(e)),Ww(e)&&Lm.childNodes(Lm.shadowRoot(e)).forEach(t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)}))}})}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","maskAttributeFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(t=>{this[t]=e[t]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}},Ym=e=>{if(!Qm)return e;return(...t)=>{try{return e(...t)}catch(e){if(Qm&&!0===Qm(e))return;throw e}}},Xm=[],Zm=["INPUT","TEXTAREA","SELECT"],ey=new WeakMap,ty=class{constructor(e){Lf(this,"iframeIdToRemoteIdMap",new WeakMap),Lf(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,n){const i=r||this.getIdToRemoteIdMap(e),o=n||this.getRemoteIdToIdMap(e);let s=i.get(t);return s||(s=this.generateIdFn(),i.set(t,s),o.set(s,t)),s}getIds(e,t){const r=this.getIdToRemoteIdMap(e),n=this.getRemoteIdToIdMap(e);return t.map(t=>this.getId(e,t,r,n))}getRemoteId(e,t,r){const n=r||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;const i=n.get(t);return i||-1}getRemoteIds(e,t){const r=this.getRemoteIdToIdMap(e);return t.map(t=>this.getRemoteId(e,t,r))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}},ry=class{constructor(e){Lf(this,"iframes",new WeakMap),Lf(this,"crossOriginIframeMap",new WeakMap),Lf(this,"crossOriginIframeMirror",new ty(tb)),Lf(this,"crossOriginIframeStyleMirror"),Lf(this,"crossOriginIframeRootIdMap",new WeakMap),Lf(this,"mirror"),Lf(this,"mutationCb"),Lf(this,"wrappedEmit"),Lf(this,"loadListener"),Lf(this,"stylesheetManager"),Lf(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new ty(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var r,n;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(r=e.contentWindow)||r.addEventListener("message",this.handleMessage.bind(this))),null==(n=this.loadListener)||n.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){const t=e;if("rrweb"!==t.data.type||t.origin!==t.data.origin)return;if(!e.source)return;const r=this.crossOriginIframeMap.get(e.source);if(!r)return;const n=this.transformCrossOriginEvent(r,t.data.event);n&&this.wrappedEmit(n,t.data.isCheckout)}transformCrossOriginEvent(e,t){var r;switch(t.type){case Bm.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);const r=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,r),this.patchRootIdOnNode(t.data.node,r),{timestamp:t.timestamp,type:Bm.IncrementalSnapshot,data:{source:qm.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case Bm.Meta:case Bm.Load:case Bm.DomContentLoaded:return!1;case Bm.Plugin:return t;case Bm.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case Bm.IncrementalSnapshot:switch(t.data.source){case qm.Mutation:return t.data.adds.forEach(t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);const r=this.crossOriginIframeRootIdMap.get(e);r&&this.patchRootIdOnNode(t.node,r)}),t.data.removes.forEach(t=>{this.replaceIds(t,e,["parentId","id"])}),t.data.attributes.forEach(t=>{this.replaceIds(t,e,["id"])}),t.data.texts.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case qm.Drag:case qm.TouchMove:case qm.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case qm.ViewportResize:return!1;case qm.MediaInteraction:case qm.MouseInteraction:case qm.Scroll:case qm.CanvasMutation:case qm.Input:return this.replaceIds(t.data,e,["id"]),t;case qm.StyleSheetRule:case qm.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case qm.Font:return t;case qm.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,["start","end"])}),t;case qm.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null==(r=t.data.styles)||r.forEach(t=>{this.replaceStyleIds(t,e,["styleId"])}),t}}return!1}replace(e,t,r,n){for(const i of n)(Array.isArray(t[i])||"number"==typeof t[i])&&(Array.isArray(t[i])?t[i]=e.getIds(r,t[i]):t[i]=e.getId(r,t[i]));return t}replaceIds(e,t,r){return this.replace(this.crossOriginIframeMirror,e,t,r)}replaceStyleIds(e,t,r){return this.replace(this.crossOriginIframeStyleMirror,e,t,r)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(e=>{this.replaceIdOnNode(e,t)})}patchRootIdOnNode(e,t){e.type===$m.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(e=>{this.patchRootIdOnNode(e,t)})}},ny=class{constructor(e){Lf(this,"shadowDoms",new WeakSet),Lf(this,"mutationCb"),Lf(this,"scrollCb"),Lf(this,"bypassOptions"),Lf(this,"mirror"),Lf(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(!Hy(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const r=tS({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(nS({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),setTimeout(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(Lm.host(e))),this.restoreHandlers.push(sS({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){const r=this;this.restoreHandlers.push(Mw(e.prototype,"attachShadow",function(e){return function(n){const i=e.call(this,n),o=Lm.shadowRoot(this);return o&&Gw(this)&&r.addShadowRoot(o,t),i}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch(e){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}},iy="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",oy="undefined"==typeof Uint8Array?[]:new Uint8Array(256),sy=0);sy<64;sy++)oy[iy.charCodeAt(sy)]=sy;ay=function(e){var t,r=new Uint8Array(e),n=r.length,i="";for(t=0;t<n;t+=3)i+=iy[r[t]>>2],i+=iy[(3&r[t])<<4|r[t+1]>>4],i+=iy[(15&r[t+1])<<2|r[t+2]>>6],i+=iy[63&r[t+2]];return n%3==2?i=i.substring(0,i.length-1)+"=":n%3==1&&(i=i.substring(0,i.length-2)+"=="),i},ly=new Map,uy=(e,t,r)=>{if(!e||!dy(e,t)&&"object"!=typeof e)return;const n=function(e,t){let r=ly.get(e);return r||(r=new Map,ly.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}(r,e.constructor.name);let i=n.indexOf(e);return-1===i&&(i=n.length,n.push(e)),i},cy=(e,t,r)=>e.map(e=>cS(e,t,r)),dy=(e,t)=>{const r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(e=>"function"==typeof t[e]);return Boolean(r.find(r=>e instanceof t[r]))},hy='(function() {\n "use strict";\n var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);\n for (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n var encode = function(arraybuffer) {\n var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = "";\n for (i2 = 0; i2 < len; i2 += 3) {\n base64 += chars[bytes[i2] >> 2];\n base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];\n base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];\n base64 += chars[bytes[i2 + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + "=";\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + "==";\n }\n return base64;\n };\n const lastBlobMap = /* @__PURE__ */ new Map();\n const transparentBlobMap = /* @__PURE__ */ new Map();\n async function getTransparentBlobFor(width, height, dataURLOptions) {\n const id = `${width}-${height}`;\n if ("OffscreenCanvas" in globalThis) {\n if (transparentBlobMap.has(id)) return transparentBlobMap.get(id);\n const offscreen = new OffscreenCanvas(width, height);\n offscreen.getContext("2d");\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n transparentBlobMap.set(id, base64);\n return base64;\n } else {\n return "";\n }\n }\n const worker = self;\n worker.onmessage = async function(e) {\n if ("OffscreenCanvas" in globalThis) {\n const { id, bitmap, width, height, dataURLOptions } = e.data;\n const transparentBase64 = getTransparentBlobFor(\n width,\n height,\n dataURLOptions\n );\n const offscreen = new OffscreenCanvas(width, height);\n const ctx = offscreen.getContext("2d");\n ctx.drawImage(bitmap, 0, 0);\n bitmap.close();\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const type = blob.type;\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n if (!lastBlobMap.has(id) && await transparentBase64 === base64) {\n lastBlobMap.set(id, base64);\n return worker.postMessage({ id });\n }\n if (lastBlobMap.get(id) === base64) return worker.postMessage({ id });\n worker.postMessage({\n id,\n type,\n base64,\n width,\n height\n });\n lastBlobMap.set(id, base64);\n } else {\n return worker.postMessage({ id: e.data.id });\n }\n };\n})();\n//# sourceMappingURL=image-bitmap-data-url-worker-IJpC7g_b.js.map\n',py="undefined"!=typeof self&&self.Blob&&new Blob([hy],{type:"text/javascript;charset=utf-8"}),fy=class{constructor(e){Lf(this,"pendingCanvasMutations",new Map),Lf(this,"rafStamps",{latestId:0,invokeId:null}),Lf(this,"mirror"),Lf(this,"mutationCb"),Lf(this,"resetObservers"),Lf(this,"frozen",!1),Lf(this,"locked",!1),Lf(this,"processMutation",(e,t)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)});const{sampling:t="all",win:r,blockClass:n,blockSelector:i,recordCanvas:o,dataURLOptions:s}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,o&&"all"===t&&this.initCanvasMutationObserver(r,n,i),o&&"number"==typeof t&&this.initCanvasFPSObserver(t,r,n,i,{dataURLOptions:s})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,t,r,n,i){const o=dS(t,r,n,!0),s=new Map,a=new pS;a.onmessage=e=>{const{id:t}=e.data;if(s.set(t,!1),!("base64"in e.data))return;const{base64:r,type:n,width:i,height:o}=e.data;this.mutationCb({id:t,type:Wm["2D"],commands:[{property:"clearRect",args:[0,0,i,o]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:n}]},0,0]}]})};const l=1e3/e;let u,c=0;const d=e=>{c&&e-c<l||(c=e,(()=>{const e=[];return t.document.querySelectorAll("canvas").forEach(t=>{Uw(t,r,n,!0)||e.push(t)}),e})().forEach(async e=>{var t;const r=this.mirror.getId(e);if(s.get(r))return;if(0===e.width||0===e.height)return;if(s.set(r,!0),["webgl","webgl2"].includes(e.__context)){const r=e.getContext(e.__context);!1===(null==(t=null==r?void 0:r.getContextAttributes())?void 0:t.preserveDrawingBuffer)&&r.clear(r.COLOR_BUFFER_BIT)}const n=await createImageBitmap(e);a.postMessage({id:r,bitmap:n,width:e.width,height:e.height,dataURLOptions:i.dataURLOptions},[n])})),u=requestAnimationFrame(d)};u=requestAnimationFrame(d),this.resetObservers=()=>{o(),cancelAnimationFrame(u)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const n=dS(e,t,r,!1),i=function(e,t,r,n){const i=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const s of o)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[s])continue;const o=Mw(t.CanvasRenderingContext2D.prototype,s,function(i){return function(...o){return Uw(this.canvas,r,n,!0)||setTimeout(()=>{const r=cy(o,t,this);e(this.canvas,{type:Wm["2D"],property:s,args:r})},0),i.apply(this,o)}});i.push(o)}catch(r){const n=Pw(t.CanvasRenderingContext2D.prototype,s,{set(t){e(this.canvas,{type:Wm["2D"],property:s,args:[t],setter:!0})}});i.push(n)}return()=>{i.forEach(e=>e())}}(this.processMutation.bind(this),e,t,r),o=function(e,t,r,n){const i=[];return i.push(...hS(t.WebGLRenderingContext.prototype,Wm.WebGL,e,r,n,t)),void 0!==t.WebGL2RenderingContext&&i.push(...hS(t.WebGL2RenderingContext.prototype,Wm.WebGL2,e,r,n,t)),()=>{i.forEach(e=>e())}}(this.processMutation.bind(this),e,t,r);this.resetObservers=()=>{n(),i(),o()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{const r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const r=this.pendingCanvasMutations.get(e);if(!r||-1===t)return;const n=r.map(e=>{const{type:t,...r}=e;return r}),{type:i}=r[0];this.mutationCb({id:t,type:i,commands:n}),this.pendingCanvasMutations.delete(e)}},gy=class{constructor(e){Lf(this,"trackedLinkElements",new WeakSet),Lf(this,"mutationCb"),Lf(this,"adoptedStyleSheetCb"),Lf(this,"styleMirror",new Fm),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(0===e.length)return;const r={id:t,styleIds:[]},n=[];for(const t of e){let e;if(this.styleMirror.has(t))e=this.styleMirror.getId(t);else{e=this.styleMirror.add(t);let r=[];try{r=Array.from(t.cssRules,(e,r)=>({rule:Gy(e,t.href),index:r}))}catch(e){if(!(e instanceof DOMException&&"SecurityError"===e.name))throw e}n.push({styleId:e,rules:r})}r.styleIds.push(e)}n.length>0&&(r.styles=n),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}},vy=class{constructor(){Lf(this,"nodeMap",new WeakMap),Lf(this,"active",!1)}inOtherBuffer(e,t){const r=this.nodeMap.get(e);return r&&Array.from(r).some(e=>e!==t)}add(e,t){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}},wy=!1;try{if(2!==Array.from([1],e=>2*e)[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(Df=e.contentWindow)?void 0:Df.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}var e;Sy=new Gf,fS.addCustomEvent=(e,t)=>{if(!wy)throw new Error("please add custom event after start recording");my({type:Bm.Custom,data:{tag:e,payload:t}})},fS.freezePage=()=>{Xm.forEach(e=>e.freeze())},fS.takeFullSnapshot=e=>{if(!wy)throw new Error("please take full snapshot after start recording");yy(e)},fS.mirror=Sy,(e=Ey||(Ey={}))[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped",({addCustomEvent:ky}=fS),({freezePage:xy}=fS),({takeFullSnapshot:Cy}=fS)}}),yS={};function bS(e,t){if(new Blob([e]).size<=t)return{value:e,truncated:!1};for(var r=0,n=Math.min(e.length,t);r<n;){var i=Math.ceil((r+n)/2);new Blob([e.slice(0,i)]).size<=t?r=i:n=i-1}return r>0&&e.charCodeAt(r-1)>=55296&&e.charCodeAt(r-1)<=56319&&(r-=1),{value:e.slice(0,r),truncated:!0}}c(yS,{NetworkObservers:()=>vS});var wS,SS,ES,kS,xS,CS,IS,OS,TS,AS,_S,RS,PS,MS,NS,LS,DS,jS,US,FS,BS=l({"../../../../node_modules/@amplitude/session-replay-browser/lib/esm/observers.js"(){Ne(),Ki(),gS=["image/","audio/","video/","application/octet-stream","font/"],vS=function(){function e(){this.fetchObserver=null}return e.prototype.start=function(e,t){this.eventCallback=e,this.networkConfig=t,this.observeFetch()},e.prototype.stop=function(){var e;null===(e=this.fetchObserver)||void 0===e||e.call(this),this.fetchObserver=null,this.eventCallback=void 0,this.networkConfig=void 0},e.prototype.notifyEvent=function(e){var t;null===(t=this.eventCallback)||void 0===t||t.call(this,e)},e.prototype.observeFetch=function(){var e=this,t=de();if(t){var r=t.fetch;r&&(t.fetch=function(t,n){return v(e,void 0,void 0,function(){var e,i,o,s,a,l,u,c,d,h,p,f,g=this;return m(this,function(v){switch(v.label){case 0:e=Date.now(),i={timestamp:e,type:"fetch",method:(null==n?void 0:n.method)||"GET",url:t.toString(),requestHeaders:null==n?void 0:n.headers},(null==(o=null===(p=this.networkConfig)||void 0===p?void 0:p.body)?void 0:o.request)&&void 0!==(s=function(e){if(null!=e){if("string"==typeof e)return e;if(e instanceof URLSearchParams)return e.toString();if(e instanceof FormData){var t=[];return e.forEach(function(e,r){t.push("".concat(r,"=").concat("string"==typeof e?e:"[File]"))}),t.join("&")}}}(null==n?void 0:n.body))&&(a=null!==(f=o.maxBodySizeBytes)&&void 0!==f?f:10240,i.requestBody=bS(s,a).value),v.label=1;case 1:return v.trys.push([1,3,,4]),[4,r(t,n)];case 2:return l=v.sent(),d=Date.now(),i.status=l.status,i.duration=d-e,u={},l.headers.forEach(function(e,t){u[t]=e}),i.responseHeaders=u,(null==o?void 0:o.response)?!function(e){return!!e&&gS.some(function(t){return e.toLowerCase().startsWith(t)})}(u["content-type"]||null)?l.clone().text().then(function(e){var t,r=bS(e,null!==(t=o.maxBodySizeBytes)&&void 0!==t?t:10240),n=r.value,s=r.truncated;i.responseBody=n,i.responseBodyStatus=s?"truncated":"captured",g.notifyEvent(i)},function(){i.responseBodyStatus="error",g.notifyEvent(i)}):(i.responseBodyStatus="skipped_binary",this.notifyEvent(i)):this.notifyEvent(i),[2,l];case 3:throw c=v.sent(),d=Date.now(),i.duration=d-e,h=c,i.error={name:h.name||"UnknownError",message:h.message||"An unknown error occurred"},this.notifyEvent(i),c;case 4:return[2]}})})},this.fetchObserver=function(){t.fetch=r})}},e}()}}),qS=l({"../../../../node_modules/@amplitude/session-replay-browser/lib/esm/session-replay.js"(){Ne(),Ki(),To(),Ao(),Ji(),bo(),Vo(),qs(),zs(),sa(),Il(),Ol(),Qi(),Tl(),Jl(),ru(),Ho(),su(),uu(),wS=function(){function e(){var e=this;this.name="@amplitude/session-replay-browser",this.recordCancelCallback=null,this.eventCount=0,this.sessionTargetingMatch=!1,this.pageLeaveFns=[],this.suppressedSendCount=0,this.hasEmittedGateDecision=!1,this.recordFunction=null,this.recordEventsInFlight=!1,this.pendingEmitEvents=[],this.currentPageUrl="",this.recordEventsPendingShouldLogMetadata=null,this.urlChangeCleanup=null,this.crossOriginIframeCoordinator=null,this.crossOriginParentSignalCleanup=null,this.latestUrlChangeTargetingEvaluationId=0,this.teardownEventListeners=function(t){var r=de();r&&(r.removeEventListener("blur",e.blurListener),r.removeEventListener("focus",e.focusListener),!t&&r.addEventListener("blur",e.blurListener),!t&&r.addEventListener("focus",e.focusListener),r.self&&"onpagehide"in r.self?(r.removeEventListener("pagehide",e.pageLeaveListener),!t&&r.addEventListener("pagehide",e.pageLeaveListener)):(r.removeEventListener("beforeunload",e.pageLeaveListener),!t&&r.addEventListener("beforeunload",e.pageLeaveListener)))},this.blurListener=function(){e.sendEvents()},this.focusListener=function(){if(e.recordCancelCallback&&e.recordFunction)try{e.recordFunction.takeFullSnapshot(!0)}catch(t){e.loggerProvider.warn("Failed to take full snapshot on focus:",t)}else e.recordEventsInFlight||e.recordEvents(!1)},this.pageLeaveListener=function(t){var r;null===(r=e.eventCompressor)||void 0===r||r.flushQueue(),e.sendEvents(),e.pageLeaveFns.forEach(function(e){e(t)})},this.evaluateTargetingAndCapture=function(t,r,n,i){return void 0===r&&(r=!1),void 0===n&&(n=!1),void 0===i&&(i=!1),v(e,void 0,void 0,function(){var e,o,s,a,l,u,c,d,h,p,f,g;return m(this,function(v){switch(v.label){case 0:if(!this.identifiers||!this.identifiers.sessionId||!this.config)return this.identifiers&&!this.identifiers.sessionId?this.loggerProvider.log("Session ID has not been set yet, cannot evaluate targeting for Session Replay."):this.loggerProvider.warn("Session replay init has not been called, cannot evaluate targeting."),[2];if(!this.config.targetingConfig){if(!r)return this.loggerProvider.log("No targeting config set, skipping initialization/recording for event."),[2];this.loggerProvider.log("Targeting config has not been set yet, cannot evaluate targeting.")}return this.lastTargetingParams=t,e=this.config.targetingConfig,e&&!this.sessionTargetingMatch?(o=i?this.latestUrlChangeTargetingEvaluationId:void 0,(s=t.event)&&Object.values(E).includes(s.event_type)&&(s=void 0),a=null!==(f=null!==(d=null===(c=t.page)||void 0===c?void 0:c.url)&&void 0!==d?d:null===(p=null===(h=de())||void 0===h?void 0:h.location)||void 0===p?void 0:p.href)&&void 0!==f?f:"",l=null!==(g=t.page)&&void 0!==g?g:""!==a?{url:a}:void 0,[4,zl({sessionId:this.identifiers.sessionId,targetingConfig:e,loggerProvider:this.loggerProvider,apiKey:this.config.apiKey,targetingParams:{userProperties:t.userProperties,event:s,page:l},urlChange:i})]):[3,2];case 1:if(u=v.sent(),i&&void 0!==o&&o!==this.latestUrlChangeTargetingEvaluationId)return this.loggerProvider.debug("Ignoring stale URL-change targeting result #".concat(o,"; latest is #").concat(this.latestUrlChangeTargetingEvaluationId,".")),[2];this.sessionTargetingMatch=this.sessionTargetingMatch||u,this.loggerProvider.debug(JSON.stringify({name:"targeted replay capture config",sessionTargetingMatch:this.sessionTargetingMatch,event:s,targetingParams:t},null,2)),v.label=2;case 2:return r?(this.initialize(!0),[3,5]):[3,3];case 3:return!n&&this.recordCancelCallback?[3,5]:(this.loggerProvider.log("Recording events for session due to forceRestart or no ongoing recording."),[4,this.recordEvents()]);case 4:v.sent(),v.label=5;case 5:return[2]}})})},this.addCustomRRWebEvent=function(r,n,i){return void 0===n&&(n={}),void 0===i&&(i=!0),v(e,void 0,void 0,function(){var e,o,s,a;return m(this,function(l){switch(l.label){case 0:return l.trys.push([0,3,,4]),e=void 0,(o=this.config)&&r!==Wi.METADATA?(e={config:fo(o),version:qo},i?[4,po()]:[3,2]):[3,2];case 1:s=l.sent(),e=t(t({},s),e),l.label=2;case 2:return this.recordCancelCallback&&this.recordFunction?this.recordFunction.addCustomEvent(r,t(t({},n),e)):this.loggerProvider.debug("Not able to add custom replay capture event ".concat(r," due to no ongoing recording.")),[3,4];case 3:return a=l.sent(),this.loggerProvider.debug("Error while adding custom replay capture event: ",a),[3,4];case 4:return[2]}})})},this.stopRecordingEvents=function(){var t,r,n;try{e.loggerProvider.log("Session Replay capture stopping."),e.recordCancelCallback&&e.recordCancelCallback(),e.recordCancelCallback=null,null===(t=e.networkObservers)||void 0===t||t.stop(),null===(r=e.crossOriginIframeCoordinator)||void 0===r||r.stop(),e.crossOriginIframeCoordinator=null,null===(n=e.crossOriginParentSignalCleanup)||void 0===n||n.call(e),e.crossOriginParentSignalCleanup=null}catch(t){var i=t;e.loggerProvider.warn("Error occurred while stopping replay capture: ".concat(i.toString()))}},this.loggerProvider=new Hi(new Te)}return e.prototype.init=function(e,t){return Se(this._init(e,t))},e.prototype.setupUrlChangeListener=function(){var e,t,r=this;null===(e=this.urlChangeCleanup)||void 0===e||e.call(this);var n=de();if(null==n?void 0:n.location){var i=!!(null===(t=this.config)||void 0===t?void 0:t.targetingConfig),o=nu(n,function(e){if(r.currentPageUrl=e,i){var t=++r.latestUrlChangeTargetingEvaluationId;r.evaluateTargetingAndCapture({userProperties:{},event:void 0,page:{url:e}},!1,!1,!0),r.loggerProvider.debug("Queued URL-change targeting re-evaluation #".concat(t," for ").concat(e,"."))}});this.urlChangeCleanup=function(){o(),r.urlChangeCleanup=null}}},e.prototype.isBelowMinSessionDuration=function(){var e,t=null===(e=this.config)||void 0===e?void 0:e.minSessionDurationMs;return void 0!==t&&void 0!==this.sessionStartTime&&Date.now()-this.sessionStartTime<t},e.prototype.getCurrentPageForTargeting=function(){var e,t,r=null===(t=null===(e=de())||void 0===e?void 0:e.location)||void 0===t?void 0:t.href;return null!=r?{url:r}:void 0},e.prototype._init=function(e,r){var n,i,o,s,a,l,u,c,d,h,p,f,g,S;return v(this,void 0,void 0,function(){var v,E,k,x,C,I,O,T,A,_,R,P,M,N,L,D,j,U,F,B,q,z,V,W,H,$,G,K,J,Q,Y=this;return m(this,function(m){switch(m.label){case 0:return null===(n=this.urlChangeCleanup)||void 0===n||n.call(this),this.loggerProvider=new Hi(r.loggerProvider||new Te),Object.prototype.hasOwnProperty.call(r,"logLevel")&&this.loggerProvider.enable(r.logLevel),this.currentPageUrl=oo(),this.identifiers=new da({sessionId:r.sessionId,deviceId:r.deviceId}),v=Date.now(),ba(e,v,this.loggerProvider),this.sessionStartTime=void 0!==r.sessionId&&null!==(i=va(e,r.sessionId,v,this.loggerProvider))&&void 0!==i?i:v,E=this,[4,Io(e,r)];case 1:return E.joinedConfigGenerator=m.sent(),[4,this.joinedConfigGenerator.generateJoinedConfig()];case 2:return k=m.sent(),x=k.joinedConfig,C=k.localConfig,I=k.remoteConfig,this.config=x,this.setMetadata(r.sessionId,x,C,I,null===(o=r.version)||void 0===o?void 0:o.version,qo,null===(s=r.version)||void 0===s?void 0:s.type),this.pageLeaveFns=[],r.sessionId&&(null===(a=this.config.interactionConfig)||void 0===a?void 0:a.enabled)&&(O=ca.default({sessionId:r.sessionId,type:"interaction"},this.config),this.pageLeaveFns=[O.send(this.getDeviceId.bind(this)).bind(O)],this.scrollHook=O.hook.bind(O),this.clickHandler=new ia(this.loggerProvider,O)),T=[],"idb"!==(A=this.config.storeType)||(null===(l=de())||void 0===l?void 0:l.indexedDB)||(A="memory",this.loggerProvider.warn("Could not use preferred indexedDB storage, reverting to in memory option.")),this.loggerProvider.log("Using ".concat(A," for event storage.")),P=de(),this.config.useWebWorker&&P&&P.Worker?[4,Promise.resolve().then(()=>(bh(),cu))]:[3,4];case 3:M=m.sent(),N=M.compressionScript,L=M.trackDestinationScript,_=N,R=L,m.label=4;case 4:return m.trys.push([4,6,,7]),[4,Ns({config:this.config,type:"replay",minInterval:null===(u=this.config.flushIntervalConfig)||void 0===u?void 0:u.minIntervalMs,maxInterval:null===(c=this.config.flushIntervalConfig)||void 0===c?void 0:c.maxIntervalMs,storeType:A,trackDestinationWorkerScript:R,shouldSend:function(){return!Y.isBelowMinSessionDuration()}})];case 5:return D=m.sent(),this.rrwebEventManager=D,T.push({name:"replay",manager:D}),[3,7];case 6:return j=m.sent(),q=j,this.loggerProvider.warn("Error occurred while creating replay events manager: ".concat(q.toString())),[3,7];case 7:if(!(null===(d=this.config.interactionConfig)||void 0===d?void 0:d.enabled))return[3,11];U=this.config.interactionConfig.batch?na:ra,m.label=8;case 8:return m.trys.push([8,10,,11]),[4,Ns({config:this.config,type:"interaction",minInterval:null!==(h=this.config.interactionConfig.trackEveryNms)&&void 0!==h?h:_i,maxInterval:Ri,payloadBatcher:U,storeType:A,trackDestinationWorkerScript:R})];case 9:return F=m.sent(),T.push({name:"interaction",manager:F}),[3,11];case 10:return B=m.sent(),q=B,this.loggerProvider.warn("Error occurred while creating interaction events manager: ".concat(q.toString())),[3,11];case 11:if(this.eventsManager=new(Ls.bind.apply(Ls,w([void 0],b(T),!1))),this.eventCompressor&&this.eventCompressor.terminate(),this.eventCompressor=new Mo(this.eventsManager,this.config,this.getDeviceId(),_,function(){return Y.sendEvents()}),this.pendingEmitEvents.length>0){z=this.pendingEmitEvents.splice(0);try{for(V=y(z),W=V.next();!W.done;W=V.next())H=W.value,$=H.event,G=H.sessionId,this.eventCompressor.enqueueEvent($,G)}catch(e){J={error:e}}finally{try{W&&!W.done&&(Q=V.return)&&Q.call(V)}finally{if(J)throw J.error}}}return this.pageLeaveFns=w(w([],b(this.pageLeaveFns),!1),[function(){var e;if(Y.config&&(null===(e=Y.identifiers)||void 0===e?void 0:e.sessionId)&&D){var t=D.getBeaconEvents();if(t.length){var r=Y.getDeviceId();r&&(Y.isBelowMinSessionDuration()||D.trackDestination.sendBeacon({events:t,sessionId:Y.identifiers.sessionId,deviceId:r,apiKey:Y.config.apiKey,serverZone:Y.config.serverZone}))}}}],!1),[4,this.initializeNetworkObservers()];case 12:return m.sent(),(null===(p=de())||void 0===p?void 0:p.opener)&&(ci(K=ai()),K.setup(t({logger:this.loggerProvider},this.config.serverZone&&{endpoint:Jn[this.config.serverZone]}))),this.loggerProvider.log("Installing @amplitude/session-replay-browser."),this.teardownEventListeners(!1),[4,this.evaluateTargetingAndCapture({userProperties:r.userProperties,page:this.getCurrentPageForTargeting()},!0)];case 13:return m.sent(),(this.config.targetingConfig||(null!==(S=null===(g=null===(f=this.config.privacyConfig)||void 0===f?void 0:f.urlMaskLevels)||void 0===g?void 0:g.length)&&void 0!==S?S:0)>0)&&this.setupUrlChangeListener(),[2]}})})},e.prototype.setSessionId=function(e,t){return Se(this.asyncSetSessionId(e,t))},e.prototype.asyncSetSessionId=function(e,t,r){var n,i,o;return v(this,void 0,void 0,function(){var s,a,l,u;return m(this,function(c){switch(c.label){case 0:return this.latestUrlChangeTargetingEvaluationId++,this.sessionTargetingMatch=!1,this.lastShouldRecordDecision=void 0,(s=this.identifiers&&this.identifiers.sessionId)&&this.sendEvents(s),(a=s!==e)&&(null===(n=this.rrwebEventManager)||void 0===n||n.dropPendingBeaconEvents()),l=t||this.getDeviceId(),this.identifiers=new da({sessionId:e,deviceId:l}),a&&(this.sessionStartTime=Date.now(),this.suppressedSendCount=0,this.hasEmittedGateDecision=!1,(null===(i=this.config)||void 0===i?void 0:i.apiKey)&&(ma(this.config.apiKey,e,this.sessionStartTime,this.loggerProvider),void 0!==s&&ya(this.config.apiKey,s,this.loggerProvider))),this.joinedConfigGenerator&&s?[4,this.joinedConfigGenerator.generateJoinedConfig()]:[3,2];case 1:u=c.sent().joinedConfig,this.config=u,c.label=2;case 2:return(null===(o=this.config)||void 0===o?void 0:o.targetingConfig)?[4,this.evaluateTargetingAndCapture({userProperties:null==r?void 0:r.userProperties,page:this.getCurrentPageForTargeting()},!1,!0)]:[3,4];case 3:return c.sent(),[3,6];case 4:return[4,this.recordEvents()];case 5:c.sent(),c.label=6;case 6:return[2]}})})},e.prototype.getSessionReplayProperties=function(){var e,t=this.config,r=this.identifiers;if(!t||!r)return this.loggerProvider.warn("Session replay init has not been called, cannot get session replay properties."),{};var n=this.getShouldRecord(),i={};return n&&((e={})[gi]=r.sessionReplayId?r.sessionReplayId:null,i=e,t.debugMode&&(i[wi]=JSON.stringify({appHash:Nt(t.apiKey).toString()}))),this.addCustomRRWebEvent(Wi.GET_SR_PROPS,{shouldRecord:n,eventProperties:i},10===this.eventCount),10===this.eventCount&&(this.eventCount=0),this.eventCount++,i},e.prototype.sendEvents=function(e){var t,r,n=e||(null===(t=this.identifiers)||void 0===t?void 0:t.sessionId),i=this.getDeviceId();if(this.eventsManager&&n&&i){if(this.isBelowMinSessionDuration()){var o=this.sessionStartTime,s=this.config.minSessionDurationMs;return this.loggerProvider.log("Session ".concat(n," not sent: duration ").concat(Date.now()-o,"ms is below minimum ").concat(s,"ms.")),void this.suppressedSendCount++}if(!this.hasEmittedGateDecision&&void 0!==(null===(r=this.config)||void 0===r?void 0:r.minSessionDurationMs)&&this.recordCancelCallback&&this.recordFunction){this.hasEmittedGateDecision=!0;var a=void 0!==this.sessionStartTime?Date.now()-this.sessionStartTime:void 0;this.addCustomRRWebEvent(Wi.REPLAY_GATE_DECISION,{sessionId:n,suppressedSendCount:this.suppressedSendCount,elapsedMs:a,minSessionDurationMs:this.config.minSessionDurationMs},!1)}this.eventsManager.sendCurrentSequenceEvents({sessionId:n,deviceId:i})}},e.prototype.initialize=function(e){var t;return void 0===e&&(e=!1),v(this,void 0,void 0,function(){var r;return m(this,function(n){return(null===(t=this.identifiers)||void 0===t?void 0:t.sessionId)?(r=this.getDeviceId())?(this.eventsManager&&e&&this.eventsManager.sendStoredEvents({deviceId:r}),[2,this.recordEvents()]):(this.loggerProvider.log("Session is not being recorded due to lack of device id."),[2,Promise.resolve()]):(this.loggerProvider.log("Session is not being recorded due to lack of session id."),[2,Promise.resolve()])})})},e.prototype.shouldOptOut=function(){var e,t,r;(null===(e=this.config)||void 0===e?void 0:e.instanceName)&&(r=Et(this.config.instanceName).identityStore.getIdentity().optOut);return void 0!==r?r:null===(t=this.config)||void 0===t?void 0:t.optOut},e.prototype.getShouldRecord=function(){if(!this.identifiers||!this.config||!this.identifiers.sessionId)return this.loggerProvider.warn("Session is not being recorded due to lack of config, please call sessionReplay.init."),!1;if(!this.config.captureEnabled)return this.loggerProvider.log("Session ".concat(this.identifiers.sessionId," not being captured due to capture being disabled for project or because the remote config could not be fetched.")),!1;if(this.shouldOptOut())return this.loggerProvider.log("Opting session ".concat(this.identifiers.sessionId," out of recording due to optOut config.")),!1;var e,t,r=!1,n="",i=!1;this.config.targetingConfig?this.sessionTargetingMatch?(n="Capturing replays for session ".concat(this.identifiers.sessionId," due to matching targeting conditions."),this.loggerProvider.log(n),r=!0,i=!0):(n="Not capturing replays for session ".concat(this.identifiers.sessionId," due to not matching targeting conditions."),this.loggerProvider.log(n),r=!1,i=!1):(e=this.identifiers.sessionId,t=this.config.sampleRate,Zl(e.toString())%1e6/1e6<t)?(r=!0,i=!0):(n="Opting session ".concat(this.identifiers.sessionId," out of recording due to sample rate."),this.loggerProvider.log(n),r=!1,i=!1);return this.lastShouldRecordDecision!==r&&this.config.targetingConfig&&(this.addCustomRRWebEvent(Wi.TARGETING_DECISION,{message:n,sessionId:this.identifiers.sessionId,matched:i,targetingParams:this.lastTargetingParams}),this.lastShouldRecordDecision=r),r},e.prototype.getBlockSelectors=function(){var e,t,r,n=null!==(r=null===(t=null===(e=this.config)||void 0===e?void 0:e.privacyConfig)||void 0===t?void 0:t.blockSelector)&&void 0!==r?r:[];if(0!==n.length)return n},e.prototype.getMaskTextSelectors=function(){var e,t,r=null===(e=this.config)||void 0===e?void 0:e.privacyConfig;if("conservative"===(r?to(this.currentPageUrl,r):void 0))return"*";if(null===(t=null==r?void 0:r.urlMaskLevels)||void 0===t?void 0:t.some(function(e){return"conservative"===e.maskLevel}))return"*";var n=null==r?void 0:r.urlMaskLevels;if("conservative"===(null==r?void 0:r.defaultMaskLevel)&&n&&n.length>0)return"*";var i=null==r?void 0:r.maskSelector;return i||void 0},e.prototype.getRecordingPlugins=function(e){var t,r,n,i,o,s;return v(this,void 0,void 0,function(){var a,l,u,c;return m(this,function(d){switch(d.label){case 0:a=[];try{l=iu({ugcFilterRules:(null===(r=null===(t=this.config)||void 0===t?void 0:t.interactionConfig)||void 0===r?void 0:r.ugcFilterRules)||[],enablePolling:(null===(n=this.config)||void 0===n?void 0:n.enableUrlChangePolling)||!1,pollingInterval:null===(i=this.config)||void 0===i?void 0:i.urlChangePollingInterval,captureDocumentTitle:null===(o=this.config)||void 0===o?void 0:o.captureDocumentTitle}),a.push(l)}catch(e){this.loggerProvider.warn("Failed to create URL tracking plugin:",e)}if(!(null===(s=null==e?void 0:e.console)||void 0===s?void 0:s.enabled))return[3,4];d.label=1;case 1:return d.trys.push([1,3,,4]),[4,Promise.resolve().then(()=>(Iy(),wh))];case 2:return u=d.sent().getRecordConsolePlugin,a.push(u({level:e.console.levels})),[3,4];case 3:return c=d.sent(),this.loggerProvider.warn("Failed to load console plugin:",c),[3,4];case 4:return[2,a.length>0?a:void 0]}})})},e.prototype.getRecordFunction=function(){return v(this,void 0,void 0,function(){var e,t;return m(this,function(r){switch(r.label){case 0:if(this.recordFunction)return[2,this.recordFunction];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,Promise.resolve().then(()=>(mS(),Oy))];case 2:return e=r.sent().record,this.recordFunction=e,[2,e];case 3:return t=r.sent(),this.loggerProvider.warn("Failed to load rrweb-record module:",t),[2,null];case 4:return[2]}})})},e.prototype.recordEvents=function(e){return void 0===e&&(e=!0),v(this,void 0,void 0,function(){var t;return m(this,function(r){switch(r.label){case 0:if(this.recordEventsInFlight)return this.recordEventsPendingShouldLogMetadata=e,[2];this.recordEventsInFlight=!0,r.label=1;case 1:return r.trys.push([1,,6,7]),[4,this._recordEvents(e)];case 2:r.sent(),r.label=3;case 3:return null===this.recordEventsPendingShouldLogMetadata?[3,5]:(t=this.recordEventsPendingShouldLogMetadata,this.recordEventsPendingShouldLogMetadata=null,[4,this._recordEvents(t)]);case 4:return r.sent(),[3,3];case 5:return[3,7];case 6:return this.recordEventsInFlight=!1,this.recordEventsPendingShouldLogMetadata=null,[7];case 7:return[2]}})})},e.prototype._recordEvents=function(e){var r,n,i,o,s,a,l,u;return void 0===e&&(e=!0),v(this,void 0,void 0,function(){var c,d,h,p,f,g,v,y,b,w,S,E,k,x,C,I,O,T,A,_=this;return m(this,function(m){switch(m.label){case 0:return c=this.config,d=this.getShouldRecord(),h=null===(r=this.identifiers)||void 0===r?void 0:r.sessionId,d&&h&&c?(this.stopRecordingEvents(),[4,this.getRecordFunction()]):[2];case 1:return(p=m.sent())?[4,this.initializeNetworkObservers()]:[2];case 2:m.sent(),f=null===(n=c.loggingConfig)||void 0===n?void 0:n.network,g=Zi(c.serverZone,c.trackServerUrl),v=[xi,Ci,Ii,g],null===(i=this.networkObservers)||void 0===i||i.start(function(e){v.some(function(t){return e.url.startsWith(t)})||_.addCustomRRWebEvent(Wi.FETCH_REQUEST,e)},f),y=c.interactionConfig,b=c.loggingConfig,w=(null==y?void 0:y.enabled)?{mouseInteraction:this.eventsManager&&(null===(o=this.clickHandler)||void 0===o?void 0:o.createHook({eventsManager:this.eventsManager,sessionId:h,deviceIdFn:this.getDeviceId.bind(this),mirror:p.mirror,ugcFilterRules:null!==(s=y.ugcFilterRules)&&void 0!==s?s:[],performanceOptions:null===(a=c.performanceConfig)||void 0===a?void 0:a.interaction})),scroll:this.scrollHook}:{},S=(null==y?void 0:y.enabled)&&y.ugcFilterRules?y.ugcFilterRules:[],this.loggerProvider.log("Session Replay capture beginning for ".concat(h,".")),m.label=3;case 3:return m.trys.push([3,5,,6]),E=!!(null===(l=c.crossOriginIframes)||void 0===l?void 0:l.enabled),k=!1!==(null===(u=c.crossOriginIframes)||void 0===u?void 0:u.coordinateChildren),(x=E&&function(){try{var e=de();return!!e&&e.parent!==e}catch(e){return!0}}())&&k?(this.crossOriginParentSignalCleanup=function(e){var t=de();if(!t)return function(){};var r=t.parent;function n(t){if(t.source===r){var n=t.data;(null==n?void 0:n.type)===Vi&&("start"===n.action?e.onStart():"stop"===n.action&&e.onStop())}}return t.addEventListener("message",n),function(){return t.removeEventListener("message",n)}}({onStart:function(){return _._recordEventsInChildMode(p,h,c,w)},onStop:function(){try{_.recordCancelCallback&&_.recordCancelCallback(),_.recordCancelCallback=null}catch(t){var e=t;_.loggerProvider.warn("Error occurred while stopping child iframe replay capture: ".concat(e.toString()))}}}),[2]):(C=this,I=p,O=[t({},this.buildRRWebRecordOptions(c,w,function(e){if(_.shouldOptOut())return _.loggerProvider.log("Opting session ".concat(h," out of recording due to optOut config.")),_.stopRecordingEvents(),void _.sendEvents();e.type===wo.Meta&&(e.data.href=ho(e.data.href,S)),_.eventCompressor?_.eventCompressor.enqueueEvent(e,h):_.pendingEmitEvents.push({event:e,sessionId:h})},"Error while capturing replay: "))],A={},[4,this.getRecordingPlugins(b)]);case 4:return C.recordCancelCallback=I.apply(void 0,[t.apply(void 0,O.concat([(A.plugins=m.sent(),A.recordCrossOriginIframes=E,A)]))]),E&&!x&&k&&(this.crossOriginIframeCoordinator||(this.crossOriginIframeCoordinator=new ou),this.crossOriginIframeCoordinator.start()),this.addCustomRRWebEvent(Wi.DEBUG_INFO),e&&this.addCustomRRWebEvent(Wi.METADATA,this.metadata),[3,6];case 5:return T=m.sent(),this.loggerProvider.warn("Failed to initialize session replay:",T),[3,6];case 6:return[2]}})})},e.prototype.buildRRWebRecordOptions=function(e,r,n,i){var o=this,s=e.privacyConfig;return t(t({emit:n,inlineStylesheet:e.shouldInlineStylesheet,hooks:r,maskAllInputs:!0,maskTextClass:Ei,blockClass:Si,blockSelector:this.getBlockSelectors(),applyBackgroundColorToBlockedElements:e.applyBackgroundColorToBlockedElements,maskInputFn:no("input",s,function(){return o.currentPageUrl}),maskTextFn:no("text",s,function(){return o.currentPageUrl}),maskAttributeFn:io(s,function(){return o.currentPageUrl}),maskTextSelector:this.getMaskTextSelectors()},void 0!==e.fullSnapshotIntervalMs&&{checkoutEveryNms:e.fullSnapshotIntervalMs}),{recordCanvas:!1,captureAdoptedStyleSheets:e.captureAdoptedStyleSheets,slimDOMOptions:{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0},errorHandler:function(e){var t=e;if(t.message.includes("insertRule")&&t.message.includes("CSSStyleSheet"))throw t;if(t._external_)throw t;return o.loggerProvider.warn(i,t.toString()),!0}})},e.prototype._recordEventsInChildMode=function(e,r,n,i){try{this.recordCancelCallback&&this.recordCancelCallback(),this.recordCancelCallback=null,this.recordCancelCallback=e(t(t({},this.buildRRWebRecordOptions(n,i,function(){},"Error while capturing replay (child iframe): ")),{recordCrossOriginIframes:!0})),this.loggerProvider.log("Session Replay child iframe capture beginning for session ".concat(r,"."))}catch(e){this.loggerProvider.warn("Failed to initialize session replay in child iframe mode:",e)}},e.prototype.getDeviceId=function(){var e;return null===(e=this.identifiers)||void 0===e?void 0:e.deviceId},e.prototype.getSessionId=function(){var e;return null===(e=this.identifiers)||void 0===e?void 0:e.sessionId},e.prototype.flush=function(e){var t;return void 0===e&&(e=!1),v(this,void 0,void 0,function(){return m(this,function(r){return[2,null===(t=this.eventsManager)||void 0===t?void 0:t.flush(e)]})})},e.prototype.shutdown=function(){var e,t;null===(e=this.urlChangeCleanup)||void 0===e||e.call(this),null===(t=this.crossOriginParentSignalCleanup)||void 0===t||t.call(this),this.crossOriginParentSignalCleanup=null,this.teardownEventListeners(!0),this.stopRecordingEvents(),this.sendEvents()},e.prototype.mapSDKType=function(e){return"plugin"===e?"@amplitude/plugin-session-replay-browser":"segment"===e?"@amplitude/segment-session-replay-plugin":null},e.prototype.setMetadata=function(e,t,r,n,i,o,s){var a=(null==e?void 0:e.toString())?Nt(e.toString()):void 0;this.metadata={joinedConfig:t,localConfig:r,remoteConfig:n,sessionId:e,hashValue:a,sampleRate:t.sampleRate,replaySDKType:this.mapSDKType(s),replaySDKVersion:i,standaloneSDKType:"@amplitude/session-replay-browser",standaloneSDKVersion:o}},e.prototype.initializeNetworkObservers=function(){var e,t,r;return v(this,void 0,void 0,function(){var n,i;return m(this,function(o){switch(o.label){case 0:if(!(null===(r=null===(t=null===(e=this.config)||void 0===e?void 0:e.loggingConfig)||void 0===t?void 0:t.network)||void 0===r?void 0:r.enabled)||this.networkObservers)return[3,4];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,Promise.resolve().then(()=>(BS(),yS))];case 2:return n=o.sent().NetworkObservers,this.networkObservers=new n,[3,4];case 3:return i=o.sent(),this.loggerProvider.warn("Failed to import or instantiate NetworkObservers:",i),[3,4];case 4:return[2]}})})},e}()}}),zS=l({"../../../../node_modules/@amplitude/session-replay-browser/lib/esm/session-replay-factory.js"(){Ki(),Oo(),qS(),SS=function(e){return function(){var t=e.config||go();return{logger:t.loggerProvider,logLevel:t.logLevel}}},ES=function(){var e=new wS;return{init:it(e.init.bind(e),"init",SS(e)),evaluateTargetingAndCapture:it(e.evaluateTargetingAndCapture.bind(e),"evaluateTargetingAndRecord",SS(e)),setSessionId:it(e.setSessionId.bind(e),"setSessionId",SS(e)),getSessionId:it(e.getSessionId.bind(e),"getSessionId",SS(e)),getSessionReplayProperties:it(e.getSessionReplayProperties.bind(e),"getSessionReplayProperties",SS(e)),flush:it(e.flush.bind(e),"flush",SS(e)),shutdown:it(e.shutdown.bind(e),"shutdown",SS(e))}}()}}),VS=l({"../../../../node_modules/@amplitude/session-replay-browser/lib/esm/index.js"(){zS(),kS=ES.init,xS=ES.setSessionId,CS=ES.getSessionId,IS=ES.getSessionReplayProperties,OS=ES.flush,TS=ES.shutdown,AS=ES.evaluateTargetingAndCapture}}),WS=l({"../../../../node_modules/@amplitude/analytics-client-common/lib/esm/analytics-connector.js"(){sr(),_S=function(e){return void 0===e&&(e="$default_instance"),yt.getInstance(e)}}}),HS=l({"../../../../node_modules/@amplitude/analytics-client-common/lib/esm/index.js"(){WS()}}),$S=l({"../../../../node_modules/@amplitude/plugin-session-replay-browser/node_modules/@amplitude/analytics-types/lib/esm/event.js"(){var e,t,r;(e=RS||(RS={})).SET="$set",e.SET_ONCE="$setOnce",e.ADD="$add",e.APPEND="$append",e.PREPEND="$prepend",e.REMOVE="$remove",e.PREINSERT="$preInsert",e.POSTINSERT="$postInsert",e.UNSET="$unset",e.CLEAR_ALL="$clearAll",(t=PS||(PS={})).REVENUE_PRODUCT_ID="$productId",t.REVENUE_QUANTITY="$quantity",t.REVENUE_PRICE="$price",t.REVENUE_TYPE="$revenueType",t.REVENUE_CURRENCY="$currency",t.REVENUE="$revenue",(r=MS||(MS={})).IDENTIFY="$identify",r.GROUP_IDENTIFY="$groupidentify",r.REVENUE="revenue_amount"}}),GS=l({"../../../../node_modules/@amplitude/plugin-session-replay-browser/node_modules/@amplitude/analytics-types/lib/esm/index.js"(){$S()}}),KS=l({"../../../../node_modules/@amplitude/plugin-session-replay-browser/lib/esm/constants.js"(){GS(),NS=[RS.SET,RS.SET_ONCE,RS.ADD,RS.APPEND,RS.PREPEND,RS.POSTINSERT]}}),JS=l({"../../../../node_modules/@amplitude/plugin-session-replay-browser/lib/esm/helpers.js"(){Ne(),KS(),LS=function(e){if(e.user_properties){var r={};return Object.keys(e.user_properties).forEach(function(n){if(NS.includes(n)){var i=e.user_properties&&e.user_properties[n];r=t(t({},r),i)}}),r}}}}),QS=l({"../../../../node_modules/@amplitude/plugin-session-replay-browser/lib/esm/version.js"(){DS="1.31.0"}}),YS=l({"../../../../node_modules/@amplitude/plugin-session-replay-browser/lib/esm/session-replay.js"(){Ne(),Ki(),VS(),HS(),JS(),QS(),jS="".concat("[Amplitude]"," Session Replay ID"),US=function(){function e(r){this.name=e.pluginName,this.type="enrichment",this.config=null,this.sessionReplay={flush:OS,getSessionId:CS,getSessionReplayProperties:IS,init:kS,setSessionId:xS,shutdown:TS,evaluateTargetingAndCapture:AS},this.options=t({forceSessionTracking:!1},r),this.srInitOptions=this.options}return e.prototype.setup=function(e,r){var n,i,o,s,a,l,u,c;return v(this,void 0,void 0,function(){var r,d,h;return m(this,function(p){switch(p.label){case 0:return p.trys.push([0,2,,3]),null==e||e.loggerProvider.log("Installing @amplitude/plugin-session-replay, version ".concat(DS,".")),this.config=e,this.options.forceSessionTracking&&("boolean"==typeof e.defaultTracking?!1===e.defaultTracking&&(e.defaultTracking={pageViews:!1,formInteractions:!1,fileDownloads:!1,sessions:!0}):e.defaultTracking=t(t({},e.defaultTracking),{sessions:!0})),r=_S(this.config.instanceName).identityStore,d=r.getIdentity().userProperties,this.srInitOptions={instanceName:this.config.instanceName,deviceId:null!==(n=this.options.deviceId)&&void 0!==n?n:this.config.deviceId,optOut:this.config.optOut,sessionId:this.options.customSessionId?void 0:this.config.sessionId,loggerProvider:this.config.loggerProvider,logLevel:this.config.logLevel,flushMaxRetries:this.config.flushMaxRetries,serverZone:this.config.serverZone,configServerUrl:this.options.configServerUrl||(null===(i=this.config.remoteConfig)||void 0===i?void 0:i.serverUrl),trackServerUrl:this.options.trackServerUrl,sampleRate:this.options.sampleRate,privacyConfig:{blockSelector:null===(o=this.options.privacyConfig)||void 0===o?void 0:o.blockSelector,maskSelector:null===(s=this.options.privacyConfig)||void 0===s?void 0:s.maskSelector,unmaskSelector:null===(a=this.options.privacyConfig)||void 0===a?void 0:a.unmaskSelector,defaultMaskLevel:null===(l=this.options.privacyConfig)||void 0===l?void 0:l.defaultMaskLevel},debugMode:this.options.debugMode,shouldInlineStylesheet:this.options.shouldInlineStylesheet,version:{type:"plugin",version:DS},performanceConfig:this.options.performanceConfig,storeType:this.options.storeType,useWebWorker:null!==(u=this.options.useWebWorker)&&void 0!==u?u:null===(c=this.options.experimental)||void 0===c?void 0:c.useWebWorker,userProperties:d,applyBackgroundColorToBlockedElements:this.options.applyBackgroundColorToBlockedElements,interactionConfig:this.options.interactionConfig,captureDocumentTitle:this.options.captureDocumentTitle,enableUrlChangePolling:this.options.enableUrlChangePolling,urlChangePollingInterval:this.options.urlChangePollingInterval,captureAdoptedStyleSheets:this.options.captureAdoptedStyleSheets,crossOriginIframes:this.options.crossOriginIframes,flushIntervalConfig:this.options.flushIntervalConfig},[4,this.sessionReplay.init(e.apiKey,this.srInitOptions).promise];case 1:return p.sent(),[3,3];case 2:return h=p.sent(),null==e||e.loggerProvider.error("Session Replay: Failed to initialize due to ".concat(h.message)),[3,3];case 3:return[2]}})})},e.prototype.onSessionIdChanged=function(e){var t;return v(this,void 0,void 0,function(){return m(this,function(r){switch(r.label){case 0:return null===(t=this.config)||void 0===t||t.loggerProvider.debug("Analytics session id is changed to ".concat(e,", SR session id is ").concat(String(this.sessionReplay.getSessionId()),".")),[4,this.sessionReplay.setSessionId(e).promise];case 1:return r.sent(),[2]}})})},e.prototype.onOptOutChanged=function(e){var t;return v(this,void 0,void 0,function(){return m(this,function(r){switch(r.label){case 0:return null===(t=this.config)||void 0===t||t.loggerProvider.debug("optOut is changed to ".concat(String(e),", calling ").concat(e?"sessionReplay.shutdown()":"sessionReplay.init()",".")),e?(this.sessionReplay.shutdown(),[3,4]):[3,1];case 1:return null!=this.config?[4,this.sessionReplay.init(this.config.apiKey,this.srInitOptions).promise]:[3,3];case 2:r.sent(),r.label=3;case 3:r.label=4;case 4:return[2]}})})},e.prototype.execute=function(e){var r,n,i;return v(this,void 0,void 0,function(){var o,s,a,l,u;return m(this,function(c){switch(c.label){case 0:return c.trys.push([0,9,,10]),this.options.customSessionId?(o=this.options.customSessionId(e))?o===this.sessionReplay.getSessionId()?[3,2]:[4,this.sessionReplay.setSessionId(o).promise]:[3,3]:[3,4];case 1:c.sent(),c.label=2;case 2:l=this.sessionReplay.getSessionReplayProperties(),e.event_properties=t(t({},e.event_properties),l),c.label=3;case 3:return[3,8];case 4:return(o=null===(r=this.config)||void 0===r?void 0:r.sessionId)&&o!==this.sessionReplay.getSessionId()?[4,this.sessionReplay.setSessionId(o).promise]:[3,6];case 5:c.sent(),c.label=6;case 6:return o&&o===e.session_id?(s=void 0,e.event_type===E.IDENTIFY&&(s=LS(e)),a=de(),[4,this.sessionReplay.evaluateTargetingAndCapture({event:e,userProperties:s,page:null!=(null===(n=null==a?void 0:a.location)||void 0===n?void 0:n.href)?{url:a.location.href}:void 0})]):[3,8];case 7:c.sent(),l=this.sessionReplay.getSessionReplayProperties(),e.event_properties=t(t({},e.event_properties),l),c.label=8;case 8:return e.event_type===E.IDENTIFY&&e.event_properties&&delete e.event_properties[jS],[2,Promise.resolve(e)];case 9:return u=c.sent(),null===(i=this.config)||void 0===i||i.loggerProvider.error("Session Replay: Failed to enrich event due to ".concat(u.message)),[2,Promise.resolve(e)];case 10:return[2]}})})},e.prototype.teardown=function(){var e;return v(this,void 0,void 0,function(){return m(this,function(t){try{this.sessionReplay.shutdown(),this.config=null}catch(t){null===(e=this.config)||void 0===e||e.loggerProvider.error("Session Replay: teardown failed due to ".concat(t.message))}return[2]})})},e.prototype.getSessionReplayProperties=function(){return this.sessionReplay.getSessionReplayProperties()},e.pluginName="@amplitude/plugin-session-replay-browser",e}(),FS=function(e){return new US(e)}}}),XS={};c(XS,{SessionReplayPlugin:()=>US,plugin:()=>FS,sessionReplayPlugin:()=>FS});var ZS,eE,tE,rE,nE,iE,oE,sE,aE,lE,uE,cE,dE,hE,pE,fE,gE,vE,mE,yE,bE,wE,SE,EE,kE,xE,CE,IE,OE,TE,AE,_E,RE,PE,ME,NE,LE,DE,jE,UE,FE,BE,qE,zE,VE,WE,HE,$E,GE,KE,JE,QE,YE,XE,ZE,ek,tk,rk,nk,ik,ok,sk,ak,lk=l({"../../../../node_modules/@amplitude/plugin-session-replay-browser/lib/esm/index.js"(){YS()}});function uk(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}ZS(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}function ck(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})}function dk(e,t){var r,n,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(l){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}function hk(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function pk(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}function fk(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}var gk,vk,mk,yk,bk,wk,Sk,Ek,kk,xk,Ck,Ik,Ok,Tk,Ak,_k,Rk,Pk,Mk,Nk,Lk,Dk,jk,Uk,Fk,Bk,qk,zk,Vk,Wk,Hk,$k,Gk,Kk,Jk,Qk,Yk,Xk,Zk,ex,tx,rx,nx,ix,ox,sx,ax,lx,ux,cx,dx,hx=l({"../../../../node_modules/@amplitude/experiment-core/dist/experiment-core.esm.js"(){ZS=function(e,t){return(ZS=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},eE=function(){return eE=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},eE.apply(this,arguments)},tE={IS:"is",IS_NOT:"is not",CONTAINS:"contains",DOES_NOT_CONTAIN:"does not contain",LESS_THAN:"less",LESS_THAN_EQUALS:"less or equal",GREATER_THAN:"greater",GREATER_THAN_EQUALS:"greater or equal",VERSION_LESS_THAN:"version less",VERSION_LESS_THAN_EQUALS:"version less or equal",VERSION_GREATER_THAN:"version greater",VERSION_GREATER_THAN_EQUALS:"version greater or equal",SET_IS:"set is",SET_IS_NOT:"set is not",SET_CONTAINS:"set contains",SET_DOES_NOT_CONTAIN:"set does not contain",SET_CONTAINS_ANY:"set contains any",SET_DOES_NOT_CONTAIN_ANY:"set does not contain any",REGEX_MATCH:"regex match",REGEX_DOES_NOT_MATCH:"regex does not match"},rE=function(e){for(var t=[],r=0,n=0;n<e.length;n++){var i=e.charCodeAt(n);i<128?t[r++]=i:i<2048?(t[r++]=i>>6|192,t[r++]=63&i|128):55296==(64512&i)&&n+1<e.length&&56320==(64512&e.charCodeAt(n+1))?(i=65536+((1023&i)<<10)+(1023&e.charCodeAt(++n)),t[r++]=i>>18|240,t[r++]=i>>12&63|128,t[r++]=i>>6&63|128,t[r++]=63&i|128):(t[r++]=i>>12|224,t[r++]=i>>6&63|128,t[r++]=63&i|128)}return Uint8Array.from(t)},nE=-862048943,iE=461845907,oE=function(e,t){void 0===t&&(t=0);for(var r=rE(e),n=r.length,i=n>>2,o=t,s=0;s<i;s++){var a=uE(r,s<<2);o=sE(a,o)}var l=i<<2,u=0;switch(n-l){case 3:u^=r[l+2]<<16,u^=r[l+1]<<8,u^=r[l],u=Math.imul(u,nE),u=lE(u,15),o^=u=Math.imul(u,iE);break;case 2:u^=r[l+1]<<8,u^=r[l],u=Math.imul(u,nE),u=lE(u,15),o^=u=Math.imul(u,iE);break;case 1:u^=r[l],u=Math.imul(u,nE),u=lE(u,15),o^=u=Math.imul(u,iE)}return aE(o^=n)>>>0},sE=function(e,t){var r=e,n=t;return r=Math.imul(r,nE),r=lE(r,15),r=Math.imul(r,iE),n=lE(n^=r,13),(n=Math.imul(n,5))+-430675100|0},aE=function(e){var t=e;return t^=t>>>16,t=Math.imul(t,-2048144789),t^=t>>>13,t=Math.imul(t,-1028477387),t^=t>>>16},lE=function(e,t,r){return void 0===r&&(r=32),t>r&&(t%=r),(e<<t|(e&4294967295<<r-t>>>0)>>>0>>>r-t>>>0)>>>0},uE=function(e,t){void 0===t&&(t=0);var r=e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3];return cE(r)},cE=function(e){return(-16777216&e)>>>24|(16711680&e)>>>8|(65280&e)<<8|(255&e)<<24},dE=function(e,t){var r,n;if(t&&0!==t.length){try{for(var i=hk(t),o=i.next();!o.done;o=i.next()){var s=o.value;if(!s||!e||"object"!=typeof e)return;e=e[s]}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return null==e?void 0:e}},hE="^".concat("(\\d+)\\.(\\d+)","(\\.").concat("(\\d+)").concat("(-(([-\\w]+\\.?)*))?",")?$"),pE=function(){function e(e,t,r,n){void 0===n&&(n=void 0),this.major=e,this.minor=t,this.patch=r,this.preRelease=n}return e.parse=function(t){if(t){var r=new RegExp(hE).exec(t);if(r){var n=Number(r[1]),i=Number(r[2]);if(!isNaN(n)&&!isNaN(i))return new e(n,i,Number(r[4])||0,r[5]||void 0)}}},e.prototype.compareTo=function(e){return this.major>e.major?1:this.major<e.major?-1:this.minor>e.minor?1:this.minor<e.minor?-1:this.patch>e.patch?1:this.patch<e.patch||this.preRelease&&!e.preRelease?-1:!this.preRelease&&e.preRelease?1:this.preRelease&&e.preRelease?this.preRelease>e.preRelease?1:this.preRelease<e.preRelease?-1:0:0},e}(),fE=function(){function e(){}return e.prototype.evaluate=function(e,t){var r,n,i={},o={context:e,result:i};try{for(var s=hk(t),a=s.next();!a.done;a=s.next()){var l=a.value,u=this.evaluateFlag(o,l);u&&(i[l.key]=u)}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return i},e.prototype.evaluateWithTraces=function(e,t){var r,n,i={},o={},s={context:e,result:i};try{for(var a=hk(t),l=a.next();!l.done;l=a.next()){var u=l.value,c=this.evaluateFlagWithTrace(s,u),d=c.variant,h=c.trace;d&&(i[u.key]=d),o[u.key]=h}}catch(e){r={error:e}}finally{try{l&&!l.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return{results:i,traces:o}},e.prototype.evaluateFlag=function(e,t){var r,n,i;try{for(var o=hk(t.segments),s=o.next();!s.done;s=o.next()){var a=s.value;if(i=this.evaluateSegment(e,t,a)){var l=eE(eE(eE({},t.metadata),a.metadata),i.metadata);i=eE(eE({},i),{metadata:l});break}}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return i},e.prototype.evaluateFlagWithTrace=function(e,t){var r,n,i,o,s,a,l,u,c,d,h,p=[];try{for(var f=hk(t.segments),g=f.next();!g.done;g=f.next()){var v=g.value;if(v.conditions){var m=[],y=!1;try{for(var b=(i=void 0,hk(v.conditions)),w=b.next();!w.done;w=b.next()){var S=w.value,E=!0,k=[];try{for(var x=(s=void 0,hk(S)),C=x.next();!C.done;C=x.next()){var I=C.value,O=dE(e,I.selector),T=this.matchCondition(e,I);if(k.push({propValue:O,condition:I,matched:T}),!T){E=!1;break}}}catch(e){s={error:e}}finally{try{C&&!C.done&&(a=x.return)&&a.call(x)}finally{if(s)throw s.error}}if(m.push(k),E){y=!0;break}}}catch(e){i={error:e}}finally{try{w&&!w.done&&(o=b.return)&&o.call(b)}finally{if(i)throw i.error}}var A=!1,_=void 0;y&&(A=void 0!==(_=this.bucket(e,v))),p.push({segmentMetadata:v.metadata,conditionsPassed:y,bucketed:A,bucketVariant:_,conditionResult:m,matched:y&&A}),y&&void 0!==_&&!c&&(c=t.variants[_],d=v,h=null===(u=v.metadata)||void 0===u?void 0:u.segmentName)}else{var R=this.bucket(e,v),P=void 0!==R;p.push({segmentMetadata:v.metadata,conditionsPassed:!0,bucketed:P,bucketVariant:R,conditionResult:void 0,matched:P}),c||void 0===R||(c=t.variants[R],d=v,h=null===(l=v.metadata)||void 0===l?void 0:l.segmentName)}}}catch(e){r={error:e}}finally{try{g&&!g.done&&(n=f.return)&&n.call(f)}finally{if(r)throw r.error}}if(c&&d){var M=eE(eE(eE({},t.metadata),d.metadata),c.metadata);c=eE(eE({},c),{metadata:M})}return{variant:c,trace:{flagKey:t.key,matched:void 0!==c,matchedSegment:h,steps:p}}},e.prototype.evaluateSegment=function(e,t,r){var n;return r.conditions?this.evaluateConditions(e,r.conditions)&&void 0!==(n=this.bucket(e,r))?t.variants[n]:void 0:void 0!==(n=this.bucket(e,r))?t.variants[n]:void 0},e.prototype.evaluateConditions=function(e,t){var r,n,i,o;try{for(var s=hk(t),a=s.next();!a.done;a=s.next()){var l=a.value,u=!0;try{for(var c=(i=void 0,hk(l)),d=c.next();!d.done;d=c.next()){var h=d.value;if(!(u=this.matchCondition(e,h)))break}}catch(e){i={error:e}}finally{try{d&&!d.done&&(o=c.return)&&o.call(c)}finally{if(i)throw i.error}}if(u)return!0}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return!1},e.prototype.matchCondition=function(e,t){var r=dE(e,t.selector);if(null==r)return this.matchNull(t.op,t.values);var n=this.coerceStringArray(r);if(this.isSetOperator(t.op))return!!n&&this.matchSet(n,t.op,t.values);if(n)return this.matchStringsNonSet(n,t.op,t.values);var i=this.coerceString(r);return void 0!==i&&this.matchString(i,t.op,t.values)},e.prototype.getHash=function(e){return oE(e)},e.prototype.bucket=function(e,t){var r,n,i,o;if(!t.bucket)return t.variant;var s=this.coerceString(dE(e,t.bucket.selector));if(!s||0===s.length)return t.variant;var a="".concat(t.bucket.salt,"/").concat(s),l=this.getHash(a),u=l%100,c=Math.floor(l/100);try{for(var d=hk(t.bucket.allocations),h=d.next();!h.done;h=d.next()){var p=h.value,f=p.range[0],g=p.range[1];if(u>=f&&u<g)try{for(var v=(i=void 0,hk(p.distributions)),m=v.next();!m.done;m=v.next()){var y=m.value,b=y.range[0],w=y.range[1];if(c>=b&&c<w)return y.variant}}catch(e){i={error:e}}finally{try{m&&!m.done&&(o=v.return)&&o.call(v)}finally{if(i)throw i.error}}}}catch(e){r={error:e}}finally{try{h&&!h.done&&(n=d.return)&&n.call(d)}finally{if(r)throw r.error}}return t.variant},e.prototype.matchNull=function(e,t){var r=this.containsNone(t);switch(e){case tE.IS:case tE.CONTAINS:case tE.LESS_THAN:case tE.LESS_THAN_EQUALS:case tE.GREATER_THAN:case tE.GREATER_THAN_EQUALS:case tE.VERSION_LESS_THAN:case tE.VERSION_LESS_THAN_EQUALS:case tE.VERSION_GREATER_THAN:case tE.VERSION_GREATER_THAN_EQUALS:case tE.SET_IS:case tE.SET_CONTAINS:case tE.SET_CONTAINS_ANY:return r;case tE.IS_NOT:case tE.DOES_NOT_CONTAIN:case tE.SET_DOES_NOT_CONTAIN:case tE.SET_DOES_NOT_CONTAIN_ANY:return!r;default:return!1}},e.prototype.matchSet=function(e,t,r){switch(t){case tE.SET_IS:return this.setEquals(e,r);case tE.SET_IS_NOT:return!this.setEquals(e,r);case tE.SET_CONTAINS:return this.matchesSetContainsAll(e,r);case tE.SET_DOES_NOT_CONTAIN:return!this.matchesSetContainsAll(e,r);case tE.SET_CONTAINS_ANY:return this.matchesSetContainsAny(e,r);case tE.SET_DOES_NOT_CONTAIN_ANY:return!this.matchesSetContainsAny(e,r);default:return!1}},e.prototype.matchString=function(e,t,r){var n=this;switch(t){case tE.IS:return this.matchesIs(e,r);case tE.IS_NOT:return!this.matchesIs(e,r);case tE.CONTAINS:return this.matchesContains(e,r);case tE.DOES_NOT_CONTAIN:return!this.matchesContains(e,r);case tE.LESS_THAN:case tE.LESS_THAN_EQUALS:case tE.GREATER_THAN:case tE.GREATER_THAN_EQUALS:return this.matchesComparable(e,t,r,function(e){return n.parseNumber(e)},this.comparator);case tE.VERSION_LESS_THAN:case tE.VERSION_LESS_THAN_EQUALS:case tE.VERSION_GREATER_THAN:case tE.VERSION_GREATER_THAN_EQUALS:return this.matchesComparable(e,t,r,function(e){return pE.parse(e)},this.versionComparator);case tE.REGEX_MATCH:return this.matchesRegex(e,r);case tE.REGEX_DOES_NOT_MATCH:return!this.matchesRegex(e,r);default:return!1}},e.prototype.matchStringsNonSet=function(e,t,r){var n=this;return e.some(function(e){return n.matchString(e,t,r)})},e.prototype.matchesIs=function(e,t){if(this.containsBooleans(t)){var r=e.toLowerCase();if("true"===r||"false"===r)return t.some(function(e){return e.toLowerCase()===r})}return t.some(function(t){return e===t})},e.prototype.matchesContains=function(e,t){var r,n;try{for(var i=hk(t),o=i.next();!o.done;o=i.next()){var s=o.value;if(e.toLowerCase().includes(s.toLowerCase()))return!0}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return!1},e.prototype.matchesComparable=function(e,t,r,n,i){var o=this,s=n(e),a=r.map(function(e){return n(e)}).filter(function(e){return void 0!==e});return void 0===s||0===a.length?r.some(function(r){return o.comparator(e,t,r)}):a.some(function(e){return i(s,t,e)})},e.prototype.comparator=function(e,t,r){switch(t){case tE.LESS_THAN:case tE.VERSION_LESS_THAN:return e<r;case tE.LESS_THAN_EQUALS:case tE.VERSION_LESS_THAN_EQUALS:return e<=r;case tE.GREATER_THAN:case tE.VERSION_GREATER_THAN:return e>r;case tE.GREATER_THAN_EQUALS:case tE.VERSION_GREATER_THAN_EQUALS:return e>=r;default:return!1}},e.prototype.versionComparator=function(e,t,r){var n=e.compareTo(r);switch(t){case tE.LESS_THAN:case tE.VERSION_LESS_THAN:return n<0;case tE.LESS_THAN_EQUALS:case tE.VERSION_LESS_THAN_EQUALS:return n<=0;case tE.GREATER_THAN:case tE.VERSION_GREATER_THAN:return n>0;case tE.GREATER_THAN_EQUALS:case tE.VERSION_GREATER_THAN_EQUALS:return n>=0;default:return!1}},e.prototype.matchesRegex=function(e,t){return t.some(function(t){return Boolean(new RegExp(t).exec(e))})},e.prototype.containsNone=function(e){return e.some(function(e){return"(none)"===e})},e.prototype.containsBooleans=function(e){return e.some(function(e){switch(e.toLowerCase()){case"true":case"false":return!0;default:return!1}})},e.prototype.parseNumber=function(e){var t;return null!==(t=Number(e))&&void 0!==t?t:void 0},e.prototype.coerceString=function(e){if(null!=e)return"object"==typeof e?JSON.stringify(e):String(e)},e.prototype.coerceStringArray=function(e){var t=this;if(Array.isArray(e))return e.map(function(e){return t.coerceString(e)}).filter(Boolean);var r=String(e);if(r.startsWith("["))try{var n=JSON.parse(r);return Array.isArray(n)?n.map(function(e){return t.coerceString(e)}).filter(Boolean):void 0}catch(e){return}},e.prototype.isSetOperator=function(e){switch(e){case tE.SET_IS:case tE.SET_IS_NOT:case tE.SET_CONTAINS:case tE.SET_DOES_NOT_CONTAIN:case tE.SET_CONTAINS_ANY:case tE.SET_DOES_NOT_CONTAIN_ANY:return!0;default:return!1}},e.prototype.setEquals=function(e,t){var r=new Set(e),n=new Set(t);return r.size===n.size&&fk([],pk(n),!1).every(function(e){return r.has(e)})},e.prototype.matchesSetContainsAll=function(e,t){var r,n;if(e.length<t.length)return!1;try{for(var i=hk(t),o=i.next();!o.done;o=i.next()){var s=o.value;if(!this.matchesIs(s,e))return!1}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return!0},e.prototype.matchesSetContainsAny=function(e,t){var r,n;try{for(var i=hk(t),o=i.next();!o.done;o=i.next()){var s=o.value;if(this.matchesIs(s,e))return!0}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return!1},e}(),gE=function(e,t){var r,n,i=eE({},e),o=[],s=t||Object.keys(i);try{for(var a=hk(s),l=a.next();!l.done;l=a.next()){var u=l.value,c=vE(u,i);c&&o.push.apply(o,fk([],pk(c),!1))}}catch(e){r={error:e}}finally{try{l&&!l.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return o},vE=function(e,t,r){var n,i;void 0===r&&(r=[]);var o=t[e];if(o){if(!o.dependencies||0===o.dependencies.length)return delete t[o.key],[o];r.push(o.key);var s=[],a=function(e){if(r.some(function(t){return t===e}))throw Error("Detected a cycle between flags ".concat(r));var n=vE(e,t,r);n&&s.push.apply(s,fk([],pk(n),!1))};try{for(var l=hk(o.dependencies),u=l.next();!u.done;u=l.next()){a(u.value)}}catch(e){n={error:e}}finally{try{u&&!u.done&&(i=l.return)&&i.call(l)}finally{if(n)throw n.error}}return s.push(o),r.pop(),delete t[o.key],s}},yE=mE="3.7.8",bE="function"==typeof Buffer,wE="function"==typeof TextDecoder?new TextDecoder:void 0,SE="function"==typeof TextEncoder?new TextEncoder:void 0,EE=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),kE=(e=>{let t={};return e.forEach((e,r)=>t[e]=r),t})(EE),xE=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,CE=String.fromCharCode.bind(String),IE="function"==typeof Uint8Array.from?Uint8Array.from.bind(Uint8Array):e=>new Uint8Array(Array.prototype.slice.call(e,0)),OE=e=>e.replace(/=/g,"").replace(/[+\/]/g,e=>"+"==e?"-":"_"),TE=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),AE=e=>{let t,r,n,i,o="";const s=e.length%3;for(let s=0;s<e.length;){if((r=e.charCodeAt(s++))>255||(n=e.charCodeAt(s++))>255||(i=e.charCodeAt(s++))>255)throw new TypeError("invalid character found");t=r<<16|n<<8|i,o+=EE[t>>18&63]+EE[t>>12&63]+EE[t>>6&63]+EE[63&t]}return s?o.slice(0,s-3)+"===".substring(s):o},_E="function"==typeof btoa?e=>btoa(e):bE?e=>Buffer.from(e,"binary").toString("base64"):AE,RE=bE?e=>Buffer.from(e).toString("base64"):e=>{let t=[];for(let r=0,n=e.length;r<n;r+=4096)t.push(CE.apply(null,e.subarray(r,r+4096)));return _E(t.join(""))},PE=(e,t=!1)=>t?OE(RE(e)):RE(e),ME=e=>{if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?CE(192|t>>>6)+CE(128|63&t):CE(224|t>>>12&15)+CE(128|t>>>6&63)+CE(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return CE(240|t>>>18&7)+CE(128|t>>>12&63)+CE(128|t>>>6&63)+CE(128|63&t)},NE=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,LE=e=>e.replace(NE,ME),DE=bE?e=>Buffer.from(e,"utf8").toString("base64"):SE?e=>RE(SE.encode(e)):e=>_E(LE(e)),jE=(e,t=!1)=>t?OE(DE(e)):DE(e),UE=e=>jE(e,!0),FE=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,BE=e=>{switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return CE((t>>>10)+55296)+CE(56320+(1023&t));case 3:return CE((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return CE((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},qE=e=>e.replace(FE,BE),zE=e=>{if(e=e.replace(/\s+/g,""),!xE.test(e))throw new TypeError("malformed base64.");let t,r,n;e+="==".slice(2-(3&e.length));let i=[];for(let o=0;o<e.length;)t=kE[e.charAt(o++)]<<18|kE[e.charAt(o++)]<<12|(r=kE[e.charAt(o++)])<<6|(n=kE[e.charAt(o++)]),64===r?i.push(CE(t>>16&255)):64===n?i.push(CE(t>>16&255,t>>8&255)):i.push(CE(t>>16&255,t>>8&255,255&t));return i.join("")},VE="function"==typeof atob?e=>atob(TE(e)):bE?e=>Buffer.from(e,"base64").toString("binary"):zE,WE=bE?e=>IE(Buffer.from(e,"base64")):e=>IE(VE(e).split("").map(e=>e.charCodeAt(0))),HE=e=>WE(GE(e)),$E=bE?e=>Buffer.from(e,"base64").toString("utf8"):wE?e=>wE.decode(WE(e)):e=>qE(VE(e)),GE=e=>TE(e.replace(/[-_]/g,e=>"-"==e?"+":"/")),JE=e=>({value:e,enumerable:!1,writable:!0,configurable:!0}),QE=function(){const e=(e,t)=>Object.defineProperty(String.prototype,e,JE(t));e("fromBase64",function(){return KE(this)}),e("toBase64",function(e){return jE(this,e)}),e("toBase64URI",function(){return jE(this,!0)}),e("toBase64URL",function(){return jE(this,!0)}),e("toUint8Array",function(){return HE(this)})},YE=function(){const e=(e,t)=>Object.defineProperty(Uint8Array.prototype,e,JE(t));e("toBase64",function(e){return PE(this,e)}),e("toBase64URI",function(){return PE(this,!0)}),e("toBase64URL",function(){return PE(this,!0)})},XE=()=>{QE(),YE()},ZE={version:mE,VERSION:yE,atob:VE,atobPolyfill:zE,btoa:_E,btoaPolyfill:AE,fromBase64:KE=e=>$E(GE(e)),toBase64:jE,encode:jE,encodeURI:UE,encodeURL:UE,utob:LE,btou:qE,decode:KE,isValid:e=>{if("string"!=typeof e)return!1;const t=e.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(t)||!/[^\s0-9a-zA-Z\-_]/.test(t)},fromUint8Array:PE,toUint8Array:HE,extendString:QE,extendUint8Array:YE,extendBuiltins:XE},ek=function(e){function t(r,n){var i=e.call(this,n)||this;return i.statusCode=r,Object.setPrototypeOf(i,t.prototype),i}return uk(t,e),t}(Error),tk=function(e){function t(r){var n=e.call(this,r)||this;return Object.setPrototypeOf(n,t.prototype),n}return uk(t,e),t}(Error),rk=function(){function e(e,t,r){this.deploymentKey=e,this.serverUrl=t,this.httpClient=r}return e.prototype.getVariants=function(e,t){return ck(this,void 0,void 0,function(){var r,n,i,o;return dk(this,function(s){switch(s.label){case 0:return r=ZE.encodeURL(JSON.stringify(e)),n={Authorization:"Api-Key ".concat(this.deploymentKey),"X-Amp-Exp-User":r},(null==t?void 0:t.flagKeys)&&(n["X-Amp-Exp-Flag-Keys"]=ZE.encodeURL(JSON.stringify(t.flagKeys))),(null==t?void 0:t.trackingOption)&&(n["X-Amp-Exp-Track"]=t.trackingOption),(null==t?void 0:t.exposureTrackingOption)&&(n["X-Amp-Exp-Exposure-Track"]=t.exposureTrackingOption),i=new URL("".concat(this.serverUrl,"/sdk/v2/vardata?v=0")),(null==t?void 0:t.evaluationMode)&&i.searchParams.append("eval_mode",null==t?void 0:t.evaluationMode),(null==t?void 0:t.deliveryMethod)&&i.searchParams.append("delivery_method",null==t?void 0:t.deliveryMethod),[4,this.httpClient.request({requestUrl:i.toString(),method:"GET",headers:n,timeoutMillis:null==t?void 0:t.timeoutMillis})];case 1:if(200!=(o=s.sent()).status)throw new ek(o.status,"Fetch error response: status=".concat(o.status));return[2,JSON.parse(o.body)]}})})},e}(),nk=function(){function e(e,t,r){this.deploymentKey=e,this.serverUrl=t,this.httpClient=r}return e.prototype.getFlags=function(e){return ck(this,void 0,void 0,function(){var t,r;return dk(this,function(n){switch(n.label){case 0:return t={Authorization:"Api-Key ".concat(this.deploymentKey)},(null==e?void 0:e.libraryName)&&(null==e?void 0:e.libraryVersion)&&(t["X-Amp-Exp-Library"]="".concat(e.libraryName,"/").concat(e.libraryVersion)),(null==e?void 0:e.user)&&(t["X-Amp-Exp-User"]=ZE.encodeURL(JSON.stringify(e.user))),[4,this.httpClient.request({requestUrl:"".concat(this.serverUrl,"/sdk/v2/flags")+((null==e?void 0:e.deliveryMethod)?"?delivery_method=".concat(e.deliveryMethod):""),method:"GET",headers:t,timeoutMillis:null==e?void 0:e.timeoutMillis})];case 1:if(200!=(r=n.sent()).status)throw Error("Flags error response: status=".concat(r.status));return[2,JSON.parse(r.body).reduce(function(e,t){return e[t.key]=t,e},{})]}})})},e}(),ik="undefined"!=typeof globalThis?globalThis:global||self,ok=function(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:void 0},sk=function(){var e=ok();if(e)try{var t="EXP_test";return e.localStorage.setItem(t,t),e.localStorage.removeItem(t),!0}catch(e){return!1}return!1},ak=function(){function e(e,t){this.poller=void 0,this.action=e,this.ms=t}return e.prototype.start=function(){this.poller||(this.poller=ik.setInterval(this.action,this.ms),this.action())},e.prototype.stop=function(){this.poller&&(ik.clearInterval(this.poller),this.poller=void 0)},e}()}}),px=u({"../../../../node_modules/@amplitude/ua-parser-js/src/ua-parser.js"(e,t){!function(r,n){var i="function",o="undefined",s="object",a="string",l="model",u="name",c="type",d="vendor",h="version",p="architecture",f="console",g="mobile",v="tablet",m="smarttv",y="wearable",b="embedded",w="Amazon",S="Apple",E="ASUS",k="BlackBerry",x="Browser",C="Chrome",I="Firefox",O="Google",T="Huawei",A="LG",_="Microsoft",R="Motorola",P="Opera",M="Samsung",N="Sharp",L="Sony",D="Xiaomi",j="Zebra",U="Facebook",F=function(e){for(var t={},r=0;r<e.length;r++)t[e[r].toUpperCase()]=e[r];return t},B=function(e,t){return typeof e===a&&-1!==q(t).indexOf(q(e))},q=function(e){return e.toLowerCase()},z=function(e,t){if(typeof e===a)return e=e.replace(/^\s\s*/,""),typeof t===o?e:e.substring(0,350)},V=function(e,t){for(var r,o,a,l,u,c,d=0;d<t.length&&!u;){var h=t[d],p=t[d+1];for(r=o=0;r<h.length&&!u;)if(u=h[r++].exec(e))for(a=0;a<p.length;a++)c=u[++o],typeof(l=p[a])===s&&l.length>0?2===l.length?typeof l[1]==i?this[l[0]]=l[1].call(this,c):this[l[0]]=l[1]:3===l.length?typeof l[1]!==i||l[1].exec&&l[1].test?this[l[0]]=c?c.replace(l[1],l[2]):n:this[l[0]]=c?l[1].call(this,c,l[2]):n:4===l.length&&(this[l[0]]=c?l[3].call(this,c.replace(l[1],l[2])):n):this[l]=c||n;d+=2}},W=function(e,t){for(var r in t)if(typeof t[r]===s&&t[r].length>0){for(var i=0;i<t[r].length;i++)if(B(t[r][i],e))return"?"===r?n:r}else if(B(t[r],e))return"?"===r?n:r;return e},H={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},$={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[h,[u,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[h,[u,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[u,h],[/opios[\/ ]+([\w\.]+)/i],[h,[u,P+" Mini"]],[/\bopr\/([\w\.]+)/i],[h,[u,P]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[u,h],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[h,[u,"UC"+x]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[h,[u,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[h,[u,"WeChat"]],[/konqueror\/([\w\.]+)/i],[h,[u,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[h,[u,"IE"]],[/yabrowser\/([\w\.]+)/i],[h,[u,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[u,/(.+)/,"$1 Secure "+x],h],[/\bfocus\/([\w\.]+)/i],[h,[u,I+" Focus"]],[/\bopt\/([\w\.]+)/i],[h,[u,P+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[h,[u,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[h,[u,"Dolphin"]],[/coast\/([\w\.]+)/i],[h,[u,P+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[h,[u,"MIUI "+x]],[/fxios\/([-\w\.]+)/i],[h,[u,I]],[/\bqihu|(qi?ho?o?|360)browser/i],[[u,"360 "+x]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[u,/(.+)/,"$1 "+x],h],[/(comodo_dragon)\/([\w\.]+)/i],[[u,/_/g," "],h],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[u,h],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[u],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[u,U],h],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[u,h],[/\bgsa\/([\w\.]+) .*safari\//i],[h,[u,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[h,[u,C+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[u,C+" WebView"],h],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[h,[u,"Android "+x]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[u,h],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[h,[u,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[h,u],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[u,[h,W,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[u,h],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[u,"Netscape"],h],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[h,[u,I+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[u,h],[/(cobalt)\/([\w\.]+)/i],[u,[h,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[p,"amd64"]],[/(ia32(?=;))/i],[[p,q]],[/((?:i[346]|x)86)[;\)]/i],[[p,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[p,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[p,"armhf"]],[/windows (ce|mobile); ppc;/i],[[p,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[p,/ower/,"",q]],[/(sun4\w)[;\)]/i],[[p,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[p,q]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[l,[d,M],[c,v]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[l,[d,M],[c,g]],[/((ipod|iphone)\d+,\d+)/i],[l,[d,S],[c,g]],[/(ipad\d+,\d+)/i],[l,[d,S],[c,v]],[/\((ip(?:hone|od)[\w ]*);/i],[l,[d,S],[c,g]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[l,[d,S],[c,v]],[/(macintosh);/i],[l,[d,S]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[l,[d,T],[c,v]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[l,[d,T],[c,g]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[l,/_/g," "],[d,D],[c,g]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[l,/_/g," "],[d,D],[c,v]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[l,[d,"OPPO"],[c,g]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[l,[d,"Vivo"],[c,g]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[l,[d,"Realme"],[c,g]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[l,[d,R],[c,g]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[l,[d,R],[c,v]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[l,[d,A],[c,v]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[l,[d,A],[c,g]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[l,[d,"Lenovo"],[c,v]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[l,/_/g," "],[d,"Nokia"],[c,g]],[/(pixel c)\b/i],[l,[d,O],[c,v]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[l,[d,O],[c,g]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[l,[d,L],[c,g]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[l,"Xperia Tablet"],[d,L],[c,v]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[l,[d,"OnePlus"],[c,g]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[l,[d,w],[c,v]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[l,/(.+)/g,"Fire Phone $1"],[d,w],[c,g]],[/(playbook);[-\w\),; ]+(rim)/i],[l,d,[c,v]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[l,[d,k],[c,g]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[l,[d,E],[c,v]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[l,[d,E],[c,g]],[/(nexus 9)/i],[l,[d,"HTC"],[c,v]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony(?!-bra))[-_ ]?([-\w]*)/i],[d,[l,/_/g," "],[c,g]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[l,[d,"Acer"],[c,v]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[l,[d,"Meizu"],[c,g]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[l,[d,N],[c,g]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[d,l,[c,g]],[/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[d,l,[c,v]],[/(surface duo)/i],[l,[d,_],[c,v]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[l,[d,"Fairphone"],[c,g]],[/(u304aa)/i],[l,[d,"AT&T"],[c,g]],[/\bsie-(\w*)/i],[l,[d,"Siemens"],[c,g]],[/\b(rct\w+) b/i],[l,[d,"RCA"],[c,v]],[/\b(venue[\d ]{2,7}) b/i],[l,[d,"Dell"],[c,v]],[/\b(q(?:mv|ta)\w+) b/i],[l,[d,"Verizon"],[c,v]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[l,[d,"Barnes & Noble"],[c,v]],[/\b(tm\d{3}\w+) b/i],[l,[d,"NuVision"],[c,v]],[/\b(k88) b/i],[l,[d,"ZTE"],[c,v]],[/\b(nx\d{3}j) b/i],[l,[d,"ZTE"],[c,g]],[/\b(gen\d{3}) b.+49h/i],[l,[d,"Swiss"],[c,g]],[/\b(zur\d{3}) b/i],[l,[d,"Swiss"],[c,v]],[/\b((zeki)?tb.*\b) b/i],[l,[d,"Zeki"],[c,v]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[d,"Dragon Touch"],l,[c,v]],[/\b(ns-?\w{0,9}) b/i],[l,[d,"Insignia"],[c,v]],[/\b((nxa|next)-?\w{0,9}) b/i],[l,[d,"NextBook"],[c,v]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[d,"Voice"],l,[c,g]],[/\b(lvtel\-)?(v1[12]) b/i],[[d,"LvTel"],l,[c,g]],[/\b(ph-1) /i],[l,[d,"Essential"],[c,g]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[l,[d,"Envizen"],[c,v]],[/\b(trio[-\w\. ]+) b/i],[l,[d,"MachSpeed"],[c,v]],[/\btu_(1491) b/i],[l,[d,"Rotor"],[c,v]],[/(shield[\w ]+) b/i],[l,[d,"Nvidia"],[c,v]],[/(sprint) (\w+)/i],[d,l,[c,g]],[/(kin\.[onetw]{3})/i],[[l,/\./g," "],[d,_],[c,g]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[l,[d,j],[c,v]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[l,[d,j],[c,g]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[d,l,[c,f]],[/droid.+; (shield) bui/i],[l,[d,"Nvidia"],[c,f]],[/(playstation [345portablevi]+)/i],[l,[d,L],[c,f]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[l,[d,_],[c,f]],[/smart-tv.+(samsung)/i],[d,[c,m]],[/hbbtv.+maple;(\d+)/i],[[l,/^/,"SmartTV"],[d,M],[c,m]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[d,A],[c,m]],[/(apple) ?tv/i],[d,[l,S+" TV"],[c,m]],[/crkey/i],[[l,C+"cast"],[d,O],[c,m]],[/droid.+aft(\w)( bui|\))/i],[l,[d,w],[c,m]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[l,[d,N],[c,m]],[/(bravia[\w ]+)( bui|\))/i],[l,[d,L],[c,m]],[/(mitv-\w{5}) bui/i],[l,[d,D],[c,m]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[d,z],[l,z],[c,m]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[c,m]],[/((pebble))app/i],[d,l,[c,y]],[/droid.+; (glass) \d/i],[l,[d,O],[c,y]],[/droid.+; (wt63?0{2,3})\)/i],[l,[d,j],[c,y]],[/(quest( 2)?)/i],[l,[d,U],[c,y]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[d,[c,b]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[l,[c,g]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[l,[c,v]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[c,v]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[c,g]],[/(android[-\w\. ]{0,9});.+buil/i],[l,[d,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[h,[u,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[h,[u,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i],[u,h],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[h,u]],os:[[/microsoft (windows) (vista|xp)/i],[u,h],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[u,[h,W,H]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[u,"Windows"],[h,W,H]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[h,/_/g,"."],[u,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[u,"Mac OS"],[h,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[h,u],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[u,h],[/\(bb(10);/i],[h,[u,k]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[h,[u,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[h,[u,I+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[h,[u,"webOS"]],[/crkey\/([\d\.]+)/i],[h,[u,C+"cast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[u,"Chromium OS"],h],[/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[u,h],[/(sunos) ?([\w\.\d]*)/i],[[u,"Solaris"],h],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[u,h]]},G=function(e,t){if(typeof e===s&&(t=e,e=n),!(this instanceof G))return new G(e,t).getResult();var i=e||(typeof r!==o&&r.navigator&&r.navigator.userAgent?r.navigator.userAgent:""),f=t?function(e,t){var r={};for(var n in e)t[n]&&t[n].length%2==0?r[n]=t[n].concat(e[n]):r[n]=e[n];return r}($,t):$;return this.getBrowser=function(){var e,t={};return t[u]=n,t[h]=n,V.call(t,i,f.browser),t.major=typeof(e=t.version)===a?e.replace(/[^\d\.]/g,"").split(".")[0]:n,t},this.getCPU=function(){var e={};return e[p]=n,V.call(e,i,f.cpu),e},this.getDevice=function(){var e={};return e[d]=n,e[l]=n,e[c]=n,V.call(e,i,f.device),e},this.getEngine=function(){var e={};return e[u]=n,e[h]=n,V.call(e,i,f.engine),e},this.getOS=function(){var e={};return e[u]=n,e[h]=n,V.call(e,i,f.os),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return i},this.setUA=function(e){return i=typeof e===a&&e.length>350?z(e,350):e,this},this.setUA(i),this};G.VERSION="0.7.33",G.BROWSER=F([u,h,"major"]),G.CPU=F([p]),G.DEVICE=F([l,d,c,f,g,m,v,y,b]),G.ENGINE=G.OS=F([u,h]),typeof e!==o?(typeof t!==o&&t.exports&&(e=t.exports=G),e.UAParser=G):typeof define===i&&define.amd?define(function(){return G}):typeof r!==o&&(r.UAParser=G);var K=typeof r!==o&&(r.jQuery||r.Zepto);if(K&&!K.ua){var J=new G;K.ua=J.getResult(),K.ua.get=function(){return J.getUA()},K.ua.set=function(e){J.setUA(e);var t=J.getResult();for(var r in t)K.ua[r]=t[r]}}}("object"==typeof window?window:e)}});function fx(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})}function gx(e,t){var r,n,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(l){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}function vx(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function mx(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}function yx(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}function bx(e,t){return t=t||{},new Promise(function(r,n){var i=new XMLHttpRequest,o=[],s=[],a={},l=function(){return{ok:2==(i.status/100|0),statusText:i.statusText,status:i.status,url:i.responseURL,text:function(){return Promise.resolve(i.responseText)},json:function(){return Promise.resolve(JSON.parse(i.responseText))},blob:function(){return Promise.resolve(new Blob([i.response]))},clone:l,headers:{keys:function(){return o},entries:function(){return s},get:function(e){return a[e.toLowerCase()]},has:function(e){return e.toLowerCase()in a}}}};for(var u in i.open(t.method||"get",e,!0),i.onload=function(){i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(e,t,r){o.push(t=t.toLowerCase()),s.push([t,r]),a[t]=a[t]?a[t]+","+r:r}),r(l())},i.onerror=n,i.withCredentials="include"==t.credentials,t.headers)i.setRequestHeader(u,t.headers[u]);i.send(t.body||null)})}var wx,Sx,Ex=l({"../../../../node_modules/@amplitude/experiment-js-client/dist/experiment.esm.js"(){var e,t,r;hx(),sr(),gk=h(px()),function(){function e(e){this.amplitudeInstance=e}return e.prototype.getUser=function(){var e,t,r,n,i,o,s,a,l,u;return{device_id:null===(t=null===(e=this.amplitudeInstance)||void 0===e?void 0:e.options)||void 0===t?void 0:t.deviceId,user_id:null===(n=null===(r=this.amplitudeInstance)||void 0===r?void 0:r.options)||void 0===n?void 0:n.userId,version:null===(o=null===(i=this.amplitudeInstance)||void 0===i?void 0:i.options)||void 0===o?void 0:o.versionName,language:null===(a=null===(s=this.amplitudeInstance)||void 0===s?void 0:s.options)||void 0===a?void 0:a.language,platform:null===(u=null===(l=this.amplitudeInstance)||void 0===l?void 0:l.options)||void 0===u?void 0:u.platform,os:this.getOs(),device_model:this.getDeviceModel()}},e.prototype.getOs=function(){var e,t,r,n,i,o;return[null===(r=null===(t=null===(e=this.amplitudeInstance)||void 0===e?void 0:e._ua)||void 0===t?void 0:t.browser)||void 0===r?void 0:r.name,null===(o=null===(i=null===(n=this.amplitudeInstance)||void 0===n?void 0:n._ua)||void 0===i?void 0:i.browser)||void 0===o?void 0:o.major].filter(function(e){return null!=e}).join(" ")},e.prototype.getDeviceModel=function(){var e,t,r;return null===(r=null===(t=null===(e=this.amplitudeInstance)||void 0===e?void 0:e._ua)||void 0===t?void 0:t.os)||void 0===r?void 0:r.name},e}(),function(){function e(e){this.amplitudeInstance=e}return e.prototype.track=function(e){this.amplitudeInstance.logEvent(e.name,e.properties)},e.prototype.setUserProperty=function(e){var t,r;this.amplitudeInstance.setUserProperties(((t={})[e.userProperty]=null===(r=e.variant)||void 0===r?void 0:r.value,t))},e.prototype.unsetUserProperty=function(e){var t;this.amplitudeInstance._logEvent("$identify",null,null,{$unset:(t={},t[e.userProperty]="-",t)})},e}(),vk=function(){return vk=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},vk.apply(this,arguments)},mk=function(e,t){var r,n;void 0===t&&(t=!1);var i=wk(e,t),o=void 0,s=ik.document.cookie.split("; ");try{for(var a=vx(s),l=a.next();!l.done;l=a.next()){var u=mx(l.value.split("=",2),2),c=u[0],d=u[1];c===i&&(o=decodeURIComponent(d))}}catch(e){r={error:e}}finally{try{l&&!l.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}if(o)try{if(t){var h=atob(o);return JSON.parse(decodeURIComponent(h))}var p=o.split("."),f=void 0;return p.length>=2&&p[1]&&(f=atob(p[1])),{deviceId:p[0],userId:f}}catch(e){return}},yk=function(e){var t=wk(e,!0);try{var r=ik.localStorage.getItem(t);if(!r)return;var n=JSON.parse(r);if("object"!=typeof n)return;return n}catch(e){return}},bk=function(e){var t=wk(e,!0);try{var r=ik.sessionStorage.getItem(t);if(!r)return;var n=JSON.parse(r);if("object"!=typeof n)return;return n}catch(e){return}},wk=function(e,t){if(t){if((null==e?void 0:e.length)<10)return;return"AMP_".concat(e.substring(0,10))}if(!((null==e?void 0:e.length)<6))return"amp_".concat(e.substring(0,6))},Sk=function(){function e(e,t,r){this.type="integration",this.apiKey=e,this.identityStore=t.identityStore,this.eventBridge=t.eventBridge,this.contextProvider=t.applicationContextProvider,this.timeoutMillis=r,this.loadPersistedState(),r<=0&&(this.setup=void 0)}return e.prototype.setup=function(e,t){return fx(this,void 0,void 0,function(){return gx(this,function(r){return(null==e?void 0:e.automaticFetchOnAmplitudeIdentityChange)&&this.identityStore.addIdentityListener(function(){null==t||t.fetch()}),[2,this.waitForConnectorIdentity(this.timeoutMillis)]})})},e.prototype.getUser=function(){var e=this.identityStore.getIdentity();return{user_id:e.userId,device_id:e.deviceId,user_properties:e.userProperties,version:this.contextProvider.versionName}},e.prototype.track=function(e){return!!this.eventBridge.receiver&&(this.eventBridge.logEvent({eventType:e.eventType,eventProperties:e.eventProperties}),!0)},e.prototype.loadPersistedState=function(){if(!this.apiKey||this.apiKey.startsWith("client-"))return!1;var e=mk(this.apiKey,!0);return(e||(e=mk(this.apiKey,!1))||(e=yk(this.apiKey))||!!(e=bk(this.apiKey)))&&(this.commitIdentityToConnector(e),!0)},e.prototype.commitIdentityToConnector=function(e){var t=this.identityStore.editIdentity();t.setDeviceId(e.deviceId),e.userId&&t.setUserId(e.userId),t.commit()},e.prototype.waitForConnectorIdentity=function(e){return fx(this,void 0,void 0,function(){var t,r=this;return gx(this,function(n){return(t=this.identityStore.getIdentity()).userId||t.deviceId?[2]:[2,Promise.race([new Promise(function(e){var t=function(){e(),r.identityStore.removeIdentityListener(t)};r.identityStore.addIdentityListener(t)}),new Promise(function(t,r){ik.setTimeout(r,e,"Timed out waiting for Amplitude Analytics SDK to initialize.")})])]})})},e}(),Ek=ik.fetch||bx,kk=function(e,t){return null==t||t<=0?e:new Promise(function(r,n){ik.setTimeout(function(){n(new tk("Request timeout after "+t+" milliseconds"))},t),e.then(r,n)})},xk=function(e,t,r,n,i){return kk(fx(void 0,void 0,void 0,function(){var i,o;return gx(this,function(s){switch(s.label){case 0:return[4,Ek(e,{method:t,headers:r,body:n})];case 1:return i=s.sent(),o={status:i.status},[4,i.text()];case 2:return o.body=s.sent(),[2,o]}})}),i)},Ck=function(){function e(e){this.client=e}return e.prototype.request=function(e){return fx(this,void 0,void 0,function(){return gx(this,function(t){switch(t.label){case 0:return[4,this.client.request(e.requestUrl,e.method,e.headers,null,e.timeoutMillis)];case 1:return[2,t.sent()]}})})},e}(),Ik={request:xk},(e=Ok||(Ok={}))[e.Disable=0]="Disable",e[e.Error=1]="Error",e[e.Warn=2]="Warn",e[e.Info=3]="Info",e[e.Debug=4]="Debug",e[e.Verbose=5]="Verbose",(t=Tk||(Tk={})).LocalStorage="localStorage",t.InitialVariants="initialVariants",(r=Ak||(Ak={})).LocalStorage="storage",r.InitialVariants="initial",r.SecondaryLocalStorage="secondary-storage",r.SecondaryInitialVariants="secondary-initial",r.FallbackInline="fallback-inline",r.FallbackConfig="fallback-config",r.LocalEvaluation="local-evaluation",_k=function(e){return!e||e===Ak.FallbackInline||e===Ak.FallbackConfig||e===Ak.SecondaryInitialVariants},Rk={debug:!1,logLevel:Ok.Error,loggerProvider:null,instanceName:"$default_instance",fallbackVariant:{},initialVariants:{},initialFlags:void 0,source:Tk.LocalStorage,serverUrl:"https://api.lab.amplitude.com",flagsServerUrl:"https://flag.lab.amplitude.com",serverZone:"US",fetchTimeoutMillis:1e4,retryFetchOnFailure:!0,throwOnError:!1,automaticExposureTracking:!0,pollOnStart:!0,flagConfigPollingIntervalMillis:3e5,fetchOnStart:!0,automaticFetchOnAmplitudeIdentityChange:!1,userProvider:null,analyticsProvider:null,exposureTrackingProvider:null,httpClient:Ik},Pk="1.21.1",Mk=function(){function e(e,t){var r,n=this;this.isReady=new Promise(function(e){n.resolve=e}),this.config=e,this.client=t;var i=null!==(r=e.instanceName)&&void 0!==r?r:Rk.instanceName;this.queue=new Lk(i),this.cache=new Nk(i)}return e.prototype.ready=function(){return this.integration?this.isReady:Promise.resolve()},e.prototype.setIntegration=function(e){var t=this;this.integration&&this.integration.teardown&&this.integration.teardown(),this.integration=e,e.setup?this.integration.setup(this.config,this.client).then(function(){t.queue.setTracker(t.integration.track.bind(e)),t.resolve()},function(){t.queue.setTracker(t.integration.track.bind(e)),t.resolve()}):(this.queue.setTracker(this.integration.track.bind(e)),this.resolve())},e.prototype.getUser=function(){return this.integration?this.integration.getUser():{}},e.prototype.track=function(e,t){if(this.cache.shouldTrack(e,t)){var r=this.getExposureEvent(e);this.queue.push(r)}},e.prototype.getExposureEvent=function(e){var t,r,n,i={eventType:"$exposure",eventProperties:e};return(null===(t=e.metadata)||void 0===t?void 0:t.exposureEvent)?i={eventType:null===(r=e.metadata)||void 0===r?void 0:r.exposureEvent,eventProperties:e}:"web"===(null===(n=e.metadata)||void 0===n?void 0:n.deliveryMethod)&&(i={eventType:"$impression",eventProperties:e}),i},e}(),Nk=function(){function e(e){this.isSessionStorageAvailable=Dk(),this.inMemoryCache={},this.identity={},this.storageKey="EXP_sent_v3_".concat(e),this.isSessionStorageAvailable&&(ik.sessionStorage.removeItem("EXP_sent_".concat(e)),ik.sessionStorage.removeItem("EXP_sent_v2_".concat(e)))}return e.prototype.shouldTrack=function(e,t){var r,n;if("web"===(null===(r=e.metadata)||void 0===r?void 0:r.deliveryMethod))return!0;var i={userId:null==t?void 0:t.user_id,deviceId:null==t?void 0:t.device_id};this.identityEquals(this.identity,i)||this.clearCache(),this.identity=i,this.loadCache();var o=e.flag_key in this.inMemoryCache,s=this.inMemoryCache[e.flag_key],a=null!==(n=e.variant)&&void 0!==n?n:null,l=!1;return o&&(null!=s?s:null)===a||(l=!0,this.inMemoryCache[e.flag_key]=a),this.storeCache(),l},e.prototype.clearCache=function(){this.inMemoryCache={},this.isSessionStorageAvailable&&ik.sessionStorage.removeItem(this.storageKey)},e.prototype.identityEquals=function(e,t){return e.userId&&t.userId?e.userId===t.userId:!e.userId&&!t.userId&&e.deviceId===t.deviceId},e.prototype.loadCache=function(){if(this.isSessionStorageAvailable){var e=ik.sessionStorage.getItem(this.storageKey);this.inMemoryCache=e?JSON.parse(e):{}}},e.prototype.storeCache=function(){if(this.isSessionStorageAvailable)try{ik.sessionStorage.setItem(this.storageKey,JSON.stringify(this.inMemoryCache))}catch(e){}},e}(),Lk=function(){function e(e,t){void 0===t&&(t=512),this.isLocalStorageAvailable=sk(),this.inMemoryQueue=[],this.storageKey="EXP_unsent_".concat(e),this.maxQueueSize=t}return e.prototype.push=function(e){this.loadQueue(),this.inMemoryQueue.push(e),this.flush(),this.storeQueue()},e.prototype.setTracker=function(e){var t=this;this.tracker=e,this.poller=ik.setInterval(function(){t.loadFlushStore()},1e3),this.loadFlushStore()},e.prototype.flush=function(){if(this.tracker&&0!==this.inMemoryQueue.length){for(var e=0;e<this.inMemoryQueue.length;e++)try{if(!this.tracker(this.inMemoryQueue[e]))break}catch(e){break}this.inMemoryQueue=this.inMemoryQueue.slice(e),0===this.inMemoryQueue.length&&this.poller&&(ik.clearInterval(this.poller),this.poller=void 0)}},e.prototype.loadQueue=function(){if(this.isLocalStorageAvailable){var e=ik.localStorage.getItem(this.storageKey);this.inMemoryQueue=e?JSON.parse(e):[]}},e.prototype.storeQueue=function(){this.isLocalStorageAvailable&&(this.inMemoryQueue.length>this.maxQueueSize&&(this.inMemoryQueue=this.inMemoryQueue.slice(this.inMemoryQueue.length-this.maxQueueSize)),ik.localStorage.setItem(this.storageKey,JSON.stringify(this.inMemoryQueue)))},e.prototype.loadFlushStore=function(){this.loadQueue(),this.flush(),this.storeQueue()},e}(),Dk=function(){var e=ok();if(e)try{var t="EXP_test";return e.sessionStorage.setItem(t,t),e.sessionStorage.removeItem(t),!0}catch(e){return!1}return!1},jk=function(){function e(e,t){void 0===t&&(t=Ok.Error),this.logger=e,this.logLevel=t}return e.prototype.error=function(e){for(var t,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];this.logLevel>=Ok.Error&&(t=this.logger).error.apply(t,yx([e],mx(r),!1))},e.prototype.warn=function(e){for(var t,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];this.logLevel>=Ok.Warn&&(t=this.logger).warn.apply(t,yx([e],mx(r),!1))},e.prototype.info=function(e){for(var t,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];this.logLevel>=Ok.Info&&(t=this.logger).info.apply(t,yx([e],mx(r),!1))},e.prototype.debug=function(e){for(var t,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];this.logLevel>=Ok.Debug&&(t=this.logger).debug.apply(t,yx([e],mx(r),!1))},e.prototype.verbose=function(e){for(var t,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];this.logLevel>=Ok.Verbose&&(t=this.logger).verbose.apply(t,yx([e],mx(r),!1))},e}(),Uk=function(){function e(){}return e.prototype.error=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];console.error.apply(console,yx([e],mx(t),!1))},e.prototype.warn=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];console.warn.apply(console,yx([e],mx(t),!1))},e.prototype.info=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];console.info.apply(console,yx([e],mx(t),!1))},e.prototype.debug=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];console.debug.apply(console,yx([e],mx(t),!1))},e.prototype.verbose=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];console.debug.apply(console,yx([e],mx(t),!1))},e}(),Fk=function(){function e(){this.globalScope=ok()}return e.prototype.get=function(e){var t;return null===(t=this.globalScope)||void 0===t?void 0:t.localStorage.getItem(e)},e.prototype.put=function(e,t){var r;null===(r=this.globalScope)||void 0===r||r.localStorage.setItem(e,t)},e.prototype.delete=function(e){var t;null===(t=this.globalScope)||void 0===t||t.localStorage.removeItem(e)},e}(),Bk=function(e,t,r){var n=e.substring(e.length-6),i="amp-exp-".concat(t,"-").concat(n);return new Wk(i,r,Hk)},qk=function(e,t,r){void 0===r&&(r=new Fk);var n=e.substring(e.length-6),i="amp-exp-".concat(t,"-").concat(n,"-flags");return new Wk(i,r)},zk=function(e,t,r){void 0===r&&(r=new Fk);var n=e.substring(e.length-6),i="amp-exp-".concat(t,"-").concat(n,"-variants-options");return new Vk(i,r)},Vk=function(){function e(e,t){this.namespace=e,this.storage=t}return e.prototype.get=function(){return this.value},e.prototype.put=function(e){this.value=e},e.prototype.load=function(){var e=this.storage.get(this.namespace);e&&(this.value=JSON.parse(e))},e.prototype.store=function(){void 0===this.value?this.storage.delete(this.namespace):this.storage.put(this.namespace,JSON.stringify(this.value))},e}(),Wk=function(){function e(e,t,r){this.cache={},this.namespace=e,this.storage=t,this.transformer=r}return e.prototype.get=function(e){return this.cache[e]},e.prototype.getAll=function(){return vk({},this.cache)},e.prototype.put=function(e,t){this.cache[e]=t},e.prototype.putAll=function(e){var t,r;try{for(var n=vx(Object.keys(e)),i=n.next();!i.done;i=n.next()){var o=i.value;this.cache[o]=e[o]}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}},e.prototype.remove=function(e){delete this.cache[e]},e.prototype.clear=function(){this.cache={}},e.prototype.load=function(){var e,t,r,n=this.storage.get(this.namespace);try{r=JSON.parse(n)||{}}catch(e){return}var i={};try{for(var o=vx(Object.keys(r)),s=o.next();!s.done;s=o.next()){var a=s.value;try{var l=void 0;(l=this.transformer?this.transformer(r[a]):r[a])&&(i[a]=l)}catch(e){}}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}this.clear(),this.putAll(i)},e.prototype.store=function(e){void 0===e&&(e=this.cache),this.storage.put(this.namespace,JSON.stringify(e))},e}(),Hk=function(e){if("string"==typeof e)return{key:e,value:e};if("object"==typeof e){var t=e.key,r=e.value,n=e.payload,i=e.metadata,o=e.expKey;i&&i.experimentKey?o=i.experimentKey:o&&((i=i||{}).experimentKey=o);var s={};return t?s.key=t:r&&(s.key=r),r&&(s.value=r),i&&(s.metadata=i),n&&(s.payload=n),o&&(s.expKey=o),s}},$k=function(){function e(){this.globalScope=ok()}return e.prototype.get=function(e){var t;return null===(t=this.globalScope)||void 0===t?void 0:t.sessionStorage.getItem(e)},e.prototype.put=function(e,t){var r;null===(r=this.globalScope)||void 0===r||r.sessionStorage.setItem(e,t)},e.prototype.delete=function(e){var t;null===(t=this.globalScope)||void 0===t||t.sessionStorage.removeItem(e)},e}(),Gk=function(e,t,r,n){var i,o=null==r?void 0:r.value,s="[Experiment] ".concat(t);return{name:"[Experiment] Exposure",user:e,key:t,variant:r,userProperty:s,properties:{key:t,variant:o,source:n},userProperties:(i={},i[s]=o,i)}},Kk=function(e){return null==e},Jk=function(e){return!!Kk(e)||e&&0===Object.keys(e).length},Qk=function(e){var t,r;if(!e||"object"!=typeof e)return{};var n={};try{for(var i=vx(Object.entries(e)),o=i.next();!o.done;o=i.next()){var s=mx(o.value,2),a=s[0],l=s[1];Kk(l)||(n[a]=l)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return n},Yk=function(e){var t;return"local"===(null===(t=null==e?void 0:e.metadata)||void 0===t?void 0:t.evaluationMode)},Xk=function(){function e(e,t,r,n){this.started=!1,this.done=!1,this.attempts=e,this.min=t,this.max=r,this.scalar=n}return e.prototype.start=function(e){return fx(this,void 0,void 0,function(){return gx(this,function(t){switch(t.label){case 0:if(this.started)throw Error("Backoff already started");return this.started=!0,[4,this.backoff(e,0,this.min)];case 1:return t.sent(),[2]}})})},e.prototype.cancel=function(){this.done=!0,clearTimeout(this.timeoutHandle)},e.prototype.backoff=function(e,t,r){return fx(this,void 0,void 0,function(){var n=this;return gx(this,function(i){return this.done||(this.timeoutHandle=ik.setTimeout(function(){return fx(n,void 0,void 0,function(){var n,i;return gx(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,e()];case 1:return o.sent(),[3,3];case 2:return o.sent(),(n=t+1)<this.attempts&&(i=Math.min(r*this.scalar,this.max),this.backoff(e,n,i)),[3,3];case 3:return[2]}})})},r)),[2]})})},e}(),Zk=function(e){var t,r,n,i;if(!e)return{};var o={user:e},s=ok();s&&(o.page={url:s.location.href});var a={};if(!e.groups)return o;try{for(var l=vx(Object.keys(e.groups)),u=l.next();!u.done;u=l.next()){var c=u.value,d=e.groups[c];if(d.length>0&&d[0]){var h=d[0],p={group_name:h},f=null===(i=null===(n=e.group_properties)||void 0===n?void 0:n[c])||void 0===i?void 0:i[h];f&&Object.keys(f).length>0&&(p.group_properties=f),a[c]=p}}}catch(e){t={error:e}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(t)throw t.error}}return Object.keys(a).length>0&&(o.groups=a),delete o.user.groups,delete o.user.group_properties,o},ex=function(e){return null==e?{}:"string"==typeof e?{key:e,value:e}:e},tx=function(e){if(!e)return{};var t=void 0;e.metadata&&(t=e.metadata.experimentKey);var r={};return e.key&&(r.key=e.key),e.value&&(r.value=e.value),e.payload&&(r.payload=e.payload),t&&(r.expKey=t),e.metadata&&(r.metadata=e.metadata),r},rx=function(){function e(e){this.setProperties={},this.unsetProperties={},this.analyticsProvider=e}return e.prototype.track=function(e){this.setProperties[e.key]!=e.variant.value&&(this.setProperties[e.key]=e.variant.value,delete this.unsetProperties[e.key],this.analyticsProvider.track(e))},e.prototype.setUserProperty=function(e){this.setProperties[e.key]!=e.variant.value&&this.analyticsProvider.setUserProperty(e)},e.prototype.unsetUserProperty=function(e){this.unsetProperties[e.key]||(this.unsetProperties[e.key]="unset",delete this.setProperties[e.key],this.analyticsProvider.unsetUserProperty(e))},e}(),nx=function(){function e(e){this.tracked={},this.identity={},this.exposureTrackingProvider=e}return e.prototype.track=function(e,t){var r={userId:null==t?void 0:t.user_id,deviceId:null==t?void 0:t.device_id};this.identityEquals(this.identity,r)||(this.tracked={}),this.identity=r;var n=e.flag_key in this.tracked,i=this.tracked[e.flag_key];n&&i===e.variant||(this.tracked[e.flag_key]=e.variant,this.exposureTrackingProvider.track(e))},e.prototype.identityEquals=function(e,t){return e.userId===t.userId&&e.deviceId===t.deviceId},e}(),ix=function(){function e(t,r){var n,i,o,s,a=this;this.engine=new fE,this.isRunning=!1,this.apiKey=t,r=Qk(r),this.config=vk(vk(vk({},Rk),r),{serverUrl:(null==r?void 0:r.serverUrl)||("eu"===(null===(n=null==r?void 0:r.serverZone)||void 0===n?void 0:n.toLowerCase())?"https://api.lab.eu.amplitude.com":Rk.serverUrl),flagsServerUrl:(null==r?void 0:r.flagsServerUrl)||("eu"===(null===(i=null==r?void 0:r.serverZone)||void 0===i?void 0:i.toLowerCase())?"https://flag.lab.eu.amplitude.com":Rk.flagsServerUrl),flagConfigPollingIntervalMillis:r.flagConfigPollingIntervalMillis<6e4?6e4:null!==(o=r.flagConfigPollingIntervalMillis)&&void 0!==o?o:Rk.flagConfigPollingIntervalMillis}),this.logger=new jk(this.config.loggerProvider||new Uk,e.getLogLevel(r));var l=null===(s=this.config)||void 0===s?void 0:s.internalInstanceNameSuffix;if(this.isWebExperiment="web"===l,this.poller=new ak(function(){return fx(a,void 0,void 0,function(){var e;return gx(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.doFlags()];case 1:return t.sent(),[3,3];case 2:return e=t.sent(),this.logger.info(e),[3,3];case 3:return[2]}})})},this.config.flagConfigPollingIntervalMillis),this.config.initialVariants)for(var u in this.config.initialVariants)this.config.initialVariants[u]=Hk(this.config.initialVariants[u]);this.config.userProvider&&(this.userProvider=this.config.userProvider),this.config.analyticsProvider&&(this.analyticsProvider=new rx(this.config.analyticsProvider)),this.config.exposureTrackingProvider&&(this.userSessionExposureTracker=new nx(this.config.exposureTrackingProvider)),this.integrationManager=new Mk(this.config,this);var c,d=new Ck(this.config.httpClient||Ik);this.flagApi=new nk(this.apiKey,this.config.flagsServerUrl,d),this.evaluationApi=new rk(this.apiKey,this.config.serverUrl,d);var h=l?"".concat(this.config.instanceName,"-").concat(l):this.config.instanceName;c=this.isWebExperiment?new $k:new Fk,this.variants=Bk(this.apiKey,h,c),this.flags=qk(this.apiKey,h,c),this.fetchVariantsOptions=zk(this.apiKey,h,c);try{this.flags.load(),this.variants.load(),this.fetchVariantsOptions.load()}catch(e){}this.mergeInitialFlagsWithStorage()}return e.prototype.start=function(e){return fx(this,void 0,void 0,function(){var t,r,n;return gx(this,function(i){switch(i.label){case 0:if(this.isRunning)return[2];this.isRunning=!0,this.setUser(e),i.label=1;case 1:return i.trys.push([1,6,,7]),t=this.doFlags(),null===(n=this.config.fetchOnStart)||void 0===n||n?[4,Promise.all([this.fetch(e),t])]:[3,3];case 2:return i.sent(),[3,5];case 3:return[4,t];case 4:i.sent(),i.label=5;case 5:return[3,7];case 6:if(r=i.sent(),this.config.throwOnError)throw r;return[3,7];case 7:return this.config.pollOnStart&&this.poller.start(),[2]}})})},e.prototype.stop=function(){this.isRunning&&(this.poller.stop(),this.isRunning=!1)},e.prototype.fetch=function(){return fx(this,arguments,void 0,function(e,t){var r;return void 0===e&&(e=this.user),gx(this,function(n){switch(n.label){case 0:this.setUser(e||{}),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.fetchInternal(e,this.config.fetchTimeoutMillis,this.config.retryFetchOnFailure,t)];case 2:return n.sent(),[3,4];case 3:if(r=n.sent(),this.config.throwOnError)throw r;return r instanceof tk?this.logger.debug(r):this.logger.error(r),[3,4];case 4:return[2,this]}})})},e.prototype.variant=function(e,t){var r,n;if(!this.apiKey)return{value:void 0};var i=this.variantAndSource(e,t);return this.config.automaticExposureTracking&&this.exposureInternal(e,i),this.logger.debug("[Experiment] variant for ".concat(e," is ").concat((null===(r=i.variant)||void 0===r?void 0:r.key)||(null===(n=i.variant)||void 0===n?void 0:n.value))),i.variant||{}},e.prototype.exposure=function(e){var t=this.variantAndSource(e);this.exposureInternal(e,t)},e.prototype.all=function(){if(!this.apiKey)return{};var e=this.evaluate();for(var t in e){var r=this.flags.get(t);Yk(r)||delete e[t]}return vk(vk(vk({},this.secondaryVariants()),this.sourceVariants()),e)},e.prototype.clear=function(){this.variants.clear();try{this.variants.store()}catch(e){}},e.prototype.getUser=function(){var e;if(!this.user)return this.user;if(null===(e=this.user)||void 0===e?void 0:e.user_properties){var t=vk({},this.user.user_properties);return vk(vk({},this.user),{user_properties:t})}return vk({},this.user)},e.prototype.setUser=function(e){var t;if(e)if(null===(t=this.user)||void 0===t?void 0:t.user_properties){var r=vk({},e.user_properties);this.user=vk(vk({},e),{user_properties:r})}else this.user=vk({},e);else this.user=null},e.prototype.getUserProvider=function(){return this.userProvider},e.prototype.setUserProvider=function(e){return this.userProvider=e,this},e.prototype.mergeInitialFlagsWithStorage=function(){var e=this;this.config.initialFlags&&JSON.parse(this.config.initialFlags).forEach(function(t){e.flags.get(t.key)||e.flags.put(t.key,t)})},e.prototype.evaluate=function(e){var t,r,n=this.addContext(this.user),i=gE(this.flags.getAll(),e),o=Zk(n),s=this.engine.evaluate(o,i),a={};try{for(var l=vx(Object.keys(s)),u=l.next();!u.done;u=l.next()){var c=u.value;a[c]=tx(s[c])}}catch(e){t={error:e}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(t)throw t.error}}return a},e.prototype.getEvaluationTraces=function(e){var t=this.addContext(this.user),r=gE(this.flags.getAll(),e),n=Zk(t);return this.engine.evaluateWithTraces(n,r).traces},e.prototype.variantAndSource=function(e,t){var r={};this.config.source===Tk.LocalStorage?r=this.localStorageVariantAndSource(e,t):this.config.source===Tk.InitialVariants&&(r=this.initialVariantsVariantAndSource(e,t));var n=this.flags.get(e);return(Yk(n)||!r.variant&&n)&&(r=this.localEvaluationVariantAndSource(e,n,t)),r},e.prototype.localEvaluationVariantAndSource=function(e,t,r){var n,i={},o=this.evaluate([t.key])[e],s=Ak.LocalEvaluation,a=null===(n=null==o?void 0:o.metadata)||void 0===n?void 0:n.default;if(!Kk(o)&&!a)return{variant:ex(o),source:s,hasDefaultVariant:!1};if(a&&(i={variant:ex(o),source:s,hasDefaultVariant:!0}),!Kk(r))return{variant:ex(r),source:Ak.FallbackInline,hasDefaultVariant:i.hasDefaultVariant};var l=this.config.initialVariants[e];if(!Kk(l))return{variant:ex(l),source:Ak.SecondaryInitialVariants,hasDefaultVariant:i.hasDefaultVariant};var u=ex(this.config.fallbackVariant),c={variant:u,source:Ak.FallbackConfig,hasDefaultVariant:i.hasDefaultVariant};return Jk(u)?i:c},e.prototype.localStorageVariantAndSource=function(e,t){var r,n={},i=this.variants.get(e),o=null===(r=null==i?void 0:i.metadata)||void 0===r?void 0:r.default;if(!Kk(i)&&!o)return{variant:ex(i),source:Ak.LocalStorage,hasDefaultVariant:!1};if(o&&(n={variant:ex(i),source:Ak.LocalStorage,hasDefaultVariant:!0}),!Kk(t))return{variant:ex(t),source:Ak.FallbackInline,hasDefaultVariant:n.hasDefaultVariant};var s=this.config.initialVariants[e];if(!Kk(s))return{variant:ex(s),source:Ak.SecondaryInitialVariants,hasDefaultVariant:n.hasDefaultVariant};var a=ex(this.config.fallbackVariant),l={variant:a,source:Ak.FallbackConfig,hasDefaultVariant:n.hasDefaultVariant};return Jk(a)?n:l},e.prototype.initialVariantsVariantAndSource=function(e,t){var r,n={},i=this.config.initialVariants[e];if(!Kk(i))return{variant:ex(i),source:Ak.InitialVariants,hasDefaultVariant:!1};var o=this.variants.get(e),s=null===(r=null==o?void 0:o.metadata)||void 0===r?void 0:r.default;if(!Kk(o)&&!s)return{variant:ex(o),source:Ak.LocalStorage,hasDefaultVariant:!1};if(s&&(n={variant:ex(o),source:Ak.LocalStorage,hasDefaultVariant:!0}),!Kk(t))return{variant:ex(t),source:Ak.FallbackInline,hasDefaultVariant:n.hasDefaultVariant};var a=ex(this.config.fallbackVariant),l={variant:a,source:Ak.FallbackConfig,hasDefaultVariant:n.hasDefaultVariant};return Jk(a)?n:l},e.prototype.fetchInternal=function(e,t,r,n){return fx(this,void 0,void 0,function(){var i,o,s;return gx(this,function(a){switch(a.label){case 0:if(!this.apiKey)throw Error("Experiment API key is empty");this.logger.debug("[Experiment] Fetch all: retry=".concat(r)),r&&this.stopRetries(),a.label=1;case 1:return a.trys.push([1,4,,5]),[4,this.doFetch(e,t,vk({trackingOption:null===(s=this.fetchVariantsOptions.get())||void 0===s?void 0:s.trackingOption},n))];case 2:return i=a.sent(),[4,this.storeVariants(i,n)];case 3:return a.sent(),[2,i];case 4:throw o=a.sent(),r&&this.shouldRetryFetch(o)&&this.startRetries(e,n),o;case 5:return[2]}})})},e.prototype.setTracksAssignment=function(e){return fx(this,void 0,void 0,function(){return gx(this,function(t){return this.fetchVariantsOptions.put(vk(vk({},this.fetchVariantsOptions.get()||{}),{trackingOption:e?"track":"no-track"})),this.fetchVariantsOptions.store(),[2]})})},e.prototype.cleanUserPropsForFetch=function(e){var t=vk({},e);return delete t.cookie,t},e.prototype.doFetch=function(e,t,r){return fx(this,void 0,void 0,function(){var n,i,o,s,a,l,u;return gx(this,function(c){switch(c.label){case 0:return[4,this.addContextOrWait(e)];case 1:return e=c.sent(),e=this.cleanUserPropsForFetch(e),this.logger.debug("[Experiment] Fetch variants for user: ",e),[4,this.evaluationApi.getVariants(e,vk({timeoutMillis:t},r))];case 2:n=c.sent(),i={};try{for(o=vx(Object.keys(n)),s=o.next();!s.done;s=o.next())a=s.value,i[a]=tx(n[a])}catch(e){l={error:e}}finally{try{s&&!s.done&&(u=o.return)&&u.call(o)}finally{if(l)throw l.error}}return this.logger.debug("[Experiment] Received variants: ",i),[2,i]}})})},e.prototype.doFlags=function(){return fx(this,void 0,void 0,function(){var e,t,r;return gx(this,function(n){switch(n.label){case 0:return n.trys.push([0,4,,5]),e=void 0,this.isWebExperiment?[4,this.addContextOrWait(this.getUser())]:[3,2];case 1:e=n.sent(),n.label=2;case 2:return[4,this.flagApi.getFlags({libraryName:"experiment-js-client",libraryVersion:Pk,timeoutMillis:this.config.fetchTimeoutMillis,deliveryMethod:this.isWebExperiment?"web":void 0,user:(null==e?void 0:e.user_id)||(null==e?void 0:e.device_id)?{user_id:null==e?void 0:e.user_id,device_id:null==e?void 0:e.device_id}:void 0})];case 3:return t=n.sent(),this.flags.clear(),this.flags.putAll(t),[3,5];case 4:if(!((r=n.sent())instanceof tk))throw r;if(this.logger.debug(r),this.config.throwOnError)throw r;return[3,5];case 5:try{this.flags.store()}catch(e){}return this.mergeInitialFlagsWithStorage(),[2]}})})},e.prototype.storeVariants=function(e,t){return fx(this,void 0,void 0,function(){var r,n,i,o;return gx(this,function(s){for(o in 0===(r=t&&t.flagKeys?t.flagKeys:[]).length&&this.variants.clear(),n=function(t){r=r.filter(function(e){return e!==t}),i.variants.put(t,e[t])},i=this,e)n(o);for(o in r)this.variants.remove(o);try{this.variants.store()}catch(e){}return this.logger.debug("[Experiment] Stored variants: ",e),[2]})})},e.prototype.startRetries=function(e,t){return fx(this,void 0,void 0,function(){var r=this;return gx(this,function(n){return this.logger.debug("[Experiment] Retry fetch"),this.retriesBackoff=new Xk(8,500,1e4,1.5),this.retriesBackoff.start(function(){return fx(r,void 0,void 0,function(){return gx(this,function(r){switch(r.label){case 0:return[4,this.fetchInternal(e,1e4,!1,t)];case 1:return r.sent(),[2]}})})}),[2]})})},e.prototype.stopRetries=function(){this.retriesBackoff&&this.retriesBackoff.cancel()},e.prototype.addContext=function(e){var t,r=null===(t=this.userProvider)||void 0===t?void 0:t.getUser(),n=this.integrationManager.getUser(),i=vk(vk(vk({},null==r?void 0:r.user_properties),n.user_properties),null==e?void 0:e.user_properties);return vk(vk(vk(vk({library:"experiment-js-client/".concat(Pk)},r),n),e),{user_properties:i})},e.prototype.addContextOrWait=function(e){return fx(this,void 0,void 0,function(){return gx(this,function(t){switch(t.label){case 0:return[4,this.integrationManager.ready()];case 1:return t.sent(),[2,this.addContext(e)]}})})},e.prototype.sourceVariants=function(){return this.config.source==Tk.LocalStorage?this.variants.getAll():this.config.source==Tk.InitialVariants?this.config.initialVariants:void 0},e.prototype.secondaryVariants=function(){return this.config.source==Tk.LocalStorage?this.config.initialVariants:this.config.source==Tk.InitialVariants?this.variants.getAll():void 0},e.prototype.exposureInternal=function(e,t){var r,n,i,o,s,a,l,u,c;if(null===(i=null===(n=null===(r=t.variant)||void 0===r?void 0:r.metadata)||void 0===n?void 0:n.trackExposure)||void 0===i||i){this.legacyExposureInternal(e,t.variant,t.source);var d={flag_key:e},h=_k(t.source);if(!h||t.hasDefaultVariant){(null===(o=t.variant)||void 0===o?void 0:o.expKey)&&(d.experiment_key=null===(s=t.variant)||void 0===s?void 0:s.expKey);var p=null===(a=t.variant)||void 0===a?void 0:a.metadata;if(h||(null==p?void 0:p.default)||((null===(l=t.variant)||void 0===l?void 0:l.key)?d.variant=t.variant.key:(null===(u=t.variant)||void 0===u?void 0:u.value)&&(d.variant=t.variant.value)),p&&(d.metadata=p),this.isWebExperiment&&(d.time=Date.now()),this.isWebExperiment){var f=ok();if(null==f?void 0:f.location)try{var g=f.location.href;d.metadata.url=g.split("?")[0]||""}catch(e){}}var v=this.addContext(this.getUser());null===(c=this.userSessionExposureTracker)||void 0===c||c.track(d,v),this.integrationManager.track(d,v)}}},e.prototype.legacyExposureInternal=function(e,t,r){var n,i,o,s,a;if(this.analyticsProvider){var l=this.addContext(this.getUser()),u=Gk(l,e,t,r);_k(r)||!(null==t?void 0:t.value)?null===(i=null===(n=this.analyticsProvider)||void 0===n?void 0:n.unsetUserProperty)||void 0===i||i.call(n,u):(null==t?void 0:t.value)&&(null===(s=null===(o=this.analyticsProvider)||void 0===o?void 0:o.setUserProperty)||void 0===s||s.call(o,u),null===(a=this.analyticsProvider)||void 0===a||a.track(u))}},e.getLogLevel=function(e){var t;return!0===e.debug?Ok.Debug:null!==(t=e.logLevel)&&void 0!==t?t:Ok.Error},e.prototype.shouldRetryFetch=function(e){return!(e instanceof ek)||(e.statusCode<400||e.statusCode>=500||429===e.statusCode)},e.prototype.addPlugin=function(e){"integration"===e.type&&this.integrationManager.setIntegration(e)},e}(),ox=function(){function e(e,t){var r,n,i;this.globalScope=ok(),this.userAgent=void 0!==(null===(r=this.globalScope)||void 0===r?void 0:r.navigator)?null===(n=this.globalScope)||void 0===n?void 0:n.navigator.userAgent:void 0,this.ua=new gk.UAParser(this.userAgent).getResult(),this.localStorage=new Fk,this.sessionStorage=new $k,this.userProvider=e,this.apiKey=t,this.storageKey="EXP_".concat(null===(i=this.apiKey)||void 0===i?void 0:i.slice(0,10),"_DEFAULT_USER_PROVIDER")}return e.prototype.getUser=function(){var e,t,r,n,i,o=(null===(e=this.userProvider)||void 0===e?void 0:e.getUser())||{};return vk({language:this.getLanguage(),platform:"Web",os:this.getOs(this.ua),device_model:this.getDeviceModel(this.ua),device_category:null!==(r=null===(t=this.ua.device)||void 0===t?void 0:t.type)&&void 0!==r?r:"desktop",referring_url:null===(i=null===(n=this.globalScope)||void 0===n?void 0:n.document)||void 0===i?void 0:i.referrer.replace(/\/$/,""),cookie:this.getCookie(),browser:this.getBrowser(this.ua),landing_url:this.getLandingUrl(),first_seen:this.getFirstSeen(),url_param:this.getUrlParam(),user_agent:this.userAgent},o)},e.prototype.getLanguage=function(){return"undefined"!=typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},e.prototype.getOs=function(e){var t,r;return[null===(t=e.browser)||void 0===t?void 0:t.name,null===(r=e.browser)||void 0===r?void 0:r.major].filter(function(e){return null!=e}).join(" ")},e.prototype.getDeviceModel=function(e){var t;return null===(t=e.os)||void 0===t?void 0:t.name},e.prototype.getBrowser=function(e){var t,r=null===(t=e.browser)||void 0===t?void 0:t.name;return(null==r?void 0:r.includes("Chrom"))&&(r="Chrome"),(null==r?void 0:r.includes("Firefox"))&&(r="Firefox"),(null==r?void 0:r.includes("Safari"))&&(r="Safari"),(null==r?void 0:r.includes("Edge"))&&(r="Edge"),(null==r?void 0:r.includes("Opera"))&&(r="Opera"),r},e.prototype.getCookie=function(){var e,t,r,n,i;if(null===(t=null===(e=this.globalScope)||void 0===e?void 0:e.document)||void 0===t?void 0:t.cookie)return Object.fromEntries(null===(i=null===(n=null===(r=this.globalScope)||void 0===r?void 0:r.document)||void 0===n?void 0:n.cookie)||void 0===i?void 0:i.split("; ").map(function(e){return e.split("=")}))},e.prototype.getLandingUrl=function(){var e,t;try{var r=JSON.parse(this.sessionStorage.get(this.storageKey)||"{}");return r.landing_url||(r.landing_url=null===(t=null===(e=this.globalScope)||void 0===e?void 0:e.location)||void 0===t?void 0:t.href.replace(/\/$/,""),this.sessionStorage.put(this.storageKey,JSON.stringify(r))),r.landing_url}catch(e){return}},e.prototype.getFirstSeen=function(){try{var e=JSON.parse(this.localStorage.get(this.storageKey)||"{}");return e.first_seen||(e.first_seen=(Date.now()/1e3).toString(),this.localStorage.put(this.storageKey,JSON.stringify(e))),e.first_seen}catch(e){return}},e.prototype.getUrlParam=function(){var e,t,r;if(this.globalScope){var n={};try{var i=new URL(this.globalScope.location.href);try{for(var o=vx(i.searchParams),s=o.next();!s.done;s=o.next()){var a=mx(s.value,2),l=a[0],u=a[1];n[l]=yx(yx([],mx(null!==(r=n[l])&&void 0!==r?r:[]),!1),mx(u.split(",")),!1)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}}catch(e){return}return Object.entries(n).reduce(function(e,t){var r=mx(t,2),n=r[0],i=r[1];return e[n]=1==i.length?i[0]:i,e},{})}},e}(),ik.experimentInstances={},sx=ik.experimentInstances,ax=function(e,t){return dx(e,t,function(){return new Sk(e,yt.getInstance(lx(t)),1e4)})},lx=function(e){return(null==e?void 0:e.instanceName)||Rk.instanceName},ux=function(e,t){var r=lx(t),n=null==t?void 0:t.internalInstanceNameSuffix;return n?"".concat(r,".").concat(e,".").concat(n):"".concat(r,".").concat(e)},cx=function(e,t){return new ix(e,vk(vk({},t),{userProvider:new ox(null==t?void 0:t.userProvider,e)}))},dx=function(e,t,r){var n=ux(e,t),i=sx[n];return i||(i=cx(e,t),r&&i.addPlugin(r()),sx[n]=i,i)},function(){function e(){}return e.prototype.getUser=function(){return{}},e.prototype.start=function(e){return fx(this,void 0,void 0,function(){return gx(this,function(e){return[2]})})},e.prototype.stop=function(){},e.prototype.setUser=function(e){},e.prototype.fetch=function(e,t){return fx(this,void 0,void 0,function(){return gx(this,function(e){return[2,this]})})},e.prototype.getUserProvider=function(){return null},e.prototype.setUserProvider=function(e){return this},e.prototype.variant=function(e,t){return Rk.fallbackVariant},e.prototype.all=function(){return{}},e.prototype.clear=function(){},e.prototype.exposure=function(e){},e}()}}),kx=l({"../../../../node_modules/@amplitude/plugin-experiment-browser/lib/esm/experiment.js"(){Ne(),Ex(),wx=function(){function e(t){this.name=e.pluginName,this.config=t}return e.prototype.setup=function(e,t){var r;return v(this,void 0,void 0,function(){return m(this,function(t){return this.experiment=ax((null===(r=this.config)||void 0===r?void 0:r.deploymentKey)||e.apiKey,this.config),[2]})})},e.pluginName="@amplitude/experiment-analytics-plugin",e}(),Sx=function(e){return new wx(e)}}}),xx={};c(xx,{ExperimentPlugin:()=>wx,experimentPlugin:()=>Sx});var Cx,Ix,Ox,Tx,Ax,_x,Rx,Px,Mx,Nx,Lx,Dx,jx,Ux,Fx,Bx,qx,zx=l({"../../../../node_modules/@amplitude/plugin-experiment-browser/lib/esm/index.js"(){kx()}}),Vx={};function Wx(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Hx(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}c(Vx,{init:()=>Bx,plugin:()=>qx});var $x=l({"../../../../node_modules/@amplitude/engagement-browser/index.esm.js"(){var e;Cx=function(){function e(){}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:Ix(),platform:"Web",os:void 0,deviceModel:void 0}},e}(),Ix=function(){return typeof navigator<"u"&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},Ox=function(){function e(){this.queue=[]}return e.prototype.logEvent=function(e){this.receiver?this.receiver(e):this.queue.length<512&&this.queue.push(e)},e.prototype.setEventReceiver=function(e){this.receiver=e,this.queue.length>0&&(this.queue.forEach(function(t){e(t)}),this.queue=[])},e}(),Tx=function(){return Tx=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Tx.apply(this,arguments)},Ax=function(e,t){var r,n,i=typeof e;if(i!==typeof t)return!1;try{for(var o=Wx(["string","number","boolean","undefined"]),s=o.next();!s.done;s=o.next()){if(s.value===i)return e===t}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}if(null==e&&null==t)return!0;if(null==e||null==t||e.length!==t.length)return!1;var a=Array.isArray(e),l=Array.isArray(t);if(a!==l)return!1;if(!a||!l){var u=Object.keys(e).sort(),c=Object.keys(t).sort();if(!Ax(u,c))return!1;var d=!0;return Object.keys(e).forEach(function(r){Ax(e[r],t[r])||(d=!1)}),d}for(var h=0;h<e.length;h++)if(!Ax(e[h],t[h]))return!1;return!0},Object.entries||(Object.entries=function(e){for(var t=Object.keys(e),r=t.length,n=new Array(r);r--;)n[r]=[t[r],e[t[r]]];return n}),_x=function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var e=this,t=Tx({},this.identity.userProperties),r=Tx(Tx({},this.identity),{userProperties:t});return{setUserId:function(e){return r.userId=e,this},setDeviceId:function(e){return r.deviceId=e,this},setUserProperties:function(e){return r.userProperties=e,this},setOptOut:function(e){return r.optOut=e,this},updateUserProperties:function(e){var t,n,i,o,s,a,l=r.userProperties||{};try{for(var u=Wx(Object.entries(e)),c=u.next();!c.done;c=u.next()){var d=Hx(c.value,2),h=d[0],p=d[1];switch(h){case"$set":try{for(var f=(i=void 0,Wx(Object.entries(p))),g=f.next();!g.done;g=f.next()){var v=Hx(g.value,2),m=v[0],y=v[1];l[m]=y}}catch(e){i={error:e}}finally{try{g&&!g.done&&(o=f.return)&&o.call(f)}finally{if(i)throw i.error}}break;case"$unset":try{for(var b=(s=void 0,Wx(Object.keys(p))),w=b.next();!w.done;w=b.next()){delete l[m=w.value]}}catch(e){s={error:e}}finally{try{w&&!w.done&&(a=b.return)&&a.call(b)}finally{if(s)throw s.error}}break;case"$clearAll":l={}}}}catch(e){t={error:e}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(t)throw t.error}}return r.userProperties=l,this},commit:function(){return e.setIdentity(r),this}}},e.prototype.getIdentity=function(){return Tx({},this.identity)},e.prototype.setIdentity=function(e){var t=Tx({},this.identity);this.identity=Tx({},e),Ax(t,this.identity)||this.listeners.forEach(function(t){t(e)})},e.prototype.addIdentityListener=function(e){this.listeners.add(e)},e.prototype.removeIdentityListener=function(e){this.listeners.delete(e)},e}(),Rx=typeof globalThis<"u"?globalThis:typeof window<"u"?window:self,Px=function(){function e(){this.identityStore=new _x,this.eventBridge=new Ox,this.applicationContextProvider=new Cx}return e.getInstance=function(t){return Rx.analyticsConnectorInstances||(Rx.analyticsConnectorInstances={}),Rx.analyticsConnectorInstances[t]||(Rx.analyticsConnectorInstances[t]=new e),Rx.analyticsConnectorInstances[t]},e}(),Mx=["boot"],Nx="$default_instance",Lx=Symbol.for("amplitude-engagement-plugin-caller"),(e=Dx||{}).Local="https://local.amplitude.com:3010/",e.Staging="https://apps.stag2.amplitude.com/",e.Production="https://app.amplitude.com/",e.ProductionEU="https://app.eu.amplitude.com/",Dx=e,jx=e=>{if(typeof window<"u"&&window.opener)for(let t of Object.values(Dx))window.opener.postMessage({message:e},t)},Ux=()=>(jx("ENGAGEMENT_SNIPPET"),function(e){var t,r,n,i,o,s,a,l,u,c;let d=typeof window<"u"?window.engagement:void 0,h=!1,p={_q:null!=(t=null==d?void 0:d._q)?t:[],_configuration:{apiKey:null!=(n=null==(r=null==d?void 0:d._configuration)?void 0:r.apiKey)?n:"",serverUrl:null==(i=null==d?void 0:d._configuration)?void 0:i.serverUrl,chatUrl:null==(o=null==d?void 0:d._configuration)?void 0:o.chatUrl,mediaUrl:null==(s=null==d?void 0:d._configuration)?void 0:s.mediaUrl,serverZone:null!=(l=null==(a=null==d?void 0:d._configuration)?void 0:a.serverZone)?l:"US",autoRefreshIntervalSeconds:null==(u=null==d?void 0:d._configuration)?void 0:u.autoRefreshIntervalSeconds,options:{...null==(c=null==d?void 0:d._configuration)?void 0:c.options}},init(t,r){var n,i,o,s;if(p._configuration.apiKey)return void console.log("Engagement SDK has already been initialized. Ignoring additional init call.");if(!0===(null==r?void 0:r.skip))return console.log("Engagement SDK init skipped via `skip: true`. The SDK bundle will not be loaded."),void(h=!0);if(h&&(p._q.length=0),h=!1,null!=r&&r.useEngagementDomain){let e="EU"===(null!=(n=r.serverZone)?n:p._configuration.serverZone),t="amplitudeengagement.com";r.serverUrl||(r.serverUrl=e?`https://gs.eu.${t}`:`https://gs.${t}`),r.chatUrl||(r.chatUrl=e?`https://houston-chat.eu.${t}`:`https://houston-chat.${t}`),r.mediaUrl||(r.mediaUrl=e?`https://engagement-static.eu.${t}`:`https://engagement-static.${t}`),r.cdnUrl||(r.cdnUrl=e?`https://cdn.eu.${t}`:`https://cdn.${t}`)}let a;if(p._configuration={...p._configuration,...r,apiKey:t,options:{splitting:!0,...p._configuration.options,...null==r?void 0:r.options}},null!=(o=null==(i=p._configuration)?void 0:i.options)&&o.logger&&p._configuration.options.logger.enable(null!=(s=p._configuration.options.logLevel)?s:2),null!=r&&r.cdnUrl)a=p._configuration.options.splitting?`${r.cdnUrl}/engagement-browser/prod/split/index.js`:r.cdnUrl+"/engagement-browser/prod/index.min.js.gz";else{let e="EU"===p._configuration.serverZone?"https://cdn.eu.amplitude.com":"https://cdn.amplitude.com";a=p._configuration.options.splitting?`${e}/engagement-browser/prod/split/index.js`:`${e}/engagement-browser/prod/index.min.js.gz`}let l=null,u=()=>{if(h=!0,l&&(clearTimeout(l),l=null),p._q&&p._q.length>0)for(console.warn(`Engagement SDK failed to load within ${c}ms. Resolving pending calls gracefully.`);p._q.length>0;){let e=p._q.shift();if(!e)continue;let t=e[0],r=Mx.includes(t);if(console.warn(`Engagement SDK method '${t}' still in queue (isAsyncMethod=${r}); attempting to resolve as no-op.`),r&&e[1]instanceof Function&&e[2]instanceof Function){let r=e[1];console.warn(`Engagement SDK method '${t}' resolved as no-op due to script loading failure`),r(void 0)}}};e(a,p._configuration.options.splitting?"module":void 0,null==r?void 0:r.nonce,u);let c=1e4;l=setTimeout(()=>{u()},c)},plugin(e){let t=p.init,r=null==e?void 0:e.token,n=!0===(null==e?void 0:e.skip),i=(e,t)=>{let n=t.getIdentity(),i="function"==typeof r?r():r;return{user_id:e.getUserId(),device_id:e.getDeviceId(),user_properties:n.userProperties,getSessionId:e.getSessionId,...i?{token:i}:{}}};return{name:"@amplitude/engagement-browser",type:"enrichment",async setup(r,o){var s;if(n)return void t(r.apiKey,{skip:!0});let a=null!=(s=r.instanceName)?s:Nx,l=Px.getInstance(a).identityStore;p._configuration._installedViaPlugin=!0,t(r.apiKey,{serverZone:r.serverZone,...e,options:{logLevel:r.logLevel,logger:r.loggerProvider,...null==e?void 0:e.options}});let u=[{track:e=>{o.track(e)}}];await window.engagement.boot({user:()=>i(o,l),integrations:u},Lx),l.addIdentityListener(e=>{var t,r,n,s;null!=(t=window.engagement)&&t._.user&&null!=(r=window.engagement)&&r._analytics.hasBooted?(null==(s=null==(n=window.engagement)?void 0:n._.user)?void 0:s.user_id)!==e.userId?(window.engagement.shutdown(Lx),window.engagement.boot({user:()=>i(o,l),integrations:u},Lx)):window.engagement._setUserProperties(e.userProperties):console.warn("Engagement SDK not booted. Ignoring identity change.")})},execute:async e=>(n||window.engagement.forwardEvent(e),e)}}},f=p;return new Proxy(p,{get:function(e,t){return t in f?f[t]:"then"!==t?"gs"===t||"rc"===t||"assistant"===t?new Proxy({},{get:function(e,r){return function(){let e=Array.from(arguments),n=`${t}.${r}`;e.unshift(n),p._q.push(e)}}}):Mx.includes(t)?function(){let e=Array.prototype.slice.call(arguments);return new Promise((r,n)=>{e.unshift(t,r,n),p._q.push(e),h&&r(void 0)})}:function(){let e=Array.prototype.slice.call(arguments);e.unshift(t),p._q.push(e)}:void 0}})}((e,t,r,n)=>function(e,t,r,n){for(let i of e){let e=document.createElement("script");e.src=i,e.id="engagement-sdk-bundle",r&&e.setAttribute("nonce",r),t&&e.setAttribute("type",t),n&&(e.onerror=n);let o=document.getElementsByTagName("head")[0];o&&o.appendChild(e)}}([e||"https://cdn.amplitude.com/engagement-browser/prod/index.min.js.gz"],t,r,n))),Fx=Ux(),Bx=(e,t)=>{typeof window<"u"&&!window.engagement&&(window.engagement=Fx),Fx.init(e,t)},qx=e=>(typeof window<"u"&&!window.engagement&&(window.engagement=Fx),Fx.plugin(e))}}),Gx={};c(Gx,{DestinationAmplitude:()=>EA,default:()=>DA,destinationAmplitude:()=>LA});var Kx=Object.defineProperty,Jx=(e,t)=>{for(var r in t)Kx(e,r,{get:t[r],enumerable:!0})};function Qx(e,t){if("collector"===e)return"collector";if(!t)throw new Error(`stepId(${e}) requires an id`);return`${e}.${t}`}Jx({},{stepId:()=>Qx});function Yx(e,t){const r=e.destinations[t];if(!r)throw new Error(`Destination not found: ${t}`);return r}Jx({},{getDestination:()=>Yx});Jx({},{Level:()=>Zx});var Xx,Zx=((Xx=Zx||{})[Xx.ERROR=0]="ERROR",Xx[Xx.WARN=1]="WARN",Xx[Xx.INFO=2]="INFO",Xx[Xx.DEBUG=3]="DEBUG",Xx);function eC(e,t){const r=e.transformers[t];if(!r)throw new Error(`Transformer not found: ${t}`);return r}Jx({},{getTransformer:()=>eC});function tC(e,t){const r=e.sources[t];if(!r)throw new Error(`Source not found: ${t}`);return r}Jx({},{getSource:()=>tC});function rC(e,t){const r=e.stores[t];if(!r)throw new Error(`Store not found: ${t}`);return r}async function nC(e,t){return await e.get(t)}Jx({},{getStore:()=>rC,getStoreValue:()=>nC});var iC="\\$flow\\.([a-zA-Z_][a-zA-Z0-9_-]*)(?:\\.([a-zA-Z0-9_.]+))?";new RegExp(`^${iC}$`),new RegExp(iC,"g");function oC(e){return Array.isArray(e)}function sC(e){return void 0!==e}function aC(e){return"number"==typeof e&&!Number.isNaN(e)}function lC(e){return"object"==typeof e&&null!==e&&!oC(e)&&"[object Object]"===Object.prototype.toString.call(e)}function uC(e){return"string"==typeof e}function cC(e,t="",r){const n=t.split(".");let i=e;for(let e=0;e<n.length;e++){const t=n[e];if("*"===t&&oC(i)){const t=n.slice(e+1).join("."),o=[];for(const e of i){const n=cC(e,t,r);o.push(n)}return o}if(i=lC(i)||oC(i)?i[t]:void 0,void 0===i)break}return sC(i)?i:r}function dC(e,t={},r={}){const n={...t,...r},i={};let o=!e||0===Object.keys(e).length;return Object.keys(n).forEach(t=>{n[t]&&(i[t]=!0,e&&e[t]&&(o=!0))}),!!o&&i}function hC(e){return function(e){return"boolean"==typeof e}(e)||uC(e)||aC(e)||!sC(e)||oC(e)&&e.every(hC)||lC(e)&&Object.values(e).every(hC)}function pC(e){return hC(e)?e:void 0}function fC(e,t,r){return async function(...n){try{return await e(...n)}catch(e){if(!t)return;return await t(e)}finally{await(null==r?void 0:r())}}}function gC(e,t){Object.defineProperty(e,"cause",{value:t,writable:!0,configurable:!0})}var vC=class e extends Error{constructor(t,r){super(t),this.name="FatalError",r&&"cause"in r&&gC(this,r.cause),Object.setPrototypeOf(this,e.prototype)}},mC=["transport","timeout","breaker-open","blocked","queue-full","vendor-not-ready","vendor-timeout"],yC=class extends Error{constructor(e,t){super(e),p(this,"code"),p(this,"status"),p(this,"retryable"),p(this,"body"),void 0!==t.cause&&gC(this,t.cause),this.name="StepError",this.code=t.code,void 0!==t.status&&(this.status=t.status),this.retryable=function(e){if(void 0!==e.retryable)return e.retryable;const{status:t}=e;if(void 0!==t){if(429===t||t>=500&&t<600)return!0;if(t>=400&&t<500)return!1}return mC.includes(e.code)}(t),void 0!==t.body&&(this.body=t.body),Object.setPrototypeOf(this,new.target.prototype)}};async function bC(e,t,r){try{return await e()}catch(e){if(e instanceof yC)throw e;throw new yC(r,{code:t,cause:e})}}function wC(e){return e.length>300?e.slice(0,300):e}var SC=["type","mappingKey"],EC=["count","suppressed"];function kC(e,t,r,n,i,o="error"){if(null==e?void 0:e.causeLog)return void e.causeLog.report(r,n,i,o);const s=function(e,t){const r={step:e.step,code:e.code};void 0!==e.status&&(r.status=e.status);for(const e of SC)"string"==typeof t[e]&&(r[e]=t[e]);for(const e of EC)"number"==typeof t[e]&&(r[e]=t[e]);"boolean"==typeof t.retryable&&(r.retryable=t.retryable);const n="string"==typeof(i=t.event)?i:lC(i)&&"string"==typeof i.name?i.name:void 0;var i;void 0!==n&&(r.event=n);const o=function(e){if(void 0!==e)return"string"==typeof e?wC(e):e instanceof Error||lC(e)&&"string"==typeof e.message?wC(e.message):wC(String(e))}(t.error);return void 0!==o&&(r.error=o),r}(r,i);"warn"===o?t.warn(n,s):t.error(n,s)}var xC=["condition","consent","fn","key","loop","map","set","validate","value"];function CC(e,t,r,n){const i=e.event.name,o=(null==t?void 0:t.mappingKey)?`mapping.${t.mappingKey}`:"mapping";kC(e.collector,e.logger,{step:o,code:"mapping"},r,{..."string"==typeof i?{event:i}:{},...(null==t?void 0:t.mappingKey)?{mappingKey:t.mappingKey}:{},...void 0!==n?{error:n}:{}})}async function IC(e,t={},r,n){var i;if(!r.collector)throw new Error("getMappingValue: context.collector is required");const o=r.consent||r.collector.consent,s={event:null!=(i=r.event)?i:{},mapping:t,collector:r.collector,logger:r.collector.logger,consent:o},a=oC(t)?t:[t];for(const t of a){const r=await fC(OC,e=>{if(e instanceof vC)throw e;CC(s,n,"mapping value failed",e)})(e,t,{...s,mapping:t},n);if(sC(r))return r}}async function OC(e,t,r,n){return(oC(t)?t:[t]).reduce(async(t,i)=>{const o=await t;if(o)return o;const s=uC(i)?{key:i}:i;if(!Object.keys(s).length)return;if(!xC.some(e=>e in s))return void CC({...r,mapping:i},n,`mapping value has no operator (${Object.keys(s).join(", ")}): wrap the fields in map, or use key, value, fn, loop or set`);const{condition:a,consent:l,fn:u,key:c,loop:d,map:h,set:p,validate:f,value:g}=s,v={...r,mapping:i};if(a&&!await fC(a,e=>{if(e instanceof vC)throw e;return CC(v,n,"mapping condition failed",e),!1})(e,v))return;if(l&&!dC(l,v.consent))return g;let m=sC(g)?g:e;if(d){const[t,r]=d,i="this"===t?[e]:await IC(e,t,v,n);m=oC(i)?(await Promise.all(i.map(e=>sC(e)?IC(e,r,v,n):void 0))).filter(sC):void 0}else h?m=await Object.entries(h).reduce(async(t,[r,i])=>{const o=await t,s=await IC(e,i,v,n);return sC(s)&&(o[r]=s),o},Promise.resolve({})):p?m=await Promise.all(p.map(t=>OC(e,t,v,n))):c?m=cC(e,c,g):u&&(m=await fC(u,e=>{if(e instanceof vC)throw e;CC(v,n,"mapping fn failed",e)})(e,v));f&&!await fC(f,e=>{if(e instanceof vC)throw e;return CC(v,n,"mapping validate failed",e),!1})(m,v)&&(m=void 0);const y=pC(m);return sC(y)?y:pC(g)},Promise.resolve(void 0))}async function TC(e,t={},r){return async function(e,t,r,n){var i,o;if(!sC(e))return;const s=lC(e)&&e.consent||(null==r?void 0:r.consent)||(null==(i=null==r?void 0:r.collector)?void 0:i.consent),a=null!=(o=null==r?void 0:r.event)?o:lC(e)?e:{};return IC(e,t,{...r,consent:s,event:a},n)}(e,t,r)}Ne(),Ki(),Ne(),Ki(),Ne(),Ki();var AC=function(e,t){return"boolean"==typeof e?e:!1!==(null==e?void 0:e[t])&&(i=de(),"string"!=typeof(null===(n=null===(r=null==i?void 0:i.chrome)||void 0===r?void 0:r.runtime)||void 0===n?void 0:n.id)||!!(null==e?void 0:e[t]));var r,n,i},_C=function(e){return AC(e,"attribution")},RC=function(e){return AC(e,"formInteractions")},PC=function(e){return AC(e,"pageViews")},MC=function(e){return AC(e,"sessions")},NC=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.networkTracking||"object"==typeof e.networkTracking)},LC=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.elementInteractions||"object"==typeof e.elementInteractions)},DC=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.frustrationInteractions||"object"==typeof e.frustrationInteractions)},jC=function(e){if("object"==typeof e.autocapture){var t=e.autocapture.performanceTracking;return!0===t?{mainThreadBlock:!0}:"object"==typeof t&&null!==t?t:void 0}},UC=function(e){if(LC(e.autocapture)&&"object"==typeof e.autocapture&&"object"==typeof e.autocapture.elementInteractions)return e.autocapture.elementInteractions},FC=function(e){if(DC(e.autocapture)&&"object"==typeof e.autocapture&&"object"==typeof e.autocapture.frustrationInteractions)return e.autocapture.frustrationInteractions},BC=function(e){var r;if(NC(e.autocapture)){var n=void 0;return"object"==typeof e.autocapture&&"object"==typeof e.autocapture.networkTracking?n=e.autocapture.networkTracking:e.networkTrackingOptions&&(n=e.networkTrackingOptions),t(t({},n),{captureRules:null===(r=null==n?void 0:n.captureRules)||void 0===r?void 0:r.map(function(r){var n,i,o;if((null===(n=r.urls)||void 0===n?void 0:n.length)&&(null===(i=r.hosts)||void 0===i?void 0:i.length)){var s=JSON.stringify(r.hosts),a=JSON.stringify(r.urls);return null===(o=e.loggerProvider)||void 0===o||o.warn("Found network capture rule with both urls='".concat(a,"' and hosts='").concat(s,"' set. ")+"Definition of urls takes precedence over hosts, so ignoring hosts."),t(t({},r),{hosts:void 0})}return r})})}},qC=function(e){var t,r=function(){return!1},n=void 0,i=e.pageCounter;return PC(e.defaultTracking)&&(r=void 0,t=void 0,e.defaultTracking&&"object"==typeof e.defaultTracking&&e.defaultTracking.pageViews&&"object"==typeof e.defaultTracking.pageViews&&("trackOn"in e.defaultTracking.pageViews&&(r=e.defaultTracking.pageViews.trackOn),"trackHistoryChanges"in e.defaultTracking.pageViews&&(n=e.defaultTracking.pageViews.trackHistoryChanges),"eventType"in e.defaultTracking.pageViews&&e.defaultTracking.pageViews.eventType&&(t=e.defaultTracking.pageViews.eventType))),{trackOn:r,trackHistoryChanges:n,eventType:t,pageCounter:i}},zC=function(e,t){for(var r=0;r<t.length;r++){var n=t[r],i=n.name,o=n.args,s=n.resolve,a=e&&e[i];if("function"==typeof a){var l=a.apply(e,o);"function"==typeof s&&s(null==l?void 0:l.promise)}}return e},VC=function(e){return e&&void 0!==e._q};Ne(),Ki();var WC="2.42.5",HC="amplitude-ts",$C=function(){function e(){this.name="@amplitude/plugin-context-browser",this.type="before",this.library="".concat(HC,"/").concat(WC),"undefined"!=typeof navigator&&(this.userAgent=navigator.userAgent)}return e.prototype.setup=function(e){return this.config=e,Promise.resolve(void 0)},e.prototype.execute=function(e){var r,n;return v(this,void 0,void 0,function(){var i,o,s;return m(this,function(a){return i=(new Date).getTime(),o=null!==(r=this.config.lastEventId)&&void 0!==r?r:-1,s=null!==(n=e.event_id)&&void 0!==n?n:o+1,this.config.lastEventId=s,e.time||(this.config.lastEventTime=i),[2,t(t(t(t(t(t(t(t({user_id:this.config.userId,device_id:this.config.deviceId,session_id:this.config.sessionId,time:i},this.config.appVersion&&{app_version:this.config.appVersion}),this.config.trackingOptions.platform&&{platform:"Web"}),this.config.trackingOptions.language&&{language:At()}),this.config.trackingOptions.ipAddress&&{ip:"$remote"}),{insert_id:fe(),partner_id:this.config.partnerId,plan:this.config.plan}),this.config.ingestionMetadata&&{ingestion_metadata:{source_name:this.config.ingestionMetadata.sourceName,source_version:this.config.ingestionMetadata.sourceVersion}}),e),{event_id:s,library:this.library,user_agent:this.userAgent})]})})},e}();Ne(),Ki(),Ne(),Ki();var GC=1e3,KC=function(e){function t(t){var r,n,i,o=this;try{i=null===(r=de())||void 0===r?void 0:r.localStorage}catch(e){null===(n=null==t?void 0:t.loggerProvider)||void 0===n||n.debug("Failed to access localStorage. error=".concat(JSON.stringify(e))),i=void 0}return(o=e.call(this,i)||this).loggerProvider=null==t?void 0:t.loggerProvider,o}return f(t,e),t.prototype.set=function(t,r){var n;return v(this,void 0,void 0,function(){var i;return m(this,function(o){switch(o.label){case 0:return Array.isArray(r)&&r.length>GC?(i=r.length-GC,[4,e.prototype.set.call(this,t,r.slice(0,GC))]):[3,2];case 1:return o.sent(),null===(n=this.loggerProvider)||void 0===n||n.error("Failed to save ".concat(i," events because the queue length exceeded ").concat(GC,".")),[3,4];case 2:return[4,e.prototype.set.call(this,t,r)];case 3:o.sent(),o.label=4;case 4:return[2]}})})},t}(Ht);Ne(),Ki();var JC=function(e){function t(){var t;return e.call(this,null===(t=de())||void 0===t?void 0:t.sessionStorage)||this}return f(t,e),t}(Ht);Ne(),Ki();var QC=function(e){function r(t){void 0===t&&(t={});var r=e.call(this)||this;return r.state={done:4},r.customHeaders=t,r}return f(r,e),r.prototype.send=function(e,r,n){return void 0===n&&(n=!1),v(this,void 0,void 0,function(){var i=this;return m(this,function(o){return[2,new Promise(function(o,s){"undefined"==typeof XMLHttpRequest&&s(new Error("XHRTransport is not supported."));var a=new XMLHttpRequest;a.open("POST",e,!0),a.onreadystatechange=function(){if(a.readyState===i.state.done){var e=a.responseText;try{o(i.buildResponse(JSON.parse(e)))}catch(e){o(i.buildResponse({code:a.status}))}}};var l={"Content-Type":"application/json",Accept:"*/*"},u=JSON.stringify(r),c=n&&u.length>=or&&Cr(),d=function(e){var r,n;l=t(t({},i.customHeaders),l);try{for(var o=y(Object.entries(l)),s=o.next();!s.done;s=o.next()){var u=b(s.value,2),c=u[0],d=u[1];a.setRequestHeader(c,d)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}a.send(e)};v(i,void 0,void 0,function(){var e;return m(this,function(t){switch(t.label){case 0:return c?[4,Ir(u)]:[3,2];case 1:return(e=t.sent())?(l["Content-Encoding"]="gzip",d(e)):d(u),[3,3];case 2:d(u),t.label=3;case 3:return[2]}})}).catch(s)})]})})},r}(nr);Ne(),Ki();var YC=function(e){function r(t){void 0===t&&(t={});var r=e.call(this)||this;return r.customHeaders=t,r}return f(r,e),r.prototype.send=function(e,r,n){return void 0===n&&(n=!1),v(this,void 0,void 0,function(){var i,o,s,a,l,u,c;return m(this,function(d){switch(d.label){case 0:if("undefined"==typeof fetch)throw new Error("FetchTransport is not supported");return i=JSON.stringify(r),o=n&&i.length>=or&&Cr(),s=i,a={"Content-Type":"application/json",Accept:"*/*"},o?[4,Ir(i)]:[3,2];case 1:(l=d.sent())&&(a["Content-Encoding"]="gzip",s=l),d.label=2;case 2:return a=t(t({},this.customHeaders),a),[4,fetch(e,{headers:a,body:s,method:"POST"})];case 3:return[4,(u=d.sent()).text()];case 4:c=d.sent();try{return[2,this.buildResponse(JSON.parse(c))]}catch(e){return[2,this.buildResponse({code:u.status})]}return[2]}})})},r}(nr);Ne(),Ki();var XC=function(e){function t(){return e.call(this)||this}return f(t,e),t.prototype.send=function(e,t,r){return void 0===r&&(r=!1),v(this,void 0,void 0,function(){var r=this;return m(this,function(n){return[2,new Promise(function(n,i){var o=de();if(!(null==o?void 0:o.navigator.sendBeacon))throw new Error("SendBeaconTransport is not supported");try{var s=JSON.stringify(t);return n(o.navigator.sendBeacon(e,s)?r.buildResponse({code:200,events_ingested:t.events.length,payload_size_bytes:s.length,server_upload_time:Date.now()}):r.buildResponse({code:500}))}catch(e){i(e)}})]})})},t}(nr);Ne(),Ki();var ZC=function(e,t,r){return void 0===r&&(r=!0),v(void 0,void 0,void 0,function(){var n,i,o,s,a,l,u,c,d;return m(this,function(h){switch(h.label){case 0:return n=Tt(e),[4,t.getRaw(n)];case 1:return(i=h.sent())?r?[4,t.remove(n)]:[3,3]:[2,{optOut:!1}];case 2:h.sent(),h.label=3;case 3:return o=b(i.split("."),6),s=o[0],a=o[1],l=o[2],u=o[3],c=o[4],d=o[5],[2,{deviceId:s,userId:tI(a),sessionId:eI(u),lastEventId:eI(d),lastEventTime:eI(c),optOut:Boolean(l)}]}})})},eI=function(e){var t=parseInt(e,32);if(!isNaN(t))return t},tI=function(e){if(atob&&escape&&e)try{return decodeURIComponent(escape(atob(e)))}catch(e){return}},rI="[Amplitude]",nI=("".concat(rI," Page Viewed"),"".concat(rI," Form Started")),iI="".concat(rI," Form Submitted"),oI="".concat(rI," File Downloaded"),sI="session_start",aI="session_end",lI="".concat(rI," File Extension"),uI="".concat(rI," File Name"),cI="".concat(rI," Link ID"),dI="".concat(rI," Link Text"),hI="".concat(rI," Link URL"),pI="".concat(rI," Form ID"),fI="".concat(rI," Form Name"),gI="".concat(rI," Form Destination"),vI="cookie";Ne(),Ki(),Ki();var mI=function(e){var t=e.split(".");return t.length<=2?e:t.slice(t.length-2,t.length).join(".")},yI=function(e,r,n,i,o,s){void 0===o&&(o=!0);e.referrer;var a,l=e.referring_domain,u=g(e,["referrer","referring_domain"]),c=r||{},d=(c.referrer,c.referring_domain),h=g(c,["referrer","referring_domain"]),p=n.excludeInternalReferrers;if(p){var f=wI(p,i);if(!(f instanceof TypeError)&&e.referring_domain&&xI(e.referring_domain,s)){if("always"===f)return SI(f,e.referring_domain,i),!1;if("ifEmptyCampaign"===f&&(a=t(t({},e),{referring_domain:void 0,referrer:void 0}),Object.values(a).every(function(e){return!e})))return SI(f,e.referring_domain,i),!1}}if(bI(n.excludeReferrers,e.referring_domain))return i.debug("This is not a new campaign because ".concat(e.referring_domain," is in the exclude referrer list.")),!1;if(!o&&function(e){return Object.values(e).every(function(e){return!e})}(e)&&r)return i.debug("This is not a new campaign because this is a direct traffic in the same session."),!1;var v=JSON.stringify(u)!==JSON.stringify(h),m=mI(l||"")!==mI(d||""),y=!r||v||m;return y?i.debug("This is a new campaign. An $identify event will be sent."):i.debug("This is not a new campaign because it's the same as the previous one."),y},bI=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=""),e.some(function(e){return e instanceof RegExp?e.test(t):e===t})},wI=function(e,t){if(!0===e)return di.always;if("object"==typeof e){var r=e.condition;if("string"==typeof r&&Object.keys(di).includes(r))return r;if(void 0===r)return di.always}var n="Invalid configuration provided for attribution.excludeInternalReferrers: ".concat(JSON.stringify(e));return t.error(n),new TypeError(n)};function SI(e,t,r){var n="This is not a new campaign because referring_domain=".concat(t," is on the same domain as the current page and it is configured to exclude internal referrers");"always"===e?r.debug(n):"ifEmptyCampaign"===e&&r.debug("".concat(n," with empty campaign parameters"))}var EI=["ac.in","ac.jp","ac.kr","ac.th","ac.uk","ac.za","appspot.com","asn.au","azurewebsites.net","cloudfront.net","myshopify.com","blogspot.com","co.ca","co.in","co.jp","co.kr","co.nz","co.th","co.uk","co.za","com.ar","com.au","com.br","com.cn","com.hk","com.in","com.jp","com.kr","com.mx","com.pl","com.sg","com.tr","com.tw","ed.jp","edu.au","edu.br","edu.cn","edu.hk","edu.sg","edu.th","edu.tr","edu.tw","firebaseapp.com","fly.dev","gc.ca","geek.nz","github.io","gitlab.io","go.jp","go.kr","go.th","gob.ar","gob.mx","gov.au","gov.br","gov.cn","gov.hk","gov.in","gov.pl","gov.sg","gov.tr","gov.tw","gov.uk","gov.za","govt.nz","gr.jp","herokuapp.com","id.au","idv.hk","iwi.nz","lg.jp","ltd.uk","maori.nz","me.uk","mil.kr","ne.jp","ne.kr","net.au","net.br","net.cn","net.hk","net.in","net.nz","net.pl","net.sg","net.tr","net.tw","net.za","onrender.com","or.jp","or.kr","or.th","org.ar","org.au","org.br","org.cn","org.hk","org.in","org.mx","org.nz","org.pl","org.sg","org.tw","org.uk","org.za","pages.dev","pe.kr","plc.uk","re.kr","res.in","sch.uk","vercel.app","netlify.app","workers.dev"],kI=function(e){var t,r,n=e||(null===(r=null===(t=de())||void 0===t?void 0:t.location)||void 0===r?void 0:r.hostname);if(!n)return"";var i=n.split("."),o=i[i.length-1],s=i[i.length-2];return EI.find(function(e){return n.endsWith(".".concat(e))})&&(o=i[i.length-2]+"."+i[i.length-1],s=i[i.length-3]),s?"".concat(s,".").concat(o):o},xI=function(e,t){var r=de();if(!r)return!1;var n,i,o,s=(t||"").trim()||kI(r.location.hostname);return n=e,o=(i=s).startsWith(".")?i:".".concat(i),!!(n.startsWith(".")?n:".".concat(n)).endsWith(o)},CI=function(e){function t(t,r,n,i,o,s,a,l,u,c,d,h,p,f,g,v,m,y,b,w,S,E,k,x,C,I,O,T,A,_,R,P,M,N,L,D,j,U,F,B,q,z,V,W){void 0===n&&(n=new jt),void 0===i&&(i={domain:"",expiration:365,sameSite:"Lax",secure:!1,upgrade:!0}),void 0===l&&(l=1e3),void 0===u&&(u=5),void 0===c&&(c=30),void 0===d&&(d=vI),void 0===v&&(v=new Te),void 0===m&&(m=Ie.Warn),void 0===b&&(b=!1),void 0===w&&(w=!1),void 0===k&&(k=""),void 0===x&&(x="US"),void 0===O&&(O=18e5),void 0===T&&(T=new KC({loggerProvider:v})),void 0===A&&(A={ipAddress:!0,language:!0,platform:!0}),void 0===_&&(_="fetch"),void 0===R&&(R=!1),void 0===P&&(P=!0),void 0===U&&(U=!0),void 0===F&&(F=0),void 0===V&&(V=!1);var H,$=this;($=e.call(this,{apiKey:t,storageProvider:T,transportProvider:TI(_)})||this).apiKey=t,$.appVersion=r,$.cookieOptions=i,$.defaultTracking=o,$.autocapture=s,$.flushIntervalMillis=l,$.flushMaxRetries=u,$.flushQueueSize=c,$.identityStorage=d,$.ingestionMetadata=h,$.instanceName=p,$.loggerProvider=v,$.logLevel=m,$.minIdLength=y,$.offline=b,$.partnerId=S,$.plan=E,$.serverUrl=k,$.serverZone=x,$.sessionTimeout=O,$.storageProvider=T,$.trackingOptions=A,$.transport=_,$.useBatch=R,$.fetchRemoteConfig=P,$.networkTrackingOptions=D,$.identify=j,$.enableDiagnostics=U,$.diagnosticsSampleRate=F,$.diagnosticsClient=B,$.remoteConfig=q,$.topLevelDomain=z,$.enableRequestBodyCompression=V,$.customEnrichment=W,$.version=WC,$._optOut=!1,$._cookieStorage=n,$.deviceId=a,$.lastEventId=f,$.lastEventTime=g,$.optOut=w,$.deferredSessionId=I,$.sessionId=C,$.pageCounter=N,$.userId=M,$.debugLogsEnabled=L,$.loggerProvider.enable(L?Ie.Debug:$.logLevel),$.networkTrackingOptions=D,$.identify=j,$.enableDiagnostics=U,$.diagnosticsSampleRate=F,$.diagnosticsClient=B;var G=null!==(H=null==q?void 0:q.fetchRemoteConfig)&&void 0!==H?H:P;return $.remoteConfig=$.remoteConfig||{},$.remoteConfig.fetchRemoteConfig=G,$.fetchRemoteConfig=G,$.topLevelDomain=z||kI(),$}return f(t,e),Object.defineProperty(t.prototype,"cookieStorage",{get:function(){return this._cookieStorage},set:function(e){this._cookieStorage!==e&&(this._cookieStorage=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"deviceId",{get:function(){return this._deviceId},set:function(e){this._deviceId!==e&&(this._deviceId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"userId",{get:function(){return this._userId},set:function(e){this._userId!==e&&(this._userId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sessionId",{get:function(){return this._sessionId},set:function(e){this._sessionId!==e&&(this._sessionId=e,void 0!==e&&void 0!==this._deferredSessionId&&(this._deferredSessionId=void 0),this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"deferredSessionId",{get:function(){return this._deferredSessionId},set:function(e){this._deferredSessionId!==e&&e!==this.sessionId&&(this._deferredSessionId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut!==e&&(this._optOut=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastEventTime",{get:function(){return this._lastEventTime},set:function(e){this._lastEventTime!==e&&(this._lastEventTime=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastEventId",{get:function(){return this._lastEventId},set:function(e){this._lastEventId!==e&&(this._lastEventId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageCounter",{get:function(){return this._pageCounter},set:function(e){this._pageCounter!==e&&(this._pageCounter=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"debugLogsEnabled",{set:function(e){this._debugLogsEnabled!==e&&(this._debugLogsEnabled=e,this.updateStorage())},enumerable:!1,configurable:!0}),t.prototype.updateStorage=function(){var e={deviceId:this._deviceId,userId:this._userId,sessionId:this._sessionId,deferredSessionId:this._deferredSessionId,optOut:this._optOut,lastEventTime:this._lastEventTime,lastEventId:this._lastEventId,pageCounter:this._pageCounter,debugLogsEnabled:this._debugLogsEnabled,cookieDomain:void 0};this.cookieStorage instanceof Ft&&(e.cookieDomain=this.cookieStorage.options.domain),this.cookieStorage.set(Ot(this.apiKey),e)},t}(_e),II=function(e,r,n,i,o){return void 0===r&&(r={}),v(void 0,void 0,void 0,function(){var s,a,l,u,c,d,h,p,f,g,v,y,b,w,S,E,k,x,C,I,O,T,A,_,R,P,M,N,L,D,j,U,F,B,q,z,V,W,H,$,G,K,J,Q,Y,X,Z,ee,te,re,ne;return m(this,function(m){switch(m.label){case 0:return s=r.identityStorage||vI,a="",s!==vI||(null===(T=r.cookieOptions)||void 0===T?void 0:T.domain)||""===(null===(A=r.cookieOptions)||void 0===A?void 0:A.domain)?[3,2]:[4,AI(void 0,i)];case 1:a=m.sent(),m.label=2;case 2:return l=t({domain:null!==(R=null===(_=r.cookieOptions)||void 0===_?void 0:_.domain)&&void 0!==R?R:a,expiration:365,sameSite:"Lax",secure:!1,upgrade:!0},r.cookieOptions),u={duplicateResolverFn:function(e){var t=zt(e);if(!t)return!1;var r=JSON.parse(t);return Vt(r.cookieDomain,l.domain)},diagnosticsClient:i},c=OI(r.identityStorage,l,u),[4,ZC(e,c,null===(M=null===(P=r.cookieOptions)||void 0===P?void 0:P.upgrade)||void 0===M||M)];case 3:return d=m.sent(),[4,c.get(Ot(e))];case 4:return h=m.sent(),p=_t(),f=p.ampTimestamp?Number(p.ampTimestamp):void 0,g=!f||Date.now()<f,v=null!==(U=null!==(j=null!==(D=null!==(N=r.deviceId)&&void 0!==N?N:g?null!==(L=p.ampDeviceId)&&void 0!==L?L:p.deviceId:void 0)&&void 0!==D?D:null==h?void 0:h.deviceId)&&void 0!==j?j:d.deviceId)&&void 0!==U?U:fe(),y=null!==(F=null==h?void 0:h.lastEventId)&&void 0!==F?F:d.lastEventId,b=null!==(B=null==h?void 0:h.lastEventTime)&&void 0!==B?B:d.lastEventTime,w=null!==(z=null!==(q=r.optOut)&&void 0!==q?q:null==h?void 0:h.optOut)&&void 0!==z?z:d.optOut,S=null!==(V=null==h?void 0:h.sessionId)&&void 0!==V?V:d.sessionId,E=null==h?void 0:h.deferredSessionId,k=null!==(H=null!==(W=r.userId)&&void 0!==W?W:null==h?void 0:h.userId)&&void 0!==H?H:d.userId,n.previousSessionDeviceId=null!==($=null==h?void 0:h.deviceId)&&void 0!==$?$:d.deviceId,n.previousSessionUserId=null!==(G=null==h?void 0:h.userId)&&void 0!==G?G:d.userId,x={ipAddress:null===(J=null===(K=r.trackingOptions)||void 0===K?void 0:K.ipAddress)||void 0===J||J,language:null===(Y=null===(Q=r.trackingOptions)||void 0===Q?void 0:Q.language)||void 0===Y||Y,platform:null===(Z=null===(X=r.trackingOptions)||void 0===X?void 0:X.platform)||void 0===Z||Z},C=null==h?void 0:h.pageCounter,I=null==h?void 0:h.debugLogsEnabled,void 0!==r.autocapture&&(r.defaultTracking=r.autocapture),[4,(O=new CI(e,r.appVersion,c,l,r.defaultTracking,r.autocapture,v,r.flushIntervalMillis,r.flushMaxRetries,r.flushQueueSize,s,r.ingestionMetadata,r.instanceName,y,b,null!==(ee=null==o?void 0:o.loggerProvider)&&void 0!==ee?ee:r.loggerProvider,r.logLevel,r.minIdLength,r.offline,w,r.partnerId,r.plan,r.serverUrl,null!==(te=null==o?void 0:o.serverZone)&&void 0!==te?te:r.serverZone,S,E,r.sessionTimeout,r.storageProvider,x,r.transport,r.useBatch,r.fetchRemoteConfig,k,C,I,r.networkTrackingOptions,r.identify,null!==(re=null==o?void 0:o.enableDiagnostics)&&void 0!==re?re:r.enableDiagnostics,null!==(ne=null==o?void 0:o.diagnosticsSampleRate)&&void 0!==ne?ne:n._diagnosticsSampleRate,i,r.remoteConfig,a,r.enableRequestBodyCompression,r.customEnrichment)).storageProvider.isEnabled()];case 5:return m.sent()||(O.loggerProvider.warn("Storage provider ".concat(O.storageProvider.constructor.name," is not enabled. Falling back to MemoryStorage.")),O.storageProvider=new jt),[2,O]}})})},OI=function(e,r,n){switch(void 0===e&&(e=vI),void 0===r&&(r={}),e){case"localStorage":return new KC;case"sessionStorage":return new JC;case"none":return new jt;default:return new Ft(t(t({},r),{expirationDays:r.expiration}),n)}},TI=function(e){var t="object"==typeof e?e.type:e,r="object"==typeof e?e.headers:void 0;return"xhr"===t?new QC(r):"beacon"===t?new XC:new YC(r)},AI=function(e,t){return v(void 0,void 0,void 0,function(){var r,n,i,o,s,a,l;return m(this,function(u){switch(u.label){case 0:return[4,new Ft(void 0,{diagnosticsClient:t}).isEnabled()];case 1:if(!u.sent()||!e&&("undefined"==typeof location||!location.hostname))return[2,""];if(r=null!=e?e:location.hostname,1===(n=r.split(".")).length)return[2,""];for(i=[],o=1,EI.find(function(e){return r.endsWith(".".concat(e))})&&(o=2),s=n.length-o-1;s>=0;--s)i.push(n.slice(s).join("."));s=0,u.label=2;case 2:if(!(s<i.length))return[3,7];a=i[s],u.label=3;case 3:return u.trys.push([3,5,,6]),[4,Ft.isDomainWritable(a)];case 4:return u.sent()?[2,"."+a]:[3,6];case 5:return l=u.sent(),t&&t.recordEvent("cookies.tld.failure",{reason:"Unexpected exception checking domain is writable: ".concat(a),error:l instanceof Error?l.message:String(l)}),[3,6];case 6:return s++,[3,2];case 7:return t&&t.recordEvent("cookies.tld.failure",{reason:"Could not determine TLD for host ".concat(r)}),[2,""]}})})};Ne(),Ki();var _I="AMP_PAGE_VIEW",RI=function(e){var r;void 0===e&&(e={});var n,i,o=de(),s=void 0,a=!1,l=e.trackOn,u=e.trackHistoryChanges,c=e.eventType,d=void 0===c?"[Amplitude] Page Viewed":c,h=function(e){var t=e;try{t=decodeURI(e)}catch(e){null==s||s.error("Malformed URI sequence: ",e)}return t},p=function(e){return v(void 0,void 0,void 0,function(){var r,n,i;return m(this,function(o){switch(o.label){case 0:return r=h("undefined"!=typeof location&&location.href||""),i={event_type:d},n=[{}],[4,PI()];case 1:return[2,(i.event_properties=t.apply(void 0,[t.apply(void 0,n.concat([o.sent()])),{"[Amplitude] Page Domain":"undefined"!=typeof location&&location.hostname||"","[Amplitude] Page Location":r,"[Amplitude] Page Path":"undefined"!=typeof location&&h(location.pathname)||"","[Amplitude] Page Title":Dn(Ln),"[Amplitude] Page URL":r.split("?")[0],"[Amplitude] Page View ID":e}]),i)]}})})},f=function(){return void 0===l||"function"==typeof l&&l()},g="undefined"!=typeof location?location.href:null,y=function(){v(void 0,void 0,void 0,function(){var e,t,n,o,a;return m(this,function(l){switch(l.label){case 0:return e=location.href,t=NI(u,e,g||"")&&f(),g=e,t?(n=void 0,i&&(n=fe(),i.set(_I,{pageViewId:n})),null==s||s.log("Tracking page view event"),null!=r?[3,1]:[3,3]):[3,4];case 1:return a=(o=r).track,[4,p(n)];case 2:a.apply(o,[l.sent()]),l.label=3;case 3:l.label=4;case 4:return[2]}})})};return{name:"@amplitude/plugin-page-view-tracking-browser",type:"enrichment",setup:function(e,t){return v(void 0,void 0,void 0,function(){var l,u,c;return m(this,function(d){switch(d.label){case 0:if(r=t,n=e,(s=e.loggerProvider).log("Installing @amplitude/plugin-page-view-tracking-browser"),a=!0,o){try{i=new Ht(o.sessionStorage)}catch(e){null==s||s.debug("sessionStorage is not available in this environment.")}o.addEventListener("popstate",y),o.history.pushState=new Proxy(o.history.pushState,{apply:function(e,t,r){var n=b(r,3),i=n[0],o=n[1],s=n[2];e.apply(t,[i,o,s]),a&&y()}})}return f()?(s.log("Tracking page view event"),l=void 0,i&&(l=fe(),i.set(_I,{pageViewId:l})),c=(u=r).track,[4,p(l)]):[3,2];case 1:c.apply(u,[d.sent()]),d.label=2;case 2:return[2]}})})},execute:function(e){return v(void 0,void 0,void 0,function(){var r,o,a;return m(this,function(u){switch(u.label){case 0:return"attribution"===l&&MI(e)?(null==s||s.log("Enriching campaign event to page view event with campaign parameters"),r=void 0,i?[4,i.get(_I)]:[3,2]):[3,4];case 1:o=u.sent(),r=null==o?void 0:o.pageViewId,u.label=2;case 2:return[4,p(r)];case 3:a=u.sent(),e.event_type=a.event_type,e.event_properties=t(t({},e.event_properties),a.event_properties),u.label=4;case 4:return n&&e.event_type===d&&(n.pageCounter=n.pageCounter?n.pageCounter+1:1,e.event_properties=t(t({},e.event_properties),{"[Amplitude] Page Counter":n.pageCounter})),[2,e]}})})},teardown:function(){return v(void 0,void 0,void 0,function(){return m(this,function(e){return o&&(o.removeEventListener("popstate",y),a=!1),[2]})})}}},PI=function(){return v(void 0,void 0,void 0,function(){var e;return m(this,function(t){switch(t.label){case 0:return e=Dt,[4,(new An).parse()];case 1:return[2,e.apply(void 0,[t.sent()])]}})})},MI=function(e){if("$identify"===e.event_type&&e.user_properties){var t=e.user_properties,r=t[S.SET]||{},n=t[S.UNSET]||{},i=w(w([],b(Object.keys(r)),!1),b(Object.keys(n)),!1);return Object.keys(K).every(function(e){return i.includes(e)})}return!1},NI=function(e,t,r){if("pathOnly"===e){if(""==r)return!0;var n=new URL(t),i=new URL(r);return n.origin+n.pathname!==i.origin+i.pathname}return t!==r};Ne(),Ki();var LI=function(){var e,t,r=[],n=function(e,t,n){e.addEventListener(t,n),r.push({element:e,type:t,handler:n})};return{name:"@amplitude/plugin-form-interaction-tracking-browser",type:"enrichment",setup:function(r,i){return v(void 0,void 0,void 0,function(){var o,s;return m(this,function(a){return t=function(e){if(RC(e.defaultTracking)&&e.defaultTracking&&"object"==typeof e.defaultTracking&&"object"==typeof e.defaultTracking.formInteractions)return e.defaultTracking.formInteractions}(r),o=function(){if(i){if("undefined"!=typeof document){var o=new WeakSet,s=function(e){if(!o.has(e)){o.add(e);var s=!1;n(e,"change",function(){var t,r=jI(e);s||i.track(nI,((t={})[pI]=DI(e.id),t[fI]=DI(e.name),t[gI]=r,t)),s=!0}),n(e,"submit",function(n){var o,a,l=jI(e);if(s||i.track(nI,((o={})[pI]=DI(e.id),o[fI]=DI(e.name),o[gI]=l,o)),s=!0,void 0!==(null==t?void 0:t.shouldTrackSubmit))if("function"==typeof t.shouldTrackSubmit&&"undefined"!=typeof SubmitEvent&&n instanceof SubmitEvent)try{if(!t.shouldTrackSubmit(n))return}catch(e){r.loggerProvider.warn("shouldTrackSubmit callback threw an error, proceeding with tracking.")}else r.loggerProvider.warn("shouldTrackSubmit is ignored because it is not a function or event is not a SubmitEvent.");i.track(iI,((a={})[pI]=DI(e.id),a[fI]=DI(e.name),a[gI]=l,a)),s=!1})}};Array.from(document.getElementsByTagName("form")).forEach(s),"undefined"!=typeof MutationObserver&&(e=new MutationObserver(function(e){e.forEach(function(e){e.addedNodes.forEach(function(e){"FORM"===e.nodeName&&s(e),"querySelectorAll"in e&&"function"==typeof e.querySelectorAll&&Array.from(e.querySelectorAll("form")).map(s)})})})).observe(document.body,{subtree:!0,childList:!0})}}else r.loggerProvider.warn("Form interaction tracking requires a later version of @amplitude/analytics-browser. Form interaction events are not tracked.")},"complete"===document.readyState?o():(s=de())?s.addEventListener("load",o):r.loggerProvider.debug("Form interaction tracking is not installed because global is undefined."),[2]})})},execute:function(e){return v(void 0,void 0,void 0,function(){return m(this,function(t){return[2,e]})})},teardown:function(){return v(void 0,void 0,void 0,function(){return m(this,function(t){return null==e||e.disconnect(),r.forEach(function(e){var t=e.element,r=e.type,n=e.handler;null==t||t.removeEventListener(r,n)}),r=[],[2]})})}}},DI=function(e){if("string"==typeof e)return e},jI=function(e){var t=e.getAttribute("action");try{t=new URL(encodeURI(null!=t?t:""),window.location.href).href}catch(e){}return t};Ne(),Ki();var UI=function(){var e,t=[];return{name:"@amplitude/plugin-file-download-tracking-browser",type:"enrichment",setup:function(r,n){return v(void 0,void 0,void 0,function(){var i,o;return m(this,function(s){return i=function(){if(n){if("undefined"!=typeof document){var i=function(e){var r;try{r=new URL(e.href,window.location.href)}catch(e){return}var i,s,a,l=o.exec(r.href),u=null==l?void 0:l[1];u&&(s="click",a=function(){var t;u&&n.track(oI,((t={})[lI]=u,t[uI]=r.pathname,t[cI]=e.id,t[dI]=e.text,t[hI]=e.href,t))},(i=e).addEventListener(s,a),t.push({element:i,type:s,handler:a}))},o=/\.(pdf|xlsx?|docx?|txt|rtf|csv|exe|key|pp(s|t|tx)|7z|pkg|rar|gz|zip|avi|mov|mp4|mpe?g|wmv|midi?|mp3|wav|wma)(\?.+)?$/;Array.from(document.getElementsByTagName("a")).forEach(i),"undefined"!=typeof MutationObserver&&(e=new MutationObserver(function(e){e.forEach(function(e){e.addedNodes.forEach(function(e){"A"===e.nodeName&&i(e),"querySelectorAll"in e&&"function"==typeof e.querySelectorAll&&Array.from(e.querySelectorAll("a")).map(i)})})})).observe(document.body,{subtree:!0,childList:!0})}}else r.loggerProvider.warn("File download tracking requires a later version of @amplitude/analytics-browser. File download events are not tracked.")},"complete"===document.readyState?i():(o=de())?o.addEventListener("load",i):r.loggerProvider.debug("File download tracking is not installed because global is undefined."),[2]})})},execute:function(e){return v(void 0,void 0,void 0,function(){return m(this,function(t){return[2,e]})})},teardown:function(){return v(void 0,void 0,void 0,function(){return m(this,function(r){return null==e||e.disconnect(),t.forEach(function(e){var t=e.element,r=e.type,n=e.handler;null==t||t.removeEventListener(r,n)}),t=[],[2]})})}}},FI=!1;Ne(),Ki();var BI=function(){var e=de(),t=[],r=function(r,n){(null==e?void 0:e.addEventListener)&&(null==e||e.addEventListener(r,n),t.push({type:r,handler:n}))};return{name:"@amplitude/plugin-network-checker-browser",type:"before",setup:function(e,t){return v(void 0,void 0,void 0,function(){return m(this,function(n){return"undefined"==typeof navigator?(e.loggerProvider.debug("Network connectivity checker plugin is disabled because navigator is not available."),e.offline=!1,[2]):(e.offline=!navigator.onLine,r("online",function(){e.loggerProvider.debug("Network connectivity changed to online."),e.offline=!1,setTimeout(function(){t.flush()},e.flushIntervalMillis)}),r("offline",function(){e.loggerProvider.debug("Network connectivity changed to offline."),e.offline=!0}),[2])})})},teardown:function(){return v(void 0,void 0,void 0,function(){return m(this,function(r){return t.forEach(function(t){var r=t.type,n=t.handler;null==e||e.removeEventListener(r,n)}),t=[],[2]})})}}};function qI(e){var t,r,n,i,o,s,a,l,u,c,d,h;if("object"==typeof e&&null!==e&&!Array.isArray(e)){var p=Object.keys(e);try{for(var f=y(p),g=f.next();!g.done;g=f.next()){var v=g.value;try{var m=e[v];"boolean"==typeof(null==m?void 0:m.enabled)&&(m.enabled?(delete m.enabled,0===Object.keys(m).length&&(e[v]=!0)):e[v]=!1),qI(m)}catch(e){}}}catch(e){t={error:e}}finally{try{g&&!g.done&&(r=f.return)&&r.call(f)}finally{if(t)throw t.error}}try{if(null===(u=null===(l=null===(a=e.autocapture)||void 0===a?void 0:a.networkTracking)||void 0===l?void 0:l.captureRules)||void 0===u?void 0:u.length)try{for(var S=y(e.autocapture.networkTracking.captureRules),E=S.next();!E.done;E=S.next()){var k=E.value;try{for(var x=(o=void 0,y(["responseHeaders","requestHeaders"])),C=x.next();!C.done;C=x.next()){var I=C.value,O=null!==(c=k[I])&&void 0!==c?c:{},T=O.captureSafeHeaders,A=O.allowlist;(T||A)&&(void 0===A||Array.isArray(A)?k[I]=w(w([],b(T?J:[]),!1),b(null!=A?A:[]),!1):delete k[I])}}catch(e){o={error:e}}finally{try{C&&!C.done&&(s=x.return)&&s.call(x)}finally{if(o)throw o.error}}}}catch(e){n={error:e}}finally{try{E&&!E.done&&(i=S.return)&&i.call(S)}finally{if(n)throw n.error}}}catch(e){}var _=null===(d=e.autocapture)||void 0===d?void 0:d.frustrationInteractions;_&&(_.rageClick&&(_.rageClicks=_.rageClick,delete _.rageClick),_.deadClick&&(_.deadClicks=_.deadClick,delete _.deadClick));try{var R=null===(h=e.autocapture)||void 0===h?void 0:h.elementInteractions;if(R&&"object"==typeof R&&(!0===R.viewportContentUpdated&&(R.viewportContentUpdated={}),!1===R.viewportContentUpdated&&(R.viewportContentUpdated={enabled:!1}),void 0!==R.exposureDuration)){var P=R.viewportContentUpdated;void 0===P?R.viewportContentUpdated={exposureDuration:R.exposureDuration}:"object"==typeof P&&void 0===P.exposureDuration&&!1!==P.enabled&&(P.exposureDuration=R.exposureDuration),delete R.exposureDuration}}catch(e){}}}function zI(e,t,r){var n,i,o=[];try{for(var s=y(null!=t?t:[]),a=s.next();!a.done;a=s.next()){var l=a.value;try{o.push(new RegExp(l))}catch(e){r.loggerProvider.warn("Invalid regex pattern: ".concat(l),e)}}}catch(e){n={error:e}}finally{try{a&&!a.done&&(i=s.return)&&i.call(s)}finally{if(n)throw n.error}}return e.concat(o)}function VI(e,r){var n,i,o,s,a,l,u;if(e){qI(e);try{r.loggerProvider.debug("Update browser config with remote configuration:",JSON.stringify(e));var c=e;if(c&&"autocapture"in c){if("boolean"==typeof c.autocapture&&(r.autocapture=c.autocapture),"object"==typeof c.autocapture&&null!==c.autocapture){var d=t({},c.autocapture);if(void 0===r.autocapture&&(r.autocapture=c.autocapture),"object"==typeof c.autocapture.elementInteractions&&null!==c.autocapture.elementInteractions&&(null===(o=c.autocapture.elementInteractions.pageUrlAllowlistRegex)||void 0===o?void 0:o.length)){d.elementInteractions=t({},c.autocapture.elementInteractions);var h=d.elementInteractions,p=null!==(s=h.pageUrlAllowlist)&&void 0!==s?s:[],f=c.autocapture.elementInteractions.pageUrlAllowlistRegex;h.pageUrlAllowlist=zI(p,f,r),delete h.pageUrlAllowlistRegex}if("object"==typeof c.autocapture.networkTracking&&null!==c.autocapture.networkTracking&&(null===(a=c.autocapture.networkTracking.captureRules)||void 0===a?void 0:a.length)){d.networkTracking=t({},c.autocapture.networkTracking);var g=null!==(l=d.networkTracking.captureRules)&&void 0!==l?l:[];try{for(var v=y(g),m=v.next();!m.done;m=v.next()){var b=m.value;b.urls=zI(null!==(u=b.urls)&&void 0!==u?u:[],b.urlsRegex,r),delete b.urlsRegex}}catch(e){n={error:e}}finally{try{m&&!m.done&&(i=v.return)&&i.call(v)}finally{if(n)throw n.error}}}"boolean"==typeof r.autocapture&&(r.autocapture=t({attribution:r.autocapture,fileDownloads:r.autocapture,formInteractions:r.autocapture,pageViews:r.autocapture,sessions:r.autocapture,elementInteractions:r.autocapture,webVitals:r.autocapture,frustrationInteractions:r.autocapture},d)),"object"==typeof r.autocapture&&(r.autocapture=t(t({},r.autocapture),d))}r.defaultTracking=r.autocapture}"customEnrichment"in c&&null!==c.customEnrichment&&!1!==r.customEnrichment&&(r.customEnrichment=c.customEnrichment),r.loggerProvider.debug("Browser config after remote config update:",JSON.stringify(r))}catch(e){r.loggerProvider.error("Failed to apply remote configuration because of error: ",e)}}}Ne(),Ki(),Ne(),Ki();var WI="1.27.2";Ki();var HI="[Amplitude] Element Clicked",$I="[Amplitude] Element Tag",GI="[Amplitude] Element Text",KI="[Amplitude] Page URL",JI="[Amplitude] Viewport Height",QI="[Amplitude] Viewport Width",YI="[Amplitude] Page View ID",XI="data-amp-mask-attributes";Ne(),Ki();var ZI,eO,tO=["input","select","textarea"],rO=function(e,t){var r,n=null===(r=null===window||void 0===window?void 0:window.getComputedStyle)||void 0===r?void 0:r.call(window,e);return"pointer"===(null==n?void 0:n.getPropertyValue("cursor"))&&"click"===t},nO=function(e){var t=e.pageUrlAllowlist,r=e.pageUrlExcludelist;return!(r&&r.length>0&&Pt(window.location.href,r))&&!!Pt(window.location.href,t)},iO=function(e,t,r){return void 0===r&&(r=!1),function(n,i){var o,s,a=e.shouldTrackEventResolver,l=null===(s=null===(o=null==i?void 0:i.tagName)||void 0===o?void 0:o.toLowerCase)||void 0===s?void 0:s.call(o);if(!l)return!1;if(a)return a(n,i);if(!nO(e))return!1;var u=String(null==i?void 0:i.getAttribute("type"))||"";if("string"==typeof u)switch(u.toLowerCase()){case"hidden":case"password":return!1}var c=rO(i,n);if(r&&c)return!0;if(t&&!t.some(function(e){var t;return!!(null===(t=null==i?void 0:i.matches)||void 0===t?void 0:t.call(i,e))}))return!1;switch(l){case"input":case"select":case"textarea":return"change"===n||"click"===n;default:return!!c||"click"===n}}},oO=function(e){return e?e.split(",").map(function(e){return e.trim()}).filter(function(e){return e.length>0&&"id"!==e&&"class"!==e}):[]},sO=function(e){return Object.keys(e).reduce(function(t,r){var n=e[r];return function(e){return null==e||"object"==typeof e&&0===Object.keys(e).length||"string"==typeof e&&0===e.trim().length}(n)||(t[r]=n),t},{})},aO=function(){var e;try{var t=de(),r=null===(e=null==t?void 0:t.sessionStorage)||void 0===e?void 0:e.getItem("AMP_PAGE_VIEW");if(!r)return;var n=JSON.parse(r);if("string"==typeof n.pageViewId)return n.pageViewId}catch(e){}},lO=function(e,t){return e?t.some(function(t){var r;return null===(r=null==e?void 0:e.matches)||void 0===r?void 0:r.call(e,t)})?e:lO(null==e?void 0:e.parentElement,t):null},uO=function(e){return!(null===e.event.target||!e.closestTrackedAncestor)};(eO=ZI||(ZI={}))[eO.LEFT_OR_TOUCH_CONTACT=0]="LEFT_OR_TOUCH_CONTACT",eO[eO.MIDDLE=1]="MIDDLE",eO[eO.RIGHT=2]="RIGHT";var cO="__AMPLITUDE_VISUAL_TAGGING__";Ki(),Ki(),Ne(),Ki();var dO=de(),hO=function(){return new jn.default(function(e){var t=new MutationObserver(function(t){e.next(t)});return document.body&&t.observe(document.body,{childList:!0,attributes:!0,characterData:!0,subtree:!0}),function(){return t.disconnect()}})},pO=function(e){return void 0===e&&(e="click"),new jn.default(function(t){var r,n=function(e){t.next(e)};return null===(r=de())||void 0===r||r.document.addEventListener(e,n,{capture:!0}),function(){var t;null===(t=de())||void 0===t||t.document.removeEventListener(e,n,{capture:!0})}})},fO=function(){var e=Wn(new jn.default(function(e){var r=function(r){if(r instanceof ErrorEvent){var n={kind:"error"};r.error instanceof Error||r.error instanceof DOMException?n=t(t({},n),{message:r.error.message,stack:r.error.stack,filename:r.filename,lineNumber:r.lineno,columnNumber:r.colno}):"string"==typeof r.error&&(n.message=r.error),e.next(n)}};return dO.addEventListener("error",r),function(){dO.removeEventListener("error",r)}}),new jn.default(function(e){var t=function(t){var r={kind:"unhandledrejection"};t.reason instanceof Error||t.reason instanceof DOMException?(r.message=t.reason.message,r.stack=t.reason.stack):"string"==typeof t.reason&&(r.message=t.reason),e.next(r)};return dO.addEventListener("unhandledrejection",t),function(){dO.removeEventListener("unhandledrejection",t)}}));return Wn(e,new jn.default(function(e){var t=function(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];var i=void 0;Array.isArray(r[0])&&"string"==typeof r[0][0]&&(i=r[0][0]),e.next({kind:"console",message:i})};return Lr.addListener("error",t),function(){Lr.removeListener(t)}}))};Ne();var gO=function(e,t,r){e.forEach(function(e){if("string"!=typeof e&&"ATTACH_EVENT_PROPERTY"===e.actionType){var n=r.extractDataFromDataSource(e.dataSource,t.closestTrackedAncestor);t.targetElementProperties[e.destinationKey]=n}})},vO={"[Amplitude] Element Clicked":"click","[Amplitude] Element Changed":"change"},mO=function(e){var t,r,n,i,o=Object.values(vO).reduce(function(e,t){return e[t]=new Set,e},{});if(!e)return o;try{for(var s=y(e),a=s.next();!a.done;a=s.next()){var l=a.value;try{try{for(var u=(n=void 0,y(l.definition)),c=u.next();!c.done;c=u.next()){var d=c.value,h=vO[d.event_type];h&&o[h].add(l.id)}}catch(e){n={error:e}}finally{try{c&&!c.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}}catch(e){console.warn("Skipping Labeled Event due to malformed definition",null==l?void 0:l.id,e)}}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}return o},yO=function(e){var t,r,n,i,o=new Map;try{for(var s=y(e),a=s.next();!a.done;a=s.next()){var l=a.value;try{for(var u=(n=void 0,y(l.conditions)),c=u.next();!c.done;c=u.next()){var d=c.value;if("LABELED_EVENT"===d.type){var h=d.match.eventId,p=o.get(h);p||(p=[],o.set(h,p)),p.push(l)}}}catch(e){n={error:e}}finally{try{c&&!c.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}return o},bO=function(e,t){return t.filter(function(t){return t.definition.some(function(t){return vO[t.event_type]===e.type&&t.filters.every(function(t){return function(e,t){try{if("[Amplitude] Element Text"===t.subprop_key)return"is"===t.subprop_op&&t.subprop_value.includes(e.targetElementProperties["[Amplitude] Element Text"]);if("[Amplitude] Element Hierarchy"===t.subprop_key)return"autotrack css match"===t.subprop_op&&!!e.closestTrackedAncestor.closest(t.subprop_value.toString())}catch(e){return console.error("Error matching event to filter",e),!1}return!1}(e,t)})})})},wO=function(){function e(e,t,r,n){this.groupedLabeledEvents=e,this.labeledEventToTriggerMap=t,this.dataExtractor=r,this.options=n}return e.prototype.evaluate=function(e){var t,r,n=this.options.pageActions;if(!n)return e;var i=function(e,t){var r,n,i,o,s=new Set;try{for(var a=y(e),l=a.next();!l.done;l=a.next()){var u=l.value,c=t.get(u.id);if(c)try{for(var d=(i=void 0,y(c)),h=d.next();!h.done;h=d.next()){var p=h.value;s.add(p)}}catch(e){i={error:e}}finally{try{h&&!h.done&&(o=d.return)&&o.call(d)}finally{if(i)throw i.error}}}}catch(e){r={error:e}}finally{try{l&&!l.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return Array.from(s)}(bO(e,Array.from(this.groupedLabeledEvents[e.type]).map(function(e){return n.labeledEvents[e]})),this.labeledEventToTriggerMap);try{for(var o=y(i),s=o.next();!s.done;s=o.next()){var a=s.value;gO(a.actions,e,this.dataExtractor)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return e},e.prototype.update=function(e,t,r){this.groupedLabeledEvents=e,this.labeledEventToTriggerMap=t,this.options=r},e}();Ne(),Ki(),Ne(),Ki();var SO=new Set(["id","class","style","value","onclick","onchange","oninput","onblur","onsubmit","onfocus","onkeydown","onkeyup","onkeypress","data-reactid","data-react-checksum","data-reactroot",XI,_n]),EO=["type"],kO=["svg","path","g"],xO=["password","hidden"];function CO(e,t){var r,n,i,o,s,a;if(null===e)return null;var l=String(e.tagName).toLowerCase(),u={tag:l},c=Array.from(null!==(o=null===(i=e.parentElement)||void 0===i?void 0:i.children)&&void 0!==o?o:[]);c.length&&(u.index=c.indexOf(e),u.indexOfType=c.filter(function(t){return t.tagName===e.tagName}).indexOf(e));var d=null===(a=null===(s=e.previousElementSibling)||void 0===s?void 0:s.tagName)||void 0===a?void 0:a.toLowerCase();d&&(u.prevSib=String(d));var h=e.getAttribute("id");h&&(u.id=String(h));var p=Array.from(e.classList);p.length&&(u.classes=p);var f={},g=Array.from(e.attributes).filter(function(e){return!SO.has(e.name)}),v=!function(e){var t,r,n,i=null===(r=null===(t=null==e?void 0:e.tagName)||void 0===t?void 0:t.toLowerCase)||void 0===r?void 0:r.call(t),o=e instanceof HTMLElement&&"true"===(null===(n=e.getAttribute("contenteditable"))||void 0===n?void 0:n.toLowerCase());return!tO.includes(i)&&!o}(e);if(!xO.includes(String(e.getAttribute("type")))&&!kO.includes(l))try{for(var m=y(g),b=m.next();!b.done;b=m.next()){var w=b.value;v&&!EO.includes(w.name)||(t.has(w.name)?f[w.name]=Rn:f[w.name]=String(w.value).substring(0,128))}}catch(e){r={error:e}}finally{try{b&&!b.done&&(n=m.return)&&n.call(m)}finally{if(r)throw r.error}}return Object.keys(f).length&&(u.attrs=f),u}Ne();var IO,OO,TO=function(){function e(e,t){this.value=e,this.optimized=t}return e.prototype.toString=function(){return this.value},e}(),AO=function(e,t,r){var n,i;if(e.nodeType!==Node.ELEMENT_NODE)return null;var o=e.getAttribute("id");if(t){if(o)return new TO(c(o),!0);var s=e.tagName.toLowerCase();if("body"===s||"head"===s||"html"===s)return new TO(s,!0)}var a=e.tagName.toLowerCase();if(o)return new TO(a+c(o),!0);var l=e.parentNode;if(!l||l.nodeType===Node.DOCUMENT_NODE)return new TO(a,!0);function u(e){var t=e.getAttribute("class");return t?t.split(/\s+/g).filter(Boolean).map(function(e){return"$"+e}):[]}function c(e){return"#"+CSS.escape(e)}for(var d=u(e),h=!1,p=!1,f=-1,g=-1,v=l.children,m=0;v&&(-1===f||!p)&&m<v.length;++m){var b=v[m];if(b.nodeType===Node.ELEMENT_NODE)if(g+=1,b!==e){if(!p&&b.tagName.toLowerCase()===a){h=!0;var w=new Set(d);if(w.size)for(var S=u(b),E=0;E<S.length;++E){var k=S[E];if(w.has(k)&&(w.delete(k),!w.size)){p=!0;break}}else p=!0}}else f=g}var x=a;if(r&&"input"===a.toLowerCase()&&e.getAttribute("type")&&!e.getAttribute("id")&&!e.getAttribute("class")&&(x+="[type="+CSS.escape(e.getAttribute("type")||"")+"]"),p)x+=":nth-child("+String(f+1)+")";else if(h)try{for(var C=y(d),I=C.next();!I.done;I=C.next()){var O=I.value;x+="."+CSS.escape(O.slice(1))}}catch(e){n={error:e}}finally{try{I&&!I.done&&(i=C.return)&&i.call(C)}finally{if(n)throw n.error}}return new TO(x,!1)},_O=function(){return function(e,t){var r,n,i,o=this;this.replaceSensitiveString=function(e){return Ln(e,o.additionalMaskTextPatterns)},this.getHierarchy=function(e){var t,r,n,i,s,a=performance.now();if(!e)return[];for(var l=function(e){var t=[];if(!e)return t;t.push(e);for(var r=e.parentElement;r&&"HTML"!==r.tagName;)t.push(r),r=r.parentElement;return t}(e),u=new Map,c=l.length-1;c>=0;c--){var d=l[c];if(d){var h=oO(d.getAttribute(XI)),p=c===l.length-1?[]:null!==(n=u.get(l[c+1]))&&void 0!==n?n:new Set,f=new Set(w(w([],b(p),!1),b(h),!1));u.set(d,f)}}s=l.map(function(e){var t;return CO(e,null!==(t=u.get(e))&&void 0!==t?t:new Set)});var g=function(e){(null==e?void 0:e.attrs)&&Object.entries(e.attrs).forEach(function(t){var r=b(t,2),n=r[0],i=r[1];e.attrs&&(e.attrs[n]=o.replaceSensitiveString(i))})};try{for(var v=y(s),m=v.next();!m.done;m=v.next()){g(m.value)}}catch(e){t={error:e}}finally{try{m&&!m.done&&(r=v.return)&&r.call(v)}finally{if(t)throw t.error}}var S=performance.now();return null===(i=o.diagnosticsClient)||void 0===i||i.recordHistogram("autocapturePlugin.getHierarchy",S-a),s},this.getNearestLabel=function(e){var t,r=e.parentElement;if(!r)return"";try{t=r.querySelector(":scope>span,h1,h2,h3,h4,h5,h6")}catch(e){t=null}return t?o.getText(t):o.getNearestLabel(r)},this.getElementPath=function(e){var t;if(!e)return"";var r=performance.now(),n=function(e,t){if(e.nodeType!==Node.ELEMENT_NODE)return"";for(var r=[],n=e;n;){var i=AO(n,Boolean(t),n===e);if(!i)break;if(r.push(i),i.optimized)break;n=n.parentElement}return r.reverse(),r.join(" > ")}(e),i=performance.now();return null===(t=o.diagnosticsClient)||void 0===t||t.recordHistogram("autocapturePlugin.getElementPath",i-r),n},this.getEventProperties=function(e,t,r){var n,i,s,a,l,u,c=null===(s=null===(i=null==t?void 0:t.tagName)||void 0===i?void 0:i.toLowerCase)||void 0===s?void 0:s.call(i),d="function"==typeof t.getBoundingClientRect?t.getBoundingClientRect():{left:null,top:null},h=o.getHierarchy(t),p=null===(a=h[0])||void 0===a?void 0:a.attrs,f=o.getNearestLabel(t),g=(l=null!=p?p:{},u=r,Object.entries(l).reduce(function(e,t){var r=b(t,2),n=r[0],i=r[1];if(n.startsWith(u)){var o=n.replace(u,"");o&&(e[o]=i||"")}return e},{})),v=((n={})["[Amplitude] Element Hierarchy"]=h,n[$I]=c,n[GI]=o.getText(t),n["[Amplitude] Element Position Left"]=null==d.left?null:Math.round(d.left),n["[Amplitude] Element Position Top"]=null==d.top?null:Math.round(d.top),n["[Amplitude] Element Attributes"]=g,n["[Amplitude] Element Path"]=o.getElementPath(t),n["[Amplitude] Element Parent Label"]=f,n[KI]=Mt(window.location.href.split("?")[0]),n["[Amplitude] Page Title"]=Dn(o.replaceSensitiveString),n[JI]=window.innerHeight,n[QI]=window.innerWidth,n),m=aO();if(m&&(v[YI]=m),v["[Amplitude] Element ID"]=t.getAttribute("id")||"",v["[Amplitude] Element Class"]=t.getAttribute("class"),v["[Amplitude] Element Aria Label"]=null==p?void 0:p["aria-label"],"a"===c&&"click"===e&&t instanceof HTMLAnchorElement){var y=t.href.substring(0,128);v["[Amplitude] Element Href"]=o.replaceSensitiveString(y)}return sO(v)},this.addTypeAndTimestamp=function(e,t){return{event:e,timestamp:Date.now(),type:t}},this.addAdditionalEventProperties=function(e,t,r,n,i){void 0===i&&(i=!1);var s=o.addTypeAndTimestamp(e,t);if(function(e){return"click"===e.type||"change"===e.type}(s)&&null!==s.event.target){if(i)if(rO(s.event.target,s.type))return s.closestTrackedAncestor=s.event.target,s.targetElementProperties=o.getEventProperties(s.type,s.closestTrackedAncestor,n),s;var a=lO(s.event.target,r);return a&&(s.closestTrackedAncestor=a,s.targetElementProperties=o.getEventProperties(s.type,a,n)),s}return s},this.extractDataFromDataSource=function(e,t){if("DOM_ELEMENT"===e.sourceType){var r=function(e,t){try{if("DOM_ELEMENT"===e.sourceType){var r=document.documentElement;return e.scope&&t&&(r=t.closest(e.scope)),r&&e.selector?r.querySelector(e.selector):r}}catch(e){return}}(e,t);if(!r)return;return"TEXT"===e.elementExtractType?o.getText(r):"ATTRIBUTE"===e.elementExtractType&&e.attribute?r.getAttribute(e.attribute):void 0}},this.getTextWithMaskedDescendants=function(e){var t,r,n="[".concat(_n,"], [contenteditable]");if(!e.querySelector(n))return e.innerText;var i="",s=Array.from(e.childNodes);try{for(var a=y(s),l=a.next();!l.done;l=a.next()){var u=l.value;u.nodeType!==Node.TEXT_NODE?u instanceof Element&&(u.hasAttribute(_n)||u.hasAttribute("contenteditable")?i+=Rn:i+=o.getTextWithMaskedDescendants(u)):i+=u.textContent||""}}catch(e){t={error:e}}finally{try{l&&!l.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}return i},this.getText=function(e){if(null!==e.closest("[".concat(_n,"]")))return Rn;var t="";return t=e.querySelector("[".concat(_n,"], [contenteditable]"))?o.getTextWithMaskedDescendants(e):e.innerText||"",o.replaceSensitiveString(t.substring(0,255)).replace(/\s+/g," ").trim()},this.getEventTagProps=function(e){var t,r,n;if(!e)return{};var i=null===(n=null===(r=null==e?void 0:e.tagName)||void 0===r?void 0:r.toLowerCase)||void 0===n?void 0:n.call(r),s=((t={})[$I]=i,t[GI]=o.getText(e),t[KI]=window.location.href.split("?")[0],t);return sO(s)},this.diagnosticsClient=null==t?void 0:t.diagnosticsClient;var s=null!==(i=e.maskTextRegex)&&void 0!==i?i:[],a=[];try{for(var l=y(s),u=l.next();!u.done;u=l.next()){var c=u.value;if(a.length>=25)break;if(c instanceof RegExp)a.push(c);else if("pattern"in c&&"string"==typeof c.pattern)try{a.push(new RegExp(c.pattern,"i"))}catch(e){}}}catch(e){r={error:e}}finally{try{u&&!u.done&&(n=l.return)&&n.call(l)}finally{if(r)throw r.error}}this.additionalMaskTextPatterns=a}}();Ki(),Ki(),Ki(),(OO=IO||(IO={})).ClickObservable="clickObservable",OO.ChangeObservable="changeObservable",OO.NavigateObservable="navigateObservable",OO.MutationObservable="mutationObservable",OO.ScrollObservable="scrollObservable",OO.ExposureObservable="exposureObservable",OO.BrowserErrorObservable="browserErrorObservable",OO.SelectionObservable="selectionObservable",OO.MouseMoveObservable="mouseMoveObservable";var RO=function(e,r){var n,i,o,s,a,l,u,c,d,h,p,f;void 0===e&&(e={}),null==r||r.diagnosticsClient.setTag("plugin.autocapture.version",WI);var g=e.dataAttributePrefix,S=void 0===g?Hr:g,E=e.visualTaggingOptions,k=void 0===E?{enabled:!0}:E;e.cssSelectorAllowlist=null!==(n=e.cssSelectorAllowlist)&&void 0!==n?n:Wr,e.actionClickAllowlist=null!==(i=e.actionClickAllowlist)&&void 0!==i?i:$r,e.debounceTime=null!==(o=e.debounceTime)&&void 0!==o?o:0;var x=!1!==(null===(s=e.viewportContentUpdated)||void 0===s?void 0:s.enabled),C=null!==(u=null!==(l=null===(a=e.viewportContentUpdated)||void 0===a?void 0:a.exposureDuration)&&void 0!==l?l:e.exposureDuration)&&void 0!==u?u:Gr;e.viewportContentUpdated=t(t({},e.viewportContentUpdated),{exposureDuration:C}),e.pageUrlExcludelist=null===(c=e.pageUrlExcludelist)||void 0===c?void 0:c.reduce(function(e,t){if("string"==typeof t&&e.push(t),t instanceof RegExp&&e.push(t),"object"==typeof t&&null!==t&&"pattern"in t)try{e.push(new RegExp(t.pattern))}catch(r){return console.warn("Invalid regex pattern: ".concat(t.pattern),r),e}return e},[]);var I,O="@amplitude/plugin-autocapture-browser",T=[],A=new _O(e,r),_=new Set,R=new Set,P=function(){var t,r,n=Hn(pO().map(function(t){return A.addAdditionalEventProperties(t,"click",e.cssSelectorAllowlist,S)})),i=Hn(new jn.default(function(t){var r,n=function(r){var n=A.addAdditionalEventProperties(r,"change",e.cssSelectorAllowlist,S);t.next(n)};return null===(r=de())||void 0===r||r.document.addEventListener("change",n,{capture:!0}),function(){var e;return null===(e=de())||void 0===e?void 0:e.document.removeEventListener("change",n)}}));window.navigation&&(r=Hn(new jn.default(function(t){var r=function(r){var n=A.addAdditionalEventProperties(r,"navigate",e.cssSelectorAllowlist,S);t.next(n)};return window.navigation.addEventListener("navigate",r),function(){window.navigation.removeEventListener("navigate",r)}})));var o=Hn(hO().map(function(t){return A.addAdditionalEventProperties(t,"mutation",e.cssSelectorAllowlist,S)})),s=new jn.default(function(e){var t,r=function(t){e.next(t)};return null===(t=de())||void 0===t||t.addEventListener("scroll",r),function(){var e;null===(e=de())||void 0===e||e.removeEventListener("scroll",r)}}),a=function(e,t){return new jn.default(function(r){var n,i=de();if(!(null==i?void 0:i.IntersectionObserver))return function(){};var o=new IntersectionObserver(function(e){e.forEach(function(e){r.next(e)})},{root:null,rootMargin:"0px",threshold:1}),s=t.join(",");(null!==(n=null==i?void 0:i.document.querySelectorAll(s))&&void 0!==n?n:[]).forEach(function(e){o.observe(e)});var a=e.subscribe(function(e){return e.event.forEach(function(e){return e.addedNodes.forEach(function(e){e instanceof Element&&(e.matches(s)&&o.observe(e),e.querySelectorAll(s).forEach(function(e){o.observe(e)}))})})});return function(){a.unsubscribe(),o.disconnect()}})}(o,e.cssSelectorAllowlist);return(t={})[IO.ChangeObservable]=i,t[IO.ClickObservable]=n,t[IO.MutationObservable]=o,t[IO.NavigateObservable]=r,t[IO.ScrollObservable]=s,t[IO.ExposureObservable]=a,t},M=mO(Object.values(null!==(h=null===(d=e.pageActions)||void 0===d?void 0:d.labeledEvents)&&void 0!==h?h:{})),N=yO(null!==(f=null===(p=e.pageActions)||void 0===p?void 0:p.triggers)&&void 0!==f?f:[]),L=function(e,t,r,n){return new wO(e,t,r,n)}(M,N,A,e);return{name:O,type:"enrichment",setup:function(r,n){return v(void 0,void 0,void 0,function(){var i,o,s,a,l,u,c,d,h,p,f,g,v,y,E,D,j,U,F,B,q;return m(this,function(m){return"undefined"==typeof document||(i=!1,o={maxX:void 0,maxY:void 0},r.fetchRemoteConfig&&(r.remoteConfigClient?r.remoteConfigClient.subscribe("configs.analyticsSDK.pageActions","all",function(r){!function(r){var n,i;r&&(e.pageActions=t(t({},e.pageActions),r),M=mO(Object.values(null!==(n=e.pageActions.labeledEvents)&&void 0!==n?n:{})),N=yO(null!==(i=e.pageActions.triggers)&&void 0!==i?i:[]),L.update(M,N,e))}(r)}):r.loggerProvider.debug("Remote config client is not provided, skipping remote config fetch")),s=iO(e,e.cssSelectorAllowlist),a=iO(e,e.actionClickAllowlist),l=P(),u=function(e){var t=e.amplitude,r=e.allObservables,n=e.shouldTrackEvent,i=e.evaluateTriggers;return r.clickObservable.filter(uO).filter(function(e){return n("click",e.closestTrackedAncestor)}).map(function(e){return i(e)}).subscribe(function(e){null==t||t.track(HI,e.targetElementProperties)})}({allObservables:l,amplitude:n,shouldTrackEvent:s,evaluateTriggers:L.evaluate.bind(L)}),T.push(u),c=function(e){var t=e.amplitude,r=e.allObservables,n=e.getEventProperties,i=e.shouldTrackEvent,o=e.evaluateTriggers;return r.changeObservable.filter(uO).filter(function(e){return i("change",e.closestTrackedAncestor)}).map(function(e){return o(e)}).subscribe(function(e){null==t||t.track("[Amplitude] Element Changed",n("change",e.closestTrackedAncestor))})}({allObservables:l,getEventProperties:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return A.getEventProperties.apply(A,w(w([],b(e),!1),[S],!1))},amplitude:n,shouldTrackEvent:s,evaluateTriggers:L.evaluate.bind(L)}),T.push(c),d=function(e){var t=e.amplitude,r=e.allObservables,n=e.options,i=e.getEventProperties,o=e.shouldTrackEvent,s=e.shouldTrackActionClick,a=r.clickObservable,l=r.mutationObservable,u=r.navigateObservable,c=a.filter(function(e){return!o("click",e.closestTrackedAncestor)}).map(function(e){var t=lO(e.event.target,n.actionClickAllowlist);return e.closestTrackedAncestor=t,null!==e.closestTrackedAncestor&&(e.targetElementProperties=i(e.type,e.closestTrackedAncestor)),e}).filter(uO).filter(function(e){return s("click",e.closestTrackedAncestor)}),d=u?Wn(l,u):l,h=Wn(c,d),p=null,f=null;return Vn(h,function(e){if(p&&(clearTimeout(p),p=null),"click"===e.type)return f=e,p=setTimeout(function(){p=null,f=null},500),Promise.resolve(null);if(f){var t=f;return f=null,Promise.resolve(t)}return Promise.resolve(null)}).subscribe(function(e){e&&(null==t||t.track(HI,i("click",e.closestTrackedAncestor)))})}({allObservables:l,options:e,getEventProperties:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return A.getEventProperties.apply(A,w(w([],b(e),!1),[S],!1))},amplitude:n,shouldTrackEvent:s,shouldTrackActionClick:a}),d&&T.push(d),h=function(e){e.amplitude;var t=e.allObservables.scrollObservable,r={maxX:0,maxY:0},n=t.subscribe(function(){var e,t,n,i,o=de(),s=Math.floor(null!==(t=null!==(e=null==o?void 0:o.scrollX)&&void 0!==e?e:null==o?void 0:o.pageXOffset)&&void 0!==t?t:0),a=Math.floor(null!==(i=null!==(n=null==o?void 0:o.scrollY)&&void 0!==n?n:null==o?void 0:o.pageYOffset)&&void 0!==i?i:0);r.maxX=Math.max(r.maxX,s),r.maxY=Math.max(r.maxY,a)});return{unsubscribe:function(){n.unsubscribe()},getState:function(){return r},reset:function(){r.maxX=0,r.maxY=0}}}({allObservables:l,amplitude:n}),T.push(h),p={},f=de(),g=function(e){e&&i||(setTimeout(function(){i=!1},100),i=!0,function(e){var t,r,n,i,o,s,a=e.amplitude,l=e.scrollTracker,u=e.currentElementExposed,c=e.elementExposedForPage,d=e.exposureTracker,h=e.isPageEnd,p=e.lastScroll,f=l.getState(),g=de(),v=null!==(r=null==g?void 0:g.innerWidth)&&void 0!==r?r:0,m=null!==(n=null==g?void 0:g.innerHeight)&&void 0!==n?n:0,y=((t={})[KI]=Mt(null!==(s=null===(o=null===(i=null==g?void 0:g.location)||void 0===i?void 0:i.href)||void 0===o?void 0:o.split("?")[0])&&void 0!==s?s:""),t["[Amplitude] Max Page X"]=f.maxX+v,t["[Amplitude] Max Page Y"]=f.maxY+m,t[JI]=m,t[QI]=v,t["[Amplitude] Element Exposed"]=Array.from(u),t),b=aO();b&&(y[YI]=b),0!==u.size||f.maxX!==p.maxX||f.maxY!==p.maxY?(null==a||a.track("[Amplitude] Viewport Content Updated",y),p.maxX=f.maxX,p.maxY=f.maxY,u.clear(),h&&(l.reset(),c.clear(),null==d||d.reset())):h&&(l.reset(),c.clear(),null==d||d.reset())}({amplitude:n,scrollTracker:h,currentElementExposed:R,elementExposedForPage:_,exposureTracker:p.exposure,isPageEnd:e,lastScroll:o}))},v=function(e){!function(e,t,r,n){if(!t.has(e)){t.add(e),r.add(e);var i=Array.from(r);JSON.stringify(i).length>=18e3&&n(!1)}}(e,_,R,g)},x&&(p.exposure=function(e){var t=e.allObservables,r=e.onExposure,n=e.dataExtractor,i=e.exposureDuration,o=void 0===i?Gr:i,s=new Map,a=new Map,l=t.exposureObservable.subscribe(function(e){var t=e,i=t.target;if(t.isIntersecting){if(!s.get(i)){var l=setTimeout(function(){s.set(i,!0);var e=n.getElementPath(i);r(e),a.set(i,null)},o);a.set(i,l)}}else!t.isIntersecting&&t.intersectionRatio<1&&(l=a.get(i))&&(clearTimeout(l),a.set(i,null))});return{unsubscribe:function(){l.unsubscribe()},reset:function(){a.forEach(function(e){e&&clearTimeout(e)}),a.clear(),s.clear()}}}({allObservables:l,onExposure:v,dataExtractor:A,exposureDuration:C}),p.exposure&&T.push(p.exposure),y=function(){g(!0)},null==f||f.addEventListener("beforeunload",y),I=function(){null==f||f.removeEventListener("beforeunload",y)},T.push({unsubscribe:function(){return I()}}),(E=l[IO.NavigateObservable])?T.push(E.subscribe(function(){g(!0)})):f&&(D=function(){g(!0)},f.addEventListener("popstate",D),j=f.history.pushState,f.history&&j&&(f.history.pushState=new Proxy(j,{apply:function(e,t,r){var n=b(r,3),i=n[0],o=n[1],s=n[2];e.apply(t,[i,o,s]),g(!0)}})),T.push({unsubscribe:function(){f.removeEventListener("popstate",D),f.history&&j&&(f.history.pushState=j)}}))),null===(q=null==r?void 0:r.loggerProvider)||void 0===q||q.log("".concat(O," has been successfully added.")),window.opener&&k.enabled&&(U=e.cssSelectorAllowlist,F=e.actionClickAllowlist,function(e,t){var r=e;if(!0!==r[cO]){r[cO]=!0;var n=t.dataExtractor,i=t.isElementSelectable,o=t.cssSelectorAllowlist,s=t.actionClickAllowlist,a=null,l=function(t){e.notify({action:"element-selected",data:t})},u=function(t,r){"selector-mode-changed"===t?e.notify({action:"track-selector-mode-changed",data:r}):"selector-moved"===t&&e.notify({action:"track-selector-moved",data:r})};e.registerActionHandler("initialize-visual-tagging-selector",function(t){e.loadScriptOnce("https://cdn.amplitude.com/libs/visual-tagging-selector-1.0.0-alpha.js.gz").then(function(){var r;a=null===(r=null===window||void 0===window?void 0:window.amplitudeVisualTaggingSelector)||void 0===r?void 0:r.call(window,{getEventTagProps:n.getEventTagProps,isElementSelectable:function(e){return!i||i((null==t?void 0:t.actionType)||"click",e)},onTrack:u,onSelect:l,visualHighlightClass:"amp-visual-tagging-selector-highlight",messenger:e,cssSelectorAllowlist:o,actionClickAllowlist:s,extractDataFromDataSource:n.extractDataFromDataSource,dataExtractor:n,diagnostics:{autocapture:{version:WI}}}),e.notify({action:"selector-loaded"})}).catch(function(){var t;null===(t=e.logger)||void 0===t||t.warn("Failed to initialize visual tagging selector")})}),e.registerActionHandler("close-visual-tagging-selector",function(){var e;null===(e=null==a?void 0:a.close)||void 0===e||e.call(a)})}}(B=ai(),{dataExtractor:A,isElementSelectable:iO(e,w(w([],b(U),!1),b(F),!1)),cssSelectorAllowlist:U,actionClickAllowlist:F}),ci(B),B.setup(t({logger:null==r?void 0:r.loggerProvider},(null==r?void 0:r.serverZone)&&{endpoint:Jn[r.serverZone]})))),[2]})})},execute:function(e){return v(void 0,void 0,void 0,function(){return m(this,function(t){return[2,e]})})},teardown:function(){return v(void 0,void 0,void 0,function(){var e,t,r,n;return m(this,function(i){try{for(e=y(T),t=e.next();!t.done;t=e.next())t.value.unsubscribe()}catch(e){r={error:e}}finally{try{t&&!t.done&&(n=e.return)&&n.call(e)}finally{if(r)throw r.error}}return[2]})})}}};Ne(),Ki(),Ne(),Ki();var PO=["mutation","navigate"];Ne(),Ki();var MO=Zr,NO=Xr,LO=en;function DO(e,t){var r,n,i,o,s=t.event,a=s.pageX,l=s.pageY;e.yMin=Math.min(null!==(r=e.yMin)&&void 0!==r?r:l,l),e.yMax=Math.max(null!==(n=e.yMax)&&void 0!==n?n:l,l),e.xMin=Math.min(null!==(i=e.xMin)&&void 0!==i?i:a,a),e.xMax=Math.max(null!==(o=e.xMax)&&void 0!==o?o:a,a),e.isOutOfBounds=e.yMax-e.yMin>LO||e.xMax-e.xMin>LO}function jO(e){if(0===e.length)return null;var r=e[0],n=e[e.length-1];return{rageClickEvent:t({"[Amplitude] Begin Time":new Date(r.timestamp).toISOString(),"[Amplitude] End Time":new Date(n.timestamp).toISOString(),"[Amplitude] Duration":n.timestamp-r.timestamp,"[Amplitude] Clicks":e.map(function(e){return{X:e.event.pageX,Y:e.event.pageY,Time:e.timestamp}}),"[Amplitude] Click Count":e.length},r.targetElementProperties),time:r.timestamp}}function UO(e){var t=this,r=e.amplitude,n=e.allObservables,i=e.shouldTrackRageClick,o=n.clickObservable,s=n.selectionObservable,a=[],l={},u=null;function c(e){a=[],l={},e&&(DO(l,e),a.push(e))}var d=Vn(o.filter(function(e){return i("click",e.closestTrackedAncestor)}),function(e){return v(t,void 0,void 0,function(){var t;return m(this,function(r){return DO(l,e),t=null,0===a.length||function(e,t){return e.length>0&&e[e.length-1].closestTrackedAncestor!==t.closestTrackedAncestor}(a,e)||function(e,t){var r=e[Math.max(0,e.length-MO+1)];return t.timestamp-r.timestamp>=NO}(a,e)||l.isOutOfBounds?(u&&(t=jO(a)),c(e)):a.push(e),u&&(clearTimeout(u.timerId),u.resolve(t),u=null),a.length>=MO?[2,new Promise(function(e){u={resolve:e,timerId:setTimeout(function(){e(jO(a))},NO)}})]:[2,null]})})}),h=null==s?void 0:s.subscribe(function(){c()}),p=d.subscribe(function(e){null!==e&&r.track("[Amplitude] Rage Click",e.rageClickEvent,{time:e.time})});return{unsubscribe:function(){p.unsubscribe(),null==h||h.unsubscribe()}}}Ne(),Ki();var FO,BO,qO,zO;Ki(),(BO=FO||(FO={})).INCREASING="increasing",BO.DECREASING="decreasing",(zO=qO||(qO={})).X="x",zO.Y="y";function VO(e){var t=e.changes,r=e.changesThreshold,n=e.thresholdMs;return!(t.length<r)&&t[t.length-1]-t[0]<n}function WO(e){e.changes=[],e.startTime=void 0}function HO(e){for(var t=e.changes,r=e.thresholdMs,n=0,i=t[t.length-1];n<t.length;n++){if(i-t[n]<r)break}0!==n&&(e.startTime=t[n],e.changes.splice(0,n))}var $O=function(e){var t=e.mouseDirectionChangeObservable,r=e.directionChanges,n=void 0===r?20:r,i=e.thresholdMs,o=void 0===i?2e3:i;return new jn.default(function(e){var r={changes:[],changesThreshold:n,thresholdMs:o},i={changes:[],changesThreshold:n,thresholdMs:o},s=void 0,a=null;function l(){void 0!==s&&(e.next(s),s=void 0,null!==a&&clearTimeout(a),WO(r),WO(i))}return t.subscribe(function(e){null!==a&&clearTimeout(a),function(e){var t=+Date.now();e.startTime=e.startTime||t;var r=e.changes,n=e.changesThreshold;r.push(t),r.length>n&&r.shift()}(e===qO.X?r:i);var t=function(e,t){var r=void 0;if(VO(e)&&(r=e.startTime),VO(t)){var n=t.startTime;n&&(!r||n<r)&&(r=n)}return r}(r,i);return t?(s=s||t,a=setTimeout(function(){l(),a=null},o)):l(),HO(r),HO(i),function(){null!==a&&(clearTimeout(a),a=null)}})})},GO=function(e){var t=e.amplitude,r=e.options,n=e.allObservables,i=e.directionChanges,o=void 0===i?20:i,s=e.thresholdMs,a=void 0===s?2e3:s,l=function(e){var t=e.allWindowObservables.mouseMoveObservable;return new jn.default(function(e){var r=null,n=null,i=null;return t.subscribe(function(t){var o={x:t.clientX,y:t.clientY};null!==r?(o.x>r.x?(n===FO.DECREASING&&e.next(qO.X),n=FO.INCREASING):o.x<r.x&&(n===FO.INCREASING&&e.next(qO.X),n=FO.DECREASING),o.y>r.y?(i===FO.DECREASING&&e.next(qO.Y),i=FO.INCREASING):o.y<r.y&&(i===FO.INCREASING&&e.next(qO.Y),i=FO.DECREASING),r=o):r=o})})}({allWindowObservables:n});return $O({mouseDirectionChangeObservable:l,directionChanges:o,thresholdMs:a}).subscribe(function(e){nO(r)&&t.track("[Amplitude] Thrashed Cursor",void 0,{time:e})})};function KO(e,t,r,n){if(!n)return[];var i=e[t];return"object"==typeof i&&null!==i&&"cssSelectorAllowlist"in i&&Array.isArray(i.cssSelectorAllowlist)?i.cssSelectorAllowlist:r}var JO=4e3,QO=function(e){var r;void 0===e&&(e={});var n="@amplitude/plugin-frustration-browser",i=[],o=!1!==e.errorClicks;e.errorClicks||(o=!1);var s=!1!==e.deadClicks&&null!==e.deadClicks,a=!1!==e.rageClicks&&null!==e.rageClicks,l=!1!==e.thrashedCursor&&null!==e.thrashedCursor;e.thrashedCursor||(l=!1);var u=KO(e,"rageClicks",Yr,a),c=KO(e,"deadClicks",Jr,s),d=KO(e,"errorClicks",Qr,o),h=null!==(r=e.dataAttributePrefix)&&void 0!==r?r:Hr,p=new _O(e),f=w([],b(new Set(w(w(w([],b(u),!1),b(c),!1),b(d),!1))),!1),g=function(){var e,r,n=Hn(pO("pointerdown").map(function(e){return p.addAdditionalEventProperties(e,"click",f,h,!0)})),i=Hn(fO().map(function(e){return p.addTypeAndTimestamp(e,"error")})),o=Hn(hO().map(function(e){return p.addAdditionalEventProperties(e,"mutation",f,h)}));window.navigation&&(r=Hn(new jn.default(function(e){var r=function(r){e.next(t(t({},r),{type:"navigate"}))};return window.navigation.addEventListener("navigate",r),function(){window.navigation.removeEventListener("navigate",r)}}).map(function(e){return p.addAdditionalEventProperties(e,"navigate",f,h)})));var s=Hn(new jn.default(function(e){var t=function(){var t=document.activeElement;if(t&&("TEXTAREA"===t.tagName||"INPUT"===t.tagName)){try{if(t.selectionStart===t.selectionEnd)return}catch(e){return}return e.next()}var r=window.getSelection();if(r&&!r.isCollapsed)return e.next()};return window.document.addEventListener("selectionchange",t),function(){window.document.removeEventListener("selectionchange",t)}})),a=Hn(new jn.default(function(e){var t=function(t){e.next(t)},r={capture:!0};return dO.document.addEventListener("mousemove",t,r),function(){dO.document.removeEventListener("mousemove",t,r)}}));return(e={})[IO.ClickObservable]=n,e[IO.MutationObservable]=o,e[IO.NavigateObservable]=r,e[IO.BrowserErrorObservable]=i,e[IO.SelectionObservable]=s,e[IO.MouseMoveObservable]=a,e};return{name:n,type:"enrichment",setup:function(r,f){return v(void 0,void 0,void 0,function(){var v,y,b,w,S,E,k,x,C,I,O;return m(this,function(m){return"undefined"==typeof document||(v=g(),a&&(y=iO(e,u),b=UO({allObservables:v,amplitude:f,shouldTrackRageClick:y}),i.push(b)),s&&(w=iO(e,c),S=function(e){var r=e.amplitude,n=e.allObservables,i=e.getEventProperties,o=e.shouldTrackDeadClick,s=n.clickObservable,a=n.mutationObservable,l=n.navigateObservable,u=s.filter(function(e){return uO(e)&&o("click",e.closestTrackedAncestor)&&e.event.target instanceof Element&&null===e.event.target.closest('a[target="_blank"]')&&e.event.button===ZI.LEFT_OR_TOUCH_CONTACT}),c=l?Wn(a,l):a,d=Wn(u,c),h=null;return Vn(d,function(e){return h&&PO.includes(e.type)?(clearTimeout(h),h=null,Promise.resolve(null)):"click"===e.type?h?Promise.resolve(null):new Promise(function(t){h=setTimeout(function(){t(e),h=null},3e3)}):Promise.resolve(null)}).subscribe(function(e){if(e){var n={"[Amplitude] X":e.event.clientX,"[Amplitude] Y":e.event.clientY};r.track("[Amplitude] Dead Click",t(t({},i("click",e.closestTrackedAncestor)),n),{time:e.timestamp})}})}({amplitude:f,allObservables:v,getEventProperties:function(e,t){return p.getEventProperties(e,t,h)},shouldTrackDeadClick:w}),i.push(S)),o&&(E=iO(e,d),k=function(e){var r=e.amplitude,n=e.allObservables,i=e.shouldTrackErrorClick,o=n.clickObservable,s=n.browserErrorObservable,a=o.filter(function(e){return uO(e)&&i("click",e.closestTrackedAncestor)&&e.event.target instanceof Element&&null===e.event.target.closest('a[target="_blank"]')&&e.event.button===ZI.LEFT_OR_TOUCH_CONTACT}),l=null,u=null,c=function(){null!==l&&(clearTimeout(l),l=null),u=null};return Wn(a,s).subscribe(function(e){var n;if("click"===e.type)return c(),u=e,void(l=setTimeout(c,2e3));"error"===e.type&&u&&(r.track("[Amplitude] Error Click",t(((n={})["[Amplitude] Kind"]=e.event.kind,n["[Amplitude] Message"]=e.event.message,n["[Amplitude] Stack"]=e.event.stack,n["[Amplitude] Filename"]=e.event.filename,n["[Amplitude] Line Number"]=e.event.lineNumber,n["[Amplitude] Column Number"]=e.event.columnNumber,n),u.targetElementProperties)),c())})}({amplitude:f,allObservables:v,shouldTrackErrorClick:E}),i.push(k)),l&&(x=void 0,C=void 0,"object"==typeof e.thrashedCursor&&(x=e.thrashedCursor.directionChanges,C=e.thrashedCursor.threshold,x&&x<5&&(r.loggerProvider.warn("'thrashedCursor.directionChanges' of ".concat(x," is below the minimum of ").concat(5,", setting to ").concat(5)),x=5),C&&C>JO&&(r.loggerProvider.warn("'thrashedCursor.threshold' of ".concat(C," is above the maximum of ").concat(JO,", setting to ").concat(JO)),C=JO)),I=GO({amplitude:f,options:e,allObservables:v,directionChanges:x,thresholdMs:C}),i.push(I)),null===(O=null==r?void 0:r.loggerProvider)||void 0===O||O.log("".concat(n," has been successfully added."))),[2]})})},execute:function(e){return v(void 0,void 0,void 0,function(){return m(this,function(t){return[2,e]})})},teardown:function(){return v(void 0,void 0,void 0,function(){var e,t,r,n;return m(this,function(o){try{for(e=y(i),t=e.next();!t.done;t=e.next())t.value.unsubscribe()}catch(e){r={error:e}}finally{try{t&&!t.done&&(n=e.return)&&n.call(e)}finally{if(r)throw r.error}}return[2]})})}}};Ne(),Ne();function YO(e,t){var r=e.startTime+e.duration;return t.filter(function(t){return t.startTime<r&&t.startTime+t.duration>e.startTime}).map(function(e){return e.name})}function XO(e,r){var n,i=YO(e,r),o=null!==(n=e.scripts)&&void 0!==n?n:[],s=o.map(function(e){return e.sourceURL}).filter(Boolean),a=o.map(function(e){return e.sourceFunctionName}).filter(Boolean),l=o.map(function(e){return e.sourceCharPosition}).filter(function(e){return"number"==typeof e&&e>=0}),u=o.map(function(e){return e.invokerType}).filter(Boolean),c=o.map(function(e){return e.invoker}).filter(Boolean);return t(t(t(t(t(t(t({"[Amplitude] Main Thread Block Source":"long-animation-frame","[Amplitude] Main Thread Block Duration":e.duration,"[Amplitude] Main Thread Block Blocking Duration":e.blockingDuration,"[Amplitude] Main Thread Block Start Time":e.startTime},i.length>0&&{"[Amplitude] Main Thread Block Measures":i}),{"[Amplitude] Main Thread Block Render Start":e.renderStart,"[Amplitude] Main Thread Block Style And Layout Start":e.styleAndLayoutStart,"[Amplitude] Main Thread Block Script Count":o.length}),s.length>0&&{"[Amplitude] Main Thread Block Script URLs":s}),a.length>0&&{"[Amplitude] Main Thread Block Script Functions":a}),l.length>0&&{"[Amplitude] Main Thread Block Script Positions":l}),u.length>0&&{"[Amplitude] Main Thread Block Invoker Types":u}),c.length>0&&{"[Amplitude] Main Thread Block Invokers":c})}function ZO(e,r){var n,i=YO(e,r),o=null!==(n=e.attribution)&&void 0!==n?n:[];return t(t({"[Amplitude] Main Thread Block Source":"long-task","[Amplitude] Main Thread Block Duration":e.duration,"[Amplitude] Main Thread Block Blocking Duration":e.duration,"[Amplitude] Main Thread Block Start Time":e.startTime},i.length>0&&{"[Amplitude] Main Thread Block Measures":i}),o.length>0&&{"[Amplitude] Main Thread Block Attribution":o.map(function(e){return e.name})})}function eT(e){var t=e.amplitude,r=e.options,n=e.durationThreshold,i=void 0===n?100:n,o=function(){if("undefined"==typeof PerformanceObserver)return null;try{var e=PerformanceObserver.supportedEntryTypes;if(e.includes("long-animation-frame"))return"long-animation-frame";if(e.includes("longtask"))return"longtask"}catch(e){}return null}();if(!o)return{unsubscribe:function(){}};var s=[],a=new PerformanceObserver(function(e){var t,r,n=performance.now();try{for(var i=y(e.getEntries()),o=i.next();!o.done;o=i.next()){var a=o.value;s.push(a)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}for(var l=n-1e4;s.length>0&&s[0].startTime<l;)s.shift()});try{a.observe({entryTypes:["measure"]})}catch(e){}var l=new PerformanceObserver(function(e){var n,a;try{for(var l=y(e.getEntries()),u=l.next();!u.done;u=l.next()){var c=u.value;if(!nO(r))return;if(!(c.duration<i)){var d="long-animation-frame"===o?XO(c,s):ZO(c,s);t.track("[Amplitude] Main Thread Block",d)}}}catch(e){n={error:e}}finally{try{u&&!u.done&&(a=l.return)&&a.call(l)}finally{if(n)throw n.error}}});try{l.observe({entryTypes:[o]})}catch(e){return a.disconnect(),{unsubscribe:function(){}}}return{unsubscribe:function(){l.disconnect(),a.disconnect()}}}var tT=function(e){void 0===e&&(e={});var t="@amplitude/plugin-performance-browser",r=[],n=!0===e.mainThreadBlock||"object"==typeof e.mainThreadBlock&&null!==e.mainThreadBlock;return{name:t,type:"enrichment",setup:function(i,o){return v(void 0,void 0,void 0,function(){var s,a,l;return m(this,function(u){return"undefined"==typeof document||(n&&(s=100,"object"==typeof e.mainThreadBlock&&void 0!==e.mainThreadBlock.durationThreshold&&(s=e.mainThreadBlock.durationThreshold),a=eT({amplitude:o,options:e,durationThreshold:s}),r.push(a)),null===(l=null==i?void 0:i.loggerProvider)||void 0===l||l.log("".concat(t," performance tracking has been successfully added."))),[2]})})},execute:function(e){return v(void 0,void 0,void 0,function(){return m(this,function(t){return[2,e]})})},teardown:function(){return v(void 0,void 0,void 0,function(){var e,t,n,i;return m(this,function(o){try{for(e=y(r),t=e.next();!t.done;t=e.next())t.value.unsubscribe()}catch(e){n={error:e}}finally{try{t&&!t.done&&(i=e.return)&&i.call(e)}finally{if(n)throw n.error}}return[2]})})}}};Ne(),Ki();var rT="[Amplitude] Network Request";Ki(),Ne(),Ki();var nT,iT,oT="500-599";function sT(e,t){var r="^"+t.replace(/[-[\]{}()+?.,\\^$|#\s]/g,"\\$&").replace(/\*/g,".*")+"$";return new RegExp(r).test(e)}function aT(e,t){var r,n,i=t.split(",");try{for(var o=y(i),s=o.next();!s.done;s=o.next()){var a=b(s.value.split("-").map(Number),2),l=a[0],u=a[1];if(e===l&&void 0===u)return!0;if(e>=l&&e<=u)return!0}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return!1}function lT(e){var t;if(e)try{var r=null===(t=de())||void 0===t?void 0:t.location.href,n=new URL(e,r),i=n.searchParams.toString(),o=n.hash.replace("#",""),s=n.href,a=n.host;return n.hash="",n.search="",{query:i,fragment:o,href:s,hrefWithoutQueryOrHash:n.href,host:a}}catch(e){return}}function uT(e){if("object"==typeof e&&null!==e){if(0!==e.length)return e}else{if(e)return w([],b(J),!1);if(void 0===e){return}}}function cT(e){var t,r,n;return!(null===(t=null==e?void 0:e.allowlist)||void 0===t?void 0:t.length)&&!(null===(r=null==e?void 0:e.blocklist)||void 0===r?void 0:r.length)&&!(null===(n=null==e?void 0:e.excludelist)||void 0===n?void 0:n.length)}function dT(e,t){var r;void 0===t&&(t={});var n=lT(e.url);if(!n)return!1;var i,o=n.host;if(!1!==t.ignoreAmplitudeRequests&&(sT(o,"*.amplitude.com")||sT(o,"amplitude.com")))return!1;if(null===(r=t.ignoreHosts)||void 0===r?void 0:r.find(function(e){return sT(o,e)}))return!1;if(!t.captureRules&&void 0!==e.status&&!aT(e.status,oT))return!1;if(t.captureRules&&(w([],b(t.captureRules),!1).reverse().find(function(t){if(i=function(e,t,r,n,i){if((!e.hosts||e.hosts.find(function(e){return sT(t,e)}))&&(!n||!e.urls||Pt(n,e.urls))&&(!i||!e.methods||e.methods.find(function(e){return i.toLowerCase()===e.toLowerCase()||"*"===e})))return!((r||0===r)&&!aT(r,e.statusCodeRange||oT))}(t,o,e.status,e.url,e.method),i){var r=uT(t.responseHeaders);if(e.responseWrapper&&r){var n=e.responseWrapper.headers(r);n&&(e.responseHeaders=n)}var s=uT(t.requestHeaders);if(e.requestWrapper&&s){var a=e.requestWrapper.headers(s);a&&(e.requestHeaders=a)}if(e.responseWrapper&&t.responseBody&&!cT(t.responseBody)){var l=t.responseBody.excludelist||t.responseBody.blocklist;e.responseBodyJson=e.responseWrapper.json(t.responseBody.allowlist,l)}if(e.requestWrapper&&t.requestBody&&!cT(t.requestBody)){l=t.requestBody.excludelist||t.requestBody.blocklist;e.requestBodyJson=e.requestWrapper.json(t.requestBody.allowlist,l)}}return void 0!==i}),!i))return!1;return!e.requestWrapper||!function(e,t){if(e.includes("amplitude.com"))try{var r=t.body;if("string"!=typeof r)return!1;if(JSON.parse(r).events.find(function(e){return e.event_type===rT}))return!0}catch(e){}return!1}(o,e.requestWrapper)}function hT(e){var t=e.allObservables,r=e.networkTrackingOptions,n=e.amplitude,i=e.loggerProvider;return t.networkObservable.filter(function(e){return dT(e.event,r)}).subscribe(function(e){var t,r,o,s=e.event,a=lT(s.url);if(a){var l=null===(r=s.responseWrapper)||void 0===r?void 0:r.bodySize,u=null===(o=s.requestWrapper)||void 0===o?void 0:o.bodySize;!function(e,t,r,n){v(this,void 0,void 0,function(){var i,o,s;return m(this,function(a){switch(a.label){case 0:return t.requestBodyJson||t.responseBodyJson?[4,Promise.all([t.requestBodyJson,t.responseBodyJson])]:[3,2];case 1:if(i=b.apply(void 0,[a.sent(),2]),o=i[0],s=i[1],o)try{e["[Amplitude] Request Body"]=JSON.stringify(o)}catch(e){null==n||n.debug("Failed to stringify request body",e)}if(s)try{e["[Amplitude] Response Body"]=JSON.stringify(s)}catch(e){null==n||n.debug("Failed to stringify response body")}a.label=2;case 2:return null==r||r.track(rT,e),[2]}})})}(((t={})["[Amplitude] URL"]=a.hrefWithoutQueryOrHash,t["[Amplitude] URL Query"]=a.query,t["[Amplitude] URL Fragment"]=a.fragment,t["[Amplitude] Request Method"]=s.method,t["[Amplitude] Status Code"]=s.status,t["[Amplitude] Start Time"]=s.startTime,t["[Amplitude] Completion Time"]=s.endTime,t["[Amplitude] Duration"]=s.duration,t["[Amplitude] Request Body Size"]=u,t["[Amplitude] Response Body Size"]=l,t["[Amplitude] Request Type"]=s.type,t["[Amplitude] Request Headers"]=s.requestHeaders,t["[Amplitude] Response Headers"]=s.responseHeaders,t),s,n,i)}})}!function(e){e.NetworkObservable="networkObservable"}(nT||(nT={}));var pT=function(e){void 0===e&&(e={});var t,r="@amplitude/plugin-network-capture-browser",n=function(){var e,r=new jn.default(function(e){var r=new xn(function(t){var r=function(e,t){return{event:e,timestamp:Date.now(),type:t}}(t,"network");e.next(r)});return In.subscribe(r,t),function(){In.unsubscribe(r)}});return(e={})[nT.NetworkObservable]=r,e};return{name:r,type:"enrichment",setup:function(i,o){return v(void 0,void 0,void 0,function(){var s;return m(this,function(a){return"undefined"==typeof document||(s=n(),t=null==i?void 0:i.loggerProvider,iT=hT({allObservables:s,networkTrackingOptions:e,amplitude:o,loggerProvider:t}),null==t||t.log("".concat(r," has been successfully added."))),[2]})})},execute:function(e){return v(void 0,void 0,void 0,function(){return m(this,function(t){return[2,e]})})},teardown:function(){return v(void 0,void 0,void 0,function(){return m(this,function(e){return iT.unsubscribe(),[2]})})}}};Ne(),Ki();var fT=-1,gT=e=>{addEventListener("pageshow",t=>{t.persisted&&(fT=t.timeStamp,e(t))},!0)},vT=(e,t,r,n)=>{let i,o;return s=>{var a,l;t.value>=0&&(s||n)&&(o=t.value-(null!=i?i:0),(o||void 0===i)&&(i=t.value,t.delta=o,t.rating=(a=t.value)>(l=r)[1]?"poor":a>l[0]?"needs-improvement":"good",e(t)))}},mT=e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))},yT=()=>{const e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},bT=()=>{var e;const t=yT();return null!=(e=null==t?void 0:t.activationStart)?e:0},wT=(e,t=-1)=>{const r=yT();let n="navigate";return fT>=0?n="back-forward-cache":r&&(document.prerendering||bT()>0?n="prerender":document.wasDiscarded?n="restore":r.type&&(n=r.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:`v5-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:n}},ST=new WeakMap;function ET(e,t){return ST.get(e)||ST.set(e,new t),ST.get(e)}var kT,xT=class{constructor(){p(this,"t"),p(this,"i",0),p(this,"o",[])}h(e){var t;if(e.hadRecentInput)return;const r=this.o[0],n=this.o.at(-1);this.i&&r&&n&&e.startTime-n.startTime<1e3&&e.startTime-r.startTime<5e3?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),null==(t=this.t)||t.call(this,e)}},CT=(e,t,r={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){const n=new PerformanceObserver(e=>{Promise.resolve().then(()=>{t(e.getEntries())})});return n.observe({type:e,buffered:!0,...r}),n}}catch(e){}},IT=e=>{let t=!1;return()=>{t||(e(),t=!0)}},OT=-1,TT=new Set,AT=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,_T=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(const e of TT)e();isFinite(OT)||(OT="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",_T,!0))}},RT=()=>{var e;if(OT<0){const t=bT(),r=document.prerendering||null==(e=globalThis.performance.getEntriesByType("visibility-state").filter(e=>"hidden"===e.name&&e.startTime>t)[0])?void 0:e.startTime;OT=null!=r?r:AT(),addEventListener("visibilitychange",_T,!0),addEventListener("prerenderingchange",_T,!0),gT(()=>{setTimeout(()=>{OT=AT()})})}return{get firstHiddenTime(){return OT},onHidden(e){TT.add(e)}}},PT=e=>{document.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()},MT=[1800,3e3],NT=(e,t={})=>{PT(()=>{const r=RT();let n,i=wT("FCP");const o=CT("paint",e=>{for(const t of e)"first-contentful-paint"===t.name&&(o.disconnect(),t.startTime<r.firstHiddenTime&&(i.value=Math.max(t.startTime-bT(),0),i.entries.push(t),n(!0)))});o&&(n=vT(e,i,MT,t.reportAllChanges),gT(r=>{i=wT("FCP"),n=vT(e,i,MT,t.reportAllChanges),mT(()=>{i.value=performance.now()-r.timeStamp,n(!0)})}))})},LT=[.1,.25],DT=0,jT=1/0,UT=0,FT=e=>{for(const t of e)t.interactionId&&(jT=Math.min(jT,t.interactionId),UT=Math.max(UT,t.interactionId),DT=UT?(UT-jT)/7+1:0)},BT=()=>{var e;return kT?DT:null!=(e=performance.interactionCount)?e:0},qT=0,zT=class{constructor(){p(this,"u",[]),p(this,"l",new Map),p(this,"m"),p(this,"p")}v(){qT=BT(),this.u.length=0,this.l.clear()}L(){const e=Math.min(this.u.length-1,Math.floor((BT()-qT)/50));return this.u[e]}h(e){var t,r;if(null==(t=this.m)||t.call(this,e),!e.interactionId&&"first-input"!==e.entryType)return;const n=this.u.at(-1);let i=this.l.get(e.interactionId);if(i||this.u.length<10||e.duration>n.P){if(i?e.duration>i.P?(i.entries=[e],i.P=e.duration):e.duration===i.P&&e.startTime===i.entries[0].startTime&&i.entries.push(e):(i={id:e.interactionId,entries:[e],P:e.duration},this.l.set(i.id,i),this.u.push(i)),this.u.sort((e,t)=>t.P-e.P),this.u.length>10){const e=this.u.splice(10);for(const t of e)this.l.delete(t.id)}null==(r=this.p)||r.call(this,i)}}},VT=e=>{const t=globalThis.requestIdleCallback||setTimeout;"hidden"===document.visibilityState?e():(e=IT(e),addEventListener("visibilitychange",e,{once:!0,capture:!0}),t(()=>{e(),removeEventListener("visibilitychange",e,{capture:!0})}))},WT=[200,500],HT=(e,t={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const r=RT();PT(()=>{var n;"interactionCount"in performance||kT||(kT=CT("event",FT,{type:"event",buffered:!0,durationThreshold:0}));let i,o=wT("INP");const s=ET(t,zT),a=e=>{VT(()=>{for(const t of e)s.h(t);const t=s.L();t&&t.P!==o.value&&(o.value=t.P,o.entries=t.entries,i())})},l=CT("event",a,{durationThreshold:null!=(n=t.durationThreshold)?n:40});i=vT(e,o,WT,t.reportAllChanges),l&&(l.observe({type:"first-input",buffered:!0}),r.onHidden(()=>{a(l.takeRecords()),i(!0)}),gT(()=>{s.v(),o=wT("INP"),i=vT(e,o,WT,t.reportAllChanges)}))})},$T=class{constructor(){p(this,"m")}h(e){var t;null==(t=this.m)||t.call(this,e)}},GT=[2500,4e3],KT=[800,1800],JT=e=>{document.prerendering?PT(()=>JT(e)):"complete"!==document.readyState?addEventListener("load",()=>JT(e),!0):setTimeout(e)};function QT(e){var t,r=(null===(t=e.entries[0])||void 0===t?void 0:t.startTime)||0;return performance.timeOrigin+r}function YT(e){return{value:e.value,rating:e.rating,delta:e.delta,navigationType:e.navigationType,id:e.id,timestamp:Math.floor(QT(e)),navigationStart:Math.floor(performance.timeOrigin)}}var XT=function(){var e=null,t=de(),r=null==t?void 0:t.document,n=null==t?void 0:t.location;return{name:"web-vitals-browser",type:"enrichment",setup:function(t,i){return v(void 0,void 0,void 0,function(){var o,s;return m(this,function(a){return void 0===r||(o=Mt((null==n?void 0:n.href)||"",t.loggerProvider),s={"[Amplitude] Page Domain":(null==n?void 0:n.hostname)||"","[Amplitude] Page Location":o,"[Amplitude] Page Path":Mt((null==n?void 0:n.pathname)||"",t.loggerProvider),"[Amplitude] Page Title":"undefined"!=typeof document&&document.title||"","[Amplitude] Page URL":Mt(o.split("?")[0],t.loggerProvider)},((e,t={})=>{PT(()=>{const r=RT();let n,i=wT("LCP");const o=ET(t,$T),s=e=>{t.reportAllChanges||(e=e.slice(-1));for(const t of e)o.h(t),t.startTime<r.firstHiddenTime&&(i.value=Math.max(t.startTime-bT(),0),i.entries=[t],n())},a=CT("largest-contentful-paint",s);if(a){n=vT(e,i,GT,t.reportAllChanges);const r=IT(()=>{s(a.takeRecords()),a.disconnect(),n(!0)}),o=e=>{e.isTrusted&&(VT(r),removeEventListener(e.type,o,{capture:!0}))};for(const e of["keydown","click","visibilitychange"])addEventListener(e,o,{capture:!0});gT(r=>{i=wT("LCP"),n=vT(e,i,GT,t.reportAllChanges),mT(()=>{i.value=performance.now()-r.timeStamp,n(!0)})})}})})(function(e){s["[Amplitude] LCP"]=YT(e)}),NT(function(e){s["[Amplitude] FCP"]=YT(e)}),HT(function(e){s["[Amplitude] INP"]=YT(e)}),((e,t={})=>{const r=RT();NT(IT(()=>{let n,i=wT("CLS",0);const o=ET(t,xT),s=e=>{for(const t of e)o.h(t);o.i>i.value&&(i.value=o.i,i.entries=o.o,n())},a=CT("layout-shift",s);a&&(n=vT(e,i,LT,t.reportAllChanges),r.onHidden(()=>{s(a.takeRecords()),n(!0)}),gT(()=>{o.i=0,i=wT("CLS",0),n=vT(e,i,LT,t.reportAllChanges),mT(()=>n())}),setTimeout(n))}))})(function(e){s["[Amplitude] CLS"]=YT(e)}),((e,t={})=>{let r=wT("TTFB"),n=vT(e,r,KT,t.reportAllChanges);JT(()=>{const i=yT();i&&(r.value=Math.max(i.responseStart-bT(),0),r.entries=[i],n(!0),gT(()=>{r=wT("TTFB",0),n=vT(e,r,KT,t.reportAllChanges),n(!0)}))})})(function(e){s["[Amplitude] TTFB"]=YT(e)}),e=function(){"hidden"===r.visibilityState&&e&&(i.track("[Amplitude] Web Vitals",s),r.removeEventListener("visibilitychange",e),e=null)},r.addEventListener("visibilitychange",e)),[2]})})},execute:function(e){return v(void 0,void 0,void 0,function(){return m(this,function(t){return[2,e]})})},teardown:function(){return v(void 0,void 0,void 0,function(){return m(this,function(t){return e&&(null==r||r.removeEventListener("visibilitychange",e)),[2]})})}}};Ne(),Ki();var ZT=function(){function e(e,r){var n,i,o;this.shouldTrackNewCampaign=!1,this.options=t({initialEmptyValue:"EMPTY",resetSessionOnNewCampaign:!1,excludeReferrers:(i=(null===(n=r.cookieOptions)||void 0===n?void 0:n.domain)||r.topLevelDomain,o=i,o?(o.startsWith(".")&&(o=o.substring(1)),[new RegExp("".concat(o.replace(".","\\."),"$"))]):[]),optOut:r.optOut},e),this.storage=r.cookieStorage,this.storageKey=Wt(r.apiKey,"MKTG"),this.webExpStorageKey=Wt(r.apiKey,"MKTG_ORIGINAL"),this.currentCampaign=K,this.sessionTimeout=r.sessionTimeout,this.lastEventTime=r.lastEventTime,this.logger=r.loggerProvider,this.topLevelDomain=r.topLevelDomain,r.loggerProvider.log("Installing web attribution tracking.")}return e.prototype.init=function(){return v(this,void 0,void 0,function(){var e,t;return m(this,function(r){switch(r.label){case 0:return this.options.optOut?[2]:[4,this.fetchCampaign()];case 1:return t=b.apply(void 0,[r.sent(),2]),this.currentCampaign=t[0],this.previousCampaign=t[1],e=!this.lastEventTime||It(this.sessionTimeout,this.lastEventTime),yI(this.currentCampaign,this.previousCampaign,this.options,this.logger,e,this.topLevelDomain)?(this.shouldTrackNewCampaign=!0,[4,this.storage.set(this.storageKey,this.currentCampaign)]):[3,3];case 2:r.sent(),r.label=3;case 3:return[2]}})})},e.prototype.fetchCampaign=function(){return v(this,void 0,void 0,function(){var e;return m(this,function(t){switch(t.label){case 0:return[4,this.storage.get(this.webExpStorageKey)];case 1:return(e=t.sent())?[4,this.storage.remove(this.webExpStorageKey)]:[3,3];case 2:t.sent(),t.label=3;case 3:return[4,Promise.all([e||(new An).parse(),this.storage.get(this.storageKey)])];case 4:return[2,t.sent()]}})})},e.prototype.generateCampaignEvent=function(e){this.shouldTrackNewCampaign=!1;var r,n,i,o,s=(r=this.currentCampaign,n=this.options,i=t(t({},K),r),o=Object.entries(i).reduce(function(e,t){var r,i=b(t,2),o=i[0],s=i[1];return e.setOnce("initial_".concat(o),null!==(r=null!=s?s:n.initialEmptyValue)&&void 0!==r?r:"EMPTY"),s?e.set(o,s):e.unset(o)},new Z),me(o));return e&&(s.event_id=e),s},e.prototype.shouldSetSessionIdOnNewCampaign=function(){return this.shouldTrackNewCampaign&&!!this.options.resetSessionOnNewCampaign},e}();Ne(),Ki();var eA=new Set([E.IDENTIFY,E.GROUP_IDENTIFY]),tA=function(e){var r;void 0===e&&(e={});var n,i,o,s,a,l,u=null!==(r=e.fallbackAttributionEvent)&&void 0!==r&&r,c=de(),d={},h=!1,p=!1,f=function(){return v(void 0,void 0,void 0,function(){var e;return m(this,function(t){switch(t.label){case 0:return[4,(new An).parse()];case 1:return e=t.sent(),d=Dt(e),u&&(null==i||i.log("Tracking attribution fallback event."),null==n||n.track("[Amplitude] Attribution",d)),[2]}})})},g=function(){f()},y=function(e){return new Proxy(e,{apply:function(e,t,r){Reflect.apply(e,t,r),h&&g()}})};return{name:"@amplitude/plugin-event-property-attribution-browser",type:"enrichment",setup:function(e,t){return v(void 0,void 0,void 0,function(){return m(this,function(r){switch(r.label){case 0:return n=t,i=e.loggerProvider,h=!0,i.log("Installing event property attribution tracking."),[4,f()];case 1:if(r.sent(),!c)return[2];if(c.addEventListener("popstate",g),!p){if(o=Reflect.get(c.history,"pushState"),s=Reflect.get(c.history,"replaceState"),!o||!s)return[2];a=y(o),c.history.pushState=a,l=y(s),c.history.replaceState=l,p=!0}return[2]}})})},execute:function(e){return v(void 0,void 0,void 0,function(){return m(this,function(r){return eA.has(e.event_type)||(e.event_properties=t(t({},d),e.event_properties)),[2,e]})})},teardown:function(){return v(void 0,void 0,void 0,function(){var e,t;return m(this,function(r){return c&&(c.removeEventListener("popstate",g),e=Reflect.get(c.history,"pushState"),t=Reflect.get(c.history,"replaceState"),p&&e===a&&o&&(c.history.pushState=o),p&&t===l&&s&&(c.history.replaceState=s)),h=!1,p=!1,o=void 0,s=void 0,a=void 0,l=void 0,d={},[2]})})}}};Ne(),Ki();var rA,nA,iA="AMP_CURRENT_PAGE",oA="AMP_PREVIOUS_PAGE",sA="AMP_URL_INFO";(nA=rA||(rA={})).Direct="direct",nA.Internal="internal",nA.External="external";var aA=new Set([E.IDENTIFY,E.GROUP_IDENTIFY,E.REVENUE]),lA=function(e){var r=(void 0===e?{}:e).internalDomains,n=void 0===r?[]:r,i=de(),o=void 0,s=!1,a=void 0,l=!1,u=!1,c=function(e){var t;try{var r=Mt(e,a);t=new URL(r).hostname}catch(e){null==a||a.error("Could not parse URL: ",e)}return t},d=function(e){var t="undefined"!=typeof location&&location.hostname||"",r=e?c(e):void 0;if(!r)return rA.Direct;var i=n.some(function(e){return-1!==t.indexOf(e)}),o=n.some(function(e){return-1!==r.indexOf(e)});return t===r||o&&i?rA.Internal:rA.External},h=function(){return v(void 0,void 0,void 0,function(){var e,t,r,n,i;return m(this,function(a){switch(a.label){case 0:return o&&s?[4,o.get(sA)]:[3,3];case 1:return e=a.sent(),t=Mt("undefined"!=typeof location&&location.href||""),r=(null==e?void 0:e[iA])||"",n=void 0,n=t===r?(null==e?void 0:e[oA])||"":r||(document.referrer||""),[4,o.set(sA,(i={},i[iA]=t,i[oA]=n,i))];case 2:a.sent(),a.label=3;case 3:return[2]}})})},p=function(){h()};return{name:"@amplitude/plugin-page-url-enrichment-browser",type:"enrichment",setup:function(e,t){return v(void 0,void 0,void 0,function(){var t,r,n,d,f,g,v,y;return m(this,function(m){switch(m.label){case 0:if((a=e.loggerProvider).log("Installing @amplitude/plugin-page-url-enrichment-browser"),u=!0,!i)return[3,7];try{o=new Ht(i.sessionStorage)}catch(e){null==a||a.debug("sessionStorage is not available in this environment.")}return[4,null==o?void 0:o.isEnabled()];case 1:return s=null!==(y=m.sent())&&void 0!==y&&y,o&&s?(t="undefined"!=typeof document&&document.referrer||"",r=t?c(t):void 0,n="undefined"!=typeof location&&location.hostname||"",d=Mt("undefined"!=typeof location&&location.href||""),[4,o.get(sA)]):[3,6];case 2:return f=m.sent(),g=(null==f?void 0:f[iA])||"",!!r&&r!==n&&g!==d?[4,o.set(sA,(v={},v[iA]=d,v[oA]=t,v))]:[3,4];case 3:return m.sent(),[3,6];case 4:return[4,h()];case 5:m.sent(),m.label=6;case 6:i.addEventListener("popstate",p),l||(i.history.pushState=new Proxy(i.history.pushState,{apply:function(e,t,r){var n=b(r,3),i=n[0],o=n[1],s=n[2];e.apply(t,[i,o,s]),u&&p()}}),i.history.replaceState=new Proxy(i.history.replaceState,{apply:function(e,t,r){var n=b(r,3),i=n[0],o=n[1],s=n[2];e.apply(t,[i,o,s]),u&&p()}}),l=!0),m.label=7;case 7:return[2]}})})},execute:function(e){return v(void 0,void 0,void 0,function(){var r,n,i;return m(this,function(a){switch(a.label){case 0:return r=Mt("undefined"!=typeof location&&location.href||""),o&&s?[4,o.get(sA)]:[3,2];case 1:if(n=a.sent(),i=(null==n?void 0:n[oA])||"",aA.has(e.event_type))return[2,e];e.event_properties=t(t({},e.event_properties||{}),{"[Amplitude] Page Domain":uA(e,"[Amplitude] Page Domain","undefined"!=typeof location&&location.hostname||""),"[Amplitude] Page Location":uA(e,"[Amplitude] Page Location",r),"[Amplitude] Page Path":uA(e,"[Amplitude] Page Path","undefined"!=typeof location&&Mt(location.pathname)||""),"[Amplitude] Page Title":uA(e,"[Amplitude] Page Title",Dn(Ln)),"[Amplitude] Page URL":uA(e,"[Amplitude] Page URL",r.split("?")[0]),"[Amplitude] Previous Page Location":i,"[Amplitude] Previous Page Type":d(i)}),a.label=2;case 2:return[2,e]}})})},teardown:function(){return v(void 0,void 0,void 0,function(){return m(this,function(e){switch(e.label){case 0:return i&&(i.removeEventListener("popstate",p),u=!1),o&&s?[4,o.set(sA,{})]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}})})}}};function uA(e,t,r){return e.event_properties||(e.event_properties={}),void 0===e.event_properties[t]?r:e.event_properties[t]}Ne();var cA=function(){var e,t,r;function n(t){if(t)try{var r=new Function("return "+t)();if("function"==typeof r)return r;null==e||e.error("Custom enrichment body did not evaluate to a function")}catch(t){null==e||e.error("Could not create custom enrichment function",t)}return function(e){return e}}return{name:"@amplitude/plugin-custom-enrichment-browser",type:"enrichment",setup:function(i,o){return v(void 0,void 0,void 0,function(){var o,s;return m(this,function(a){return null==(e=i.loggerProvider)||e.log("Installing @amplitude/plugin-custom-enrichment-browser"),(null===(s=i.remoteConfig)||void 0===s?void 0:s.fetchRemoteConfig)&&(i.remoteConfigClient?(o=i.remoteConfigClient.subscribe("configs.analyticsSDK.browserSDK.customEnrichment","all",function(e){r=e&&function(e){return"object"==typeof e&&null!==e&&"body"in e&&"string"==typeof e.body}(e)?n(e.body||""):n("")}),t=function(){var e;return null===(e=i.remoteConfigClient)||void 0===e?void 0:e.unsubscribe(o)}):null==e||e.debug("Remote config client is not provided, skipping remote config fetch")),[2]})})},execute:function(t){return v(void 0,void 0,void 0,function(){var n;return m(this,function(i){if(r)try{return[2,null!==(n=r(t))&&void 0!==n?n:null]}catch(r){return null==e||e.error("Could not execute custom enrichment function",r),[2,t]}return[2,t]})})},teardown:function(){return v(void 0,void 0,void 0,function(){return m(this,function(e){return t&&t(),[2]})})}}};Ne();var dA,hA="userProperty",pA="eventProperty",fA=function(e){return e===hA||e===pA},gA=function(e,t){return function(e){var t=w([],b(new Set((Array.isArray(e)?e:[e]).filter(fA))),!1);return t.length>0?t:[hA]}(e.trackingMethod).includes(t)},vA=function(e){return gA(e,hA)},mA=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return t._diagnosticsSampleRate=0,t}return f(r,e),r.prototype.init=function(e,r,n){var i,o;return void 0===e&&(e=""),arguments.length>2?(i=r,o=n):"string"==typeof r?(i=r,o=void 0):(i=null==r?void 0:r.userId,o=r),Se(this._init(t(t({},o),{userId:i,apiKey:e})))},r.prototype._init=function(r){var n,i,o,s,a,l,u,c;return v(this,void 0,void 0,function(){var d,h,p,f,y,b,w,S,E,k,x,C,I,O,T,A=this;return m(this,function(_){switch(_.label){case 0:return this.initializing?[2]:(this.initializing=!0,d=function(e){var t,r;return void 0===e&&(e={}),!0===(null===(t=e.remoteConfig)||void 0===t?void 0:t.fetchRemoteConfig)||!1!==(null===(r=e.remoteConfig)||void 0===r?void 0:r.fetchRemoteConfig)&&!1!==e.fetchRemoteConfig}(r),h=null!==(n=r.loggerProvider)&&void 0!==n?n:new Te,r.loggerProvider||h.enable(null!==(i=r.logLevel)&&void 0!==i?i:Ie.Warn),p=null!==(o=r.serverZone)&&void 0!==o?o:"US",y=this._diagnosticsSampleRate,b=null===(s=r.enableDiagnostics)||void 0===s||s,d?(f=new Ar(r.apiKey,h,p,null===(a=r.remoteConfig)||void 0===a?void 0:a.serverUrl),[4,new Promise(function(e){null==f||f.subscribe("configs.diagnostics.browserSDK","all",function(t,r,n){if(h.debug("Diagnostics remote configuration received:",JSON.stringify({remoteConfig:t,source:r,lastFetch:n},null,2)),t){var i=t.sampleRate;"number"!=typeof i||isNaN(i)||(y=i);var o=t.enabled;"boolean"==typeof o&&(b=o)}e()})})]):[3,2]);case 1:_.sent(),_.label=2;case 2:return(w=new rr(r.apiKey,h,p,{enabled:b,sampleRate:y})).setTag("library","".concat(HC,"/").concat(WC)),"undefined"!=typeof navigator&&w.setTag("user_agent",navigator.userAgent),[4,II(r.apiKey,r,this,w,{loggerProvider:h,serverZone:p,enableDiagnostics:b,diagnosticsSampleRate:y})];case 3:return S=_.sent(),d&&f?[4,new Promise(function(e){null==f||f.subscribe("configs.analyticsSDK.browserSDK","all",function(t,r,n){S.loggerProvider.debug("Remote configuration received:",JSON.stringify({remoteConfig:t,source:r,lastFetch:n},null,2)),t&&VI(t,S),e()})})]:[3,5];case 4:_.sent(),_.label=5;case 5:return[4,e.prototype._init.call(this,S)];case 6:return _.sent(),this.logBrowserOptions(S),this.config.remoteConfigClient=f,M=this.config,E=_C(M.defaultTracking)&&M.defaultTracking&&"object"==typeof M.defaultTracking&&M.defaultTracking.attribution&&"object"==typeof M.defaultTracking.attribution?t({},M.defaultTracking.attribution):{},_C(this.config.defaultTracking)&&vA(E)?(this.config.optOut&&this.timeline.addOptOutListener(function(e){return v(A,void 0,void 0,function(){return m(this,function(t){switch(t.label){case 0:return e?[3,2]:(this.webAttribution=new ZT(E,this.config),[4,this.webAttribution.init()]);case 1:t.sent(),t.label=2;case 2:return[2]}})})}),this.webAttribution=new ZT(E,this.config),[4,this.webAttribution.init()]):[3,8];case 7:_.sent(),_.label=8;case 8:return k=_t(),x=k.ampTimestamp?Number(k.ampTimestamp):void 0,C=!x||Date.now()<x,I=C&&!Number.isNaN(Number(k.ampSessionId))?Number(k.ampSessionId):void 0,-1!==(O=this.config.deferredSessionId)||this.config.optOut||(O=Date.now()),this.setSessionId(null!==(c=null!==(u=null!==(l=r.sessionId)&&void 0!==l?l:I)&&void 0!==u?u:O)&&void 0!==c?c:this.config.sessionId),this.config.optOut&&this.timeline.addOptOutListener(function(e){return v(A,void 0,void 0,function(){return m(this,function(t){return!e&&this.config.deferredSessionId&&(-1===this.config.deferredSessionId?this.setSessionId(void 0):this.setSessionId(this.config.deferredSessionId)),[2]})})}),(T=Et(r.instanceName)).identityStore.setIdentity({userId:this.config.userId,deviceId:this.config.deviceId}),this.config.offline===Vr?[3,10]:[4,this.add(BI()).promise];case 9:_.sent(),_.label=10;case 10:return[4,this.add(new at({diagnosticsClient:w})).promise];case 11:return _.sent(),[4,this.add(new $C).promise];case 12:return _.sent(),[4,this.add(new Ct).promise];case 13:return _.sent(),function(e){FI||void 0!==e.defaultTracking||(e.loggerProvider.warn("`options.defaultTracking` is set to undefined. This implicitly configures your Amplitude instance to track Page Views, Sessions, File Downloads, and Form Interactions. You can suppress this warning by explicitly setting a value to `options.defaultTracking`. The value must either be a boolean, to enable and disable all default events, or an object, for advanced configuration. For example:\n\namplitude.init(<YOUR_API_KEY>, {\n defaultTracking: true,\n});\n\nVisit https://www.docs.developers.amplitude.com/data/sdks/browser-2/#tracking-default-events for more details."),FI=!0)}(this.config),P=this.config.defaultTracking,AC(P,"fileDownloads")?(this.config.loggerProvider.debug("Adding file download tracking plugin"),[4,this.add(UI()).promise]):[3,15];case 14:_.sent(),_.label=15;case 15:return RC(this.config.defaultTracking)?(this.config.loggerProvider.debug("Adding form interaction plugin"),[4,this.add(LI()).promise]):[3,17];case 16:_.sent(),_.label=17;case 17:return PC(this.config.defaultTracking)?this.config.optOut?[3,19]:(this.config.loggerProvider.debug("Adding page view tracking plugin"),[4,this.add(RI(qC(this.config))).promise]):[3,20];case 18:return _.sent(),[3,20];case 19:this.timeline.addOptOutListener(function(e){return v(A,void 0,void 0,function(){return m(this,function(t){switch(t.label){case 0:return e?[2]:(this.config.loggerProvider.debug("Adding page view tracking plugin"),[4,this.add(RI(qC(this.config))).promise]);case 1:return t.sent(),[2]}})})}),_.label=20;case 20:return _C(this.config.defaultTracking)&&function(e){return gA(e,pA)}(E)?(this.config.loggerProvider.debug("Adding event property attribution plugin"),[4,this.add(tA(E)).promise]):[3,22];case 21:_.sent(),_.label=22;case 22:return LC(this.config.autocapture)?(this.config.loggerProvider.debug("Adding user interactions plugin (autocapture plugin)"),[4,this.add(RO(UC(this.config),{diagnosticsClient:w})).promise]):[3,24];case 23:_.sent(),_.label=24;case 24:return DC(this.config.autocapture)?(this.config.loggerProvider.debug("Adding frustration interactions plugin"),[4,this.add(QO(FC(this.config))).promise]):[3,26];case 25:_.sent(),_.label=26;case 26:return NC(this.config.autocapture)?(this.config.loggerProvider.debug("Adding network tracking plugin"),[4,this.add(pT(BC(this.config))).promise]):[3,28];case 27:_.sent(),_.label=28;case 28:return function(e){return"boolean"==typeof e?e:"object"==typeof e&&!0===e.webVitals}(this.config.autocapture)?(this.config.loggerProvider.debug("Adding web vitals plugin"),[4,this.add(XT()).promise]):[3,30];case 29:_.sent(),_.label=30;case 30:return function(e){return"object"==typeof e&&(!0===e.performanceTracking||"object"==typeof e.performanceTracking)}(this.config.autocapture)?(this.config.loggerProvider.debug("Adding performance tracking plugin"),[4,this.add(tT(jC(this.config))).promise]):[3,32];case 31:_.sent(),_.label=32;case 32:return function(e){return AC(e,"pageUrlEnrichment")}(this.config.autocapture)?(this.config.loggerProvider.debug("Adding referrer page url plugin"),[4,this.add(lA()).promise]):[3,34];case 33:_.sent(),_.label=34;case 34:return("boolean"==typeof(R=this.config.customEnrichment)?R:"object"==typeof R&&null!==R&&!1!==R.enabled)?(this.config.loggerProvider.debug("Adding custom enrichment plugin"),[4,this.add(cA()).promise]):[3,36];case 35:_.sent(),_.label=36;case 36:return this.initializing=!1,[4,this.runQueuedFunctions("dispatchQ")];case 37:return _.sent(),T.eventBridge.setEventReceiver(function(e){var t=e.eventProperties||{},r=t.time,n=g(t,["time"]),i="number"==typeof r?{time:r}:void 0;A.track(e.eventType,n,i)}),[2]}var R,P,M})})},r.prototype.getUserId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.userId},r.prototype.setUserId=function(e){this.config?(this.config.loggerProvider.debug("function setUserId: ",e),e===this.config.userId&&void 0!==e||(this.config.userId=e,this.timeline.onIdentityChanged({userId:e}),kt(e,this.config.instanceName))):this.q.push(this.setUserId.bind(this,e))},r.prototype.getDeviceId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.deviceId},r.prototype.setDeviceId=function(e){this.config?(this.config.loggerProvider.debug("function setDeviceId: ",e),e!==this.config.deviceId&&(this.config.deviceId=e,this.timeline.onIdentityChanged({deviceId:e}),xt(e,this.config.instanceName))):this.q.push(this.setDeviceId.bind(this,e))},r.prototype.reset=function(){this.setDeviceId(fe()),this.setUserId(void 0),this.timeline.onReset()},r.prototype.getIdentity=function(){var e,t;return{deviceId:null===(e=this.config)||void 0===e?void 0:e.deviceId,userId:null===(t=this.config)||void 0===t?void 0:t.userId,userProperties:this.userProperties}},r.prototype.setIdentity=function(e){var t,r,n;if("userId"in e&&this.setUserId(e.userId),"deviceId"in e&&e.deviceId&&this.setDeviceId(e.deviceId),"userProperties"in e){this.userProperties=e.userProperties;var i=new Z,o=null!==(n=e.userProperties)&&void 0!==n?n:{};try{for(var s=y(Object.entries(o)),a=s.next();!a.done;a=s.next()){var l=b(a.value,2),u=l[0],c=l[1];i.set(u,c)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}this.identify(i)}},r.prototype.getOptOut=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.optOut},r.prototype.getSessionId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.sessionId},r.prototype.setSessionId=function(e){var t,r=[];if(!this.config)return this.q.push(this.setSessionId.bind(this,e)),Se(Promise.resolve());if(this.config.optOut)return this.config.deferredSessionId=null!=e?e:-1,Se(Promise.resolve());if(void 0===e&&(e=Date.now()),e===this.config.sessionId)return Se(Promise.resolve());this.config.loggerProvider.debug("function setSessionId: ",e);var n=this.getSessionId();n!==e&&this.timeline.onSessionIdChanged(e);var i=this.config.lastEventTime,o=null!==(t=this.config.lastEventId)&&void 0!==t?t:-1;this.config.sessionId=e,this.config.lastEventTime=void 0,this.config.pageCounter=0,MC(this.config.defaultTracking)&&(n&&i&&r.push(this.track(aI,void 0,{device_id:this.previousSessionDeviceId,event_id:++o,session_id:n,time:i+1,user_id:this.previousSessionUserId}).promise),this.config.lastEventTime=this.config.sessionId);var s=this.trackCampaignEventIfNeeded(++o,r);return this.config.identify&&r.push(this.track(me(this.config.identify)).promise),MC(this.config.defaultTracking)&&r.push(this.track(sI,void 0,{event_id:s?++o:o,session_id:this.config.sessionId,time:this.config.lastEventTime}).promise),this.previousSessionDeviceId=this.config.deviceId,this.previousSessionUserId=this.config.userId,Se(Promise.all(r))},r.prototype.extendSession=function(){this.config?this.config.lastEventTime=Date.now():this.q.push(this.extendSession.bind(this))},r.prototype.setTransport=function(e){this.config?this.config.transportProvider=TI(e):this.q.push(this.setTransport.bind(this,e))},r.prototype.identify=function(t,r){if(VC(t)){var n=t._q;t._q=[],t=zC(new Z,n)}return(null==r?void 0:r.user_id)&&this.setUserId(r.user_id),(null==r?void 0:r.device_id)&&this.setDeviceId(r.device_id),e.prototype.identify.call(this,t,r)},r.prototype.groupIdentify=function(t,r,n,i){if(VC(n)){var o=n._q;n._q=[],n=zC(new Z,o)}return e.prototype.groupIdentify.call(this,t,r,n,i)},r.prototype.revenue=function(t,r){if(VC(t)){var n=t._q;t._q=[],t=zC(new ke,n)}return e.prototype.revenue.call(this,t,r)},r.prototype.trackCampaignEventIfNeeded=function(e,t){if(!this.webAttribution||!this.webAttribution.shouldTrackNewCampaign||!vA(this.webAttribution.options))return!1;var r=this.webAttribution.generateCampaignEvent(e);return t?t.push(this.track(r).promise):this.track(r),this.config.loggerProvider.log("Tracking attribution."),!0},r.prototype.process=function(t){return v(this,void 0,void 0,function(){var r,n,i;return m(this,function(o){return r=Date.now(),n=It(this.config.sessionTimeout,this.config.lastEventTime),i=this.webAttribution&&this.webAttribution.shouldSetSessionIdOnNewCampaign(),t.event_type===sI||t.event_type===aI||t.session_id&&t.session_id!==this.getSessionId()||(n||i?(this.setSessionId(r),i&&this.config.loggerProvider.log("Created a new session for new campaign.")):n||this.trackCampaignEventIfNeeded()),[2,e.prototype.process.call(this,t)]})})},r.prototype.logBrowserOptions=function(e){try{var r=t(t({},e),{apiKey:e.apiKey.substring(0,10)+"********"});this.config.loggerProvider.debug("Initialized Amplitude with BrowserConfig:",Gn(r))}catch(e){this.config.loggerProvider.error("Error logging browser config",e)}},r.prototype._setDiagnosticsSampleRate=function(e){e>1||e<0||this.config||(this._diagnosticsSampleRate=e)},r}(Ee);dA=new mA,it(dA.init.bind(dA),"init",tt(dA),nt(dA,["config"])),it(dA.add.bind(dA),"add",tt(dA),nt(dA,["config.apiKey","timeline.plugins"])),it(dA.remove.bind(dA),"remove",tt(dA),nt(dA,["config.apiKey","timeline.plugins"])),it(dA.track.bind(dA),"track",tt(dA),nt(dA,["config.apiKey","timeline.queue.length"])),it(dA.logEvent.bind(dA),"logEvent",tt(dA),nt(dA,["config.apiKey","timeline.queue.length"])),it(dA.identify.bind(dA),"identify",tt(dA),nt(dA,["config.apiKey","timeline.queue.length"])),it(dA.groupIdentify.bind(dA),"groupIdentify",tt(dA),nt(dA,["config.apiKey","timeline.queue.length"])),it(dA.setGroup.bind(dA),"setGroup",tt(dA),nt(dA,["config.apiKey","timeline.queue.length"])),it(dA.revenue.bind(dA),"revenue",tt(dA),nt(dA,["config.apiKey","timeline.queue.length"])),it(dA.flush.bind(dA),"flush",tt(dA),nt(dA,["config.apiKey","timeline.queue.length"])),it(dA.getUserId.bind(dA),"getUserId",tt(dA),nt(dA,["config","config.userId"])),it(dA.setUserId.bind(dA),"setUserId",tt(dA),nt(dA,["config","config.userId"])),it(dA.getDeviceId.bind(dA),"getDeviceId",tt(dA),nt(dA,["config","config.deviceId"])),it(dA.setDeviceId.bind(dA),"setDeviceId",tt(dA),nt(dA,["config","config.deviceId"])),it(dA.reset.bind(dA),"reset",tt(dA),nt(dA,["config","config.userId","config.deviceId"])),it(dA.getSessionId.bind(dA),"getSessionId",tt(dA),nt(dA,["config"])),it(dA.setSessionId.bind(dA),"setSessionId",tt(dA),nt(dA,["config"])),it(dA.extendSession.bind(dA),"extendSession",tt(dA),nt(dA,["config"])),it(dA.setOptOut.bind(dA),"setOptOut",tt(dA),nt(dA,["config"])),it(dA.setTransport.bind(dA),"setTransport",tt(dA),nt(dA,["config"])),it(dA.getIdentity.bind(dA),"getIdentity",tt(dA),nt(dA,["config"])),it(dA.setIdentity.bind(dA),"setIdentity",tt(dA),nt(dA,["config","config.userId","config.deviceId"])),it(dA.getOptOut.bind(dA),"getOptOut",tt(dA),nt(dA,["config"])),it(dA._setDiagnosticsSampleRate.bind(dA),"_setDiagnosticsSampleRate",tt(dA),nt(dA,["config"]));Ki();lk(),zx(),$x(),Ne();var yA=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return f(r,e),r.prototype.sessionReplay=function(){return this._sessionReplay},r.prototype.experiment=function(){if(void 0!==this.config){var e=this.plugins(wx);return 0===e.length?void this.config.loggerProvider.debug("".concat(wx.pluginName," plugin is not found.")):1===e.length?e[0].experiment:void this.config.loggerProvider.debug("Multiple instances of ".concat(wx.pluginName," are found."))}},r.prototype.initAll=function(r,n){return v(this,void 0,void 0,function(){var i=this;return m(this,function(o){return this._initAllPromise||(this._initAllPromise=v(i,void 0,void 0,function(){var i,o;return m(this,function(s){switch(s.label){case 0:return i={serverZone:null==n?void 0:n.serverZone,instanceName:null==n?void 0:n.instanceName},e.prototype.add.call(this,{type:"enrichment",name:"@amplitude/unified-library-plugin",execute:function(e){var t;return v(this,void 0,void 0,function(){return m(this,function(r){return e.library="".concat("amplitude-ts-unified","/").concat("1.1.10","-").concat(null!==(t=e.library)&&void 0!==t?t:""),[2,e]})})}}),[4,e.prototype.init.call(this,r,t(t({},null==n?void 0:n.analytics),i)).promise];case 1:return s.sent(),[4,e.prototype.add.call(this,FS(t(t({},null==n?void 0:n.sessionReplay),i))).promise];case 2:return s.sent(),[4,e.prototype.add.call(this,Sx(t(t({},null==n?void 0:n.experiment),i))).promise];case 3:return s.sent(),void 0===(o=this.plugin(US.pluginName))?this.config.loggerProvider.debug("".concat(US.pluginName," plugin is not found.")):this._sessionReplay=o.sessionReplay,[4,e.prototype.add.call(this,qx(t(t({},null==n?void 0:n.engagement),i))).promise];case 4:return s.sent(),[2]}})}).finally(function(){i._initAllPromise=void 0})),[2,this._initAllPromise]})})},r.prototype.init=function(t,r,n){return void 0===t&&(t=""),e.prototype.init.call(this,t,r,n)},r}(mA);Ki();var bA,wA=function(){var e=new yA;return{_setDiagnosticsSampleRate:it(e._setDiagnosticsSampleRate.bind(e),"_setDiagnosticsSampleRate",tt(e),nt(e,["config"])),experiment:it(e.experiment.bind(e),"experiment",tt(e),nt(e,["config"])),sessionReplay:it(e.sessionReplay.bind(e),"sessionReplay",tt(e),nt(e,["config"])),initAll:it(e.initAll.bind(e),"initAll",tt(e),nt(e,["config"])),init:it(e.init.bind(e),"init",tt(e),nt(e,["config"])),add:it(e.add.bind(e),"add",tt(e),nt(e,["config.apiKey","timeline.plugins"])),remove:it(e.remove.bind(e),"remove",tt(e),nt(e,["config.apiKey","timeline.plugins"])),track:it(e.track.bind(e),"track",tt(e),nt(e,["config.apiKey","timeline.queue.length"])),logEvent:it(e.logEvent.bind(e),"logEvent",tt(e),nt(e,["config.apiKey","timeline.queue.length"])),identify:it(e.identify.bind(e),"identify",tt(e),nt(e,["config.apiKey","timeline.queue.length"])),groupIdentify:it(e.groupIdentify.bind(e),"groupIdentify",tt(e),nt(e,["config.apiKey","timeline.queue.length"])),setGroup:it(e.setGroup.bind(e),"setGroup",tt(e),nt(e,["config.apiKey","timeline.queue.length"])),revenue:it(e.revenue.bind(e),"revenue",tt(e),nt(e,["config.apiKey","timeline.queue.length"])),flush:it(e.flush.bind(e),"flush",tt(e),nt(e,["config.apiKey","timeline.queue.length"])),getUserId:it(e.getUserId.bind(e),"getUserId",tt(e),nt(e,["config","config.userId"])),setUserId:it(e.setUserId.bind(e),"setUserId",tt(e),nt(e,["config","config.userId"])),getDeviceId:it(e.getDeviceId.bind(e),"getDeviceId",tt(e),nt(e,["config","config.deviceId"])),setDeviceId:it(e.setDeviceId.bind(e),"setDeviceId",tt(e),nt(e,["config","config.deviceId"])),reset:it(e.reset.bind(e),"reset",tt(e),nt(e,["config","config.userId","config.deviceId"])),getSessionId:it(e.getSessionId.bind(e),"getSessionId",tt(e),nt(e,["config"])),setSessionId:it(e.setSessionId.bind(e),"setSessionId",tt(e),nt(e,["config"])),extendSession:it(e.extendSession.bind(e),"extendSession",tt(e),nt(e,["config"])),setOptOut:it(e.setOptOut.bind(e),"setOptOut",tt(e),nt(e,["config"])),getOptOut:it(e.getOptOut.bind(e),"getOptOut",tt(e),nt(e,["config"])),setTransport:it(e.setTransport.bind(e),"setTransport",tt(e),nt(e,["config"])),getIdentity:it(e.getIdentity.bind(e),"getIdentity",tt(e),nt(e,["config"])),setIdentity:it(e.setIdentity.bind(e),"setIdentity",tt(e),nt(e,["config","config.userId","config.deviceId"]))}},SA=wA(),EA=(SA._setDiagnosticsSampleRate,SA.initAll,SA.experiment,SA.sessionReplay,SA.add,SA.extendSession,SA.flush,SA.getDeviceId,SA.getIdentity,SA.getOptOut,SA.getSessionId,SA.getUserId,SA.groupIdentify,SA.identify,SA.logEvent,SA.remove,SA.reset,SA.revenue,SA.setDeviceId,SA.setGroup,SA.setIdentity,SA.setOptOut,SA.setSessionId,SA.setTransport,SA.setUserId,SA.track,{});function kA(){if(bA)return bA;const e=wA();return bA={init:(t,r)=>e.init(t,void 0,r),add:t=>e.add(t),track:(t,r)=>e.track(t,r),identify:t=>e.identify(t),revenue:t=>e.revenue(t),reset:()=>e.reset(),setOptOut:t=>e.setOptOut(t),setUserId:t=>e.setUserId(t),setDeviceId:t=>e.setDeviceId(t),setSessionId:t=>e.setSessionId(t),setGroup:(t,r)=>e.setGroup(t,r),groupIdentify:(t,r,n)=>e.groupIdentify(t,r,n),Identify:Z,Revenue:ke}}function xA(e){const t=lC(e)?e.amplitude:void 0;if(void 0===t||lC(r=t)&&["init","add","track","identify","revenue","reset","setOptOut","setUserId","setDeviceId","setSessionId","setGroup","groupIdentify","Identify","Revenue"].every(e=>"function"==typeof r[e]))return t;var r;throw new yC("env.amplitude is not an Amplitude SDK",{code:"config"})}var CA=e=>bC(e,"transport","Amplitude call failed");function IA(e,t,r,n){e.debug(`Amplitude skipped ${r}: ${n} resolved to nothing`,{event:t.name})}async function OA(e){const t=await e();lC(t)&&t.promise instanceof Promise&&await t.promise}async function TA(e,t,r,n={}){const i={...n};if("user"in r){const o=r.user;null===o||""===o?(await t(()=>e.setUserId(void 0)),delete i.user):uC(o)&&o!==n.user&&(await t(()=>e.setUserId(o)),i.user=o)}if("device"in r){const o=r.device;uC(o)&&o!==n.device&&(await t(()=>e.setDeviceId(o)),i.device=o)}if("session"in r){const o=r.session,s=aC(o)?o:uC(o)&&/^\d+$/.test(o)?Number(o):uC(o)?function(e){let t=5381;for(let r=0;r<e.length;r++)t=(t<<5)+t+e.charCodeAt(r)|0;return Math.abs(t)}(o):void 0;void 0!==s&&s!==n.session&&(await t(()=>e.setSessionId(s)),i.session=s)}return i}var AA=["set","setOnce","add","append","prepend","preInsert","postInsert","remove"];function _A(e,t){let r;const n=()=>(r||(r=new e.Identify),r);for(const e of AA){const r=t[e];if(lC(r))for(const[t,i]of Object.entries(r))sC(i)&&("add"===e?aC(i)&&n().add(t,i):n()[e](t,i))}if(oC(t.unset))for(const e of t.unset)uC(e)&&n().unset(e);return!0===t.clearAll&&n().clearAll(),r}function RA(e,t){const r=new e.Revenue,{productId:n,price:i,quantity:o,revenueType:s,currency:a,revenue:l}=t,{receipt:u,receiptSig:c,eventProperties:d}=t;return uC(n)&&r.setProductId(n),aC(i)&&r.setPrice(i),aC(o)&&r.setQuantity(o),uC(s)&&r.setRevenueType(s),uC(a)&&r.setCurrency(a),aC(l)&&r.setRevenue(l),uC(u)&&r.setReceipt(u),uC(c)&&r.setReceiptSig(c),lC(d)&&r.setEventProperties(d),r}async function PA(e,t){const{apiKey:r,identify:n,sessionReplay:i,experiment:o,engagement:s,_state:a,...l}=t,u={autocapture:!1,identityStorage:"none",...l};await bC(()=>OA(()=>e.init(r,u)),"vendor-not-ready","Amplitude init failed");const{serverZone:c,instanceName:d}=u,h={...c?{serverZone:c}:{},...d?{instanceName:d}:{}},p=[];i&&p.push(["Session Replay",async()=>{const{sessionReplayPlugin:e}=await Promise.resolve().then(()=>(lk(),XS));return e({...i,...h})}]),(null==o?void 0:o.deploymentKey)&&p.push(["Experiment",async()=>{const{experimentPlugin:e}=await Promise.resolve().then(()=>(zx(),xx));return e({...o,...h})}]),s&&p.push(["Guides & Surveys",async()=>{const{plugin:e}=await Promise.resolve().then(()=>($x(),Vx));return e({...!0===s?{}:s,...h})}]);for(const[t,r]of p)await bC(async()=>{const t=await r();await OA(()=>e.add(t))},"vendor-not-ready",`Amplitude ${t} failed to start`)}async function MA(e,t,r,n,i,o,s,a){var l;const u=r._state||{};if(void 0!==n.reset){("boolean"==typeof n.reset?n.reset:await TC(t,n.reset,{collector:s}))&&(await CA(()=>e.reset()),u.lastIdentity={})}const c=null!=(l=n.identify)?l:r.identify;let d;if(void 0!==c){const r=await TC(t,c,{collector:s});lC(r)?(d=r,u.lastIdentity=await TA(e,CA,r,u.lastIdentity)):IA(a,t,"identify","identify")}if(d){const t=_A(e,d);t&&await CA(()=>e.identify(t))}if(void 0!==n.group){const r=await TC(t,n.group,{collector:s}),{type:i,name:o}=lC(r)?r:{};uC(i)&&(uC(o)||oC(h=o)&&h.every(uC))?await CA(()=>e.setGroup(i,o)):IA(a,t,"setGroup","group")}var h;if(void 0!==n.groupIdentify){const r=await TC(t,n.groupIdentify,{collector:s}),{type:i,name:o}=lC(r)?r:{},l=lC(r)&&uC(i)&&uC(o)?_A(e,r):void 0;l&&uC(i)&&uC(o)?await CA(()=>e.groupIdentify(i,o,l)):IA(a,t,"groupIdentify","groupIdentify")}if(void 0!==n.revenue){const r=await TC(t,n.revenue,{collector:s});let i=0;for(const t of oC(r)?r:[r]){if(!lC(t))continue;const r=RA(e,t);await CA(()=>e.revenue(r)),i++}i||IA(a,t,"revenue","revenue")}if(!0!==(null==i?void 0:i.silent)){const r=uC(null==i?void 0:i.name)?i.name:t.name,n=lC(o)?o:{};await CA(()=>e.track(r,n))}r._state=u}var NA,LA={type:"amplitude",config:{},async init({config:e,env:t}){var r;const n=null==(r=e.settings)?void 0:r.apiKey;if(!n)throw new yC("Amplitude needs settings.apiKey",{code:"config"});const i={...e.settings,apiKey:n},o=xA(t);o?await PA(o,i):await PA(kA(),i).catch(e=>{throw bA=void 0,e});return{...e,settings:{...i,_state:{lastIdentity:{}}}}},async push(e,{config:t,rule:r,env:n,data:i,collector:o,logger:s}){const a={apiKey:"",...t.settings},l=(null==r?void 0:r.settings)||{},u=xA(n);await MA(u||kA(),e,a,l,r,i,o,s)},async on(e,{config:t,data:r,env:n,collector:i}){var o;const s=t.consent;if("consent"!==e||!s||!lC(r))return;if(!Object.keys(s).some(e=>e in r))return;const a=!1!==dC(s,i.consent),l=null!=(o=xA(n))?o:kA();await bC(()=>l.setOptOut(!a),"consent-not-applied","Amplitude did not take the consent update")}},DA=LA;return NA=Gx,d(n({},"__esModule",{value:!0}),NA)})();
|