@amplitude/plugin-session-replay-browser 1.37.0-codexsemantic-review-integration.0 → 1.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/semantic-context.d.ts +3 -3
- package/lib/cjs/semantic-context.d.ts.map +1 -1
- package/lib/cjs/semantic-context.js +61 -25
- package/lib/cjs/semantic-context.js.map +1 -1
- package/lib/cjs/session-replay.js +1 -1
- package/lib/cjs/session-replay.js.map +1 -1
- package/lib/cjs/version.d.ts +1 -1
- package/lib/cjs/version.d.ts.map +1 -1
- package/lib/cjs/version.js +1 -1
- package/lib/cjs/version.js.map +1 -1
- package/lib/esm/semantic-context.d.ts +3 -3
- package/lib/esm/semantic-context.d.ts.map +1 -1
- package/lib/esm/semantic-context.js +61 -25
- package/lib/esm/semantic-context.js.map +1 -1
- package/lib/esm/session-replay.js +1 -1
- package/lib/esm/session-replay.js.map +1 -1
- package/lib/esm/version.d.ts +1 -1
- package/lib/esm/version.d.ts.map +1 -1
- package/lib/esm/version.js +1 -1
- package/lib/esm/version.js.map +1 -1
- package/lib/scripts/index-min.js +1 -1
- package/lib/scripts/index-min.js.gz +0 -0
- package/lib/scripts/index-min.js.map +1 -1
- package/lib/scripts/plugin-session-replay-browser-min.js +1 -1
- package/lib/scripts/plugin-session-replay-browser-min.js.gz +0 -0
- package/lib/scripts/plugin-session-replay-browser-min.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var sessionReplay=function(e){"use strict";function t(e,t){return t.forEach(function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach(function(r){if("default"!==r&&!(r in e)){var n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:function(){return t[r]}})}})}),Object.freeze(e)}var r=function(e,t){return r=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])},r(e,t)};function n(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var s,i,o=function(){return o=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},o.apply(this,arguments)};function a(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 s=0;for(n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]])}return r}function l(e,t,r,n){return new(r||(r=Promise))(function(s,i){function o(e){try{l(n.next(e))}catch(e){i(e)}}function a(e){try{l(n.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})}function c(e,t){var r,n,s,i={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=a(0),o.throw=a(1),o.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]&&(i=0)),i;)try{if(r=1,n&&(s=2&a[0]?n.return:a[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,a[1])).done)return s;switch(n=0,s&&(a=[2&a[0],s.value]),a[0]){case 0:case 1:s=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(s=i.trys,(s=s.length>0&&s[s.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!s||a[1]>s[0]&&a[1]<s[3])){i.label=a[1];break}if(6===a[0]&&i.label<s[1]){i.label=s[1],s=a;break}if(s&&i.label<s[2]){i.label=s[2],i.ops.push(a);break}s[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],n=0}finally{r=s=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}function u(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 h(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,s,i=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(e){s={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(s)throw s.error}}return o}function d(e,t,r){if(r||2===arguments.length)for(var n,s=0,i=t.length;s<i;s++)!n&&s in t||(n||(n=Array.prototype.slice.call(t,0,s)),n[s]=t[s]);return e.concat(n||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError,function(e){e.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"}(s||(s={})),function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"}(i||(i={}));var p,f="$default_instance",m="https://api2.amplitude.com/2/httpapi";!function(e){e.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"}(p||(p={}));var g=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},v=d([],h(Array(256).keys()),!1).map(function(e){return e.toString(16).padStart(2,"0")}),y=function(e){var t,r=g();if(!(null===(t=null==r?void 0:r.crypto)||void 0===t?void 0:t.getRandomValues))return 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,y)}(e);var n=r.crypto.getRandomValues(new Uint8Array(16));return n[6]=15&n[6]|64,n[8]=63&n[8]|128,d([],h(n.entries()),!1).map(function(e){var t=h(e,2),r=t[0],n=t[1];return[4,6,8,10].includes(r)?"-".concat(v[n]):v[n]}).join("")},b={},w={get exports(){return b},set exports(e){b=e}},S=Object.prototype.hasOwnProperty;function C(e){return"[Throws: "+(e?e.message:"?")+"]"}function x(e){var t=[];return function e(r){if(null===r||"object"!=typeof r)return r;if(-1!==t.indexOf(r))return"[Circular]";if(t.push(r),"function"==typeof r.toJSON)try{var n=e(r.toJSON());return t.pop(),n}catch(e){return C(e)}if(Array.isArray(r)){var s=r.map(e);return t.pop(),s}var i=Object.keys(r).reduce(function(t,n){return t[n]=e(function(e,t){if(S.call(e,t))try{return e[t]}catch(e){return C(e)}return e[t]}(r,n)),t},{});return t.pop(),i}(e)}w.exports=function(e,t,r){return JSON.stringify(x(e),t,r)};var k,I=b.ensureProperties=x,E=b||t({__proto__:null,ensureProperties:I,get default(){return b}},[b]),O=function(e){return{promise:e||Promise.resolve()}};!function(e){e[e.None=0]="None",e[e.Error=1]="Error",e[e.Warn=2]="Warn",e[e.Verbose=3]="Verbose",e[e.Debug=4]="Debug"}(k||(k={}));var M="Amplitude Logger ",R=function(){function e(){this.logLevel=k.None}return e.prototype.disable=function(){this.logLevel=k.None},e.prototype.enable=function(e){void 0===e&&(e=k.Warn),this.logLevel=e},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<k.Verbose||console.log("".concat(M,"[Log]: ").concat(e.join(" ")))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<k.Warn||console.warn("".concat(M,"[Warn]: ").concat(e.join(" ")))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<k.Error||console.error("".concat(M,"[Error]: ").concat(e.join(" ")))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<k.Debug||console.log("".concat(M,"[Debug]: ").concat(e.join(" ")))},e}(),P=function(e){return void 0===e||""===e?f:e},A=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,instanceName:f,logLevel:k.Warn,loggerProvider:new R,offline:!1,optOut:!1,serverUrl:m,serverZone:"US",useBatch:!1}},T=function(){function e(e){var t,r,n,s;this._optOut=!1;var i=A();this.apiKey=e.apiKey,this.flushIntervalMillis=null!==(t=e.flushIntervalMillis)&&void 0!==t?t:i.flushIntervalMillis,this.flushMaxRetries=e.flushMaxRetries||i.flushMaxRetries,this.flushQueueSize=e.flushQueueSize||i.flushQueueSize,this.instanceName=P(e.instanceName),this.loggerProvider=e.loggerProvider||i.loggerProvider,this.logLevel=null!==(r=e.logLevel)&&void 0!==r?r:i.logLevel,this.minIdLength=e.minIdLength,this.plan=e.plan,this.ingestionMetadata=e.ingestionMetadata,this.offline=void 0!==e.offline?e.offline:i.offline,this.optOut=null!==(n=e.optOut)&&void 0!==n?n:i.optOut,this.serverUrl=e.serverUrl,this.serverZone=e.serverZone||i.serverZone,this.storageProvider=e.storageProvider,this.transportProvider=e.transportProvider,this.useBatch=null!==(s=e.useBatch)&&void 0!==s?s:i.useBatch,this.loggerProvider.enable(this.logLevel);var o=L(e.serverUrl,e.serverZone,e.useBatch);this.serverZone=o.serverZone,this.serverUrl=o.serverUrl}return Object.defineProperty(e.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut=e},enumerable:!1,configurable:!0}),e}(),N=function(e,t){return"EU"===e?t?"https://api.eu.amplitude.com/batch":"https://api.eu.amplitude.com/2/httpapi":t?"https://api2.amplitude.com/batch":m},L=function(e,t,r){if(void 0===e&&(e=""),void 0===t&&(t=A().serverZone),void 0===r&&(r=A().useBatch),e)return{serverUrl:e,serverZone:void 0};var n=["US","EU"].includes(t)?t:A().serverZone;return{serverZone:n,serverUrl:N(n,r)}};var _=function(e,t,r,n,s){return void 0===s&&(s=null),function(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];var a=r(),l=a.logger,c=a.logLevel;if(c&&c<k.Debug||!c||!l)return e.apply(s,i);var u,h={type:"invoke public method",name:t,args:i,stacktrace:(u=1,void 0===u&&(u=0),((new Error).stack||"").split("\n").slice(2+u).map(function(e){return e.trim()})),time:{start:(new Date).toISOString()},states:{}};n&&h.states&&(h.states.before=n());var d=e.apply(s,i);return d&&d.promise?d.promise.then(function(){n&&h.states&&(h.states.after=n()),h.time&&(h.time.end=(new Date).toISOString()),l.debug(JSON.stringify(h,null,2))}):(n&&h.states&&(h.states.after=n()),h.time&&(h.time.end=(new Date).toISOString()),l.debug(JSON.stringify(h,null,2))),d}};class D{getApplicationContext(){return{versionName:this.versionName,language:F(),platform:"Web",os:void 0,deviceModel:void 0}}}const F=()=>"undefined"!=typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||"";class B{constructor(){this.queue=[]}logEvent(e){this.receiver?this.receiver(e):this.queue.length<512&&this.queue.push(e)}setEventReceiver(e){this.receiver=e,this.queue.length>0&&(this.queue.forEach(t=>{e(t)}),this.queue=[])}}const U=(e,t)=>{const r=["string","number","boolean","undefined"],n=typeof e;if(n!==typeof t)return!1;for(const s of r)if(s===n)return e===t;if(null==e&&null==t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;const s=Array.isArray(e),i=Array.isArray(t);if(s!==i)return!1;if(!s||!i){const r=Object.keys(e).sort(),n=Object.keys(t).sort();if(!U(r,n))return!1;let s=!0;return Object.keys(e).forEach(r=>{U(e[r],t[r])||(s=!1)}),s}for(let r=0;r<e.length;r++)if(!U(e[r],t[r]))return!1;return!0};Object.entries||(Object.entries=function(e){const t=Object.keys(e);let r=t.length;const n=new Array(r);for(;r--;)n[r]=[t[r],e[t[r]]];return n});class j{constructor(){this.identity={userProperties:{}},this.listeners=new Set}editIdentity(){const e=this,t=Object.assign({},this.identity.userProperties),r=Object.assign(Object.assign({},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(e){return r.optOut=e,this},updateUserProperties:function(e){let t=r.userProperties||{};for(const[r,n]of Object.entries(e))switch(r){case"$set":for(const[e,r]of Object.entries(n))t[e]=r;break;case"$unset":for(const e of Object.keys(n))delete t[e];break;case"$clearAll":t={}}return r.userProperties=t,this},commit:function(){return e.setIdentity(r),this}}}getIdentity(){return Object.assign({},this.identity)}setIdentity(e){const t=Object.assign({},this.identity);this.identity=Object.assign({},e),U(t,this.identity)||this.listeners.forEach(t=>{t(e)})}addIdentityListener(e){this.listeners.add(e)}removeIdentityListener(e){this.listeners.delete(e)}}const z="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:self;class W{constructor(){this.identityStore=new j,this.eventBridge=new B,this.applicationContextProvider=new D}static getInstance(e){return z.analyticsConnectorInstances||(z.analyticsConnectorInstances={}),z.analyticsConnectorInstances[e]||(z.analyticsConnectorInstances[e]=new W),z.analyticsConnectorInstances[e]}}var q=function(e){return W.getInstance(P(e))},$=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},V=function(){function e(){}return e.prototype.send=function(e,t,r){return Promise.resolve(null)},e.prototype.buildResponse=function(e){var t,r,n,s,i,o,a,l,c,u,h,d,f,m,g,v,y,b,w,S,C,x;if("object"!=typeof e)return null;var k=e.code||0,I=this.buildStatus(k);switch(I){case p.Success:return{status:I,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 p.Invalid:return{status:I,statusCode:k,body:{error:null!==(s=e.error)&&void 0!==s?s:"",missingField:null!==(i=e.missing_field)&&void 0!==i?i:"",eventsWithInvalidFields:null!==(o=e.events_with_invalid_fields)&&void 0!==o?o:{},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!==(c=e.eps_threshold)&&void 0!==c?c:0,exceededDailyQuotaDevices:null!==(u=e.exceeded_daily_quota_devices)&&void 0!==u?u:{},silencedDevices:null!==(h=e.silenced_devices)&&void 0!==h?h:[],silencedEvents:null!==(d=e.silenced_events)&&void 0!==d?d:[],throttledDevices:null!==(f=e.throttled_devices)&&void 0!==f?f:{},throttledEvents:null!==(m=e.throttled_events)&&void 0!==m?m:[]}};case p.PayloadTooLarge:return{status:I,statusCode:k,body:{error:null!==(g=e.error)&&void 0!==g?g:""}};case p.RateLimit:return{status:I,statusCode:k,body:{error:null!==(v=e.error)&&void 0!==v?v:"",epsThreshold:null!==(y=e.eps_threshold)&&void 0!==y?y:0,throttledDevices:null!==(b=e.throttled_devices)&&void 0!==b?b:{},throttledUsers:null!==(w=e.throttled_users)&&void 0!==w?w:{},exceededDailyQuotaDevices:null!==(S=e.exceeded_daily_quota_devices)&&void 0!==S?S:{},exceededDailyQuotaUsers:null!==(C=e.exceeded_daily_quota_users)&&void 0!==C?C:{},throttledEvents:null!==(x=e.throttled_events)&&void 0!==x?x:[]}};case p.Timeout:default:return{status:I,statusCode:k}}},e.prototype.buildStatus=function(e){return function(e){return e>=200&&e<300}(e)?p.Success:429===e?p.RateLimit:413===e?p.PayloadTooLarge:408===e?p.Timeout:e>=400&&e<500?p.Invalid:e>=500?p.Failed:p.Unknown},e}(),G=function(e){function t(t){void 0===t&&(t={});var r=e.call(this)||this;return r.customHeaders=t,r}return n(t,e),t.prototype.send=function(e,t){return l(this,void 0,void 0,function(){var r,n,s;return c(this,function(i){switch(i.label){case 0:if("undefined"==typeof fetch)throw new Error("FetchTransport is not supported");return r={headers:o({"Content-Type":"application/json",Accept:"*/*"},this.customHeaders),body:JSON.stringify(t),method:"POST"},[4,fetch(e,r)];case 1:return[4,(n=i.sent()).text()];case 2:s=i.sent();try{return[2,this.buildResponse(JSON.parse(s))]}catch(e){return[2,this.buildResponse({code:n.status})]}return[2]}})})},t}(V),H=function(){function e(e,t){this.key="AMP_remote_config_".concat(e.substring(0,10)),this.logger=t;try{this.isSupported="undefined"!=typeof localStorage}catch(e){this.logger.debug("Remote config localstorage failed to access: ",e),this.isSupported=!1}}return e.prototype.fetchConfig=function(){var e=null,t={remoteConfig:null,lastFetch:new Date};if(!this.isSupported)return Promise.resolve(t);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(E(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){if(!this.isSupported)return Promise.resolve(!1);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}();var J,K=401,Y=403,X=429,Q=function(){function e(t,r,n,s,i,o,a){void 0===n&&(n="US"),void 0===o&&(o=e.DEFAULT_CONFIG_GROUP),this.callbackInfos=[],this.lastSuccessfulFetch=null,this.fetchPromise=null,this.isLastFetchInvalidApiKey=!1,this.apiKey=t,this.configGroup=o,this.serverUrl=s||("US"===n?"https://sr-client-cfg.amplitude.com/config":"https://sr-client-cfg.eu.amplitude.com/config"),this.logger=r,this.storage=a||new H(t,r),this.customFetch=i}return e.prototype.subscribe=function(e,t,r){var n=y(),s={id:n,key:e,deliveryMode:t,callback:r};return this.callbackInfos.push(s),"all"===t?this.subscribeAll(s):this.subscribeWaitForRemote(s,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 l(this,void 0,void 0,function(){var e,t=this;return c(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 l(this,void 0,void 0,function(){var t,r,n,s=this;return c(this,function(i){switch(i.label){case 0:return t=this.getOrCreateFetchPromise().then(function(t){s.logger.debug("Remote config client subscription all mode fetched from remote: ".concat(JSON.stringify(t))),s.sendCallback(e,t,"remote"),s.storage.setConfig(t)}),r=this.storage.fetchConfig().then(function(e){return e}),[4,Promise.race([t,r])];case 1:return void 0!==(n=i.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 i.sent(),[2]}})})},e.prototype.subscribeWaitForRemote=function(e,t){return l(this,void 0,void 0,function(){var r,n;return c(this,function(s){switch(s.label){case 0:r=new Promise(function(e,r){setTimeout(function(){r("Timeout exceeded")},t)}),s.label=1;case 1:return s.trys.push([1,3,,5]),[4,Promise.race([this.getOrCreateFetchPromise(),r])];case 2:return n=s.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 s.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=s.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),l(this,void 0,void 0,function(){var r,n,s,i,o,a,l=this;return c(this,function(u){switch(u.label){case 0:r=t/e,n={remoteConfig:null,lastFetch:new Date},s=function(n){var s,o,a,u,h,d,p,f,m;return c(this,function(c){switch(c.label){case 0:s=!0,o=new AbortController,a=setTimeout(function(){return o.abort()},t),c.label=1;case 1:return c.trys.push([1,10,11,12]),u=i.getUrlParams(),h={Accept:"*/*"},i.customFetch?[4,(g=i.customFetch({url:u,method:"GET",headers:h,signal:o.signal}),v=o.signal,new Promise(function(e,t){var r=function(){var e=new Error("Remote config custom fetch aborted by timeout");e.name="AbortError",t(e)};v.addEventListener("abort",r,{once:!0}),g.then(function(t){v.removeEventListener("abort",r),e(t)},function(e){v.removeEventListener("abort",r),t(e)})}))]:[3,3];case 2:return p=c.sent(),[3,5];case 3:return[4,fetch(u,{method:"GET",headers:h,signal:o.signal})];case 4:p=c.sent(),c.label=5;case 5:return(d=p).ok||d.status>=200&&d.status<300?[3,7]:[4,d.text()];case 6:return f=c.sent(),i.logger.debug("Remote config client fetch with retry time ".concat(e," failed with ").concat(d.status,": ").concat(f)),d.status===K||d.status===Y?(i.logger.error("Remote config client fetch failed with ".concat(d.status,". Invalid API key; future fetches will be skipped.")),i.isLastFetchInvalidApiKey=!0,s=!1):d.status>=400&&d.status<500&&d.status!==X&&(s=!1),[3,9];case 7:return[4,d.json()];case 8:return[2,{value:{remoteConfig:c.sent(),lastFetch:new Date}}];case 9:return[3,12];case 10:return(m=c.sent())instanceof Error&&"AbortError"===m.name?i.logger.debug("Remote config client fetch with retry time ".concat(e," timed out after ").concat(t,"ms")):i.logger.debug("Remote config client fetch with retry time ".concat(e," is rejected because: "),m),[3,12];case 11:return clearTimeout(a),[7];case 12:return s?n<e-1?[4,new Promise(function(e){return setTimeout(e,l.getJitterDelay(r))})]:[3,14]:[2,"break"];case 13:c.sent(),c.label=14;case 14:return[2]}var g,v})},i=this,o=0,u.label=1;case 1:return o<e?[5,s(o)]:[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 o++,[3,1];case 4:return[2,n]}})})},e.prototype.getJitterDelay=function(e){return Math.floor(Math.random()*e)},e.prototype.getUrlParams=function(){var e=encodeURIComponent(this.apiKey),t=new URLSearchParams;return t.append("config_group",this.configGroup),"".concat(this.serverUrl,"/").concat(e,"?").concat(t.toString())},e.DEFAULT_CONFIG_GROUP="browser",e}();function Z(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e||null==e}function ee(e,t,r){e&&te({json:e,allowlist:t.map(re),excludelist:r.map(re),ancestors:[]})}function te(e){var t,r,n=e.json,s=e.targetObject,i=e.allowlist,o=e.excludelist,a=e.ancestors,l=e.parentObject,c=e.targetKey;s||(s=n);var p=Object.keys(s);try{for(var f=u(p),m=f.next();!m.done;m=f.next()){var g=m.value,v=d(d([],h(a),!1),[g],!1);Z(s[g])?se(v,i)&&!se(v,o)||delete s[g]:te({json:n,targetObject:s[g],allowlist:i,excludelist:o,ancestors:v,parentObject:s,targetKey:g})}}catch(e){t={error:e}}finally{try{m&&!m.done&&(r=f.return)&&r.call(f)}finally{if(t)throw t.error}}0===Object.keys(s).length&&l&&c&&delete l[c]}function re(e){return e.startsWith("/")&&(e=e.slice(1)),e.split("/").map(function(e){return e.replace(/~0/g,"~").replace(/~1/g,"/")})}function ne(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 s=t[n];if("**"===s){if(n+1===t.length)return!0;for(var i=r;i<=e.length;i++)if(ne(e,t,i,n+1))return!0;return!1}return("*"===s||s===e[r])&&ne(e,t,r+1,n+1)}function se(e,t){return t.some(function(t){return ne(e,t)})}!function(e){e.US="US",e.EU="EU",e.STAGING="STAGING"}(J||(J={}));var ie,oe="https://app.amplitude.com",ae={US:oe,EU:"https://app.eu.amplitude.com",STAGING:"https://apps.stag2.amplitude.com"};var le="__AMPLITUDE_MESSENGER_INSTANCE__",ce="__AMPLITUDE_MESSENGER__",ue=function(){function e(e){var t=(void 0===e?{}:e).origin,r=void 0===t?oe:t;this[ie]=!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,s;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===(s=null===(n=window.opener)||void 0===n?void 0:n.postMessage)||void 0===s||s.call(n,e,this.endpoint)},e.prototype.sendRequest=function(e,t,r){var n=this;void 0===r&&(r={timeout:15e3});var s="".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9)),i={id:s,action:e,args:t};return new Promise(function(t,o){n.requestCallbacks[s]={resolve:t,reject:o},n.notify(i),r.timeout>0&&setTimeout(function(){o(new Error("".concat(e," timed out (id: ").concat(s,")"))),delete n.requestCallbacks[s]},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,s,i;this.actionHandlers.has(e)&&(null===(i=null===(s=this.logger)||void 0===s?void 0:s.warn)||void 0===i||i.call(s,"Overwriting existing action handler for: ".concat(e))),this.actionHandlers.set(e,t);var o=this.pendingMessages.get(e);if(o){this.pendingMessages.delete(e);try{for(var a=u(o),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 l(this,void 0,void 0,function(){var t,r,n;return c(this,function(s){switch(s.label){case 0:if(t=this.scriptLoadPromises.get(e))return[2,t];r=function(e){return document.querySelector('script[src="'.concat(CSS.escape(e),'"]'))?Promise.resolve({status:!0}):new Promise(function(t,r){var n;try{var s=document.createElement("script");s.type="text/javascript",s.async=!0,s.src=e,s.addEventListener("load",function(){t({status:!0})},{once:!0}),s.addEventListener("error",function(){r({status:!1,message:"Failed to load the script ".concat(e)})}),null===(n=document.head)||void 0===n||n.appendChild(s)}catch(e){r(e)}})}(e).then(function(){}),this.scriptLoadPromises.set(e,r),s.label=1;case 1:return s.trys.push([1,3,,4]),[4,r];case 2:return s.sent(),[3,4];case 3:throw n=s.sent(),this.scriptLoadPromises.delete(e),n;case 4:return[2]}})})},e.prototype.setup=function(e){var t,r,n=this,s=void 0===e?{}:e,i=s.logger,o=s.endpoint;i&&(this.logger=i),o&&this.endpoint===oe&&(this.endpoint=o),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,s,i,o;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===(i=null===(s=n.logger)||void 0===s?void 0:s.debug)||void 0===i||i.call(s,"Received Response to previous request: ",JSON.stringify(e)),n.handleResponse(a);else{if("ping"===l)return void n.notify({action:"pong"});var c=n.actionHandlers.get(l);if(c)c(a.data);else{var u=null!==(o=n.pendingMessages.get(l))&&void 0!==o?o:[];u.push(a.data),n.pendingMessages.set(l,u)}}}},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=g();(null==e?void 0:e[ce])===this&&delete e[ce]},e}();function he(e){var t,r=g(),n=null==r?void 0:r[ce];if("object"==typeof(t=n)&&null!==t&&le in t&&!0===t[le])return n;var s=new ue(e);return r&&(r[ce]=s),s}ie=le;var de=["desktop","tablet","mobile"],pe="__AMPLITUDE_BACKGROUND_CAPTURE__";function fe(e,t){var r,n=e;if(!0!==n[pe]){n[pe]=!0;var s=null!==(r=null==t?void 0:t.scriptUrl)&&void 0!==r?r:"https://cdn.amplitude.com/libs/background-capture-1.1.0.js.gz",i=null,a=function(t,r){var n,s;"background-capture-complete"===t&&(null===(s=null===(n=e.logger)||void 0===n?void 0:n.debug)||void 0===s||s.call(n,"Background capture complete"),e.notify({action:"background-capture-complete",data:r}))};e.registerActionHandler("initialize-background-capture",function(t){var r,n;null===(n=null===(r=e.logger)||void 0===r?void 0:r.debug)||void 0===n||n.call(r,"Initializing background capture (external script)");var l=new URL(s,e.endpoint).toString(),c=t&&"object"==typeof t?function(e){if("string"==typeof e)return de.includes(e)?e:void 0}(t.deviceMode):void 0;e.loadScriptOnce(l).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)"),i=null===(n=null===window||void 0===window?void 0:window.amplitudeBackgroundCapture)||void 0===n?void 0:n.call(window,o({messenger:e,onBackgroundCapture:a},void 0!==c?{initialDeviceMode:c}:{})),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==i?void 0:i.close)||void 0===e||e.call(i),i=null})}}var me,ge="[Amplitude]",ve="".concat(ge," Session Replay ID"),ye=J.US,be={enabled:!0},we=1e3,Se="".concat(ge," Session Replay Debug"),Ce="https://api-sr.amplitude.com/sessions/v2/track",xe="https://api-sr.eu.amplitude.com/sessions/v2/track",ke="https://api-sr.stag2.amplitude.com/sessions/v2/track",Ie=9e6,Ee=/payload.*exceed/i,Oe=500,Me=1e4,Re=1024,Pe="X-Session-Replay-Event-Skipped",Ae="amplitude-sr-iframe";!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"}(me||(me={}));var Te=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="medium";function Le(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?t.toLowerCase():null}var _e=new Map,De=function(e){var t=_e.get(e);if(t)return t;var r="\0TRAIL\0",n="\0MID\0",s="\0DS\0",i="\0ST\0",o="\0QU\0",a=e;a=(a=(a=(a=(a=(a=(a=(a=(a=(a=(a=a.replace(/\/\*\*$/,r)).replace(/\/\*\*\//g,n)).replace(/\*\*/g,s)).replace(/\*/g,i)).replace(/\?/g,o)).replace(/[.+^${}()|[\]\\]/g,"\\$&")).split(r).join("(/.*)?")).split(n).join("/(.*\\/)?")).split(s).join(".*")).split(i).join(".*")).split(o).join(".");var l=new RegExp("^".concat(a,"$"));return _e.set(e,l),l},Fe=function(e,t,r){var n;switch(t){case"light":if("input"!==e)return!1;var s=r?Le(r):"";return!!s&&(!!["password","hidden","email","tel"].includes(s)||!!(null===(n=r.autocomplete)||void 0===n?void 0:n.startsWith("cc-")));case"medium":return"input"===e;case"conservative":return!0;default:return Fe(e,Ne,r)}},Be=function(e,t){var r,n,s;if(e&&t.urlMaskLevels)try{for(var i=u(t.urlMaskLevels),o=i.next();!o.done;o=i.next()){var a=o.value;if(De(a.match).test(e))return a.maskLevel}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return null!==(s=t.defaultMaskLevel)&&void 0!==s?s:Ne},Ue=function(e,t,r,n){var s,i;if(void 0===t&&(t={defaultMaskLevel:Ne}),r){if(r.closest(".amp-mask, [data-amp-mask]"))return!0;var o=(null!==(s=t.maskSelector)&&void 0!==s?s:[]).some(function(e){return r.closest(e)});if(o)return!0;if(r.closest(".amp-unmask, [data-amp-unmask]"))return!1;var a=(null!==(i=t.unmaskSelector)&&void 0!==i?i:[]).some(function(e){return r.closest(e)});if(a)return!1}return Fe(e,Be(n,t),r)},je=function(e,t,r){return function(n,s){return Ue(e,t,s,null==r?void 0:r())?n.replace(/[^\s]/g,"*"):n}},ze=function(e,t){return function(r,n,s){var i;if("style"===r)return n;if(!(null!==(i=null==e?void 0:e.maskAttributes)&&void 0!==i?i:[]).includes(r))return n;var o=["INPUT","SELECT","TEXTAREA"].includes(s.tagName)?"input":"text";return Ue(o,e,s,null==t?void 0:t())?n.replace(/[^\s]/g,"*"):n}},We=function(e){var t=null==e?void 0:e.blockSelector;return d(d([],h("string"==typeof t?t?[t]:[]:null!=t?t:[]),!1),["[data-amp-block]"],!1).join(",")},qe=function(e,t){var r,n;return e&&("conservative"===Be(t,e)||"conservative"===e.defaultMaskLevel||(null===(r=e.urlMaskLevels)||void 0===r?void 0:r.some(function(e){return"conservative"===e.maskLevel})))?"*":d(d([],h(null!==(n=null==e?void 0:e.maskSelector)&&void 0!==n?n:[]),!1),["[data-amp-mask]"],!1).join(",")};function $e(e,t){return t||("STAGING"===e?ke:"EU"===e?xe:Ce)}var Ve=function(){var e=g();return(null==e?void 0:e.location)?e.location.href:""},Ge=function(e,t){var r,n;try{for(var s=u(t),i=s.next();!i.done;i=s.next()){var o=i.value,a=De(o.selector);if(a.test(e))return e.replace(a,o.replacement)}}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return e},He=function(){return l(void 0,void 0,void 0,function(){var e,t,r,n,s,i,o;return c(this,function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),(e=g())?[4,e.navigator.storage.estimate()]:[3,2];case 1:return t=a.sent(),r=t.usage,n=t.quota,s=t.usageDetails,i=r?Math.round(r/Re):0,o=r&&n?Math.round(1e3*(r/n+Number.EPSILON))/1e3:0,[2,{totalStorageSize:i,percentOfQuota:o,usageDetails:JSON.stringify(s)}];case 2:return[3,4];case 3:return a.sent(),[3,4];case 4:return[2,{totalStorageSize:0,percentOfQuota:0,usageDetails:""}]}})})},Je=function(e){var t=o({},e),r=t.apiKey;return t.apiKey="****".concat(r.substring(r.length-4)),t},Ke=function(){return{flushMaxRetries:2,logLevel:k.Warn,loggerProvider:new R,transportProvider:new G}},Ye=function(e){function t(t,r){var n,s,i,a,l,c,u,p,f,m,g,v,y,b,w=this,S=Ke();(w=e.call(this,o(o({transportProvider:S.transportProvider,loggerProvider:new Te(r.loggerProvider||S.loggerProvider)},r),{apiKey:t}))||this).flushMaxRetries=void 0!==r.flushMaxRetries&&r.flushMaxRetries<=S.flushMaxRetries?r.flushMaxRetries:S.flushMaxRetries,w.apiKey=t,w.sampleRate=r.sampleRate||0,w.semanticCapture=r.semanticCapture,w.semanticAnalyticsContext=r.semanticAnalyticsContext,w.serverZone=r.serverZone||ye,w.configServerUrl=r.configServerUrl,w.trackServerUrl=r.trackServerUrl,w.shouldInlineStylesheet=r.shouldInlineStylesheet,w.inlineImages=r.inlineImages,w.version=r.version,w.performanceConfig=r.performanceConfig||be,w.storeType=null!==(n=r.storeType)&&void 0!==n?n:"memory",w.applyBackgroundColorToBlockedElements=null!==(s=r.applyBackgroundColorToBlockedElements)&&void 0!==s&&s,w.enableUrlChangePolling=null!==(i=r.enableUrlChangePolling)&&void 0!==i&&i,w.urlChangePollingInterval=null!==(a=r.urlChangePollingInterval)&&void 0!==a?a:we,w.captureDocumentTitle=null!==(l=r.captureDocumentTitle)&&void 0!==l&&l,void 0!==r.fullSnapshotIntervalMs&&(w.fullSnapshotIntervalMs=r.fullSnapshotIntervalMs),void 0!==r.eagerFullSnapshotSend&&(w.eagerFullSnapshotSend=r.eagerFullSnapshotSend),w.captureFullSnapshotOnFocus=null!==(c=r.captureFullSnapshotOnFocus)&&void 0!==c&&c,void 0!==r.maxPersistedEventsSizeBytes&&(w.maxPersistedEventsSizeBytes=tt(r.maxPersistedEventsSizeBytes,Qe,Ze,"maxPersistedEventsSizeBytes",w.loggerProvider)),void 0!==r.maxSingleEventSizeBytes&&(w.maxSingleEventSizeBytes=tt(r.maxSingleEventSizeBytes,Qe,et,"maxSingleEventSizeBytes",w.loggerProvider)),w.privacyConfig=o(o({},null!==(u=r.privacyConfig)&&void 0!==u?u:{}),{unmaskSelector:Array.from(new Set(d([".".concat("amp-unmask")],h(null!==(f=null===(p=r.privacyConfig)||void 0===p?void 0:p.unmaskSelector)&&void 0!==f?f:[]),!1)))}),r.interactionConfig&&(w.interactionConfig=r.interactionConfig,w.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")}(w.interactionConfig.ugcFilterRules)),r.debugMode&&(w.debugMode=r.debugMode);var C=r;return w.useWebWorker=null===(v=null!==(m=r.useWebWorker)&&void 0!==m?m:null===(g=C.experimental)||void 0===g?void 0:g.useWebWorker)||void 0===v||v,w.enableTransportCompression=null===(y=r.enableTransportCompression)||void 0===y||y,w.sendTimeoutMs=r.sendTimeoutMs,w.captureAdoptedStyleSheets=null===(b=r.captureAdoptedStyleSheets)||void 0===b||b,r.crossOriginIframes&&(w.crossOriginIframes=r.crossOriginIframes),r.flushIntervalConfig?w.flushIntervalConfig=function(e,t){var r,n,s={};void 0!==e.minIntervalMs&&(!Number.isFinite(e.minIntervalMs)||e.minIntervalMs<Xe?(t.warn("flushIntervalConfig.minIntervalMs ".concat(e.minIntervalMs," is below floor ").concat(Xe,"ms; clamping.")),s.minIntervalMs=Xe):s.minIntervalMs=e.minIntervalMs);void 0!==e.maxIntervalMs&&(Number.isNaN(e.maxIntervalMs)||e.maxIntervalMs<Xe?(t.warn("flushIntervalConfig.maxIntervalMs ".concat(e.maxIntervalMs," is below floor ").concat(Xe,"ms; clamping.")),s.maxIntervalMs=Xe):s.maxIntervalMs=e.maxIntervalMs);if(void 0!==s.minIntervalMs||void 0!==s.maxIntervalMs){var i=null!==(r=s.minIntervalMs)&&void 0!==r?r:Oe,o=null!==(n=s.maxIntervalMs)&&void 0!==n?n:Me;o<i&&(void 0===s.maxIntervalMs?(t.warn("flushIntervalConfig.minIntervalMs (".concat(i,") exceeds the default maxIntervalMs (").concat(Me,"); raising max to match min.")),s.maxIntervalMs=i):void 0===s.minIntervalMs?(t.warn("flushIntervalConfig.maxIntervalMs (".concat(o,") is below the default minIntervalMs (").concat(Oe,"); lowering min to match max.")),s.minIntervalMs=o):(t.warn("flushIntervalConfig.maxIntervalMs (".concat(s.maxIntervalMs,") is less than minIntervalMs (").concat(s.minIntervalMs,"); raising max to match min.")),s.maxIntervalMs=s.minIntervalMs))}return s}(r.flushIntervalConfig,w.loggerProvider):w.flushIntervalConfig={minIntervalMs:1e3,maxIntervalMs:1e4},w.handleSendEvents=r.handleSendEvents,w.handleFetchConfig=r.handleFetchConfig,w}return n(t,e),t}(T),Xe=100,Qe=1e3,Ze=8e6,et=1e7;function tt(e,t,r,n,s){if(Number.isFinite(e))return e<t?(s.warn("".concat(n," ").concat(e," is below floor ").concat(t,"; clamping.")),t):e>r?(s.warn("".concat(n," ").concat(e," exceeds ceiling ").concat(r,"; clamping.")),r):e;s.warn("".concat(n," value is not a finite number (got ").concat(String(e),"); ignoring."))}var rt=new Set(["button","checkbox","combobox","link","listbox","menuitem","menuitemcheckbox","menuitemradio","option","radio","searchbox","slider","spinbutton","switch","tab","textbox","treeitem","gridcell"]),nt=new Set(["banner","navigation","main","complementary","contentinfo","search","form","region","dialog","alertdialog","list","table","row","group"]),st=new Set(["button","cell","checkbox","columnheader","gridcell","heading","link","menuitem","menuitemcheckbox","menuitemradio","option","radio","rowheader","switch","tab","tooltip","treeitem","alert","status","listitem"]),it=new Set(["INPUT","SELECT","TEXTAREA"]),ot=["type","name","href","target","aria-controls","aria-haspopup","data-testid"];function at(e,t){var r=e.replace(/\s+/g," ").trim();return r.length>t?r.slice(0,t-1)+"…":r}function lt(e,t){void 0===t&&(t="https://semantic.invalid/");try{var r=new URL(e,t);if("http:"!==r.protocol&&"https:"!==r.protocol)return"/";var n=/^#!?\//.test(r.hash)?"#"+r.hash.slice(1).split(/[?#]/)[0]:"",s=function(e){return e.split("/").map(function(e){var t;try{t=decodeURIComponent(e)}catch(e){return":id"}return/^\d+$/.test(t)||/^[\da-f]{8,}$/i.test(t)||/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/i.test(t)||t.length>=16&&/^[a-z\d]+$/i.test(t)&&/[a-z]/i.test(t)&&/\d/.test(t)?":id":e}).join("/")};return s(r.pathname)+s(n)}catch(e){return"/"}}function ct(e){var t,r,n,s,i=null===(t=e.getAttribute("role"))||void 0===t?void 0:t.trim().split(/\s+/)[0].toLowerCase();if(i)return"none"===i||"presentation"===i?"generic":i;var o=e.tagName.toLowerCase();if("a"===o||"area"===o)return e.hasAttribute("href")?"link":"generic";if("input"===o){return null!==(n={button:"button",image:"button",reset:"button",submit:"button",file:"button",checkbox:"checkbox",radio:"radio",range:"slider",number:"spinbutton",search:"searchbox",hidden:"generic"}[(null!==(r=e.getAttribute("type"))&&void 0!==r?r:"text").toLowerCase()])&&void 0!==n?n:e.hasAttribute("list")?"combobox":"textbox"}if("select"===o)return e.multiple||e.size>1?"listbox":"combobox";return/^h[1-6]$/.test(o)?"heading":"section"===o?e.hasAttribute("aria-label")||e.hasAttribute("aria-labelledby")?"region":"generic":null!==(s={button:"button",summary:"button",textarea:"textbox",nav:"navigation",main:"main",form:"form",header:"banner",footer:"contentinfo",aside:"complementary",dialog:"dialog",ul:"list",ol:"list",menu:"list",li:"listitem",table:"table",tr:"row",td:"cell",th:"columnheader",img:"img",option:"option",progress:"progressbar",output:"status",fieldset:"group",details:"group",optgroup:"group"}[o])&&void 0!==s?s:"generic"}function ut(e){var t,r=null===(t=e.getAttribute("aria-invalid"))||void 0===t?void 0:t.trim().toLowerCase();return!!r&&"false"!==r}function ht(e){var t=function(t){try{var r=e.getPrivacy().blockSelector;return!!t.closest(d([".amp-block","[data-amp-block]"],h("string"==typeof r?[r]:null!=r?r:[]),!1).join(","))}catch(e){return!0}},r=function(r){try{return t(r)||Ue(it.has(r.tagName)?"input":"text",e.getPrivacy(),r,e.getUrl())}catch(e){return!0}},n=function(e){return!!e.closest('[contenteditable]:not([contenteditable="false"])')},s=function(t,s,i){var o;if(void 0===i&&(i=80),r(t)||n(t)||void 0===s&&it.has(t.tagName))return null;if(void 0!==s)return null===s?null:at(s,i);for(var a,l=e.document.createTreeWalker(t,5),c=0,u="";a=l.nextNode();){if(++c>256)return null;if(1===a.nodeType){var h=a;if(r(h)||n(h)||it.has(h.tagName))return null}else u+=null!==(o=a.nodeValue)&&void 0!==o?o:"";if(u.length>2*i)break}return at(u,i)},i=function(i){var o,a,l,c,h,d=function(e,t){return{name:e||null,source:null===e?"masked":e?t:"unnamed"}};if(t(i))return d(null,"masked");var p=i.getAttribute("aria-labelledby");if(p){var f=p.trim().split(/\s+/).slice(0,20).map(function(t){return e.document.getElementById(t)}).filter(function(e){return!!e}).map(function(e){return s(e)});if(f.some(function(e){return null===e}))return d(null,"masked");var m=at(f.join(" "),80);if(m)return d(m,"aria-labelledby")}var g=i.getAttribute("aria-label");if(null==g?void 0:g.trim())return d(s(i,g),"aria-label");var v=i.labels;if(null==v?void 0:v.length){var y=v[0],b="";if(r(y))return d(null,"masked");for(var w=!1,S=e.document.createTreeWalker(y,5),C=void 0,x=0;C=S.nextNode();){if(++x>256){w=!0;break}if(1===C.nodeType&&C!==i&&(r(C)||n(C))){w=!0;break}3!==C.nodeType||(null===(l=C.parentElement)||void 0===l?void 0:l.closest('input, select, textarea, [contenteditable]:not([contenteditable="false"])'))||(b+=null!==(c=C.nodeValue)&&void 0!==c?c:"")}return d(w?null:s(y,b),y.htmlFor?"label-for":"label-wrap")}if("IMG"===i.tagName&&i.hasAttribute("alt"))return d(s(i,i.getAttribute("alt")),"alt");if("INPUT"===i.tagName&&/^(button|submit|reset)$/i.test(null!==(h=i.getAttribute("type"))&&void 0!==h?h:"")&&i.hasAttribute("value"))return d(s(i,i.getAttribute("value")),"value");if(st.has(ct(i))){var k=s(i);if(null===k||k)return d(k,"text")}try{for(var I=u(["title","placeholder"]),E=I.next();!E.done;E=I.next()){var O=E.value,M=i.getAttribute(O);if(M)return d(s(i,M),O)}}catch(e){o={error:e}}finally{try{E&&!E.done&&(a=I.return)&&a.call(I)}finally{if(o)throw o.error}}return d("","unnamed")},o=function(r){if(t(r))return null;var n=e.getNodeId(r);return n<0?null:n},a=function(e){var t=i(e);return{id:o(e),role:ct(e),name:t.name,name_source:t.source}},l=function(t){var r=t;try{return r.checkVisibility?r.checkVisibility({opacityProperty:!0,visibilityProperty:!0}):t.getClientRects().length>0&&"hidden"!==e.window.getComputedStyle(t).visibility}catch(e){return!1}},c=null,p=0,f="";return{id:o,blocked:t,masked:r,text:s,name:i,describe:a,visible:l,role:ct,url:function(t){return void 0===t&&(t=e.getUrl()),lt(t,e.getUrl())},actionable:function(e){for(var t=e,r=e,n=0;t&&n<12;n++,t=t.parentElement){var s=ct(t);if(rt.has(s))return t;r===e&&"generic"!==s&&(r=t)}return r},container:function(e){for(var t=e.parentElement,r=0;t&&r<20;r++,t=t.parentElement)if(nt.has(ct(t))||t.hasAttribute("aria-label")){var n=a(t);return{id:n.id,role:n.role,name:n.name}}return null},states:function(e){var t,r,n=[],s=e,i="INPUT"===e.tagName&&"checkbox"===s.type&&s.indeterminate||"mixed"===e.getAttribute("aria-checked")||"mixed"===e.getAttribute("aria-pressed");try{for(var o=u(Object.entries({disabled:e.matches(":disabled")||"true"===e.getAttribute("aria-disabled"),required:s.required||"true"===e.getAttribute("aria-required"),invalid:ut(e)||s.willValidate&&!s.validity.valid,checked:!i&&(s.checked||"true"===e.getAttribute("aria-checked")),mixed:i,busy:"true"===e.getAttribute("aria-busy"),open:("DETAILS"===e.tagName||"DIALOG"===e.tagName)&&e.hasAttribute("open"),expanded:"true"===e.getAttribute("aria-expanded"),collapsed:"false"===e.getAttribute("aria-expanded"),selected:s.selected||"true"===e.getAttribute("aria-selected"),current:e.hasAttribute("aria-current")&&"false"!==e.getAttribute("aria-current"),pressed:"true"===e.getAttribute("aria-pressed"),readonly:s.readOnly||"true"===e.getAttribute("aria-readonly")})),a=o.next();!a.done;a=o.next()){var l=h(a.value,2),c=l[0];l[1]&&n.push(c)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return n},heading:function(){var t=e.window.performance.now(),r=e.getUrl();if(t<p&&r===f&&(!c||c.isConnected&&l(c)))return c?s(c):null;c=null,p=t+250,f=r;var n=e.document.body;if(!n)return null;for(var i=e.document.createTreeWalker(n,1),o=i.nextNode(),a=0;o&&a++<2e3&&e.window.performance.now()-t<2;){var u="H1"===o.tagName;if((u||o.matches('[role="heading"][aria-level="1"]'))&&l(o)){if(o.closest('main,[role="main"]')){c=o;break}u&&!c&&(c=o)}o=i.nextNode()}return c?s(c):null},invalidateHeading:function(){p=0,c=null},attributes:function(n){var s,i,o,a={};if(t(n))return a;try{for(var l=u(ot),c=l.next();!c.done;c=l.next()){var h=c.value,d=n.getAttribute(h);null===d||(null===(o=e.getPrivacy().maskAttributes)||void 0===o?void 0:o.includes(h))&&r(n)||(a[h]=at("href"===h?lt(d,e.getUrl()):d,60))}}catch(e){s={error:e}}finally{try{c&&!c.done&&(i=l.return)&&i.call(l)}finally{if(s)throw s.error}}return a}}}var dt=new WeakMap;function pt(e){try{return e.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)})}}function ft(e,t){var r=dt.get(e);return r||(r=Object.freeze({tab_id:pt(t),document_id:pt(t)}),dt.set(e,r)),r}var mt={click:2e3,keys:1e3,"resource-error":200,field:1e3,submit:300,notice:300,dialog:300,"amp-event":500,context:200,recording:200,navigation:200,visibility:200,lifecycle:200};function gt(e){return o(o({},e),{families:e.families?o({},e.families):void 0})}var vt=["valueMissing","typeMismatch","patternMismatch","tooShort","tooLong","rangeUnderflow","rangeOverflow","stepMismatch","badInput","customError"];function yt(e){var t,r=e.target;return 1===(null==r?void 0:r.nodeType)?r:null!==(t=null==r?void 0:r.parentElement)&&void 0!==t?t:null}function bt(e){return["INPUT","SELECT","TEXTAREA"].includes(e.tagName)}function wt(e){var t;return"INPUT"===e.tagName&&["password","hidden"].includes(null!==(t=Le(e))&&void 0!==t?t:"")}function St(e){var t,r,n=[];if(bt(e))try{for(var s=u(vt),i=s.next();!i.done;i=s.next()){var o=i.value;e.validity[o]&&n.push(o)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}return ut(e)&&n.push("ariaInvalid"),{valid:(!bt(e)||e.validity.valid)&&!n.includes("ariaInvalid"),validity:n}}function Ct(e,t){var r=e.helpers.name(t),n=r.name,s=r.source;return{id:e.helpers.id(t),role:e.helpers.role(t),name:"text"===s||"value"===s?null:n,name_source:"text"===s||"value"===s?"masked":s}}function xt(e,t,r){if(r)return null;if("SELECT"===t.tagName){var n=t.selectedOptions[0];return!n||e.helpers.blocked(n)?null:n.hasAttribute("label")?e.helpers.text(n,n.label):e.helpers.text(n)}return"INPUT"===t.tagName&&["radio","checkbox"].includes(t.type)&&t.checked?Ct(e,t).name:null}var kt={families:["click","field","submit"],setup:function(e){var t,r,n=e.host,s=e.helpers,i=[],a=new Set,l=!0,c=new WeakMap,p=new Map,f=function(e){var t=n.window.setTimeout(function(){a.delete(t),l&&e()},0);return a.add(t),t},m=function(e,t){n.document.addEventListener(e,t,!0),i.push(function(){return n.document.removeEventListener(e,t,!0)})},g=function(t){var r=e.now();if(l&&e.enabled("click")&&("auxclick"!==t.type||1===t.button)){var i=yt(t);if(i&&!s.blocked(i)){var a=s.actionable(i);if(!s.blocked(a)&&e.canEmit("click")){var c=function(e,t){var r,n,s,i=null!==(s=e.host.getPrivacy().maskAttributes)&&void 0!==s?s:[];try{for(var o=u(["data-amp-key","data-testid","data-test","data-cy","id"]),a=o.next();!a.done;a=o.next()){var l=a.value,c=t.getAttribute(l);if(!(!c||i.includes(l)&&e.helpers.masked(t)||"id"===l&&(/^\d+$/.test(c)||/[a-f\d]{8,}/i.test(c)||/:r/.test(c)||/\d{3,}/.test(c))))return c.length>80?"".concat(c.slice(0,79),"…"):c}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return null}(e,a),h=null;if(!c&&n.getSelector)try{h=n.getSelector(a)}catch(e){}e.emit("click",o(o(o(o({},s.describe(a)),{container:s.container(a),states:s.states(a),visible:s.visible(a),key:c}),c?{}:{selector:h}),{attrs:s.attributes(a),url:s.url(),heading:s.heading(),keyboard:0===t.detail,modifiers:[t.altKey?"alt":"",t.ctrlKey?"ctrl":"",t.metaKey?"meta":"",t.shiftKey?"shift":""].filter(Boolean),trusted:t.isTrusted}),r)}}}},v=function(t){var r,i;if(e.enabled("field")){var a=yt(t),l=null==a?void 0:a.closest('input, select, textarea, [contenteditable=""], [contenteditable="true"], [contenteditable="plaintext-only"]');if(l&&("change"!==t.type||bt(l))&&!wt(l)&&!s.blocked(l)&&e.canEmit("field")){var u=Ue("input",n.getPrivacy(),l,n.getUrl()),h=o(o(o(o(o(o({},Ct(e,l)),{states:s.states(l),kind:"INPUT"===l.tagName?l.type:bt(l)?l.tagName.toLowerCase():"contenteditable",value_state:(bt(l)?l.value.length>0:(null!==(i=null===(r=l.textContent)||void 0===r?void 0:r.length)&&void 0!==i?i:0)>0)?"filled":"empty"}),"INPUT"===l.tagName&&["checkbox","radio"].includes(l.type)?{checked:l.checked}:{}),function(e,t){if(t)return{};if("TEXTAREA"===e.tagName)return{value:e.value};if("INPUT"!==e.tagName)return{};var r=e;return["checkbox","radio","file","button","submit","reset","image"].includes(r.type)?{}:{value:r.value}}(l,u)),St(l)),{masked:u,option_label:xt(e,l,u)}),d=JSON.stringify(h),p=c.get(l),f=e.now();(null==p?void 0:p.payload)===d&&("focusout"===t.type||f-p.timestamp<500)||e.emit("field",h)&&c.set(l,{payload:d,timestamp:f})}}},y=function(e,t){var r=s.describe(e);if(null===r.name&&"masked"!==r.name_source){var n=null!=t?t:e.querySelector('button:not([type]), button[type="submit"], input[type="submit"], input[type="image"]');n&&!s.blocked(n)&&(r.name=s.name(n).name)}return{id:r.id,role:r.role,name:r.name}};return e.enabled("click")&&(n.externalClicks?i.push(e.on("click",g)):m("click",function(e){return g(e)}),(null!==(t=n.externalAuxClicks)&&void 0!==t?t:n.externalClicks)||m("auxclick",function(e){return g(e)})),e.enabled("field")&&(m("change",v),m("focusout",v)),e.enabled("submit")&&(m("submit",function(t){if(e.enabled("submit")){var r=yt(t);if("FORM"===(null==r?void 0:r.tagName)&&!s.blocked(r)){var n=t.submitter,i=n&&!s.blocked(n)?n:null;f(function(){e.enabled("submit")&&!s.blocked(r)&&e.canEmit("submit")&&e.emit("submit",{form:y(r,i&&!s.blocked(i)?i:null),submitter:i&&!s.blocked(i)?{id:s.id(i),role:s.role(i),name:s.name(i).name}:null,valid:!0,invalid_fields:[],prevented:t.defaultPrevented})})}}}),m("invalid",function(t){if(e.enabled("submit")){var n=yt(t);if(n&&bt(n)){var i=n.form;if(i&&!s.blocked(i)){var o=p.get(i);o||(o=new Set,p.set(i,o)),!wt(n)&&!s.blocked(n)&&o.size<10&&o.add(n),void 0===r&&(r=f(function(){var t,n;r=void 0;var i=d([],h(p),!1);if(p.clear(),e.enabled("submit"))try{for(var o=u(i),a=o.next();!a.done;a=o.next()){var l=h(a.value,2),c=l[0],f=l[1];s.blocked(c)||e.canEmit("submit")&&e.emit("submit",{form:y(c,null),submitter:null,valid:!1,prevented:!0,invalid_fields:d([],h(f),!1).filter(function(e){return!s.blocked(e)&&!wt(e)}).map(function(t){var r=Ct(e,t);return{id:r.id,name:r.name,validity:St(t).validity}})})}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}}))}}}})),function(){l=!1,i.forEach(function(e){return e()}),a.forEach(function(e){return n.window.clearTimeout(e)}),a.clear(),p.clear()}}},It='dialog,[role="dialog"],[role="alertdialog"],[aria-modal="true"]';function Et(e,t){var r,n,s,i,o,a;return c(this,function(l){switch(l.label){case 0:r=[{children:[e],index:0,hidden:!1}],l.label=1;case 1:return r.length?(n=r[r.length-1]).index===n.children.length?(r.pop(),[3,1]):(s=n.children[n.index++],i=s.attributes,o=n.hidden||void 0!==(null==i?void 0:i.hidden)||"true"===(null==i?void 0:i["aria-hidden"]),[4,{node:s,baseline:t,hidden:o}]):[3,3];case 2:return l.sent(),(null===(a=s.childNodes)||void 0===a?void 0:a.length)&&r.push({children:s.childNodes,index:0,hidden:o}),[3,1];case 3:return[2]}})}function Ot(e){var t,r,n,s,i,o,a,l,h,d,p,f,m,g,v,y,b,w,S,C,x,k,I,E,O,M;return c(this,function(R){switch(R.label){case 0:return"snapshot"!==e.type?[3,2]:[5,u(Et(e.node,!0))];case 1:return R.sent(),[3,33];case 2:R.trys.push([2,7,8,9]),t=u(e.texts),r=t.next(),R.label=3;case 3:return r.done?[3,6]:[4,{id:r.value.id,text:!0}];case 4:R.sent(),R.label=5;case 5:return r=t.next(),[3,3];case 6:return[3,9];case 7:return n=R.sent(),S={error:n},[3,9];case 8:try{r&&!r.done&&(C=t.return)&&C.call(t)}finally{if(S)throw S.error}return[7];case 9:s=function(e){return c(this,function(t){switch(t.label){case 0:return[4,{id:e.id,dialogs:["open","hidden","aria-hidden","role","aria-modal"].some(function(t){return t in e.attributes})}];case 1:return t.sent(),[2]}})},R.label=10;case 10:R.trys.push([10,15,16,17]),i=u(e.attributes),o=i.next(),R.label=11;case 11:return o.done?[3,14]:(a=o.value,[5,s(a)]);case 12:R.sent(),R.label=13;case 13:return o=i.next(),[3,11];case 14:return[3,17];case 15:return l=R.sent(),x={error:l},[3,17];case 16:try{o&&!o.done&&(k=i.return)&&k.call(i)}finally{if(x)throw x.error}return[7];case 17:h=new Set,d=function(e){var t=!h.has(e);return h.size<1e3&&h.add(e),{id:e,text:t}},R.label=18;case 18:R.trys.push([18,23,24,25]),p=u(e.removes),f=p.next(),R.label=19;case 19:return f.done?[3,22]:(m=f.value,[4,d(m.parentId)]);case 20:R.sent(),R.label=21;case 21:return f=p.next(),[3,19];case 22:return[3,25];case 23:return g=R.sent(),I={error:g},[3,25];case 24:try{f&&!f.done&&(E=p.return)&&E.call(p)}finally{if(I)throw I.error}return[7];case 25:R.trys.push([25,31,32,33]),v=u(e.adds),y=v.next(),R.label=26;case 26:return y.done?[3,30]:(b=y.value,[4,d(b.parentId)]);case 27:return R.sent(),[5,u(Et(b.node,!1))];case 28:R.sent(),R.label=29;case 29:return y=v.next(),[3,26];case 30:return[3,33];case 31:return w=R.sent(),O={error:w},[3,33];case 32:try{y&&!y.done&&(M=v.return)&&M.call(v)}finally{if(O)throw O.error}return[7];case 33:return[2]}})}var Mt={families:["notice","dialog"],setup:function(e){var t=e.hasCapacity("notice"),r=e.hasCapacity("dialog"),n=e.host,s=e.helpers,i=n.window;if(!t&&!r||!n.getNode)return function(){};var o,a=!0,l=null,c=!1,d=0,p=[],f=new Set,m=new Set,g=new Set,v=new WeakMap,y=new WeakMap,b=new Map,w=new WeakMap,S=new Set,C=new Set,x=!1,k=!1,I=function(e){var t;if(!C.has(e)){C.add(e);try{null===(t=n.onError)||void 0===t||t.call(n,new Error("Semantic feedback ".concat(e," limit reached; some changes may be omitted.")))}catch(e){}}},E=function(e,r){var n;if(t&&e.isConnected&&!(void 0!==r&&(null!==(n=y.get(e))&&void 0!==n?n:-1)>=r)){if(!m.has(e)&&!b.has(e)){if(m.size+b.size>=256)return void I("notice queue");m.add(e)}void 0!==r&&y.set(e,r)}},O=function(e){r&&!g.has(e)&&g.add(e)},M=e.subscribe(function(e){"click"===e.name&&(l=e.timestamp)}),R=function(){return null!==l&&e.now()-l>=0&&e.now()-l<=3e3?l:null},P=function(){m.clear(),b.forEach(function(e){return i.clearTimeout(e)}),b.clear()},A=function(){a=!1,U(),M(),void 0!==o&&(c?i.clearTimeout(o):i.cancelAnimationFrame(o),o=void 0),P(),p.length=0,f.clear(),g.clear(),S.clear()},T=function(){return t&&!e.hasCapacity("notice")&&(t=!1,P()),r&&!e.hasCapacity("dialog")&&(r=!1,g.clear(),S.clear(),f.clear()),t||r||A(),a},N=function(r){if(m.delete(r),r.isConnected&&!b.has(r)){var n=v.get(r),o=void 0===n?0:500-(e.now()-n);o<=0?function(t){if(a&&t.isConnected&&!s.blocked(t)&&e.canEmit("notice")){var r=s.text(t,void 0,200);if(null===r||r.trim()){var n=t.getAttribute("role"),i=s.container(t);e.emit("notice",{id:s.id(t),role:"alert"===n||"status"===n||"log"===n?n:"live",text:r,visible:s.visible(t),region:i?{role:i.role,name:i.name}:null,cause_click_ts:R()}),v.set(t,e.now())}}}(r):b.set(r,i.setTimeout(function(){b.delete(r),a&&t&&(E(r),m.size&&D())},o))}},L=function(t){if(g.delete(t),s.blocked(t))return S.delete(t),void f.delete(t);var r=w.get(t),n=function(e){return e.isConnected&&e.matches(It)&&!e.closest('[hidden],[aria-hidden="true"]')&&("DIALOG"!==e.tagName||e.hasAttribute("open"))}(t);if((null==r?void 0:r.open)!==n&&(r||n)){var i=function(e){var t=w.get(e),r=e.isConnected&&e.matches(It)&&!e.closest('[hidden],[aria-hidden="true"]')&&("DIALOG"!==e.tagName||e.hasAttribute("open")),n="true"===e.getAttribute("aria-modal");try{n=n||e.matches(":modal")}catch(e){}var i=!e.isConnected&&t?t.payload:s.describe(e);return{open:r,payload:{id:i.id,role:"alertdialog"===e.getAttribute("role")?"alertdialog":"dialog",name:e.isConnected?i.name:null,name_source:e.isConnected?i.name_source:"masked",state:r?"open":"closed",modal:!e.isConnected&&t?t.payload.modal:n,visible:r&&s.visible(e),cause_click_ts:R()}}}(t);w.set(t,i),n?S.add(t):S.delete(t),e.emit("dialog",i.payload),t.isConnected||f.delete(t)}},_=function(){var e,t,r,n,s,l,c,d;if(o=void 0,a&&T()){var v=i.performance.now();if(x){x=!1;try{for(var y=u(f),w=y.next();!w.done;w=y.next()){var C=w.value;O(C)}}catch(t){e={error:t}}finally{try{w&&!w.done&&(t=y.return)&&t.call(y)}finally{if(e)throw e.error}}try{for(var I=u(m),E=I.next();!E.done;E=I.next()){(C=E.value).isConnected||m.delete(C)}}catch(e){r={error:e}}finally{try{E&&!E.done&&(n=I.return)&&n.call(I)}finally{if(r)throw r.error}}try{for(var M=u(b),R=M.next();!R.done;R=M.next()){var P=h(R.value,2),A=(C=P[0],P[1]);C.isConnected||(i.clearTimeout(A),b.delete(C))}}catch(e){s={error:e}}finally{try{R&&!R.done&&(l=M.return)&&l.call(M)}finally{if(s)throw s.error}}try{for(var _=u(f),F=_.next();!F.done;F=_.next()){(C=F.value).isConnected||S.has(C)||(f.delete(C),g.delete(C))}}catch(e){c={error:e}}finally{try{F&&!F.done&&(d=_.return)&&d.call(_)}finally{if(c)throw c.error}}}var U=0,j=function(e){for(;a&&(m.size||g.size)&&U<50&&i.performance.now()<e;){var t=g.size>0&&(k||!m.size);k=!t,U++,t?L(g.values().next().value):N(m.values().next().value),T()}};j(v+2);for(var z=0;a&&p.length&&z++<1e3&&i.performance.now()-v<4;){var W=p[0],q=W.work.next();q.done?p.shift():B(q.value,W.generation)}j(v+4),a&&(x||p.length||m.size||g.size)&&D()}},D=function(){a&&void 0===o&&(c="function"!=typeof i.requestAnimationFrame,o=c?i.setTimeout(_,16):i.requestAnimationFrame(_))},F=function(e){return!!f.has(e)||(f.size>=256?(I("dialog tracking"),!1):(f.add(e),!0))},B=function(e,i){var o,a,l;if("node"in e){var c=e.node,h=e.baseline,d=e.hidden;if(2!==c.type)return;var p=null!==(l=c.attributes)&&void 0!==l?l:{},m="dialog"===c.tagName||"dialog"===p.role||"alertdialog"===p.role||"true"===p["aria-modal"],g=["alert","status","log"].includes(p.role)||["polite","assertive"].includes(p["aria-live"]);if((!r||!m)&&(!t||!g||h))return;var v=n.getNode(c.id);if(!v||1!==v.nodeType||s.blocked(v))return;var y=v;if(r&&m&&F(y))if(h&&!w.has(y)){var b=!d&&("dialog"!==c.tagName||void 0!==p.open);w.set(y,{open:b,payload:{id:c.id,role:"alertdialog"===p.role?"alertdialog":"dialog",name:null,name_source:"unnamed",state:b?"open":"closed",modal:"true"===p["aria-modal"]||"modal"===p.rr_open_mode,visible:!1,cause_click_ts:null}}),b&&S.add(y)}else{var C=w.get(y);C&&h&&(C.payload.id=c.id),O(y)}t&&g&&!h&&E(y,i)}else if(t&&e.text||r&&e.dialogs){var x=n.getNode(e.id),k=1===(null==x?void 0:x.nodeType)?x:null==x?void 0:x.parentElement;if(k&&k.isConnected&&!s.blocked(k)){if(t&&e.text){var I=k.closest('[role="alert"],[role="status"],[role="log"],[aria-live="polite"],[aria-live="assertive"]');I&&E(I,i)}if(r&&e.dialogs){k.matches(It)&&F(k)&&O(k);try{for(var M=u(f),R=M.next();!R.done;R=M.next()){m=R.value;k.contains(m)&&O(m)}}catch(e){o={error:e}}finally{try{R&&!R.done&&(a=M.return)&&a.call(M)}finally{if(o)throw o.error}}}}}},U=e.on("dom",function(e){a&&T()&&(d++,("snapshot"===e.type||e.removes.length)&&(x=!0),p.length>=128?I("replay batch queue"):p.push({work:Ot(e),generation:d}),D())});return A}};var Rt={families:["context","recording","visibility","lifecycle"],setup:function(e){var t=[],r=e.host,n=r.document,s=r.window;if(e.enabled("context")&&t.push(e.on("snapshot",function(){return function(e){var t,r,n,s,i;if(e.canEmit("context")){var a=e.host,l=a.document,c=a.window,h={total:0,inlined:0,unreadable:0};try{for(var d=u(Array.from(l.styleSheets)),p=d.next();!p.done;p=d.next()){var f=p.value;h.total++;try{f.cssRules,!1!==a.inlineStylesheet&&h.inlined++}catch(e){h.unreadable++}}}catch(e){t={error:e}}finally{try{p&&!p.done&&(r=d.return)&&r.call(d)}finally{if(t)throw t.error}}var m="function"==typeof c.matchMedia&&c.matchMedia("(pointer:coarse)").matches,g=m&&c.innerWidth<768?"mobile":m&&c.innerWidth<1024?"tablet":"desktop",v=e.dropped();e.emit("context",o({sdk:a.sdk,mask:null!==(n=a.getPrivacy().defaultMaskLevel)&&void 0!==n?n:"medium",css:h,viewport:{w:c.innerWidth,h:c.innerHeight},device:g,language:c.navigator.language,visibility_state:"hidden"===l.visibilityState?"hidden":"visible",focused:l.hasFocus(),user_agent:c.navigator.userAgent,analytics_sdk:null!==(i=null===(s=a.getAnalyticsContext)||void 0===s?void 0:s.call(a))&&void 0!==i?i:{present:!1,autocapture:[]}},Object.keys(v).length?{caps_hit:v}:{}))}}(e)})),e.enabled("recording")&&t.push(e.on("recording",function(t){return e.emit("recording",t)})),e.enabled("visibility")){var i=function(){return"hidden"===n.visibilityState?"hidden":"visible"},a=i(),l=function(){var t=i();t!==a&&(a=t,e.emit("visibility",{state:t}))};n.addEventListener("visibilitychange",l,!0),t.push(function(){return n.removeEventListener("visibilitychange",l,!0)})}if(e.enabled("lifecycle")){var c=function(r,n,s){var i=function(t){e.emit("lifecycle",{type:"pageshow"===n&&t.persisted?"pageshow_bfcache":s})};r.addEventListener(n,i,!0),t.push(function(){return r.removeEventListener(n,i,!0)})};c(s,"pagehide","pagehide"),c(s,"pageshow","pageshow"),c(n,"freeze","freeze"),c(n,"resume","resume")}return function(){return t.forEach(function(e){return e()})}}},Pt=/^(Escape|Enter|Tab|ArrowUp|ArrowDown|ArrowLeft|ArrowRight|Home|End|PageUp|PageDown|F[1-9]|F1[0-2])$/,At=/^[kpf]$/i,Tt={families:["keys"],setup:function(e){var t=e.host.document,r=e.helpers,n=function(t){if(e.enabled("keys")&&!t.repeat&&!t.isComposing&&229!==t.keyCode&&!t.getModifierState("AltGraph")){var n=t.key;if(!Pt.test(n)){if(t.altKey||t.ctrlKey===t.metaKey||!At.test(n))return;n=n.toUpperCase()}var s=t.composedPath().filter(function(e){return 1===e.nodeType}),i=s[0];if(i&&!s.some(function(e){return r.blocked(e)})&&!i.matches('input[type="password"], input[type="hidden"]')&&e.canEmit("keys")){var o=r.name(i),a="value"===o.source||"text"===o.source&&!!i.closest("input,textarea,select,[contenteditable]");e.emit("keys",{key:[t.ctrlKey?"Ctrl":"",t.metaKey?"Meta":"",t.altKey?"Alt":"",t.shiftKey?"Shift":"",n].filter(Boolean).join("+"),target:{id:r.id(i),role:r.role(i),name:a?null:o.name,name_source:a?"masked":o.source,states:r.states(i)}})}}},s=function(){return t.removeEventListener("keydown",n,!0)};return e.onCleanup(s),t.addEventListener("keydown",n,!0),s}},Nt=65535,Lt={families:["resource-error"],setup:function(e){var t,r=e.host,n=r.document,s=r.window,i=e.helpers,a=!0,l=[],c=0,h=n.fonts,d=function(){void 0!==t&&s.clearTimeout(t),t=void 0},p=function(){var t,r,n,s;d();var h=l,p=c;if(l=[],c=0,a&&e.enabled("resource-error")){var f=new Map;try{for(var m=u(h),g=m.next();!g.done;g=m.next()){var v=g.value;if(v.element.isConnected&&!i.blocked(v.element)){var y=i.container(v.element),b=o(o({rt:v.rt,count:v.count},v.path?{path:v.path}:{}),y?{container:y}:{}),w=JSON.stringify([b.rt,b.path,b.container]),S=f.get(w);S?S.count=Math.min(Nt,S.count+b.count):f.set(w,b)}}}catch(e){t={error:e}}finally{try{g&&!g.done&&(r=m.return)&&r.call(m)}finally{if(t)throw t.error}}p&&e.emit("resource-error",{rt:"font",count:p});try{for(var C=u(f.values()),x=C.next();!x.done;x=C.next()){b=x.value;e.emit("resource-error",b)}}catch(e){n={error:e}}finally{try{x&&!x.done&&(s=C.return)&&s.call(C)}finally{if(n)throw n.error}}}},f=function(){"hidden"===n.visibilityState?p():void 0===t&&(t=s.setTimeout(p,500))},m=function(t){if(a&&e.enabled("resource-error")){var r=t.target;if(r&&1===r.nodeType&&!i.blocked(r)){var s,o;if("IMG"===r.tagName)s="img",o=r.currentSrc||r.getAttribute("src")||"";else if("SCRIPT"===r.tagName&&r.hasAttribute("src"))s="script",o=r.getAttribute("src")||"";else{if("LINK"!==r.tagName||!r.relList.contains("stylesheet"))return;s="css",o=r.getAttribute("href")||""}var c=function(e){if(e)try{var t=new URL(e,n.baseURI);if("http:"!==t.protocol&&"https:"!==t.protocol)return;var r=i.url(t.origin+t.pathname);return r.length<=200?r:void 0}catch(e){return}}(o),u=l.find(function(e){return e.element===r&&e.rt===s&&e.path===c});u?u.count=Math.min(Nt,u.count+1):(l.length>=100&&p(),l.push({element:r,rt:s,path:c,count:1})),f()}}},g=function(t){if(a&&e.enabled("resource-error")){var r=t.fontfaces;(null==r?void 0:r.length)&&(c=Math.min(Nt,c+r.length),f())}},v=function(){"hidden"===n.visibilityState&&p()},y=function(){a=!1,d(),l=[],c=0,n.removeEventListener("error",m,!0),n.removeEventListener("visibilitychange",v,!0),s.removeEventListener("pagehide",p,!0),null==h||h.removeEventListener("loadingerror",g)};return e.onCleanup(y),n.addEventListener("error",m,!0),n.addEventListener("visibilitychange",v,!0),s.addEventListener("pagehide",p,!0),null==h||h.addEventListener("loadingerror",g),y}},_t=new Set(["[Amplitude] Dead Click","[Amplitude] Rage Click","[Amplitude] Error Click","[Amplitude] Thrashed Cursor"]),Dt=["[Amplitude] Clicks","[Amplitude] Begin Time","[Amplitude] End Time"],Ft="[Amplitude] Element Text",Bt="[Amplitude] Element Tag",Ut="[Amplitude] Page Path",jt={families:["amp-event"],setup:function(e){if(!e.enabled("amp-event"))return function(){};var t,r=e.subscribe(function(e){"click"===e.name&&(t={timestamp:e.timestamp,id:e.payload.id,name:e.payload.name})}),n=e.on("analytics",function(r){var n,s;if(e.enabled("amp-event")&&_t.has(r.eventType)){var i=e.helpers,o=r.element;if((!o||!i.blocked(o))&&e.canEmit("amp-event")){var a=r.properties,l={},c=null,h=a[Ft];if("string"==typeof h){if(o){var d=i.text(o),p=i.text(o,h);null!==d&&d===p&&(c=p)}l[Ft]=c}var f=a[Bt];o?l[Bt]=o.tagName.toLowerCase():"string"==typeof f&&/^[a-z][a-z0-9-]{0,59}$/i.test(f)&&(l[Bt]=f.toLowerCase());try{for(var m=u(Dt),g=m.next();!g.done;g=m.next()){var v=g.value,y=a[v];"number"==typeof y&&Number.isFinite(y)&&(l[v]=y)}}catch(e){n={error:e}}finally{try{g&&!g.done&&(s=m.return)&&s.call(m)}finally{if(n)throw n.error}}var b=a[Ut];"string"==typeof b&&(l[Ut]=i.url(b));var w=t?e.now()-t.timestamp:1/0,S=null!==c&&t&&w>=0&&w<=3e3&&t.name===c?t.id:null;e.emit("amp-event",{event_type:r.eventType,insert_id:"string"==typeof r.insertId?r.insertId:null,id:S,props:l})}}});return function(){n(),r(),t=void 0}}},zt=[kt,Mt,Rt,{families:["navigation"],setup:function(e){return e.on("url",function(t){var r=t.url,n=t.timestamp;r.trim()&&e.canEmit("navigation")&&e.emit("navigation",{url:e.helpers.url(r)},n)})}},jt,Tt,Lt];function Wt(e,t,r){return void 0===r&&(r=zt),function(e,t,r){var n,s,i=gt(e),a=!1,l=!1,c=!1,h=[],d={},p={},f=new Map,m=new Set,g=null!==(n=t.now)&&void 0!==n?n:Date.now,v=function(e){var r;try{null===(r=t.onError)||void 0===r||r.call(t,e)}catch(e){}},y=function(e){try{e()}catch(e){v(e)}},b=function(e){var t;return a&&!1!==(null===(t=i.families)||void 0===t?void 0:t[e])},w=function(e){var t;return b(e)&&(null!==(t=d[e])&&void 0!==t?t:0)<mt[e]},S=function(e){var t;return!(!b(e)||!w(e)&&(p[e]=(null!==(t=p[e])&&void 0!==t?t:0)+1,1))},C={host:t,helpers:ht(t),now:g,enabled:b,canEmit:S,hasCapacity:w,dropped:function(){return o({},p)},hasSnapshot:function(){return c},emit:function(e,r,n){var s,i,a;if(void 0===n&&(n=g()),!S(e))return!1;try{a=null===(s=t.getIdentity)||void 0===s?void 0:s.call(t)}catch(e){v(e)}null!=a||(a=ft(t.document,t.window));var l={name:e,payload:o(o({},r),{v:1,tab_id:a.tab_id,document_id:a.document_id}),timestamp:n};d[e]=(null!==(i=d[e])&&void 0!==i?i:0)+1;try{t.emit(l)}catch(e){return v(e),!1}return"context"===e&&(p={}),m.forEach(function(e){return y(function(){return e(l)})}),!0},on:function(e,t){var r=f.get(e);r||(r=new Set,f.set(e,r));var n=function(e){return y(function(){return t(e)})};r.add(n);var s=r;return function(){s.delete(n)}},subscribe:function(e){return m.add(e),function(){m.delete(e)}}},x=function(){a=!1;var e=h;h=[],e.reverse().forEach(function(e){return y(e)}),f.clear(),m.clear()},k=function(){var e,n,c,d;if(!a&&l&&i.enabled){var p=null!==(c=i.sampleRate)&&void 0!==c?c:1;if(!(!Number.isFinite(p)||p<=0||p>1||(void 0===s&&(s=(null!==(d=t.random)&&void 0!==d?d:Math.random)()),s>=p))){a=!0;var f=function(e){if(e.families.some(b)){var t=[],r=o(o({},C),{onCleanup:function(e){t.push(e)},on:function(e,r){var n=C.on(e,r);return t.push(n),n},subscribe:function(e){var r=C.subscribe(e);return t.push(r),r}}),n=function(){t.splice(0).reverse().forEach(function(e){return y(e)})};try{t.push(e.setup(r)),h.push(n)}catch(e){n(),v(e)}}};try{for(var m=u(r),g=m.next();!g.done;g=m.next())f(g.value)}catch(t){e={error:t}}finally{try{g&&!g.done&&(n=m.return)&&n.call(m)}finally{if(e)throw e.error}}}}};return{isActive:function(){return a},start:function(){l=!0,k()},stop:function(){l=!1,c=!1,x()},updateConfig:function(e){x(),i=gt(e),k()},resetSession:function(){x(),s=void 0,c=!1,d={},p={},k()},notify:function(e,t){var r,n,s;"snapshot"===e&&(c=!0),"snapshot"!==e&&"navigation"!==e&&"url"!==e||null===(n=(r=C.helpers).invalidateHeading)||void 0===n||n.call(r),a&&(null===(s=f.get(e))||void 0===s||s.forEach(function(e){return e(t)}))}}}(e,t,r)}var qt,$t,Vt,Gt=(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))(Gt||{}),Ht=(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))(Ht||{}),Jt=(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))(Jt||{}),Kt=function(){function e(e){this.ready=!1,this.firstSnapshot=!1,this.pendingSnapshots=0,this.pendingEvents=[],this.startSignal={state:"start",reason:"init"},this.resumeReason="focus",this.config={enabled:!1},this.capture=Wt(this.config,e)}return e.prototype.prepare=function(e,t){var r=this.sessionId!==t,n=void 0===this.sessionId;this.config=e,this.capture.updateConfig(e),r&&this.capture.resetSession(),this.startSignal={state:r?"start":"resume",reason:n?"init":r?"new_session":this.resumeReason},this.sessionId=t,this.ready=!1,this.firstSnapshot=!1,this.pendingSnapshots=0,this.pendingEvents=[]},e.prototype.recordingReady=function(){var e,t;if(this.config.enabled&&!this.ready){this.ready=!0,this.capture.start();var r=this.pendingEvents;this.pendingEvents=[];try{for(var n=u(r),s=n.next();!s.done;s=n.next()){var i=s.value;this.event(i)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}var o=this.pendingSnapshots;this.pendingSnapshots=0;for(var a=0;a<o;a++)this.snapshot()}},e.prototype.event=function(e){if(this.config.enabled){var t=e.type===Gt.FullSnapshot,r=e.type===Gt.IncrementalSnapshot&&e.data.source===Ht.Mutation,n=e.type===Gt.Plugin&&"amplitude/url-tracking@1"===e.data.plugin?e.data.payload:void 0,s=n&&"object"==typeof n&&"url-change-event"===n.type&&"string"==typeof n.href?n.href:void 0;(t||r||void 0!==s)&&(this.ready?this.capture.isActive()&&(void 0!==s?this.capture.notify("url",{url:s,timestamp:e.timestamp}):e.type===Gt.FullSnapshot?(this.capture.notify("dom",{type:"snapshot",node:e.data.node}),this.snapshot()):e.type===Gt.IncrementalSnapshot&&e.data.source===Ht.Mutation&&this.capture.notify("dom",o(o({},e.data),{type:"mutation"}))):this.pendingEvents.length<128&&this.pendingEvents.push(e))}},e.prototype.click=function(e){this.ready&&this.capture.notify("click",e)},e.prototype.snapshot=function(){this.config.enabled&&(this.ready?(this.firstSnapshot||(this.firstSnapshot=!0,this.capture.notify("recording",this.startSignal)),this.capture.notify("snapshot",void 0)):this.pendingSnapshots++)},e.prototype.stop=function(e,t){void 0===e&&(e="targeting"),void 0===t&&(t="stop");var r=this.ready&&this.firstSnapshot;this.ready=!1,this.firstSnapshot=!1,r&&(this.resumeReason=e,this.capture.notify("recording",{state:t,reason:e})),this.capture.stop(),this.pendingEvents=[],this.ready=!1,this.pendingSnapshots=0},e}(),Yt="AMP_semantic_tab_v1",Xt=new WeakMap,Qt=/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function Zt(e,t){if(Vt=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 r={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};qt=o(o({},r),t),$t=function(e,t){if(e.nodeType===Node.DOCUMENT_NODE)return e;if(e===t.root)return e.ownerDocument;return e}(qt.root,r);var n=er(e,"all",function(){return er(e,"two",function(){return er(e,"one",function(){return er(e,"none")})})});if(n){var s=ur(hr(n,e));return s.length>0&&(n=s[0]),rr(n)}throw new Error("Selector was not found.")}function er(e,t,r){for(var n=null,s=[],i=e,o=0,a=function(){var e,a,l=(new Date).getTime()-Vt.getTime();if(void 0!==qt.timeoutMs&&l>qt.timeoutMs)throw new Error("Timeout: Can't find a unique selector after ".concat(l,"ms"));var c=ar(function(e){var t=e.getAttribute("id");if(t&&qt.idName(t))return{name:"#"+CSS.escape(t),penalty:0};return null}(i))||ar.apply(void 0,d([],h(function(e){var t=Array.from(e.attributes).filter(function(e){return qt.attr(e.name,e.value)});return t.map(function(e){return{name:"[".concat(CSS.escape(e.name),'="').concat(CSS.escape(e.value),'"]'),penalty:.5}})}(i)),!1))||ar.apply(void 0,d([],h(function(e){var t=Array.from(e.classList).filter(qt.className);return t.map(function(e){return{name:"."+CSS.escape(e),penalty:1}})}(i)),!1))||ar(function(e){var t=e.tagName.toLowerCase();if(qt.tagName(t))return{name:t,penalty:2};return null}(i))||[{name:"*",penalty:3}],p=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}(i);if("all"==t)p&&(c=c.concat(c.filter(or).map(function(e){return ir(e,p)})));else if("two"==t)c=c.slice(0,1),p&&(c=c.concat(c.filter(or).map(function(e){return ir(e,p)})));else if("one"==t){var f=h(c=c.slice(0,1),1)[0];p&&or(f)&&(c=[ir(f,p)])}else"none"==t&&(c=[{name:"*",penalty:3}],p&&(c=[ir(c[0],p)]));try{for(var m=(e=void 0,u(c)),g=m.next();!g.done;g=m.next()){(f=g.value).level=o}}catch(t){e={error:t}}finally{try{g&&!g.done&&(a=m.return)&&a.call(m)}finally{if(e)throw e.error}}if(s.push(c),s.length>=qt.seedMinLength&&(n=tr(s,r)))return"break";i=i.parentElement,o++};i;){if("break"===a())break}return n||(n=tr(s,r)),!n&&r?r():n}function tr(e,t){var r,n,s=ur(cr(e));if(s.length>qt.threshold)return t?t():null;try{for(var i=u(s),o=i.next();!o.done;o=i.next()){var a=o.value;if(sr(a))return a}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return null}function rr(e){for(var t=e[0],r=t.name,n=1;n<e.length;n++){var s=e[n].level||0;r=t.level===s-1?"".concat(e[n].name," > ").concat(r):"".concat(e[n].name," ").concat(r),t=e[n]}return r}function nr(e){return e.map(function(e){return e.penalty}).reduce(function(e,t){return e+t},0)}function sr(e){var t=rr(e);switch($t.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 ir(e,t){return{name:e.name+":nth-child(".concat(t,")"),penalty:e.penalty+1}}function or(e){return"html"!==e.name&&!e.name.startsWith("#")}function ar(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e.filter(lr);return r.length>0?r:null}function lr(e){return null!=e}function cr(e,t){var r,n,s,i,o,a;return void 0===t&&(t=[]),c(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=u(e[0]),n=r.next(),l.label=2;case 2:return n.done?[3,5]:(s=n.value,[5,u(cr(e.slice(1,e.length),t.concat(s)))]);case 3:l.sent(),l.label=4;case 4:return n=r.next(),[3,2];case 5:return[3,8];case 6:return i=l.sent(),o={error:i},[3,8];case 7:try{n&&!n.done&&(a=r.return)&&a.call(r)}finally{if(o)throw o.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 ur(e){return d([],h(e),!1).sort(function(e,t){return nr(e)-nr(t)})}function hr(e,t,r){var n,s,i;return void 0===r&&(r={counter:0,visited:new Map}),c(this,function(o){switch(o.label){case 0:if(!(e.length>2&&e.length>qt.optimizedMinLength))return[3,5];n=1,o.label=1;case 1:return n<e.length-1?r.counter>qt.maxNumberOfTries?[2]:(r.counter+=1,(s=d([],h(e),!1)).splice(n,1),i=rr(s),r.visited.has(i)?[2]:sr(s)&&function(e,t){return $t.querySelector(rr(e))===t}(s,t)?[4,s]:[3,4]):[3,5];case 2:return o.sent(),r.visited.set(i,!0),[5,u(hr(s,t,r))];case 3:o.sent(),o.label=4;case 4:return n++,[3,1];case 5:return[2]}})}var dr=function(e,t){var r=document.createDocumentFragment();return function(e,t,r){var n,s,i=o({},e);try{for(var a=u(["blockSelector","maskSelector","unmaskSelector"]),l=a.next();!l.done;l=a.next()){var c=l.value,h=e[c],d=("string"==typeof h?[h]:null!=h?h:[]).filter(function(e){try{return t(e),!0}catch(t){if(!r)throw new Error("Invalid privacy selector: ".concat(e));return r(e),!1}});i[c]=d.length?d:void 0}}catch(e){n={error:e}}finally{try{l&&!l.done&&(s=a.return)&&s.call(a)}finally{if(n)throw n.error}}return i}(e,function(e){r.querySelector(e)},function(e){t.warn('[session-replay-browser] omitting selector "'.concat(e,'" because it is invalid'))})},pr=function(){function e(e,t){this.localConfig=t,this.remoteConfigClient=e}return e.prototype.generateJoinedConfig=function(){var e,t,r,n,s,i,a,p;return l(this,void 0,void 0,function(){var l,f,m,g,v,y,b,w,S,C,x,k,I,E,O,M,R,P,A=this;return c(this,function(c){switch(c.label){case 0:(l=o({},this.localConfig)).optOut=this.localConfig.optOut,l.captureEnabled=!0,c.label=1;case 1:return c.trys.push([1,3,,4]),[4,new Promise(function(e,t){A.remoteConfigClient.subscribe("configs.sessionReplay",{timeout:1500},function(r,n){var s;if(A.localConfig.loggerProvider.debug("Session Replay remote configuration received from ".concat(n,":"),JSON.stringify(r,null,2)),r){var i=r,o=i.sr_sampling_config,a=i.sr_privacy_config,c=i.sr_targeting_config,u=i.sr_semantic_config,h=null===(s=l.interactionConfig)||void 0===s?void 0:s.ugcFilterRules;l.interactionConfig=i.sr_interaction_config,l.interactionConfig&&h&&(l.interactionConfig.ugcFilterRules=h),l.loggingConfig=i.sr_logging_config,(o||a||c||u)&&(f={},u&&(f.sr_semantic_config=u),o&&(f.sr_sampling_config=o),a&&(f.sr_privacy_config=a),c&&(f.sr_targeting_config=c)),e()}else t(new Error("No remote config received"))})})];case 2:return c.sent(),[3,4];case 3:return m=c.sent(),this.localConfig.loggerProvider.error("Failed to generate joined config: ",m),l.captureEnabled=!1,[2,{localConfig:this.localConfig,joinedConfig:l,remoteConfig:void 0}];case 4:if(!f)return[2,{localConfig:this.localConfig,joinedConfig:l,remoteConfig:f}];if(g=f.sr_sampling_config,v=f.sr_privacy_config,y=f.sr_targeting_config,(b=f.sr_semantic_config)&&(l.semanticCapture=o(o(o({enabled:!1},l.semanticCapture),b),{families:o(o({},null===(e=l.semanticCapture)||void 0===e?void 0:e.families),b.families)})),g&&Object.keys(g).length>0?(Object.prototype.hasOwnProperty.call(g,"capture_enabled")?l.captureEnabled=g.capture_enabled:l.captureEnabled=!1,Object.prototype.hasOwnProperty.call(g,"sample_rate")&&(l.sampleRate=g.sample_rate),Object.prototype.hasOwnProperty.call(g,"min_session_duration_ms")&&(l.minSessionDurationMs=this.sanitizeMinSessionDurationMs(g.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.")),v){w=null!==(t=l.privacyConfig)&&void 0!==t?t:{},S={defaultMaskLevel:null!==(n=null!==(r=v.defaultMaskLevel)&&void 0!==r?r:w.defaultMaskLevel)&&void 0!==n?n:"medium",blockSelector:[],maskSelector:[],unmaskSelector:[],maskAttributes:d([],h(new Set(d(d([],h(null!==(s=w.maskAttributes)&&void 0!==s?s:[]),!1),h(null!==(i=v.maskAttributes)&&void 0!==i?i:[]),!1))),!1),urlMaskLevels:d(d([],h(null!==(a=v.urlMaskLevels)&&void 0!==a?a:[]),!1),h(null!==(p=w.urlMaskLevels)&&void 0!==p?p:[]),!1)},C=function(e){var t,r,n,s,i,o,a,l,c,h={};"string"==typeof e.blockSelector&&(e.blockSelector=[e.blockSelector]);try{for(var d=u(null!==(a=e.blockSelector)&&void 0!==a?a:[]),p=d.next();!p.done;p=d.next()){h[p.value]="block"}}catch(e){t={error:e}}finally{try{p&&!p.done&&(r=d.return)&&r.call(d)}finally{if(t)throw t.error}}try{for(var f=u(null!==(l=e.maskSelector)&&void 0!==l?l:[]),m=f.next();!m.done;m=f.next()){h[m.value]="mask"}}catch(e){n={error:e}}finally{try{m&&!m.done&&(s=f.return)&&s.call(f)}finally{if(n)throw n.error}}try{for(var g=u(null!==(c=e.unmaskSelector)&&void 0!==c?c:[]),v=g.next();!v.done;v=g.next()){h[v.value]="unmask"}}catch(e){i={error:e}}finally{try{v&&!v.done&&(o=g.return)&&o.call(g)}finally{if(i)throw i.error}}return h},x=o(o({},C(w)),C(v));try{for(k=u(Object.entries(x)),I=k.next();!I.done;I=k.next())E=h(I.value,2),O=E[0],"mask"===(M=E[1])?S.maskSelector.push(O):"block"===M?S.blockSelector.push(O):"unmask"===M&&S.unmaskSelector.push(O)}catch(e){R={error:e}}finally{try{I&&!I.done&&(P=k.return)&&P.call(k)}finally{if(R)throw R.error}}l.privacyConfig=dr(S,this.localConfig.loggerProvider)}return y&&Object.keys(y).length>0&&(l.targetingConfig=y),this.localConfig.loggerProvider.debug(JSON.stringify({name:"session replay joined config",config:Je(l)},null,2)),[2,{localConfig:this.localConfig,joinedConfig:l,remoteConfig:f}]}})})},e.prototype.sanitizeMinSessionDurationMs=function(e){if("number"==typeof e&&Number.isFinite(e)){if(!(e<0))return e>fr?(this.localConfig.loggerProvider.warn("min_session_duration_ms remote value ".concat(e," exceeds ").concat(fr,"ms ceiling; clamping.")),fr):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}(),fr=6e4,mr=function(e,t){return l(void 0,void 0,void 0,function(){var r,n;return c(this,function(s){return r=new Ye(e,t),n=new Q(e,r.loggerProvider,r.serverZone,t.configServerUrl,t.handleFetchConfig),[2,new pr(n,r)]})})};function gr(e){for(var t=e.length,r=0;r<t&&!(e.charCodeAt(r)>127);r++);if(r===t)return t;for(var n=r;r<t;r++){var s=e.charCodeAt(r);if(s<=127)n++;else if(s<=2047)n+=2;else if(s>=55296&&s<=56319){var i=r+1<t?e.charCodeAt(r+1):NaN;i>=56320&&i<=57343?(n+=4,r++):n+=3}else n+=3}return n}function vr(e){for(var t=0,r=0;r<e.length;r++)t+=gr(e[r]);return t}function yr(e,t){if(!(3*e.length<=t)){var r=gr(e);return r>t?r:void 0}}function br(e){if(e.type!==Gt.IncrementalSnapshot)return!1;var t=e.data;return t.source===Ht.Mutation&&!t.isAttachIframe}function wr(e){var t,r,n=new Map;if(e.forEach(function(e,t){if(e.attributes&&"style"in e.attributes){var r=n.get(e.id);r?r.push(t):n.set(e.id,[t])}}),0===n.size)return e;var s=function(t){return e[t].attributes.style},i=new Set,a=new Map,l=function(e){if(1===e.length)return"continue";var t=-1;e.forEach(function(e,r){var n;("object"!=typeof(n=s(e))||null===n)&&(t=r)});var r=[];if(e.forEach(function(e,n){n!==t&&(i.add(e),n>t&&r.push(e))}),r.length>0){var n=r[r.length-1],o=function(e){var t,r,n,s,i={};try{for(var o=u(e),a=o.next();!a.done;a=o.next()){var l=a.value;try{for(var c=(n=void 0,u(Object.keys(l))),h=c.next();!h.done;h=c.next()){var d=h.value;i[d]=l[d]}}catch(e){n={error:e}}finally{try{h&&!h.done&&(s=c.return)&&s.call(c)}finally{if(n)throw n.error}}}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return i}(r.map(function(e){return s(e)}));i.delete(n),a.set(n,o)}};try{for(var c=u(n.values()),h=c.next();!h.done;h=c.next()){l(h.value)}}catch(e){t={error:e}}finally{try{h&&!h.done&&(r=c.return)&&r.call(c)}finally{if(t)throw t.error}}if(0===i.size&&0===a.size)return e;var d=[];return e.forEach(function(e,t){var r=a.get(t);if(void 0===r)if(i.has(t)){var n=o({},e.attributes);delete n.style,Object.keys(n).length>0&&d.push(o(o({},e),{attributes:n}))}else d.push(e);else d.push(o(o({},e),{attributes:o(o({},e.attributes),{style:r})}))}),d}function Sr(e){var t,r,n,s,i=e[0],a=new Map,l=new Map,c=new Map,d=new Map,p=new Map;e.forEach(function(e,t){var r,n,s,i,o=e.data;try{for(var h=u(o.adds),f=h.next();!f.done;f=h.next()){var m=f.value;a.has(m.node.id)||a.set(m.node.id,t),l.set(m.node.id,t),p.set(m.node.id,m.parentId)}}catch(e){r={error:e}}finally{try{f&&!f.done&&(n=h.return)&&n.call(h)}finally{if(r)throw r.error}}try{for(var g=u(o.removes),v=g.next();!v.done;v=g.next()){var y=v.value;c.has(y.id)||c.set(y.id,t),d.set(y.id,t)}}catch(e){s={error:e}}finally{try{v&&!v.done&&(i=g.return)&&i.call(g)}finally{if(s)throw s.error}}});var f=new Set,m=new Set;try{for(var g=u(a),v=g.next();!v.done;v=g.next()){var y=h(v.value,2),b=y[0],w=y[1],S=c.get(b);if(void 0!==S)l.get(b)>=d.get(b)||(w<S?f.add(b):S<w&&m.add(b))}}catch(e){t={error:e}}finally{try{v&&!v.done&&(r=g.return)&&r.call(g)}finally{if(t)throw t.error}}var C=new Set;if(f.size>0||m.size>0)for(var x=!0;x;){x=!1;try{for(var k=(n=void 0,u(p)),I=k.next();!I.done;I=k.next()){var E=h(I.value,2),O=E[0],M=E[1];if(!f.has(O)&&!m.has(O)&&!C.has(O)&&(f.has(M)||m.has(M)||C.has(M))){var R=c.get(O),P=a.get(O);void 0!==R&&void 0!==P&&R<P?m.add(O):void 0!==R&&void 0!==P&&R===P?C.add(O):f.add(O),x=!0}}}catch(e){n={error:e}}finally{try{I&&!I.done&&(s=k.return)&&s.call(k)}finally{if(n)throw n.error}}}var A=f.size>0||m.size>0||C.size>0,T=[];e.forEach(function(e,t){var r,n;try{for(var s=u(e.data.removes),i=s.next();!i.done;i=s.next()){var o=i.value;f.has(o.id)||(m.has(o.id)&&t>=a.get(o.id)||C.has(o.id)&&(f.has(o.parentId)||m.has(o.parentId)||C.has(o.parentId))||T.push(o))}}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}});var N=e.flatMap(function(e){return e.data.adds}),L=e.flatMap(function(e){return e.data.texts}),_=e.flatMap(function(e){return e.data.attributes}),D=A?_.filter(function(e){return!f.has(e.id)&&!m.has(e.id)&&!C.has(e.id)}):_,F={source:Ht.Mutation,removes:T,adds:A?N.filter(function(e){return!f.has(e.node.id)&&!m.has(e.node.id)&&!C.has(e.node.id)}):N,texts:A?L.filter(function(e){return!f.has(e.id)&&!m.has(e.id)&&!C.has(e.id)}):L,attributes:wr(D)};return o(o({},i),{data:F})}function Cr(e){if(e.length<=1)return e;for(var t=[],r=0;r<e.length;)if(br(e[r])){for(var n=r+1;n<e.length&&br(e[n]);)n++;t.push(n>r+1?Sr(e.slice(r,n)):e[r]),r=n}else t.push(e[r]),r++;return t}var xr=function(){function e(e,t,r,n,s){var i,o=this;this.taskQueue=[],this.pendingQueue=[],this.isProcessing=!1,this.compressEvent=function(e){var t=e,r=t.type,n=t.timestamp,s=t.delay,i=t.data;return null!=s?JSON.stringify({type:r,timestamp:n,delay:s,data:i}):JSON.stringify({type:r,timestamp:n,data:i})},this.addCompressedEventToManager=function(e,t){var r,n=yr(e,null!==(r=o.config.maxSingleEventSizeBytes)&&void 0!==r?r:Ie);void 0===n?o.eventsManager&&o.deviceId&&o.eventsManager.addEvent({event:{type:"replay",data:e},sessionId:t,deviceId:o.deviceId}):o.config.loggerProvider.warn("Session replay event dropped: serialized size ".concat(Math.round(n/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."))},this.addCompressedEvent=function(e,t){if(o.worker)try{o.worker.postMessage({event:e,sessionId:t})}catch(r){"DataCloneError"===r.name?o.worker.postMessage(JSON.stringify({event:e,sessionId:t})):o.config.loggerProvider.warn("Unexpected error while posting message to worker:",r)}else{var r=o.compressEvent(e);o.addCompressedEventToManager(r,t)}},this.flushQueue=function(){var e;for(o.pendingQueue.length>0&&(e=o.taskQueue).push.apply(e,d([],h(o.mergeMutationTasks(o.pendingQueue.splice(0))),!1));o.taskQueue.length>0;){var t=o.taskQueue.shift();if(t){var r=t.event,n=t.sessionId,s=o.compressEvent(r);o.addCompressedEventToManager(s,n)}}o.isProcessing=!1},this.terminate=function(){var e;null===(e=o.worker)||void 0===e||e.terminate()};var a=g();if(this.canUseIdleCallback=a&&"requestIdleCallback"in a,this.eventsManager=e,this.config=t,this.deviceId=r,this.timeout=(null===(i=t.performanceConfig)||void 0===i?void 0:i.timeout)||2e3,this.onFullSnapshotProcessed=s,n){t.loggerProvider.log("Enabling web worker for compression");try{var l=new Blob([n],{type:"application/javascript"}),c=URL.createObjectURL(l),u=new Worker(c);u.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,")")),u.terminate(),o.worker=void 0},u.onmessage=function(e){var t=e.data,r=t.compressedEvent,n=t.sessionId;o.addCompressedEventToManager(r,n)},this.worker=u}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,s,i;if(e.type===Gt.FullSnapshot){if(this.config.loggerProvider.debug("Processing full snapshot immediately."),this.taskQueue.length>0||this.pendingQueue.length>0){var o=d(d([],h(this.taskQueue.splice(0)),!1),h(this.mergeMutationTasks(this.pendingQueue.splice(0))),!1);try{for(var a=u(o),l=a.next();!l.done;l=a.next()){var c=l.value,p=this.compressEvent(c.event);this.addCompressedEventToManager(p,c.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 f=this.compressEvent(e);return this.addCompressedEventToManager(f,t),void(null===(s=this.onFullSnapshotProcessed)||void 0===s||s.call(this))}this.canUseIdleCallback&&(null===(i=this.config.performanceConfig)||void 0===i?void 0:i.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,d([],h(this.mergeMutationTasks(this.pendingQueue.splice(0))),!1));this.taskQueue.length>0&&(e.timeRemaining()>0||e.didTimeout);){var n=this.taskQueue.shift();if(n){var s=n.event,i=n.sessionId;this.addCompressedEvent(s,i)}}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(!1===(null===(n=this.config.performanceConfig)||void 0===n?void 0:n.mergeMutations))return e;if(e.length<=1)return e;for(var s=[],i=0;i<e.length;){for(var o=e[i].sessionId,a=i+1;a<e.length&&e[a].sessionId===o;)a++;var l=Cr(e.slice(i,a).map(function(e){return e.event}));try{for(var c=(t=void 0,u(l)),h=c.next();!h.done;h=c.next()){var d=h.value;s.push({event:d,sessionId:o})}}catch(e){t={error:e}}finally{try{h&&!h.done&&(r=c.return)&&r.call(c)}finally{if(t)throw t.error}}i=a}return s},e}(),kr="Session replay event batch rejected due to exceeded retry count",Ir="Failed to store session replay events in IndexedDB",Er="Session replay event batch dropped: server signalled capture disabled or session out of valid range for this session",Or="1.52.0-codexsemantic-review-integration.0";function Mr(e,t){return l(this,void 0,void 0,function(){var r,n,s,i,o,a,h,d,p,f,m,g,v,y,b=this;return c(this,function(w){switch(w.label){case 0:return w.trys.push([0,4,,5]),r=t.CompressionStream,n=new r("gzip"),s=n.writable.getWriter(),i=n.readable.getReader(),o=[],a=l(b,void 0,void 0,function(){var e,t,r;return c(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];o.push(r),n.label=2;case 2:return[3,0];case 3:return[2]}})}),[4,s.write((new TextEncoder).encode(e))];case 1:return w.sent(),[4,s.close()];case 2:return w.sent(),[4,a];case 3:w.sent(),h=o.reduce(function(e,t){return e+t.length},0),d=new Uint8Array(h),p=0;try{for(f=u(o),m=f.next();!m.done;m=f.next())g=m.value,d.set(g,p),p+=g.length}catch(e){v={error:e}}finally{try{m&&!m.done&&(y=f.return)&&y.call(f)}finally{if(v)throw v.error}}return[2,d];case 4:return w.sent(),[2,null];case 5:return[2]}})})}var Rr=function(){function e(e){var t=e.trackServerUrl,r=e.loggerProvider,n=e.payloadBatcher,s=e.workerScript,i=e.enableTransportCompression,o=e.sendTimeoutMs,a=e.handleSendEvents,l=this;if(this.storageKey="",this.retryTimeout=1e3,this.scheduled=null,this.queue=[],this.sendIdCounter=0,this.pendingWorkerRequests=new Map,this.timedOutWorkerRequests=new Map,this.flushPauseUntilMs=0,this.mergeOnNextFlush=!1,this.coalesceNextFlush=!1,this.mergeLogFiredThisPause=!1,this.killedSessions=new Set,this.loggerProvider=r,this.payloadBatcher=n||function(e){return e},this.trackServerUrl=t,this.enableTransportCompression=null==i||i,this.sendTimeoutMs=null!=o?o:1e4,this.handleSendEvents=a,s)try{var c=new Blob([s],{type:"application/javascript"}),d=URL.createObjectURL(c),p=new Worker(d);p.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,")")),p.terminate(),l.worker=void 0;try{for(var s=u(l.pendingWorkerRequests),i=s.next();!i.done;i=s.next()){var o=h(i.value,2)[1];o.timeout&&clearTimeout(o.timeout),r.warn("Session replay event send failed due to worker crash: ".concat(e.message)),o.resolve()}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}l.pendingWorkerRequests.clear(),l.timedOutWorkerRequests.clear()},p.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=l.pendingWorkerRequests.get(t.id);if(n)n.timeout&&clearTimeout(n.timeout),l.handlePayloadTooLargeResponse(n.context,t.isWaf),n.resolve(),l.pendingWorkerRequests.delete(t.id);else(s=l.timedOutWorkerRequests.get(t.id))&&(l.timedOutWorkerRequests.delete(t.id),l.handlePayloadTooLargeResponse(s,t.isWaf))}else if("complete"===t.type){var s,i=l.pendingWorkerRequests.get(t.id);if(i)i.timeout&&clearTimeout(i.timeout),void 0!==t.skipCode&&l.applyServerDirective(i.context.sessionId,t.skipCode),l.completeRequest({context:i.context}),i.resolve(),l.pendingWorkerRequests.delete(t.id);else(s=l.timedOutWorkerRequests.get(t.id))&&(l.timedOutWorkerRequests.delete(t.id),void 0!==t.skipCode&&l.applyServerDirective(s.sessionId,t.skipCode),l.completeRequest({context:s}))}else"fetch-request"===t.type&&l.handleDelegatedFetch(p,t).catch(function(e){r.warn("Failed to handle delegated session replay fetch:",e)})},this.worker=p}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(o(o({},e),{attempts:0,timeout:0}))},e.prototype.markCoalesceNextFlush=function(){this.coalesceNextFlush=!0,this.schedule(0)},e.prototype.sendBeacon=function(e){var t,r,n=this,s=e.events,i=e.sessionId,o=e.deviceId,a=e.apiKey,l=e.serverZone,c=function(e){return gr(e)},u=s,h=JSON.stringify({version:2,events:u});if(c(h)>65536){for(var d=0,p=u.length;d<p;){var f=Math.floor((d+p+1)/2);c(JSON.stringify({version:2,events:u.slice(0,f)}))<=65536?d=f:p=f-1}u=u.slice(0,d),h=JSON.stringify({version:2,events:u}),this.loggerProvider.warn("sendBeacon payload exceeded 64 KB limit, trimmed from ".concat(s.length," to ").concat(u.length," events"))}if(0!==u.length)if(this.handleSendEvents){var m=new URLSearchParams({device_id:o,session_id:String(i),type:"replay"}),v="".concat($e(l,this.trackServerUrl),"?").concat(m.toString()),y={"Content-Type":"application/json",Accept:"*/*",Authorization:"Bearer ".concat(a)};this.loggerProvider.debug("Routing session replay exit batch (".concat(u.length," events) through custom transport for session id ").concat(i,"."));try{this.handleSendEvents({url:v,method:"POST",headers:y,body:h,keepalive:!0}).catch(function(e){n.loggerProvider.warn("Custom transport failed to send session replay exit batch:",e)})}catch(e){this.loggerProvider.warn("Custom transport threw while sending session replay exit batch:",e)}}else{var b=new URLSearchParams({device_id:o,session_id:String(i),type:"replay",api_key:a}),w="".concat($e(l,this.trackServerUrl),"?").concat(b.toString()),S=g();try{var C=new Blob([h],{type:"application/json"});!1===(null===(r=null===(t=null==S?void 0:S.navigator)||void 0===t?void 0:t.sendBeacon)||void 0===r?void 0:r.call(t,w,C))&&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:Er}),!1):t.attempts<(t.flushMaxRetries||0)?(t.attempts+=1,!0):(e.completeRequest({context:t,err:kr}),!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),l(this,void 0,void 0,function(){var t,r,n,s,i,o,a;return c(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,this.coalesceNextFlush=!1,t=this.mergeQueueAfterThrottle(t)):this.coalesceNextFlush&&(this.coalesceNextFlush=!1,t=this.mergeDrainBacklog(t)),l.label=1;case 1:l.trys.push([1,6,7,8]),r=u(t),n=r.next(),l.label=2;case 2:return n.done?[3,5]:(s=n.value,[4,this.send(s,e)]);case 3:l.sent(),l.label=4;case 4:return n=r.next(),[3,2];case 5:return[3,8];case 6:return i=l.sent(),o={error:i},[3,8];case 7:try{n&&!n.done&&(a=r.return)&&a.call(r)}finally{if(o)throw o.error}return[7];case 8:return[2]}})})},e.prototype.mergeQueueAfterThrottle=function(e){var t=this.coalesceByIdentity(e);return t.length<e.length&&!this.mergeLogFiredThisPause&&(this.mergeLogFiredThisPause=!0,this.loggerProvider.log("Session replay throttle pause ended; merged ".concat(e.length," queued batches into ").concat(t.length," request(s)"))),t},e.prototype.mergeDrainBacklog=function(e){var t=this.coalesceByIdentity(e);return t.length<e.length&&this.loggerProvider.log("Session replay coalesced ".concat(e.length," persisted page-load backlog batches into ").concat(t.length," request(s)")),t},e.prototype.coalesceByIdentity=function(e){var t,r,n,s,i,a,p,f,m,g,v,y=this;if(e.length<=1)return e;var b=new Map;try{for(var w=u(e),S=w.next();!S.done;S=w.next()){var C=S.value,x=[C.sessionId,null!==(i=C.deviceId)&&void 0!==i?i:"",null!==(a=C.apiKey)&&void 0!==a?a:"",C.type,null!==(p=C.serverZone)&&void 0!==p?p:"",C.sampleRate,null!==(m=null===(f=C.version)||void 0===f?void 0:f.type)&&void 0!==m?m:"",null!==(v=null===(g=C.version)||void 0===g?void 0:g.version)&&void 0!==v?v:""].join("|"),k=b.get(x);k?k.push(C):b.set(x,[C])}}catch(e){t={error:e}}finally{try{S&&!S.done&&(r=w.return)&&r.call(w)}finally{if(t)throw t.error}}var I=[],E=function(e){var t,r;if(1===e.length)return I.push(e[0]),"continue";var n=null,s=0,i=function(){n&&I.push(n),n=null,s=0},a=function(e){var t=vr(e.events);if(null===n)return n=o(o({},e),{events:d([],h(e.events),!1),attempts:0}),s=t,"continue";if(s+t>4e6)return i(),n=o(o({},e),{events:d([],h(e.events),!1),attempts:0}),s=t,"continue";var r=n.onComplete,a=e.onComplete;n.events=n.events.concat(e.events),s+=t,n.onComplete=function(){return l(y,void 0,void 0,function(){return c(this,function(e){switch(e.label){case 0:return[4,Promise.allSettled([r(),a()])];case 1:return e.sent(),[2]}})})}};try{for(var p=(t=void 0,u(e)),f=p.next();!f.done;f=p.next()){a(f.value)}}catch(e){t={error:e}}finally{try{f&&!f.done&&(r=p.return)&&r.call(p)}finally{if(t)throw t.error}}i()};try{for(var O=u(b.values()),M=O.next();!M.done;M=O.next()){E(M.value)}}catch(e){n={error:e}}finally{try{M&&!M.done&&(s=O.return)&&s.call(O)}finally{if(n)throw n.error}}return I},e.prototype.send=function(e,t){return void 0===t&&(t=!0),l(this,void 0,void 0,function(){var r,n,s,i;return c(this,function(o){return this.killedSessions.has(e.sessionId)?[2,this.completeRequest({context:e,err:Er})]:(r=e.apiKey)?(n=e.deviceId)?0===(s=this.payloadBatcher({version:1,events:e.events})).events.length?(this.completeRequest({context:e}),[2]):(i=this.worker)?[2,this.sendViaWorker(i,e,s,t)]:[2,this.sendOnMainThread(r,n,e,s,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 l(this,void 0,void 0,function(){var s,i=this;return c(this,function(o){return s="".concat(++this.sendIdCounter),[2,new Promise(function(o){var a,l=i.sendTimeoutMs>0?setTimeout(function(){var e=i.pendingWorkerRequests.get(s);e&&(i.pendingWorkerRequests.delete(s),i.rememberTimedOutRequest(s,e.context),i.loggerProvider.warn("Session replay worker send timed out after ".concat(i.sendTimeoutMs,"ms; leaving events for retry")),e.resolve())},i.sendTimeoutMs):void 0;i.pendingWorkerRequests.set(s,{context:t,resolve:o,timeout:l}),e.postMessage({type:"send",id:s,payload:r,useRetry:n,useCustomTransport:!!i.handleSendEvents,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:i.trackServerUrl,version:t.version,currentUrl:Ve(),sdkVersion:Or,enableTransportCompression:i.enableTransportCompression,sendTimeoutMs:i.sendTimeoutMs}})})]})})},e.prototype.rememberTimedOutRequest=function(e,t){var r,n;if(this.timedOutWorkerRequests.set(e,t),this.timedOutWorkerRequests.size>256)try{for(var s=u(this.timedOutWorkerRequests.keys()),i=s.next();!i.done;i=s.next()){var o=i.value;this.timedOutWorkerRequests.delete(o);break}}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}},e.prototype.handleDelegatedFetch=function(e,t){var r,n,s;return l(this,void 0,void 0,function(){var i,o,a,l,u,h,d,p,f,m,g;return c(this,function(c){switch(c.label){case 0:i=t.requestId,o=t.url,a=t.method,l=t.headers,u=t.body,h=t.keepalive,c.label=1;case 1:return c.trys.push([1,10,,11]),d=void 0,this.handleSendEvents?[4,this.handleSendEvents({url:o,method:a,headers:l,body:u,keepalive:h})]:[3,3];case 2:return d=c.sent(),[3,5];case 3:return this.loggerProvider.warn("Delegated session replay fetch received without a custom transport configured; falling back to built-in fetch."),[4,fetch(o,{method:a,headers:l,body:u,keepalive:h})];case 4:d=c.sent(),c.label=5;case 5:if(p=d.status,f=null,m="",p>=200&&p<300&&(f=null!==(s=null===(n=null===(r=d.headers)||void 0===r?void 0:r.get)||void 0===n?void 0:n.call(r,Pe))&&void 0!==s?s:null),413!==p)return[3,9];c.label=6;case 6:return c.trys.push([6,8,,9]),[4,d.text()];case 7:return m=c.sent(),[3,9];case 8:return c.sent(),[3,9];case 9:return this.loggerProvider.debug("Delegated session replay fetch (request ".concat(i,") returned status ").concat(p,".")),e.postMessage({type:"fetch-response",requestId:i,status:p,skipHeader:f,body:m}),[3,11];case 10:return g=c.sent(),this.loggerProvider.debug("Delegated session replay fetch (request ".concat(i,") failed:"),g),e.postMessage({type:"fetch-response",requestId:i,status:0,skipHeader:null,body:String(g),error:!0}),[3,11];case 11:return[2]}})})},e.prototype.sendOnMainThread=function(e,t,r,n,s){var i,a,u,h,d,p,f;return l(this,void 0,void 0,function(){var l,m,v,y,b,w,S,C,x,k,I,E,O,M,R,P,A,T,N,L,_,D;return c(this,function(c){switch(c.label){case 0:l=Ve(),m=Or,v=r.sampleRate,y=new URLSearchParams({device_id:t,session_id:"".concat(r.sessionId),type:"".concat(r.type)}),b="".concat(null!==(a=null===(i=r.version)||void 0===i?void 0:i.type)&&void 0!==a?a:"standalone","/").concat(null!==(h=null===(u=r.version)||void 0===u?void 0:u.version)&&void 0!==h?h:m),c.label=1;case 1:return c.trys.push([1,19,,23]),w=JSON.stringify(n),S=g(),this.enableTransportCompression&&S&&"CompressionStream"in S?[4,Mr(w,S)]:[3,3];case 2:return x=c.sent(),[3,4];case 3:x=null,c.label=4;case 4:if(k=(C=x)?C.byteLength:gr(w),I=new AbortController,E=o({"Content-Type":"application/json",Accept:"*/*",Authorization:"Bearer ".concat(e),"X-Client-Version":m,"X-Client-Library":b,"X-Client-Url":l.substring(0,1e3),"X-Client-Sample-Rate":"".concat(v),"X-Sampling-Hash-Alg":"xxhash32"},C?{"Content-Encoding":"gzip"}:{}),R={headers:E,body:O=null!=C?C:w,method:"POST",keepalive:M=k<=65536,signal:I.signal},P="".concat($e(r.serverZone,this.trackServerUrl),"?").concat(y.toString()),0===n.events.length)return this.completeRequest({context:r}),[2];A=this.sendTimeoutMs>0?setTimeout(function(){I.abort()},this.sendTimeoutMs):void 0,T=void 0,c.label=5;case 5:return c.trys.push([5,,10,11]),this.handleSendEvents?[4,(F=this.handleSendEvents({url:P,method:"POST",headers:E,body:O,keepalive:M}),B=I.signal,new Promise(function(e,t){var r=function(){var e=new Error("Custom session replay transport aborted by send timeout");e.name="AbortError",t(e)};B.addEventListener("abort",r,{once:!0}),F.then(function(t){B.removeEventListener("abort",r),e(t)},function(e){B.removeEventListener("abort",r),t(e)})}))]:[3,7];case 6:return N=c.sent(),[3,9];case 7:return[4,fetch(P,R)];case 8:N=c.sent(),c.label=9;case 9:return T=N,[3,11];case 10:return A&&clearTimeout(A),[7];case 11:if(null===T)return this.completeRequest({context:r,err:"Unexpected error occurred"}),[2];if(T.status>=200&&T.status<300&&(L=null!==(f=null===(p=null===(d=T.headers)||void 0===d?void 0:d.get)||void 0===p?void 0:p.call(d,Pe))&&void 0!==f?f:null,this.applyServerDirective(r.sessionId,L)),s)return[3,12];_="";try{_=JSON.stringify(T.body,null,2)}catch(e){}return this.completeRequest({context:r,success:"".concat(T.status,": ").concat(_)}),[3,18];case 12:if(_="",413!==T.status)return[3,16];c.label=13;case 13:return c.trys.push([13,15,,16]),[4,T.text()];case 14:return _=c.sent(),[3,16];case 15:return c.sent(),[3,16];case 16:return[4,this.handleReponse(T.status,r,_)];case 17:c.sent(),c.label=18;case 18:return[3,23];case 19:return D=c.sent(),!!D&&"object"==typeof D&&"AbortError"===D.name&&s?[4,this.handleOtherResponse(r)]:[3,21];case 20:return c.sent(),[3,22];case 21:this.completeRequest({context:r,err:D}),c.label=22;case 22:return[3,23];case 23:return[2]}var F,B})})},e.prototype.handleReponse=function(e,t,r){return void 0===r&&(r=""),l(this,void 0,void 0,function(){var n;return c(this,function(s){switch(s.label){case 0:switch(n=(new V).buildStatus(e),n){case p.Success:return[3,1];case p.Failed:case p.Timeout:case p.RateLimit:return[3,2];case p.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 s.sent(),[3,8];case 4:return this.handlePayloadTooLargeResponse(t,Ee.test(r)),[3,8];case 5:return 499!==e?[3,7]:[4,this.handleOtherResponse(t)];case 6:return s.sent(),[3,8];case 7:this.completeRequest({context:t,err:"Network error occurred, event batch rejected"}),s.label=8;case 8:return[2]}})})},e.prototype.handlePayloadTooLargeResponse=function(e,t){var r=t?"WAF (compressed payload too large)":"server (event too large)",n=Math.round(e.events.reduce(function(e,t){return e+t.length},0)/Re);if(t)if(1!==e.events.length){this.loggerProvider.warn("Session replay event batch rejected by ".concat(r," (").concat(e.events.length," events, ").concat(n," KB total) — splitting and retrying")),e.onComplete();var s=function(){return Promise.resolve()},i=Math.floor(e.events.length/2);this.sendEventsList(o(o({},e),{events:e.events.slice(0,i),onComplete:s})),this.sendEventsList(o(o({},e),{events:e.events.slice(i),onComplete:s}))}else this.completeRequest({context:e,err:"Session replay event dropped: single event (".concat(n," KB, 1 event) rejected by ").concat(r," — cannot split further")});else this.completeRequest({context:e,err:"Session replay event batch dropped: ".concat(r," rejected payload (").concat(e.events.length," events, ").concat(n," KB) — not retrying non-WAF 413")})},e.prototype.handleSuccessResponse=function(e){var t=Math.round(vr(e.events)/Re);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 l(this,void 0,void 0,function(){var t;return c(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:kr}),[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,s,i;if(!this.killedSessions.has(e)){if(this.killedSessions.add(e),this.killedSessions.size>256)try{for(var o=u(this.killedSessions),a=o.next();!a.done;a=o.next()){var l=a.value;this.killedSessions.delete(l);break}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}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 c=[];try{for(var h=u(this.queue),d=h.next();!d.done;d=h.next()){var p=d.value;p.sessionId===e?this.completeRequest({context:p,err:Er}):c.push(p)}}catch(e){s={error:e}}finally{try{d&&!d.done&&(i=h.return)&&i.call(h)}finally{if(s)throw s.error}}this.queue=c}},e}();const Pr=(e,t)=>t.some(t=>e instanceof t);let Ar,Tr;const Nr=new WeakMap,Lr=new WeakMap,_r=new WeakMap;let Dr={get(e,t,r){if(e instanceof IDBTransaction){if("done"===t)return Nr.get(e);if("store"===t)return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return jr(e[t])},set:(e,t,r)=>(e[t]=r,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function Fr(e){Dr=e(Dr)}function Br(e){return(Tr||(Tr=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(zr(this),t),jr(this.request)}:function(...t){return jr(e.apply(zr(this),t))}}function Ur(e){return"function"==typeof e?Br(e):(e instanceof IDBTransaction&&function(e){if(Nr.has(e))return;const t=new Promise((t,r)=>{const n=()=>{e.removeEventListener("complete",s),e.removeEventListener("error",i),e.removeEventListener("abort",i)},s=()=>{t(),n()},i=()=>{r(e.error||new DOMException("AbortError","AbortError")),n()};e.addEventListener("complete",s),e.addEventListener("error",i),e.addEventListener("abort",i)});Nr.set(e,t)}(e),Pr(e,Ar||(Ar=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,Dr):e)}function jr(e){if(e instanceof IDBRequest)return function(e){const t=new Promise((t,r)=>{const n=()=>{e.removeEventListener("success",s),e.removeEventListener("error",i)},s=()=>{t(jr(e.result)),n()},i=()=>{r(e.error),n()};e.addEventListener("success",s),e.addEventListener("error",i)});return _r.set(t,e),t}(e);if(Lr.has(e))return Lr.get(e);const t=Ur(e);return t!==e&&(Lr.set(e,t),_r.set(t,e)),t}const zr=e=>_r.get(e);function Wr(e,t,{blocked:r,upgrade:n,blocking:s,terminated:i}={}){const o=indexedDB.open(e,t),a=jr(o);return n&&o.addEventListener("upgradeneeded",e=>{n(jr(o.result),e.oldVersion,e.newVersion,jr(o.transaction),e)}),r&&o.addEventListener("blocked",e=>r(e.oldVersion,e.newVersion,e)),a.then(e=>{i&&e.addEventListener("close",()=>i()),s&&e.addEventListener("versionchange",e=>s(e.oldVersion,e.newVersion,e))}).catch(()=>{}),a}const qr=["get","getKey","getAll","getAllKeys","count"],$r=["put","add","delete","clear"],Vr=new Map;function Gr(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(Vr.get(t))return Vr.get(t);const r=t.replace(/FromIndex$/,""),n=t!==r,s=$r.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!s&&!qr.includes(r))return;const i=async function(e,...t){const i=this.transaction(e,s?"readwrite":"readonly");let o=i.store;return n&&(o=o.index(t.shift())),(await Promise.all([o[r](...t),s&&i.done]))[0]};return Vr.set(t,i),i}Fr(e=>({...e,get:(t,r,n)=>Gr(t,r)||e.get(t,r,n),has:(t,r)=>!!Gr(t,r)||e.has(t,r)}));const Hr=["continue","continuePrimaryKey","advance"],Jr={},Kr=new WeakMap,Yr=new WeakMap,Xr={get(e,t){if(!Hr.includes(t))return e[t];let r=Jr[t];return r||(r=Jr[t]=function(...e){Kr.set(this,Yr.get(this)[t](...e))}),r}};async function*Qr(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;const r=new Proxy(t,Xr);for(Yr.set(r,t),_r.set(r,zr(t));t;)yield r,t=await(Kr.get(r)||t.continue()),Kr.delete(r)}function Zr(e,t){return t===Symbol.asyncIterator&&Pr(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===t&&Pr(e,[IDBIndex,IDBObjectStore])}Fr(e=>({...e,get:(t,r,n)=>Zr(t,r)?Qr:e.get(t,r,n),has:(t,r)=>Zr(t,r)||e.has(t,r)}));var en=function(){function e(e){var t,r,n,s=this;this.minInterval=Oe,this.maxInterval=Me,this.maxPersistedEventsSize=6e6,this._timeAtLastSplit=Date.now(),this.eventsContentBytes=new WeakMap,this.sequenceContentBytes=new Map,this.shouldSplitEventsList=function(e,t){var r=s.getEventsArraySize(e),n=s.maxPersistedEventsSize-r,i=t.length>=n;return!i&&3*t.length>=n&&(i=gr(t)>=n),!!i||!!(Date.now()-s.timeAtLastSplit>s.interval&&e.length)&&(s.interval=Math.min(s.maxInterval,s.interval+s.minInterval),s._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.isPrefixOf=function(e,t){return!(t.length<e.length)&&(0===e.length||t[e.length-1]===e.tail)},e.prototype.measureContentBytes=function(e,t){if(e&&e.length===t.length&&this.isPrefixOf(e,t))return e;var r=0,n=0;e&&this.isPrefixOf(e,t)&&(r=e.contentBytes,n=e.length);for(var s=n;s<t.length;s++)r+=gr(t[s]);return{length:t.length,contentBytes:r,tail:t.length>0?t[t.length-1]:void 0}},e.prototype.getEventsContentBytes=function(e){var t=this.measureContentBytes(this.eventsContentBytes.get(e),e);return this.eventsContentBytes.set(e,t),t.contentBytes},e.prototype.getEventsArraySize=function(e){return this.getEventsContentBytes(e)+(2+Math.max(0,e.length-1)+2*e.length)},e.prototype.recallSequenceContentBytes=function(e,t){var r=this.sequenceContentBytes.get(e);r&&r.length===t.length&&this.isPrefixOf(r,t)&&this.eventsContentBytes.set(t,r)},e.prototype.rememberSequenceContentBytes=function(e,t){var r=this.measureContentBytes(this.sequenceContentBytes.get(e),t);this.sequenceContentBytes.set(e,r),this.eventsContentBytes.set(t,r)},e.prototype.forgetSequenceContentBytes=function(e){this.sequenceContentBytes.delete(e)},e}(),tn=function(e,t,r){var n;"object"==typeof(n=r)&&null!==n&&"AbortError"===n.name?e.debug(t):e.warn(t)};var rn="sessionCurrentSequence",nn="sequencesToSend",sn=5e3;function on(e,t,r){var n=setTimeout(r,t);return e.then(function(){return clearTimeout(n)},function(){return clearTimeout(n)}),function(){return clearTimeout(n)}}var an=function(e){var t,r;return e.objectStoreNames.contains(rn)||(r=e.createObjectStore(rn,{keyPath:"sessionId"})),e.objectStoreNames.contains(nn)||(t=e.createObjectStore(nn,{keyPath:"sequenceId",autoIncrement:!0})).createIndex("sessionId","sessionId"),{sequencesStore:t,currentSequenceStore:r}},ln=function(e){return l(void 0,void 0,void 0,function(){return c(this,function(t){switch(t.label){case 0:return[4,(r=Wr(e,1,{upgrade:an}),n=2e3,s="IDB openDB timed out",void 0===s&&(s="IDB operation timed out"),new Promise(function(e,t){var i=setTimeout(function(){return t(new Error("".concat(s," after ").concat(n,"ms")))},n);r.then(function(t){clearTimeout(i),e(t)},function(e){clearTimeout(i),t(e)})}))];case 1:return[2,t.sent()]}var r,n,s})})},cn=function(e){function t(t){var r,n=this;return(n=e.call(this,t)||this).consecutiveFailures=0,n.hasTriggeredFallback=!1,n.emptyFilteredCount=0,n.getSequencesToSend=function(){return l(n,void 0,void 0,function(){var e,t,r,n,s,i,o,a,l,u,h=this;return c(this,function(c){switch(c.label){case 0:e=!1,t=!1,c.label=1;case 1:return c.trys.push([1,9,,10]),r=[],(n=this.db.transaction("sequencesToSend","readwrite")).done.catch(function(r){e||t||(tn(h.loggerProvider,"".concat(Ir,": ").concat(r),r),h.recordFailure())}),s=on(n.done,sn,function(){e||t||(t=!0,tn(h.loggerProvider,"".concat(Ir,": transaction timed out")),h.recordFailure())}),[4,n.store.openCursor()];case 2:i=c.sent(),c.label=3;case 3:return i?(o=i.value,a=o.sessionId,0!==(l=o.events).length?[3,5]:(this.maybeLogEmptyFiltered("getSequencesToSend"),[4,i.delete()])):[3,8];case 4:return c.sent(),[3,6];case 5:r.push({events:l,sequenceId:i.key,sessionId:a}),c.label=6;case 6:return[4,i.continue()];case 7:return i=c.sent(),[3,3];case 8:return this.recordSuccess(),s(),[2,r];case 9:return u=c.sent(),t||(e=!0,tn(this.loggerProvider,"".concat(Ir,": ").concat(u),u),this.recordFailure()),[3,10];case 10:return[2,void 0]}})})},n.storeCurrentSequence=function(e){return l(n,void 0,void 0,function(){var t,r,n,s,i,l,u,h,d=this;return c(this,function(c){switch(c.label){case 0:t=!1,r=!1,c.label=1;case 1:return c.trys.push([1,5,,6]),(n=this.db.transaction([rn,nn],"readwrite")).done.catch(function(e){t||r||(tn(d.loggerProvider,"".concat(Ir,": ").concat(e),e),d.recordFailure())}),s=on(n.done,sn,function(){t||r||(r=!0,tn(d.loggerProvider,"".concat(Ir,": transaction timed out")),d.recordFailure())}),[4,n.objectStore(rn).get(e)];case 2:return!(i=c.sent())||i.tabId&&i.tabId!==this.tabId?(s(),[2,void 0]):0===i.events.length?(this.maybeLogEmptyFiltered("storeCurrentSequence"),s(),[2,void 0]):[4,n.objectStore(nn).put({sessionId:e,events:i.events,tabId:this.tabId})];case 3:return l=c.sent(),[4,n.objectStore(rn).put({sessionId:e,events:[],tabId:this.tabId})];case 4:return c.sent(),this.rememberSequenceContentBytes(e,[]),this.recordSuccess(),s(),i.tabId,u=a(i,["tabId"]),[2,o(o({},u),{sessionId:e,sequenceId:l})];case 5:return h=c.sent(),this.forgetSequenceContentBytes(e),r||(t=!0,tn(this.loggerProvider,"".concat(Ir,": ").concat(h),h),this.recordFailure()),[3,6];case 6:return[2,void 0]}})})},n.addEventToCurrentSequence=function(e,t){return l(n,void 0,void 0,function(){var r,n,s,i,o,a,l,u,h,d,p,f,m,g,v=this;return c(this,function(c){switch(c.label){case 0:r=!1,n=!1,c.label=1;case 1:return c.trys.push([1,15,,16]),(s=this.db.transaction([rn,nn],"readwrite")).done.catch(function(e){r||n||(tn(v.loggerProvider,"".concat(Ir,": ").concat(e),e),v.recordFailure())}),i=on(s.done,sn,function(){r||n||(n=!0,tn(v.loggerProvider,"".concat(Ir,": transaction timed out")),v.recordFailure())}),[4,s.objectStore(rn).get(e)];case 2:return(null==(o=c.sent())?void 0:o.tabId)&&o.tabId!==this.tabId?o.events.length>0?[4,s.objectStore(nn).put({sessionId:e,events:o.events,tabId:o.tabId})]:[3,4]:[3,6];case 3:c.sent(),c.label=4;case 4:return a=[t],[4,s.objectStore(rn).put({sessionId:e,events:a,tabId:this.tabId})];case 5:return c.sent(),this.rememberSequenceContentBytes(e,a),this.recordSuccess(),i(),[2,void 0];case 6:return(l=o)?[3,8]:(u=[t],[4,s.objectStore(rn).put({sessionId:e,events:u,tabId:this.tabId})]);case 7:return c.sent(),this.rememberSequenceContentBytes(e,u),this.recordSuccess(),i(),[2,void 0];case 8:return this.recallSequenceContentBytes(e,l.events),this.shouldSplitEventsList(l.events,t)?[3,10]:(h=l.events.concat(t),[4,s.objectStore(rn).put({sessionId:e,events:h,tabId:this.tabId})]);case 9:return c.sent(),this.rememberSequenceContentBytes(e,h),this.recordSuccess(),i(),[2,void 0];case 10:return 0!==(d=l.events).length?[3,12]:(this.maybeLogEmptyFiltered("addEventToCurrentSequence"),p=[t],[4,s.objectStore(rn).put({sessionId:e,events:p,tabId:this.tabId})]);case 11:return c.sent(),this.rememberSequenceContentBytes(e,p),this.recordSuccess(),i(),[2,void 0];case 12:return f=[t],[4,s.objectStore(rn).put({sessionId:e,events:f,tabId:this.tabId})];case 13:return c.sent(),this.rememberSequenceContentBytes(e,f),[4,s.objectStore(nn).put({sessionId:e,events:d,tabId:this.tabId})];case 14:return m=c.sent(),this.recordSuccess(),i(),[2,{events:d,sessionId:e,sequenceId:m}];case 15:return g=c.sent(),this.forgetSequenceContentBytes(e),n||(r=!0,tn(this.loggerProvider,"".concat(Ir,": ").concat(g),g),this.recordFailure()),[3,16];case 16:return[2,void 0]}})})},n.storeSendingEvents=function(e,t){return l(n,void 0,void 0,function(){var r,n;return c(this,function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),[4,this.db.put(nn,{sessionId:e,events:t,tabId:this.tabId})];case 1:return r=s.sent(),this.recordSuccess(),[2,r];case 2:return n=s.sent(),tn(this.loggerProvider,"".concat(Ir,": ").concat(n),n),this.recordFailure(),[3,3];case 3:return[2,void 0]}})})},n.cleanUpSessionEventsStore=function(e,t){return l(n,void 0,void 0,function(){var e;return c(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(nn,t)];case 2:return r.sent(),this.recordSuccess(),[3,4];case 3:return e=r.sent(),tn(this.loggerProvider,"".concat(Ir,": ").concat(e),e),this.recordFailure(),[3,4];case 4:return[2]}})})},n.db=t.db,n.tabId=t.tabId,n.onPersistentFailure=t.onPersistentFailure,n.consecutiveFailureThreshold=null!==(r=t.consecutiveFailureThreshold)&&void 0!==r?r:1,n}return n(t,e),t.prototype.maybeLogEmptyFiltered=function(e){this.emptyFilteredCount++%100==0&&this.loggerProvider.debug("Filtered empty session replay sequence at ".concat(e," (idb store)"))},t.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))},t.prototype.recordSuccess=function(){this.consecutiveFailures=0},t.new=function(e,r){var n;return l(this,void 0,void 0,function(){var s,i,a,l,u;return c(this,function(c){switch(c.label){case 0:return c.trys.push([0,2,,3]),s="replay"===e?"":"_".concat(e),i="".concat(r.apiKey.substring(0,10),"_amp_session_replay_events").concat(s),[4,ln(i)];case 1:return a=c.sent(),l=null!==(n=r.tabId)&&void 0!==n?n: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 t(o(o({},r),{db:a,tabId:l}))];case 2:return u=c.sent(),tn(r.loggerProvider,"".concat(Ir,": ").concat(u),u),[3,3];case 3:return[2]}})})},t.prototype.getCurrentSequenceEvents=function(e){return l(this,void 0,void 0,function(){var t,r,n,s,i,o,l,h;return c(this,function(c){switch(c.label){case 0:return e?[4,this.db.get("sessionCurrentSequence",e)]:[3,2];case 1:return(s=c.sent())?s.tabId&&s.tabId!==this.tabId?[2,void 0]:(s.tabId,[2,[i=a(s,["tabId"])]]):[2,void 0];case 2:t=[],c.label=3;case 3:return c.trys.push([3,8,9,10]),[4,this.db.getAll("sessionCurrentSequence")];case 4:r=u.apply(void 0,[c.sent()]),n=r.next(),c.label=5;case 5:if(n.done)return[3,7];if((s=n.value).tabId&&s.tabId!==this.tabId)return[3,6];s.tabId,i=a(s,["tabId"]),t.push(i),c.label=6;case 6:return n=r.next(),[3,5];case 7:return[3,10];case 8:return o=c.sent(),l={error:o},[3,10];case 9:try{n&&!n.done&&(h=r.return)&&h.call(r)}finally{if(l)throw l.error}return[7];case 10:return[2,t]}})})},t}(en),un=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 n(t,e),t.prototype.resetCurrentSequence=function(e){this.sequences[e]=[]},t.prototype.addSequence=function(e){var t=this.sequenceId++,r=d([],h(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 l(this,void 0,void 0,function(){var e,t,r,n,s,i,o,a,l,d;return c(this,function(c){e=[];try{for(t=u(Object.entries(this.finalizedSequences)),r=t.next();!r.done;r=t.next())n=h(r.value,2),s=n[0],i=n[1],o=i.sessionId,0!==(a=i.events).length?e.push({sequenceId:Number(s),sessionId:o,events:a}):(this.maybeLogEmptyFiltered("getSequencesToSend"),delete this.finalizedSequences[Number(s)])}catch(e){l={error:e}}finally{try{r&&!r.done&&(d=t.return)&&d.call(t)}finally{if(l)throw l.error}}return[2,e]})})},t.prototype.storeCurrentSequence=function(e){return l(this,void 0,void 0,function(){var t;return c(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 l(this,void 0,void 0,function(){var r;return c(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 l(this,void 0,void 0,function(){return c(this,function(r){return this.finalizedSequences[this.sequenceId]={sessionId:e,events:t},[2,this.sequenceId++]})})},t.prototype.cleanUpSessionEventsStore=function(e,t){return l(this,void 0,void 0,function(){return c(this,function(e){return void 0!==t&&delete this.finalizedSequences[t],[2]})})},t}(en),hn=function(e){var t=e.config,r=e.minInterval,n=e.maxInterval,s=e.maxPersistedEventsSize,i=e.type,a=e.payloadBatcher,u=e.storeType,p=e.trackDestinationWorkerScript,f=e.shouldSend;return l(void 0,void 0,void 0,function(){function e(e){return void 0===e&&(e=!1),l(this,void 0,void 0,function(){return c(this,function(t){return[2,g.flush(e)]})})}var m,g,v,y,b,w,S,C,x,k,I,E,O,M,R,P,A;return c(this,function(T){switch(T.label){case 0:return m=null!==(A=t.maxSingleEventSizeBytes)&&void 0!==A?A:Ie,g=new Rr(o(o({},t),{loggerProvider:t.loggerProvider,payloadBatcher:a,workerScript:p})),v=function(){return new un({loggerProvider:t.loggerProvider,maxInterval:n,minInterval:r,maxPersistedEventsSize:s})},b=!1,S=function(){return l(void 0,void 0,void 0,function(){var e,r,n;return c(this,function(s){switch(s.label){case 0:return b?(b=!1,t.loggerProvider.warn("IDB store is experiencing repeated failures; falling back to in-memory event store."),y?[4,w.getSequencesToSend()]:[3,2]):[2];case 1:return r=s.sent(),[3,3];case 2:r=void 0,s.label=3;case 3:return e=r,w=v(),e&&y&&(n=y,e.forEach(function(e){O({sequenceId:e.sequenceId,events:e.events,sessionId:e.sessionId,deviceId:n})})),[2]}})})},C=function(){return l(void 0,void 0,void 0,function(){var e;return c(this,function(o){switch(o.label){case 0:return[4,cn.new(i,{loggerProvider:t.loggerProvider,minInterval:r,maxInterval:n,maxPersistedEventsSize:s,apiKey:t.apiKey,onPersistentFailure:function(){S()}})];case 1:return(e=o.sent())?(b=!0,[2,e]):(t.loggerProvider.log("Failed to initialize idb store, falling back to memory store."),[2,v()])}})})},"idb"!==u?[3,2]:[4,C()];case 1:return x=T.sent(),[3,3];case 2:x=v(),T.label=3;case 3:return w=x,k=[],I=0,E=function(e){if(!(e<=I)){var t=Math.min(e-I,k.length);t>0&&(k.splice(0,t),I=e)}},O=function(e){for(var r=e.events,n=e.sessionId,s=e.deviceId,o=e.sequenceId,a=r,u=[],h=0;h<r.length;h++){var d=yr(r[h],m);void 0!==d?(0===u.length&&(a=r.slice(0,h)),u.push(d)):a!==r&&a.push(r[h])}u.length>0&&t.loggerProvider.warn("Dropping ".concat(u.length," oversized event(s) from session replay sequence before send. Sizes: ").concat(u.map(function(e){return"".concat(Math.round(e/1024)," KB")}).join(", "),". If this recurs, please open a GitHub issue at https://github.com/amplitude/Amplitude-TypeScript/issues or contact Amplitude support.")),0!==a.length?(t.debugMode&&He().then(function(e){var r=e.totalStorageSize,n=e.percentOfQuota,s=e.usageDetails;t.loggerProvider.debug("Total storage size: ".concat(r," KB, percentage of quota: ").concat(n,"%, usage details: ").concat(s))}).catch(function(){}),g.sendEventsList({events:a,sessionId:n,flushMaxRetries:t.flushMaxRetries,apiKey:t.apiKey,deviceId:s,sampleRate:t.sampleRate,serverZone:t.serverZone,version:t.version,type:i,onComplete:function(){return l(void 0,void 0,void 0,function(){return c(this,function(e){switch(e.label){case 0:return[4,w.cleanUpSessionEventsStore(n,o)];case 1:return e.sent(),[2]}})})}})):w.cleanUpSessionEventsStore(n,o).catch(function(e){t.loggerProvider.warn("Failed to clean up session replay events store:",e)})},M=function(e){var r=e.sessionId,n=e.deviceId;if(y=n,!f||f()){var s=I+k.length;w.storeCurrentSequence(r).then(function(e){e&&(E(s),O({sequenceId:e.sequenceId,events:e.events,sessionId:e.sessionId,deviceId:n}))}).catch(function(e){t.loggerProvider.warn("Failed to get current sequence of session replay events for session:",e)})}},R=function(e){var r=e.deviceId;return l(void 0,void 0,void 0,function(){var e;return c(this,function(n){switch(n.label){case 0:return y=r,[4,w.getSequencesToSend()];case 1:return(null==(e=n.sent())?void 0:e.length)?(t.loggerProvider.log("Draining ".concat(e.length," stored sequence(s) from previous session.")),e.length>1&&g.markCoalesceNextFlush(),e.forEach(function(e){O({sequenceId:e.sequenceId,events:e.events,sessionId:e.sessionId,deviceId:r})}),[2]):[2]}})})},P=function(e){var r=e.event,n=e.sessionId,s=e.deviceId;y=s;var i=!f||f(),o=I+k.length;k.push(r.data),w.addEventToCurrentSequence(n,r.data).then(function(e){if(e){if(!i)return w.cleanUpSessionEventsStore(e.sessionId,e.sequenceId).catch(function(e){t.loggerProvider.warn("Failed to clean up dropped session replay sequence:",e)}),void E(o);E(o),O({sequenceId:e.sequenceId,events:e.events,sessionId:e.sessionId,deviceId:s})}}).catch(function(e){t.loggerProvider.warn("Failed to add event to session replay capture:",e)})},[2,{sendCurrentSequenceEvents:M,addEvent:P,sendStoredEvents:R,flush:e,getBeaconEvents:function(){return d([],h(k),!1)},dropPendingBeaconEvents:function(){E(I+k.length)},trackDestination:g}]}})})},dn=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 l(this,void 0,void 0,function(){var t;return c(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,s=e.deviceId;null===(t=this.managers.get(n.type))||void 0===t||t.addEvent({sessionId:r,event:n,deviceId:s})},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 l(this,void 0,void 0,function(){var t;return c(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}(),pn=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}},fn=function(e){var t=e.version,r=e.events,n=[];r.forEach(function(e){var t=JSON.parse(e);"click"===t.type&&n.push(t)});var s=n.reduce(function(e,t){var r=t.x,n=t.y,s=t.selector,i=t.timestamp,a=i-i%36e5,l="".concat(r,":").concat(n,":").concat(null!=s?s:"",":").concat(a);return e[l]?e[l].count+=1:e[l]=o(o({},t),{timestamp:a,count:1}),e},{});return{version:t,events:Object.values(s)}},mn=function(){function e(e,t){var r=this;this.createHook=function(e){var t=e.eventsManager,n=e.sessionId,s=e.deviceIdFn,i=e.mirror,o=e.ugcFilterRules,a=e.performanceOptions;return function(e){var l,c,u,h,d;if(e.type===Jt.Click){var p=g();if(p){var f=p.location,m=p.innerHeight,v=p.innerWidth;if(f){var y=e.x,b=e.y;if(void 0!==y&&void 0!==b){var w,S=i.getNode(e.id);if(S)try{w=null!==(l=r.getSelector(S,a))&&void 0!==l?l:void 0}catch(e){r.logger.debug("error resolving selector from finder")}var C=Ge(f.href,o),x={x:y+(null!==(u=null===(c=r.scrollWatcher)||void 0===c?void 0:c.currentScrollX)&&void 0!==u?u:0),y:b+(null!==(d=null===(h=r.scrollWatcher)||void 0===h?void 0:h.currentScrollY)&&void 0!==d?d:0),selector:w,viewportHeight:m,viewportWidth:v,pageUrl:C,timestamp:Date.now(),type:"click"},k=s();k&&t.addEvent({sessionId:n,event:{type:"interaction",data:JSON.stringify(x)},deviceId:k})}}}}}},this.logger=e,this.scrollWatcher=t}return e.prototype.getSelector=function(e,t){var r,n,s;if(null===(r=this.clickSelectors)||void 0===r?void 0:r.has(e))return null!==(n=this.clickSelectors.get(e))&&void 0!==n?n:null;var i=Zt(e,t);return null===(s=this.clickSelectors)||void 0===s||s.set(e,i),i},e.prototype.createSharedHook=function(e,t){var r=this;return function(n,s){if(n.type===Jt.Click){var i=r.clickSelectors;r.clickSelectors=new Map;try{try{null==e||e(n)}catch(e){r.logger.debug("Heatmap click hook failed",e)}if("click"===(null==s?void 0:s.type))try{null==t||t(s)}catch(e){r.logger.debug("Semantic click hook failed",e)}}finally{r.clickSelectors=i}}}},e}();function gn(){var e=g();return(null==e?void 0:e.innerHeight)||document.documentElement&&document.documentElement.clientHeight||0}function vn(){var e=g();return(null==e?void 0:e.innerWidth)||document.documentElement&&document.documentElement.clientWidth||0}var yn=function(){function e(e,t){var r=g();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=$e(t.serverZone,t.trackServerUrl),this.apiKey=t.apiKey,this.context=e,this.handleSendEvents=t.handleSendEvents,this.loggerProvider=t.loggerProvider}return e.prototype.send=function(e,t){var r,n=this,s=this.context,i=s.sessionId,o=s.type;if(this.handleSendEvents){var a=new URLSearchParams({device_id:e,session_id:String(i),type:String(o)}),l="".concat(this.basePageUrl,"?").concat(a.toString()),c={"Content-Type":"application/json",Accept:"*/*",Authorization:"Bearer ".concat(this.apiKey)};try{this.handleSendEvents({url:l,method:"POST",headers:c,body:JSON.stringify(t),keepalive:!0}).catch(function(e){var t;null===(t=n.loggerProvider)||void 0===t||t.warn("Custom transport failed to send session replay interaction beacon:",e)})}catch(e){null===(r=this.loggerProvider)||void 0===r||r.warn("Custom transport threw while sending session replay interaction beacon:",e)}}else{var u=new URLSearchParams({device_id:e,session_id:String(i),type:String(o),api_key:this.apiKey}),h="".concat(this.basePageUrl,"?").concat(u.toString());this.sendBeacon(h,t)||this.sendXhr(h,t)}},e}(),bn=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,s,i,o,a=e(),l=g();if(l&&a){var c=null!==(n=l.scrollX)&&void 0!==n?n:0,u=null!==(s=l.scrollY)&&void 0!==s?s:0;(c>0||u>0)&&r.update({id:1,x:c,y:u}),r.transport.send(a,{version:1,events:[{maxScrollX:r._maxScrollX,maxScrollY:r._maxScrollY,maxScrollWidth:r._maxScrollWidth,maxScrollHeight:r._maxScrollHeight,viewportHeight:gn(),viewportWidth:vn(),pageUrl:Ge(l.location.href,null!==(o=null===(i=r.config.interactionConfig)||void 0===i?void 0:i.ugcFilterRules)&&void 0!==o?o:[]),timestamp:r.timestamp,type:"scroll"}]})}}},this._maxScrollX=0,this._maxScrollY=0,this._currentScrollX=0,this._currentScrollY=0,this._maxScrollWidth=vn(),this._maxScrollHeight=gn(),this.config=t,this.transport=e}return e.default=function(t,r){return new e(new yn(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=vn();this._maxScrollX=e.x;var n=e.x+r;n>this._maxScrollWidth&&(this._maxScrollWidth=n),this.timestamp=t}if(e.y>this._maxScrollY){var s=gn();this._maxScrollY=e.y;var i=e.y+s;i>this._maxScrollHeight&&(this._maxScrollHeight=i),this.timestamp=t}},e}(),wn=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))},Sn=864e5,Cn=function(e){return"".concat("AMP_SR_START_").concat(e.substring(0,10),"_")},xn=function(e,t){return"".concat(Cn(e)).concat(t)},kn=function(){try{var e=g();return null==e?void 0:e.localStorage}catch(e){return}},In=function(){var e=this;this.dbs={},this.createStore=function(t){return l(e,void 0,void 0,function(){return c(this,function(e){switch(e.label){case 0:return[4,Wr(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 l(e,void 0,void 0,function(){var e,r;return c(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,s=t.sessionId;return l(e,void 0,void 0,function(){var e,t,i,o;return c(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(s),[4,e.get("sessionTargetingMatch",t)];case 2:return[2,null==(i=a.sent())?void 0:i.targetingMatch];case 3:return o=a.sent(),tn(r,"Failed to get targeting match for session id ".concat(s,": ").concat(o),o),[3,4];case 4:return[2,void 0]}})})},this.storeTargetingMatchForSession=function(t){var r=t.loggerProvider,n=t.apiKey,s=t.sessionId,i=t.targetingMatch;return l(e,void 0,void 0,function(){var e,t,o;return c(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(s),[4,e.put("sessionTargetingMatch",{targetingMatch:i,sessionId:t,lastUpdated:Date.now()})];case 2:return[2,a.sent()];case 3:return o=a.sent(),tn(r,"Failed to store targeting match for session id ".concat(s,": ").concat(o),o),[3,4];case 4:return[2,void 0]}})})},this.clearStoreOfOldSessions=function(t){var r=t.loggerProvider,n=t.apiKey,s=t.currentSessionId;return l(e,void 0,void 0,function(){var e,t,i,o,a,l,u,h;return c(this,function(c){switch(c.label){case 0:return c.trys.push([0,8,,9]),[4,this.openOrCreateDB(n)];case 1:return e=c.sent(),t=String(s),[4,(i=e.transaction("sessionTargetingMatch","readwrite")).store.getAll()];case 2:o=c.sent(),a=0,c.label=3;case 3:return a<o.length?(l=o[a],u=Date.now()-l.lastUpdated,l.sessionId!==t&&u>1728e5?[4,i.store.delete(l.sessionId)]:[3,5]):[3,6];case 4:c.sent(),c.label=5;case 5:return a++,[3,3];case 6:return[4,i.done];case 7:return c.sent(),[3,9];case 8:return h=c.sent(),tn(r,"Failed to clear old targeting matches for sessions: ".concat(h),h),[3,9];case 9:return[2]}})})}},En=new In,On=function(e){var t=e.sessionId,r=e.targetingConfig,n=e.loggerProvider,s=e.apiKey,i=e.targetingParams,a=e.urlChange,u=void 0!==a&&a;return l(void 0,void 0,void 0,function(){var e,a,l,h,d,p;return c(this,function(c){switch(c.label){case 0:return[4,En.clearStoreOfOldSessions({loggerProvider:n,apiKey:s,currentSessionId:t})];case 1:return c.sent(),[4,En.getTargetingMatchForSession({loggerProvider:n,apiKey:s,sessionId:t})];case 2:if(!0===c.sent()&&!u)return[2,!0];e=!0,c.label=3;case 3:return c.trys.push([3,6,,7]),[4,Promise.resolve().then(function(){return Gs})];case 4:return a=c.sent().evaluateTargeting,l=o(o({},i),{flag:r,sessionId:"string"==typeof t?parseInt(t,10):t,apiKey:s,loggerProvider:n}),[4,a(l)];case 5:return(h=c.sent())&&h.sr_targeting_config&&(e="on"===h.sr_targeting_config.key),En.storeTargetingMatchForSession({loggerProvider:n,apiKey:s,sessionId:t,targetingMatch:e}),[3,7];case 6:return d=c.sent(),p=d,n.warn(p.message),[3,7];case 7:return[2,e]}})})},Mn=2654435761,Rn=2246822519,Pn=3266489917,An=374761393;function Tn(e,t){return(e<<t|e>>>32-t)>>>0}function Nn(e,t){return e=Tn(e=e+Math.imul(t,Rn)>>>0,13),e=Math.imul(e,Mn)>>>0}function Ln(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function _n(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 s=e.charCodeAt(r+1);s>=56320&&s<=57343&&(n=s-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),s=n.length,i=0;if(s>=16){for(var o=t+Mn+Rn>>>0,a=t+Rn>>>0,l=t>>>0,c=t-Mn>>>0;i<=s-16;)o=Nn(o,Ln(n,i)),a=Nn(a,Ln(n,i+=4)),l=Nn(l,Ln(n,i+=4)),c=Nn(c,Ln(n,i+=4)),i+=4;r=Tn(o,1)+Tn(a,7)+Tn(l,12)+Tn(c,18)>>>0}else r=t+An>>>0;for(r=r+s>>>0;i<=s-4;)r=r+Math.imul(Ln(n,i),Pn)>>>0,r=Math.imul(Tn(r,17),668265263)>>>0,i+=4;for(;i<s;)r=r+Math.imul(n[i],An)>>>0,r=Math.imul(Tn(r,11),Mn)>>>0,i++;return r^=r>>>15,r=Math.imul(r,Rn)>>>0,r^=r>>>13,r=Math.imul(r,Pn)>>>0,(r^=r>>>16)>>>0}var Dn="__amplitude_url_tracking_patched__",Fn=new WeakMap;function Bn(e,t,r){if(void 0===r&&(r={}),!(null==e?void 0:e.location))return function(){};var n=r.enablePolling,s=void 0!==n&&n,i=r.pollingInterval,o=void 0===i?we:i;if(s){var a=function(){var t;return null!==(t=e.location.href)&&void 0!==t?t:""},l=a(),c=e.setInterval(function(){var e,n=a();n!==l&&(l=n,t(n),null===(e=r.onNavigation)||void 0===e||e.call(r,"replace"))},o);return function(){null!=c&&e.clearInterval(c)}}var u=Fn.get(e);if(!u){var h=void 0,d=new Set,p=function(t){var r=function(){var t;return null!==(t=e.location.href)&&void 0!==t?t:""}();void 0!==h&&r===h||(h=r,d.forEach(function(e){return e(r,t)}))},f=function(e,t){var r=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var s=e.apply(this,r);return p(t),s};return r[Dn]=!0,r},m=e.history;if(null==m?void 0:m.pushState){var g=Reflect.get(m,"pushState");g[Dn]||(m.pushState=f(g,"push"))}if(null==m?void 0:m.replaceState){var v=Reflect.get(m,"replaceState");v[Dn]||(m.replaceState=f(v,"replace"))}u={callbacks:d,notify:p,onPopStateOrHashChange:function(e){return p("hashchange"===(null==e?void 0:e.type)?"hash":"pop")},listenersAttached:!1},Fn.set(e,u)}var y=u;y.listenersAttached||(e.addEventListener("popstate",y.onPopStateOrHashChange),e.addEventListener("hashchange",y.onPopStateOrHashChange),y.listenersAttached=!0);var b=function(e,n){var s;t(e),null===(s=r.onNavigation)||void 0===s||s.call(r,n)};return y.callbacks.add(b),function(){y.callbacks.delete(b),0===y.callbacks.size&&y.listenersAttached&&(e.removeEventListener("popstate",y.onPopStateOrHashChange),e.removeEventListener("hashchange",y.onPopStateOrHashChange),y.listenersAttached=!1)}}function Un(e){return void 0===e&&(e={}),{name:"amplitude/url-tracking@1",observer:function(t,r,n){var s,i,a,l=o(o({},e),n),c=l.ugcFilterRules||[],u=null!==(s=l.enablePolling)&&void 0!==s&&s,h=null!==(i=l.pollingInterval)&&void 0!==i?i:we,d=null!==(a=l.captureDocumentTitle)&&void 0!==a&&a;if(!r)return function(){};var p=void 0,f=function(){return r.location&&r.location.href||""},m=function(){var e=f();if(void 0===p||e!==p){p=e;var n=function(){var e=r.innerHeight,t=r.innerWidth,n=r.document,s=f(),i="";return d&&(i=(null==n?void 0:n.title)||""),{href:c.length>0?Ge(s,c):s,title:i,viewportHeight:e,viewportWidth:t,type:"url-change-event"}}();t(n)}},g=Bn(r,function(){return m()},u?{enablePolling:!0,pollingInterval:h}:{});return m(),function(){return g()}},options:e}}Un();var jn=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(),g()&&(this.sendToAllIframes({type:Ae,action:"start"}),this.mutationObserver=new MutationObserver(function(e){var r,n,s,i,o,a;try{for(var l=u(e),c=l.next();!c.done;c=l.next()){var h=c.value;try{for(var d=(s=void 0,u(Array.from(h.addedNodes))),p=d.next();!p.done;p=d.next()){(g=p.value)instanceof HTMLIFrameElement?t.sendToIframeAfterLoad(g):g instanceof Element&&g.querySelectorAll("iframe").forEach(function(e){t.sendToIframeAfterLoad(e)})}}catch(e){s={error:e}}finally{try{p&&!p.done&&(i=d.return)&&i.call(d)}finally{if(s)throw s.error}}try{for(var f=(o=void 0,u(Array.from(h.removedNodes))),m=f.next();!m.done;m=f.next()){var g;if((g=m.value)instanceof HTMLIFrameElement){var v=t.pendingLoadListeners.get(g);v&&(g.removeEventListener("load",v),t.pendingLoadListeners.delete(g))}}}catch(e){o={error:e}}finally{try{m&&!m.done&&(a=f.return)&&a.call(f)}finally{if(o)throw o.error}}}}catch(e){r={error:e}}finally{try{c&&!c.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:Ae,action:"stop"})},e.prototype.sendToIframeAfterLoad=function(e){var t=this,r=function(){t.pendingLoadListeners.delete(e),t.sendToIframe(e,{type:Ae,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 zn,Wn,qn,$n=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.recordingEnabled=!0,this.recordingGeneration=0,this.startChildRecordingOnSetup=!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=g();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(){var t;if(e.recordingEnabled)if(e.recordCancelCallback&&e.recordFunction){if(!1===(null===(t=e.config)||void 0===t?void 0:t.captureFullSnapshotOnFocus))return;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,s){return void 0===r&&(r=!1),void 0===n&&(n=!1),void 0===s&&(s=!1),l(e,void 0,void 0,function(){var e,o,a,l,u,h,d,p,f,m,v,y;return c(this,function(c){switch(c.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=s?this.latestUrlChangeTargetingEvaluationId:void 0,(a=t.event)&&Object.values(i).includes(a.event_type)&&(a=void 0),l=null!==(v=null!==(p=null===(d=t.page)||void 0===d?void 0:d.url)&&void 0!==p?p:null===(m=null===(f=g())||void 0===f?void 0:f.location)||void 0===m?void 0:m.href)&&void 0!==v?v:"",u=null!==(y=t.page)&&void 0!==y?y:""!==l?{url:l}:void 0,[4,On({sessionId:this.identifiers.sessionId,targetingConfig:e,loggerProvider:this.loggerProvider,apiKey:this.config.apiKey,targetingParams:{userProperties:t.userProperties,event:a,page:u},urlChange:s})]):[3,2];case 1:if(h=c.sent(),s&&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||h,this.loggerProvider.debug(JSON.stringify({name:"targeted replay capture config",sessionTargetingMatch:this.sessionTargetingMatch,event:a,targetingParams:t},null,2)),c.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:c.sent(),c.label=5;case 5:return[2]}})})},this.addCustomRRWebEvent=function(t,r,n){return void 0===r&&(r={}),void 0===n&&(n=!0),l(e,void 0,void 0,function(){var e,s,i,a;return c(this,function(l){switch(l.label){case 0:return l.trys.push([0,3,,4]),e=void 0,(s=this.config)&&t!==me.METADATA?(e={config:Je(s),version:Or},n?[4,He()]:[3,2]):[3,2];case 1:i=l.sent(),e=o(o({},i),e),l.label=2;case 2:return this.recordCancelCallback&&this.recordFunction?this.recordFunction.addCustomEvent(t,o(o({},r),e)):this.loggerProvider.debug("Not able to add custom replay capture event ".concat(t," 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(t,r){var n,s,i,o;void 0===t&&(t="targeting"),void 0===r&&(r="stop");try{null===(n=e.semanticAdapter)||void 0===n||n.stop(t,r),e.loggerProvider.log("Session Replay capture stopping."),e.recordCancelCallback&&e.recordCancelCallback(),e.recordCancelCallback=null,null===(s=e.networkObservers)||void 0===s||s.stop(),null===(i=e.crossOriginIframeCoordinator)||void 0===i||i.stop(),e.crossOriginIframeCoordinator=null,null===(o=e.crossOriginParentSignalCleanup)||void 0===o||o.call(e),e.crossOriginParentSignalCleanup=null}catch(t){var a=t;e.loggerProvider.warn("Error occurred while stopping replay capture: ".concat(a.toString()))}},this.loggerProvider=new Te(new R)}return e.prototype.init=function(e,t){return O(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=g();if(null==n?void 0:n.location){var s=!!(null===(t=this.config)||void 0===t?void 0:t.targetingConfig),i=Bn(n,function(e){if(r.currentPageUrl=e,s){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(){i(),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=g())||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,t){var r,n,s,i,a,p,f,m,v,y,b,w,S,C,x;return l(this,void 0,void 0,function(){var l,k,I,E,O,M,P,A,T,N,L,_,D,F,B,U,j,z,W,q,$,V,G,H,J,K,Y,X,Q,Z,ee,te=this;return c(this,function(c){switch(c.label){case 0:return null===(r=this.urlChangeCleanup)||void 0===r||r.call(this),null===(n=this.semanticAdapter)||void 0===n||n.stop("customer_stop"),this.semanticAdapter=void 0,this.recordingEnabled=!0,this.startChildRecordingOnSetup=!1,this.loggerProvider=new Te(t.loggerProvider||new R),Object.prototype.hasOwnProperty.call(t,"logLevel")&&this.loggerProvider.enable(t.logLevel),this.currentPageUrl=Ve(),this.identifiers=new wn({sessionId:t.sessionId,deviceId:t.deviceId}),l=Date.now(),function(e,t,r){var n,s,i=kn();if(i){var o=Cn(e);try{for(var a=[],l=0;l<i.length;l++)if((f=i.key(l))&&f.startsWith(o)){var c=i.getItem(f);if(null!==c){var h=Number(c);(!Number.isFinite(h)||h<=0||t-h>=Sn)&&a.push(f)}}try{for(var d=u(a),p=d.next();!p.done;p=d.next()){var f=p.value;i.removeItem(f)}}catch(e){n={error:e}}finally{try{p&&!p.done&&(s=d.return)&&s.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,l,this.loggerProvider),this.sessionStartTime=void 0!==t.sessionId&&null!==(s=function(e,t,r,n){var s=kn();if(s){var i=xn(e,t);try{var o=s.getItem(i);if(null!==o){var a=Number(o);if(Number.isFinite(a)&&a>0&&a<=r&&r-a<Sn)return a}return s.setItem(i,String(r)),r}catch(e){return void(null==n||n.debug("Failed to read/write replay start time from storage: ".concat(String(e))))}}}(e,t.sessionId,l,this.loggerProvider))&&void 0!==s?s:l,k=this,[4,mr(e,t)];case 1:return k.joinedConfigGenerator=c.sent(),[4,this.joinedConfigGenerator.generateJoinedConfig()];case 2:return I=c.sent(),E=I.joinedConfig,O=I.localConfig,M=I.remoteConfig,this.config=E,this.setMetadata(t.sessionId,E,O,M,null===(i=t.version)||void 0===i?void 0:i.version,Or,null===(a=t.version)||void 0===a?void 0:a.type),this.pageLeaveFns=[],t.sessionId&&(null===(p=this.config.interactionConfig)||void 0===p?void 0:p.enabled)&&(P=bn.default({sessionId:t.sessionId,type:"interaction"},this.config),this.pageLeaveFns=[P.send(this.getDeviceId.bind(this)).bind(P)],this.scrollHook=P.hook.bind(P),this.clickHandler=new mn(this.loggerProvider,P)),A=[],"idb"!==(T=this.config.storeType)||(null===(f=g())||void 0===f?void 0:f.indexedDB)||(T="memory",this.loggerProvider.warn("Could not use preferred indexedDB storage, reverting to in memory option.")),this.loggerProvider.log("Using ".concat(T," for event storage.")),_=g(),this.config.useWebWorker&&_&&_.Worker?[4,Promise.resolve().then(function(){return Hs})]:[3,4];case 3:D=c.sent(),F=D.compressionScript,B=D.trackDestinationScript,N=F,L=B,c.label=4;case 4:return c.trys.push([4,6,,7]),[4,hn({config:this.config,type:"replay",minInterval:null===(m=this.config.flushIntervalConfig)||void 0===m?void 0:m.minIntervalMs,maxInterval:null===(v=this.config.flushIntervalConfig)||void 0===v?void 0:v.maxIntervalMs,maxPersistedEventsSize:this.config.maxPersistedEventsSizeBytes,storeType:T,trackDestinationWorkerScript:L,shouldSend:function(){return!te.isBelowMinSessionDuration()}})];case 5:return U=c.sent(),this.rrwebEventManager=U,A.push({name:"replay",manager:U}),[3,7];case 6:return j=c.sent(),$=j,this.loggerProvider.warn("Error occurred while creating replay events manager: ".concat($.toString())),[3,7];case 7:if(!(null===(y=this.config.interactionConfig)||void 0===y?void 0:y.enabled))return[3,11];z=this.config.interactionConfig.batch?fn:pn,c.label=8;case 8:return c.trys.push([8,10,,11]),[4,hn({config:this.config,type:"interaction",minInterval:null!==(b=this.config.interactionConfig.trackEveryNms)&&void 0!==b?b:3e4,maxInterval:6e4,maxPersistedEventsSize:this.config.maxPersistedEventsSizeBytes,payloadBatcher:z,storeType:T,trackDestinationWorkerScript:L})];case 9:return W=c.sent(),A.push({name:"interaction",manager:W}),[3,11];case 10:return q=c.sent(),$=q,this.loggerProvider.warn("Error occurred while creating interaction events manager: ".concat($.toString())),[3,11];case 11:if(this.eventsManager=new(dn.bind.apply(dn,d([void 0],h(A),!1))),this.eventCompressor&&this.eventCompressor.terminate(),V=!0===this.config.eagerFullSnapshotSend?function(){return te.sendEvents()}:void 0,this.eventCompressor=new xr(this.eventsManager,this.config,this.getDeviceId(),N,V),this.pendingEmitEvents.length>0){G=this.pendingEmitEvents.splice(0);try{for(H=u(G),J=H.next();!J.done;J=H.next())K=J.value,Y=K.event,X=K.sessionId,this.eventCompressor.enqueueEvent(Y,X)}catch(e){Z={error:e}}finally{try{J&&!J.done&&(ee=H.return)&&ee.call(H)}finally{if(Z)throw Z.error}}}return this.pageLeaveFns=d(d([],h(this.pageLeaveFns),!1),[function(){var e;if(te.config&&(null===(e=te.identifiers)||void 0===e?void 0:e.sessionId)&&U){var t=U.getBeaconEvents();if(t.length){var r=te.getDeviceId();r&&(te.isBelowMinSessionDuration()||U.trackDestination.sendBeacon({events:t,sessionId:te.identifiers.sessionId,deviceId:r,apiKey:te.config.apiKey,serverZone:te.config.serverZone}))}}}],!1),[4,this.initializeNetworkObservers()];case 12:return c.sent(),(null===(w=g())||void 0===w?void 0:w.opener)&&(fe(Q=he()),Q.setup(o({logger:this.loggerProvider},this.config.serverZone&&{endpoint:ae[this.config.serverZone]}))),this.loggerProvider.log("Installing @amplitude/session-replay-browser."),this.teardownEventListeners(!1),[4,this.evaluateTargetingAndCapture({userProperties:t.userProperties,page:this.getCurrentPageForTargeting()},!0)];case 13:return c.sent(),(this.config.targetingConfig||(null!==(x=null===(C=null===(S=this.config.privacyConfig)||void 0===S?void 0:S.urlMaskLevels)||void 0===C?void 0:C.length)&&void 0!==x?x:0)>0)&&this.setupUrlChangeListener(),[2]}})})},e.prototype.setSessionId=function(e,t){return O(this.asyncSetSessionId(e,t))},e.prototype.asyncSetSessionId=function(e,t,r){var n,s,i,o,a,u;return l(this,void 0,void 0,function(){var l,h,d,p,f;return c(this,function(c){switch(c.label){case 0:return l=null===(n=this.identifiers)||void 0===n?void 0:n.sessionId,h=this.getDeviceId(),void 0===l||l!==e||void 0!==t&&t!==h||void 0!==(null==r?void 0:r.userProperties)&&0!==Object.keys(r.userProperties).length?(this.latestUrlChangeTargetingEvaluationId++,this.sessionTargetingMatch=!1,this.lastShouldRecordDecision=void 0,l&&this.sendEvents(l),(d=l!==e)&&(null===(i=null===(s=this.config)||void 0===s?void 0:s.semanticCapture)||void 0===i?void 0:i.enabled)&&this.semanticAdapter&&this.stopRecordingEvents("new_session"),d&&(null===(o=this.rrwebEventManager)||void 0===o||o.dropPendingBeaconEvents()),p=t||this.getDeviceId(),this.identifiers=new wn({sessionId:e,deviceId:p}),d&&(this.sessionStartTime=Date.now(),this.suppressedSendCount=0,this.hasEmittedGateDecision=!1,(null===(a=this.config)||void 0===a?void 0:a.apiKey)&&(function(e,t,r,n){var s=kn();if(s)try{s.setItem(xn(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!==l&&function(e,t,r){var n=kn();if(n)try{n.removeItem(xn(e,t))}catch(e){null==r||r.debug("Failed to remove replay start time from storage: ".concat(String(e)))}}(this.config.apiKey,l,this.loggerProvider))),this.joinedConfigGenerator&&l?[4,this.joinedConfigGenerator.generateJoinedConfig()]:[3,2]):[2];case 1:f=c.sent().joinedConfig,this.config=f,c.label=2;case 2:return(null===(u=this.config)||void 0===u?void 0:u.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(),s={};return n&&((e={})[ve]=r.sessionReplayId?r.sessionReplayId:null,s=e,t.debugMode&&(s[Se]=JSON.stringify({appHash:$(t.apiKey).toString()}))),this.addCustomRRWebEvent(me.GET_SR_PROPS,{shouldRecord:n,eventProperties:s},10===this.eventCount),10===this.eventCount&&(this.eventCount=0),this.eventCount++,s},e.prototype.sendEvents=function(e){var t,r,n=e||(null===(t=this.identifiers)||void 0===t?void 0:t.sessionId),s=this.getDeviceId();if(this.eventsManager&&n&&s){if(this.isBelowMinSessionDuration()){var i=this.sessionStartTime,o=this.config.minSessionDurationMs;return this.loggerProvider.log("Session ".concat(n," not sent: duration ").concat(Date.now()-i,"ms is below minimum ").concat(o,"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(me.REPLAY_GATE_DECISION,{sessionId:n,suppressedSendCount:this.suppressedSendCount,elapsedMs:a,minSessionDurationMs:this.config.minSessionDurationMs},!1)}this.eventsManager.sendCurrentSequenceEvents({sessionId:n,deviceId:s})}},e.prototype.initialize=function(e){var t;return void 0===e&&(e=!1),l(this,void 0,void 0,function(){var r;return c(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=q(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.recordingEnabled)return this.loggerProvider.log("Session ".concat(this.identifiers.sessionId," not being captured because recording was stopped.")),!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="",s=!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,s=!0):(n="Not capturing replays for session ".concat(this.identifiers.sessionId," due to not matching targeting conditions."),this.loggerProvider.log(n),r=!1,s=!1):(e=this.identifiers.sessionId,t=this.config.sampleRate,_n(e.toString())%1e6/1e6<t)?(r=!0,s=!0):(n="Opting session ".concat(this.identifiers.sessionId," out of recording due to sample rate."),this.loggerProvider.log(n),r=!1,s=!1);return this.lastShouldRecordDecision!==r&&this.config.targetingConfig&&(this.addCustomRRWebEvent(me.TARGETING_DECISION,{message:n,sessionId:this.identifiers.sessionId,matched:s,targetingParams:this.lastTargetingParams}),this.lastShouldRecordDecision=r),r},e.prototype.getBlockSelectors=function(){var e;return We(null===(e=this.config)||void 0===e?void 0:e.privacyConfig)},e.prototype.getMaskTextSelectors=function(){var e;return qe(null===(e=this.config)||void 0===e?void 0:e.privacyConfig,this.currentPageUrl)},e.prototype.getRecordingPlugins=function(e){var t,r,n,s,i,o;return l(this,void 0,void 0,function(){var a,l,u,h;return c(this,function(c){switch(c.label){case 0:a=[];try{l=Un({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===(s=this.config)||void 0===s?void 0:s.urlChangePollingInterval,captureDocumentTitle:null===(i=this.config)||void 0===i?void 0:i.captureDocumentTitle}),a.push(l)}catch(e){this.loggerProvider.warn("Failed to create URL tracking plugin:",e)}if(!(null===(o=null==e?void 0:e.console)||void 0===o?void 0:o.enabled))return[3,4];c.label=1;case 1:return c.trys.push([1,3,,4]),[4,Promise.resolve().then(function(){return lc})];case 2:return u=c.sent().getRecordConsolePlugin,a.push(u({level:e.console.levels})),[3,4];case 3:return h=c.sent(),this.loggerProvider.warn("Failed to load console plugin:",h),[3,4];case 4:return[2,a.length>0?a:void 0]}})})},e.prototype.getRecordFunction=function(){return l(this,void 0,void 0,function(){var e,t;return c(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(function(){return om})];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),l(this,void 0,void 0,function(){var t;return c(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.shouldAbandonRecordStart=function(e){return!this.recordingEnabled||e!==this.recordingGeneration},e.prototype._recordEvents=function(e){var t,r,n,s,i,a,u,h,d,p,f,m,v;return void 0===e&&(e=!0),l(this,void 0,void 0,function(){var l,y,b,w,S,C,x,k,I,E,O,M,R,P,A,T,N,L,_,D,F,B=this;return c(this,function(c){switch(c.label){case 0:return l=this.config,y=this.getShouldRecord(),b=null===(t=this.identifiers)||void 0===t?void 0:t.sessionId,y&&b&&l?(this.stopRecordingEvents("focus","pause"),w=this.recordingGeneration,[4,this.getRecordFunction()]):((null===(r=null==l?void 0:l.semanticCapture)||void 0===r?void 0:r.enabled)&&this.semanticAdapter&&this.recordCancelCallback&&this.stopRecordingEvents(this.shouldOptOut()?"opt_out":l.targetingConfig?"targeting":"sampled_out"),[2]);case 1:return!(S=c.sent())||this.shouldAbandonRecordStart(w)?[2]:[4,this.initializeNetworkObservers()];case 2:if(c.sent(),this.shouldAbandonRecordStart(w))return[2];C=null===(n=l.loggingConfig)||void 0===n?void 0:n.network,x=$e(l.serverZone,l.trackServerUrl),k=[Ce,xe,ke,x],null===(s=this.networkObservers)||void 0===s||s.start(function(e){k.some(function(t){return e.url.startsWith(t)})||B.addCustomRRWebEvent(me.FETCH_REQUEST,e)},C),I=l.interactionConfig,E=l.loggingConfig,O=(null==I?void 0:I.enabled)&&this.eventsManager?null===(i=this.clickHandler)||void 0===i?void 0:i.createHook({eventsManager:this.eventsManager,sessionId:b,deviceIdFn:this.getDeviceId.bind(this),mirror:S.mirror,ugcFilterRules:null!==(a=I.ugcFilterRules)&&void 0!==a?a:[],performanceOptions:null===(u=l.performanceConfig)||void 0===u?void 0:u.interaction}):void 0,M=(null===(h=l.semanticCapture)||void 0===h?void 0:h.enabled)&&S.supportsNativeMouseInteraction,R=O,M&&(P=null!==(d=this.clickHandler)&&void 0!==d?d:this.clickHandler=new mn(this.loggerProvider),R=P.createSharedHook(O,function(e){var t;return null===(t=B.semanticAdapter)||void 0===t?void 0:t.click(e)})),A=o(o({},R?{mouseInteraction:R}:{}),(null==I?void 0:I.enabled)?{scroll:this.scrollHook}:{}),T=(null==I?void 0:I.enabled)&&I.ugcFilterRules?I.ugcFilterRules:[],this.loggerProvider.log("Session Replay capture beginning for ".concat(b,".")),c.label=3;case 3:return c.trys.push([3,5,,6]),N=!!(null===(p=l.crossOriginIframes)||void 0===p?void 0:p.enabled),L=!1!==(null===(f=l.crossOriginIframes)||void 0===f?void 0:f.coordinateChildren),(_=N&&function(){try{var e=g();return!!e&&e.parent!==e}catch(e){return!0}}())&&L?(this.crossOriginParentSignalCleanup=function(e){var t=g();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)===Ae&&("start"===n.action?e.onStart():"stop"===n.action&&e.onStop())}}return t.addEventListener("message",n),function(){return t.removeEventListener("message",n)}}({onStart:function(){B.recordingEnabled&&B._recordEventsInChildMode(S,b,l,A)},onStop:function(){try{B.recordCancelCallback&&B.recordCancelCallback(),B.recordCancelCallback=null}catch(t){var e=t;B.loggerProvider.warn("Error occurred while stopping child iframe replay capture: ".concat(e.toString()))}}}),this.startChildRecordingOnSetup&&(this.startChildRecordingOnSetup=!1,this._recordEventsInChildMode(S,b,l,A)),[2]):(this.startChildRecordingOnSetup=!1,[4,this.getRecordingPlugins(E)]);case 4:return D=c.sent(),this.shouldAbandonRecordStart(w)?[2]:(this.prepareSemanticCapture(l,b),this.recordCancelCallback=S(o(o({},this.buildRRWebRecordOptions(l,A,function(e){var t,r,n,s,i=(null===(r=null===(t=B.config)||void 0===t?void 0:t.semanticCapture)||void 0===r?void 0:r.enabled)&&B.semanticAdapter&&e.type===Gt.Custom&&"amp-semantic/recording"===e.data.tag&&"stop"===(null===(n=e.data.payload)||void 0===n?void 0:n.state);if((B.shouldOptOut()||!B.recordingEnabled)&&!i)return B.loggerProvider.log(B.shouldOptOut()?"Opting session ".concat(b," out of recording due to optOut config."):"Session Replay capture stopping for ".concat(b,".")),B.stopRecordingEvents(B.shouldOptOut()?"opt_out":"customer_stop"),void B.sendEvents();e.type===Gt.Meta&&(e.data.href=Ge(e.data.href,T)),B.eventCompressor?B.eventCompressor.enqueueEvent(e,b):B.pendingEmitEvents.push({event:e,sessionId:b}),null===(s=B.semanticAdapter)||void 0===s||s.event(e)},"Error while capturing replay: ")),{plugins:D,recordCrossOriginIframes:N})),this.recordCancelCallback&&(null===(m=this.semanticAdapter)||void 0===m||m.recordingReady()),N&&!_&&L&&(this.crossOriginIframeCoordinator||(this.crossOriginIframeCoordinator=new jn),this.crossOriginIframeCoordinator.start()),this.addCustomRRWebEvent(me.DEBUG_INFO),e&&this.addCustomRRWebEvent(me.METADATA,this.metadata),[3,6]);case 5:return F=c.sent(),null===(v=this.semanticAdapter)||void 0===v||v.stop("error"),this.loggerProvider.warn("Failed to initialize session replay:",F),[3,6];case 6:return[2]}})})},e.prototype.prepareSemanticCapture=function(e,t){var r,n,s,i,a=this,l=g();if(null==l?void 0:l.document){if(!(null===(r=e.semanticCapture)||void 0===r?void 0:r.enabled))return null===(n=this.semanticAdapter)||void 0===n||n.stop("targeting"),void(null===(s=this.semanticAdapter)||void 0===s||s.prepare({enabled:!1},t));this.semanticAdapter||(this.semanticAdapter=new Kt({document:l.document,window:l,sdk:"@amplitude/session-replay-browser@".concat(Or),externalClicks:!0===(null===(i=this.recordFunction)||void 0===i?void 0:i.supportsNativeMouseInteraction),externalAuxClicks:!1,getNodeId:function(e){var t,r,n,s;return null!==(s=null===(n=null===(t=a.recordFunction)||void 0===t?void 0:(r=t.mirror).getId)||void 0===n?void 0:n.call(r,e))&&void 0!==s?s:-1},getNode:function(e){var t,r;return null!==(r=null===(t=a.recordFunction)||void 0===t?void 0:t.mirror.getNode(e))&&void 0!==r?r:null},getPrivacy:function(){var e,t;return null!==(t=null===(e=a.config)||void 0===e?void 0:e.privacyConfig)&&void 0!==t?t:{}},getUrl:function(){return l.location.href},getIdentity:function(){return function(e){var t=e.document,r=Xt.get(t);if(r)return r;var n=ft(t,e);if(e.top===e)try{var s=e.sessionStorage,i=function(){var e;try{var t=JSON.parse(null!==(e=s.getItem(Yt))&&void 0!==e?e:"null");if(t&&Qt.test(t.tab_id)&&(null===t.owner||"string"==typeof t.owner))return t}catch(e){}},a=i();null===(null==a?void 0:a.owner)&&(n=Object.freeze(o(o({},n),{tab_id:a.tab_id})));var l=function(e){try{s.setItem(Yt,JSON.stringify({tab_id:n.tab_id,owner:e}))}catch(e){}};s.setItem(Yt,JSON.stringify({tab_id:n.tab_id,owner:n.document_id})),e.addEventListener("pagehide",function(){var e;(null===(e=i())||void 0===e?void 0:e.owner)===n.document_id&&l(null)}),e.addEventListener("pageshow",function(e){e.persisted&&l(n.document_id)})}catch(r){n=ft(t,e)}return Xt.set(t,n),n}(l)},getAnalyticsContext:function(){var e,t;return null!==(t=null===(e=a.config)||void 0===e?void 0:e.semanticAnalyticsContext)&&void 0!==t?t:{present:!1,autocapture:[]}},inlineStylesheet:e.shouldInlineStylesheet,getSelector:function(e){var t,r;try{var n=o(o({},null===(r=null===(t=a.config)||void 0===t?void 0:t.performanceConfig)||void 0===r?void 0:r.interaction),{timeoutMs:1});return a.clickHandler?a.clickHandler.getSelector(e,n):Zt(e,n)}catch(e){return null}},emit:function(e){a.recordCancelCallback&&a.recordFunction&&a.recordFunction.addCustomEvent("amp-semantic/".concat(e.name),e.payload)},onError:function(e){return a.loggerProvider.debug("Semantic capture error:",e)}})),this.semanticAdapter.prepare(e.semanticCapture,t)}},e.prototype.buildRRWebRecordOptions=function(e,t,r,n){var s=this,i=e.privacyConfig;return o(o(o(o({emit:r,inlineStylesheet:e.shouldInlineStylesheet,inlineImages:e.inlineImages,hooks:t},function(e,t){return void 0===t&&(t=function(){return""}),{maskAllInputs:!0,maskTextClass:"amp-mask",blockClass:"amp-block",blockSelector:We(e),maskTextSelector:qe(e,t()),maskInputFn:je("input",e,t),maskTextFn:je("text",e,t),maskAttributeFn:ze(e,t)}}(i,function(){return s.currentPageUrl})),{applyBackgroundColorToBlockedElements:e.applyBackgroundColorToBlockedElements}),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 s.loggerProvider.warn(n,t.toString()),!0}})},e.prototype._recordEventsInChildMode=function(e,t,r,n){try{this.recordCancelCallback&&this.recordCancelCallback(),this.recordCancelCallback=null,this.recordCancelCallback=e(o(o({},this.buildRRWebRecordOptions(r,n,function(){},"Error while capturing replay (child iframe): ")),{recordCrossOriginIframes:!0})),this.loggerProvider.log("Session Replay child iframe capture beginning for session ".concat(t,"."))}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.start=function(){return O(this._start())},e.prototype._start=function(){return l(this,void 0,void 0,function(){return c(this,function(e){switch(e.label){case 0:return this.recordingEnabled=!0,this.startChildRecordingOnSetup=!0,[4,this.recordEvents()];case 1:return e.sent(),[2]}})})},e.prototype.stop=function(){this.recordingEnabled=!1,this.startChildRecordingOnSetup=!1,this.recordingGeneration++,this.stopRecordingEvents("customer_stop"),this.sendEvents()},e.prototype.flush=function(e){var t;return void 0===e&&(e=!1),l(this,void 0,void 0,function(){return c(this,function(r){return[2,null===(t=this.eventsManager)||void 0===t?void 0:t.flush(e)]})})},e.prototype.shutdown=function(){var e,t;this.recordingEnabled=!1,this.startChildRecordingOnSetup=!1,this.recordingGeneration++,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.semanticAdapter&&this.shouldOptOut()?"opt_out":"customer_stop"),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,s,i,o){var a=(null==e?void 0:e.toString())?$(e.toString()):void 0;this.metadata={joinedConfig:t,localConfig:r,remoteConfig:n,sessionId:e,hashValue:a,sampleRate:t.sampleRate,replaySDKType:this.mapSDKType(o),replaySDKVersion:s,standaloneSDKType:"@amplitude/session-replay-browser",standaloneSDKVersion:i}},e.prototype.initializeNetworkObservers=function(){var e,t,r;return l(this,void 0,void 0,function(){var n,s;return c(this,function(i){switch(i.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];i.label=1;case 1:return i.trys.push([1,3,,4]),[4,Promise.resolve().then(function(){return dm})];case 2:return n=i.sent().NetworkObservers,this.networkObservers=new n,[3,4];case 3:return s=i.sent(),this.loggerProvider.warn("Failed to import or instantiate NetworkObservers:",s),[3,4];case 4:return[2]}})})},e}(),Vn=function(e){return function(){var t=e.config||Ke();return{logger:t.loggerProvider,logLevel:t.logLevel}}},Gn=function(){var e=new $n;return{init:_(e.init.bind(e),"init",Vn(e)),evaluateTargetingAndCapture:_(e.evaluateTargetingAndCapture.bind(e),"evaluateTargetingAndRecord",Vn(e)),setSessionId:_(e.setSessionId.bind(e),"setSessionId",Vn(e)),getSessionId:_(e.getSessionId.bind(e),"getSessionId",Vn(e)),getSessionReplayProperties:_(e.getSessionReplayProperties.bind(e),"getSessionReplayProperties",Vn(e)),flush:_(e.flush.bind(e),"flush",Vn(e)),start:_(e.start.bind(e),"start",Vn(e)),stop:_(e.stop.bind(e),"stop",Vn(e)),shutdown:_(e.shutdown.bind(e),"shutdown",Vn(e))}}(),Hn=Gn.init,Jn=Gn.setSessionId,Kn=Gn.getSessionId,Yn=Gn.getSessionReplayProperties,Xn=Gn.flush,Qn=Gn.start,Zn=Gn.stop,es=Gn.shutdown,ts=Gn.evaluateTargetingAndCapture;!function(e){e.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"}(zn||(zn={})),function(e){e.REVENUE_PRODUCT_ID="$productId",e.REVENUE_QUANTITY="$quantity",e.REVENUE_PRICE="$price",e.REVENUE_TYPE="$revenueType",e.REVENUE_CURRENCY="$currency",e.REVENUE="$revenue"}(Wn||(Wn={})),function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"}(qn||(qn={}));const rs=[zn.SET,zn.SET_ONCE,zn.ADD,zn.APPEND,zn.PREPEND,zn.POSTINSERT];const ns="1.37.0-codexsemantic-review-integration.0";class ss{constructor(e){this.name=ss.pluginName,this.type="enrichment",this.config=null,this.sessionReplay={flush:Xn,getSessionId:Kn,getSessionReplayProperties:Yn,init:Hn,setSessionId:Jn,start:Qn,stop:Zn,shutdown:es,evaluateTargetingAndCapture:ts},this.options=Object.assign({forceSessionTracking:!1},e),this.srInitOptions=this.options}setup(e,t){var r,n,s,i,o,a,c,u,h;return l(this,void 0,void 0,function*(){try{null==e||e.loggerProvider.log(`Installing @amplitude/plugin-session-replay, version ${ns}.`),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=Object.assign(Object.assign({},e.defaultTracking),{sessions:!0}));const l=q(this.config.instanceName).identityStore.getIdentity().userProperties;this.srInitOptions={instanceName:this.config.instanceName,deviceId:null!==(r=this.options.deviceId)&&void 0!==r?r: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===(n=this.config.remoteConfig)||void 0===n?void 0:n.serverUrl),trackServerUrl:this.options.trackServerUrl,sampleRate:this.options.sampleRate,semanticCapture:this.options.semanticCapture,semanticAnalyticsContext:{present:!0,autocapture:(t=this.config.autocapture,!0===t?["attribution","fileDownloads","formInteractions","pageViews","sessions","elementInteractions","webVitals","frustrationInteractions"]:t&&"object"==typeof t?Object.keys(t).filter(e=>{const r=t[e];if("frustrationInteractions"!==e)return Boolean(r);const n=t.frustrationInteractions;return!0===n||!(!n||"object"!=typeof n)&&(!1!==n.deadClicks&&null!==n.deadClicks||Boolean(n.errorClicks))}):[])},privacyConfig:{blockSelector:null===(s=this.options.privacyConfig)||void 0===s?void 0:s.blockSelector,maskAttributes:null===(i=this.options.privacyConfig)||void 0===i?void 0:i.maskAttributes,maskSelector:null===(o=this.options.privacyConfig)||void 0===o?void 0:o.maskSelector,unmaskSelector:null===(a=this.options.privacyConfig)||void 0===a?void 0:a.unmaskSelector,defaultMaskLevel:null===(c=this.options.privacyConfig)||void 0===c?void 0:c.defaultMaskLevel},debugMode:this.options.debugMode,shouldInlineStylesheet:this.options.shouldInlineStylesheet,inlineImages:this.options.inlineImages,version:{type:"plugin",version:ns},performanceConfig:this.options.performanceConfig,storeType:this.options.storeType,useWebWorker:null!==(u=this.options.useWebWorker)&&void 0!==u?u:null===(h=this.options.experimental)||void 0===h?void 0:h.useWebWorker,userProperties:l,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,eagerFullSnapshotSend:this.options.eagerFullSnapshotSend,captureFullSnapshotOnFocus:this.options.captureFullSnapshotOnFocus,maxPersistedEventsSizeBytes:this.options.maxPersistedEventsSizeBytes,maxSingleEventSizeBytes:this.options.maxSingleEventSizeBytes,sendTimeoutMs:this.options.sendTimeoutMs,handleSendEvents:this.options.handleSendEvents,handleFetchConfig:this.options.handleFetchConfig},yield this.sessionReplay.init(e.apiKey,this.srInitOptions).promise}catch(t){null==e||e.loggerProvider.error(`Session Replay: Failed to initialize due to ${t.message}`)}var t})}onSessionIdChanged(e){var t;return l(this,void 0,void 0,function*(){null===(t=this.config)||void 0===t||t.loggerProvider.debug(`Analytics session id is changed to ${e}, SR session id is ${String(this.sessionReplay.getSessionId())}.`),yield this.sessionReplay.setSessionId(e).promise})}onOptOutChanged(e){var t;return l(this,void 0,void 0,function*(){null===(t=this.config)||void 0===t||t.loggerProvider.debug(`optOut is changed to ${String(e)}, calling ${e?"sessionReplay.shutdown()":"sessionReplay.init()"}.`),e?this.sessionReplay.shutdown():null!=this.config&&(yield this.sessionReplay.init(this.config.apiKey,this.srInitOptions).promise)})}execute(e){var t,r,n;return l(this,void 0,void 0,function*(){try{if(this.options.customSessionId){const t=this.options.customSessionId(e);if(t){t!==this.sessionReplay.getSessionId()&&(yield this.sessionReplay.setSessionId(t).promise);const r=this.sessionReplay.getSessionReplayProperties();e.event_properties=Object.assign(Object.assign({},e.event_properties),r)}}else{const n=null===(t=this.config)||void 0===t?void 0:t.sessionId;if(n&&n!==this.sessionReplay.getSessionId()&&(yield this.sessionReplay.setSessionId(n).promise),n&&n===e.session_id){let t;e.event_type===i.IDENTIFY&&(t=(e=>{if(!e.user_properties)return;let t={};return Object.keys(e.user_properties).forEach(r=>{if(rs.includes(r)){const n=e.user_properties&&e.user_properties[r];t=Object.assign(Object.assign({},t),n)}}),t})(e));const n=g();yield this.sessionReplay.evaluateTargetingAndCapture({event:e,userProperties:t,page:null!=(null===(r=null==n?void 0:n.location)||void 0===r?void 0:r.href)?{url:n.location.href}:void 0});const s=this.sessionReplay.getSessionReplayProperties();e.event_properties=Object.assign(Object.assign({},e.event_properties),s)}}return e.event_type===i.IDENTIFY&&e.event_properties&&delete e.event_properties["[Amplitude] Session Replay ID"],Promise.resolve(e)}catch(t){return null===(n=this.config)||void 0===n||n.loggerProvider.error(`Session Replay: Failed to enrich event due to ${t.message}`),Promise.resolve(e)}})}teardown(){var e;return l(this,void 0,void 0,function*(){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 ${t.message}`)}})}getSessionReplayProperties(){return this.sessionReplay.getSessionReplayProperties()}start(){return l(this,void 0,void 0,function*(){yield this.sessionReplay.start().promise})}stop(){this.sessionReplay.stop()}}ss.pluginName="@amplitude/plugin-session-replay-browser";const is=e=>new ss(e);var os=function(e,t){return os=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])},os(e,t)};var as=function(){return as=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},as.apply(this,arguments)};function ls(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"==typeof SuppressedError&&SuppressedError;var cs="is",us="is not",hs="contains",ds="does not contain",ps="less",fs="less or equal",ms="greater",gs="greater or equal",vs="version less",ys="version less or equal",bs="version greater",ws="version greater or equal",Ss="set is",Cs="set is not",xs="set contains",ks="set does not contain",Is="set contains any",Es="set does not contain any",Os="regex match",Ms="regex does not match",Rs=-862048943,Ps=461845907,As=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 s=e.charCodeAt(n);s<128?t[r++]=s:s<2048?(t[r++]=s>>6|192,t[r++]=63&s|128):55296==(64512&s)&&n+1<e.length&&56320==(64512&e.charCodeAt(n+1))?(s=65536+((1023&s)<<10)+(1023&e.charCodeAt(++n)),t[r++]=s>>18|240,t[r++]=s>>12&63|128,t[r++]=s>>6&63|128,t[r++]=63&s|128):(t[r++]=s>>12|224,t[r++]=s>>6&63|128,t[r++]=63&s|128)}return Uint8Array.from(t)}(e),n=r.length,s=n>>2,i=t,o=0;o<s;o++){var a=_s(r,o<<2);i=Ts(a,i)}var l=s<<2,c=0;switch(n-l){case 3:c^=r[l+2]<<16,c^=r[l+1]<<8,c^=r[l],c=Math.imul(c,Rs),c=Ls(c,15),i^=c=Math.imul(c,Ps);break;case 2:c^=r[l+1]<<8,c^=r[l],c=Math.imul(c,Rs),c=Ls(c,15),i^=c=Math.imul(c,Ps);break;case 1:c^=r[l],c=Math.imul(c,Rs),c=Ls(c,15),i^=c=Math.imul(c,Ps)}return Ns(i^=n)>>>0},Ts=function(e,t){var r=e,n=t;return r=Math.imul(r,Rs),r=Ls(r,15),r=Math.imul(r,Ps),n=Ls(n^=r,13),(n=Math.imul(n,5))+-430675100|0},Ns=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},Ls=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},_s=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 Ds(r)},Ds=function(e){return(-16777216&e)>>>24|(16711680&e)>>>8|(65280&e)<<8|(255&e)<<24},Fs=function(e,t){var r,n;if(t&&0!==t.length){try{for(var s=ls(t),i=s.next();!i.done;i=s.next()){var o=i.value;if(!o||!e||"object"!=typeof e)return;e=e[o]}}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return e||void 0}},Bs="^".concat("(\\d+)\\.(\\d+)","(\\.").concat("(\\d+)").concat("(-(([-\\w]+\\.?)*))?",")?$"),Us=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(Bs).exec(t);if(r){var n=Number(r[1]),s=Number(r[2]);if(!isNaN(n)&&!isNaN(s))return new e(n,s,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}(),js=function(){function e(){}return e.prototype.evaluate=function(e,t){var r,n,s={},i={context:e,result:s};try{for(var o=ls(t),a=o.next();!a.done;a=o.next()){var l=a.value,c=this.evaluateFlag(i,l);c&&(s[l.key]=c)}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return s},e.prototype.evaluateFlag=function(e,t){var r,n,s;try{for(var i=ls(t.segments),o=i.next();!o.done;o=i.next()){var a=o.value;if(s=this.evaluateSegment(e,t,a)){var l=as(as(as({},t.metadata),a.metadata),s.metadata);s=as(as({},s),{metadata:l});break}}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return s},e.prototype.evaluateSegment=function(e,t,r){var n,s,i,o;if(!r.conditions)return void 0!==(c=this.bucket(e,r))?t.variants[c]:void 0;try{for(var a=ls(r.conditions),l=a.next();!l.done;l=a.next()){var c,u=l.value,h=!0;try{for(var d=(i=void 0,ls(u)),p=d.next();!p.done;p=d.next()){var f=p.value;if(!(h=this.matchCondition(e,f)))break}}catch(e){i={error:e}}finally{try{p&&!p.done&&(o=d.return)&&o.call(d)}finally{if(i)throw i.error}}if(h)return void 0!==(c=this.bucket(e,r))?t.variants[c]:void 0}}catch(e){n={error:e}}finally{try{l&&!l.done&&(s=a.return)&&s.call(a)}finally{if(n)throw n.error}}},e.prototype.matchCondition=function(e,t){var r=Fs(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 s=this.coerceString(r);return void 0!==s&&this.matchString(s,t.op,t.values)}return this.matchNull(t.op,t.values)},e.prototype.getHash=function(e){return As(e)},e.prototype.bucket=function(e,t){var r,n,s,i;if(!t.bucket)return t.variant;var o=this.coerceString(Fs(e,t.bucket.selector));if(!o||0===o.length)return t.variant;var a="".concat(t.bucket.salt,"/").concat(o),l=this.getHash(a),c=l%100,u=Math.floor(l/100);try{for(var h=ls(t.bucket.allocations),d=h.next();!d.done;d=h.next()){var p=d.value,f=p.range[0],m=p.range[1];if(c>=f&&c<m)try{for(var g=(s=void 0,ls(p.distributions)),v=g.next();!v.done;v=g.next()){var y=v.value,b=y.range[0],w=y.range[1];if(u>=b&&u<w)return y.variant}}catch(e){s={error:e}}finally{try{v&&!v.done&&(i=g.return)&&i.call(g)}finally{if(s)throw s.error}}}}catch(e){r={error:e}}finally{try{d&&!d.done&&(n=h.return)&&n.call(h)}finally{if(r)throw r.error}}return t.variant},e.prototype.matchNull=function(e,t){var r=this.containsNone(t);switch(e){case cs:case hs:case ps:case fs:case ms:case gs:case vs:case ys:case bs:case ws:case Ss:case xs:case Is:return r;case us:case ds:case ks:case Es:return!r;default:return!1}},e.prototype.matchSet=function(e,t,r){switch(t){case Ss:return this.setEquals(e,r);case Cs:return!this.setEquals(e,r);case xs:return this.matchesSetContainsAll(e,r);case ks:return!this.matchesSetContainsAll(e,r);case Is:return this.matchesSetContainsAny(e,r);case Es:return!this.matchesSetContainsAny(e,r);default:return!1}},e.prototype.matchString=function(e,t,r){var n=this;switch(t){case cs:return this.matchesIs(e,r);case us:return!this.matchesIs(e,r);case hs:return this.matchesContains(e,r);case ds:return!this.matchesContains(e,r);case ps:case fs:case ms:case gs:return this.matchesComparable(e,t,r,function(e){return n.parseNumber(e)},this.comparator);case vs:case ys:case bs:case ws:return this.matchesComparable(e,t,r,function(e){return Us.parse(e)},this.versionComparator);case Os:return this.matchesRegex(e,r);case Ms: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 s=ls(t),i=s.next();!i.done;i=s.next()){var o=i.value;if(e.toLowerCase().includes(o.toLowerCase()))return!0}}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return!1},e.prototype.matchesComparable=function(e,t,r,n,s){var i=this,o=n(e),a=r.map(function(e){return n(e)}).filter(function(e){return void 0!==e});return void 0===o||0===a.length?r.some(function(r){return i.comparator(e,t,r)}):a.some(function(e){return s(o,t,e)})},e.prototype.comparator=function(e,t,r){switch(t){case ps:case vs:return e<r;case fs:case ys:return e<=r;case ms:case bs:return e>r;case gs:case ws:return e>=r;default:return!1}},e.prototype.versionComparator=function(e,t,r){var n=e.compareTo(r);switch(t){case ps:case vs:return n<0;case fs:case ys:return n<=0;case ms:case bs:return n>0;case gs:case ws: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 Ss:case Cs:case xs:case ks:case Is:case Es: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,s=0,i=t.length;s<i;s++)!n&&s in t||(n||(n=Array.prototype.slice.call(t,0,s)),n[s]=t[s]);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,s,i=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(e){s={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(s)throw s.error}}return o}(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 s=ls(t),i=s.next();!i.done;i=s.next()){var o=i.value;if(!this.matchesIs(o,e))return!1}}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return!0},e.prototype.matchesSetContainsAny=function(e,t){var r,n;try{for(var s=ls(t),i=s.next();!i.done;i=s.next()){var o=i.value;if(this.matchesIs(o,e))return!0}}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return!1},e}();"function"==typeof TextDecoder&&new TextDecoder,"function"==typeof TextEncoder&&new TextEncoder;(e=>{let t={};e.forEach((e,r)=>t[e]=r)})(Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=")),String.fromCharCode.bind(String),"function"==typeof Uint8Array.from&&Uint8Array.from.bind(Uint8Array),function(e){function t(r,n){var s=e.call(this,n)||this;return s.statusCode=r,Object.setPrototypeOf(s,t.prototype),s}(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}os(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})(t,e)}(Error);var zs,Ws=function(){var e=this;this.dbs={},this.createStore=function(t){return l(e,void 0,void 0,function(){return c(this,function(e){switch(e.label){case 0:return[4,Wr(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 l(e,void 0,void 0,function(){var e,r;return c(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(t){var r=t.sessionId,n=t.eventType,s=t.eventTime,i=t.loggerProvider,a=t.tx;return l(e,void 0,void 0,function(){var e,t,l,u,h,d,p,f,m;return c(this,function(c){switch(c.label){case 0:return c.trys.push([0,3,,4]),e=String(r),[4,a.store.get(e)];case 1:return t=c.sent(),l=t?t.eventTypes:{},u=l[n]||{},h=o(o({},l),((f={})[n]=o(o({},u),((m={})[s]={event_type:n},m)),f)),d={sessionId:e,eventTypes:h,lastUpdated:Date.now()},[4,a.store.put(d)];case 2:return c.sent(),[2,h];case 3:return p=c.sent(),i.warn("Failed to store events for targeting ".concat(r,": ").concat(p)),[3,4];case 4:return[2,void 0]}})})},this.deleteOldSessionEventTypes=function(t){var r=t.currentSessionId,n=t.loggerProvider,s=t.tx;return l(e,void 0,void 0,function(){var e,t,i,o,a,l;return c(this,function(c){switch(c.label){case 0:return c.trys.push([0,6,,7]),e=String(r),[4,s.store.getAll()];case 1:t=c.sent(),i=0,c.label=2;case 2:return i<t.length?(o=t[i],a=Date.now()-o.lastUpdated,o.sessionId!==e&&a>1728e5?[4,s.store.delete(o.sessionId)]:[3,4]):[3,5];case 3:c.sent(),c.label=4;case 4:return i++,[3,2];case 5:return[3,7];case 6:return l=c.sent(),n.warn("Failed to clear old session event types for targeting: ".concat(l)),[3,7];case 7:return[2]}})})},this.storeEventTypeForSession=function(t){var r=t.loggerProvider,n=t.sessionId,s=t.eventType,i=t.eventTime,o=t.apiKey;return l(e,void 0,void 0,function(){var e,t,a,l;return c(this,function(c){switch(c.label){case 0:return c.trys.push([0,5,,6]),[4,this.openOrCreateDB(o)];case 1:return e=c.sent(),(t=e.transaction("eventTypesForSession","readwrite"))?[4,this.updateEventListForSession({sessionId:n,tx:t,loggerProvider:r,eventType:s,eventTime:i})]:[2];case 2:return a=c.sent(),[4,this.deleteOldSessionEventTypes({currentSessionId:n,tx:t,loggerProvider:r})];case 3:return c.sent(),[4,t.done];case 4:return c.sent(),[2,a];case 5:return l=c.sent(),r.warn("Failed to store events for targeting ".concat(n,": ").concat(l)),[3,6];case 6:return[2,void 0]}})})}},qs=new Ws,$s=function(){var e=this;this.evaluateTargeting=function(t){var r=t.apiKey,n=t.loggerProvider,s=t.event,i=t.sessionId,a=t.userProperties,u=t.deviceId,h=t.page,d=t.flag;return l(e,void 0,void 0,function(){var e,t,l,p;return c(this,function(c){switch(c.label){case 0:return s&&s.time?[4,qs.storeEventTypeForSession({loggerProvider:n,apiKey:r,sessionId:i,eventType:s.event_type,eventTime:s.time})]:[3,2];case 1:return t=c.sent(),[3,3];case 2:t=void 0,c.label=3;case 3:return l=(e=t)&&new Set(Object.keys(e)),p={session_id:i,event:s,event_types:l&&Array.from(l),user:o(o({},a),{device_id:u,user_properties:a}),page:h},[2,this.evaluationEngine.evaluate(p,[d])]}})})},this.evaluationEngine=new js},Vs=function(){var e=new $s;return{evaluateTargeting:e.evaluateTargeting.bind(e)}}().evaluateTargeting,Gs=Object.freeze({__proto__:null,evaluateTargeting:Vs}),Hs=Object.freeze({__proto__:null,compressionScript:'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',trackDestinationScript:'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,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function i(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(a,i)}u((n=n.apply(e,t||[])).next())})}function s(e,t){var r,n,s,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=i(0),a.throw=i(1),a.return=i(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function i(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,i[0]&&(o=0)),o;)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 o.label++,{value:i[1],done:!1};case 5:o.label++,n=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==i[0]&&2!==i[0])){o=0;continue}if(3===i[0]&&(!s||i[1]>s[0]&&i[1]<s[3])){o.label=i[1];break}if(6===i[0]&&o.label<s[1]){o.label=s[1],s=i;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(i);break}s[2]&&o.ops.pop(),o.trys.pop();continue}i=t.call(e,o)}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,u])}}}"function"==typeof SuppressedError&&SuppressedError,function(e){e.US="US",e.EU="EU",e.STAGING="STAGING"}(t||(t={})),t.US;var o,a=/payload.*exceed/i,i="X-Session-Replay-Event-Skipped";!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"}(o||(o={}));var u="Network error occurred, event batch rejected";function c(e,t){return n(this,void 0,void 0,function(){var r,o,a,i,u,c,l,d,p,f,v,h,y,b,g=this;return s(this,function(m){switch(m.label){case 0:return m.trys.push([0,4,,5]),r=t.CompressionStream,o=new r("gzip"),a=o.writable.getWriter(),i=o.readable.getReader(),u=[],c=n(g,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];u.push(r),n.label=2;case 2:return[3,0];case 3:return[2]}})}),[4,a.write((new TextEncoder).encode(e))];case 1:return m.sent(),[4,a.close()];case 2:return m.sent(),[4,c];case 3:m.sent(),l=u.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.")}(u),v=f.next();!v.done;v=f.next())h=v.value,d.set(h,p),p+=h.length}catch(e){y={error:e}}finally{try{v&&!v.done&&(b=f.return)&&b.call(f)}finally{if(y)throw y.error}}return[2,d];case 4:return m.sent(),[2,null];case 5:return[2]}})})}function l(e){for(var t=e.length,r=0;r<t&&!(e.charCodeAt(r)>127);r++);if(r===t)return t;for(var n=r;r<t;r++){var s=e.charCodeAt(r);if(s<=127)n++;else if(s<=2047)n+=2;else if(s>=55296&&s<=56319){var o=r+1<t?e.charCodeAt(r+1):NaN;o>=56320&&o<=57343?(n+=4,r++):n+=3}else n+=3}return n}var d=0,p=new Map,f=function(e,t){return fetch(e,t)},v=function(e,t){var r="".concat(++d);return new Promise(function(n,s){var o=t.signal,a=function(){p.delete(r);var e=new Error("Delegated session replay fetch aborted by send timeout");e.name="AbortError",s(e)};o.addEventListener("abort",a,{once:!0}),p.set(r,function(e){o.removeEventListener("abort",a),e.error?s(new Error(e.body)):n({status:e.status,headers:{get:function(t){return t===i?e.skipHeader:null}},text:function(){return Promise.resolve(e.body)}})}),postMessage({type:"fetch-request",requestId:r,url:e,method:"POST",headers:t.headers,body:t.body,keepalive:t.keepalive})})};function h(e,t,o){var d,p,f,v,h,y,b,g;return n(this,void 0,void 0,function(){var n,m,w,S,T,E,k,R,C,x,A,I,M,O,U;return s(this,function(s){switch(s.label){case 0:n=null!==(d=t.sendTimeoutMs)&&void 0!==d?d:1e4,s.label=1;case 1:return s.trys.push([1,14,,15]),!1!==t.enableTransportCompression&&"CompressionStream"in self?[4,c(e,self)]:[3,3];case 2:return w=s.sent(),[3,4];case 3:w=null,s.label=4;case 4:m=w,S="".concat(null!==(f=null===(p=t.version)||void 0===p?void 0:p.type)&&void 0!==f?f:"standalone","/").concat(null!==(h=null===(v=t.version)||void 0===v?void 0:v.version)&&void 0!==h?h:t.sdkVersion),T=new URLSearchParams({device_id:t.deviceId,session_id:"".concat(t.sessionId),type:t.eventType}),E="".concat((P=t.serverZone,_=t.trackServerUrl,_||("STAGING"===P?"https://api-sr.stag2.amplitude.com/sessions/v2/track":"EU"===P?"https://api-sr.eu.amplitude.com/sessions/v2/track":"https://api-sr.amplitude.com/sessions/v2/track")),"?").concat(T.toString()),k=r({"Content-Type":"application/json",Accept:"*/*",Authorization:"Bearer ".concat(t.apiKey),"X-Client-Version":t.sdkVersion,"X-Client-Library":S,"X-Client-Url":t.currentUrl.substring(0,1e3),"X-Client-Sample-Rate":"".concat(t.sampleRate),"X-Sampling-Hash-Alg":"xxhash32"},m?{"Content-Encoding":"gzip"}:{}),R=m?m.byteLength:l(e),C=new AbortController,x=n>0?setTimeout(function(){C.abort()},n):void 0,A=void 0,s.label=5;case 5:return s.trys.push([5,,7,8]),[4,o(E,{method:"POST",headers:k,body:null!=m?m:e,keepalive:R<=65536,signal:C.signal})];case 6:return A=s.sent(),[3,8];case 7:return x&&clearTimeout(x),[7];case 8:if(null===A)return[2,{shouldRetry:!1,success:!1,message:"Unexpected error occurred"}];if(A.status>=200&&A.status<300)return I=Math.round(function(e){for(var t=0,r=0;r<e.length;r++)t+=l(e[r]);return t}(t.events)/1024),M=null!==(g=null===(b=null===(y=A.headers)||void 0===y?void 0:y.get)||void 0===b?void 0:b.call(y,i))&&void 0!==g?g:null,[2,{shouldRetry:!1,success:!0,message:"Session replay event batch tracked successfully for session id ".concat(t.sessionId,", size of events: ").concat(I," KB"),skipCode:M}];if(413!==A.status)return[3,13];O="",s.label=9;case 9:return s.trys.push([9,11,,12]),[4,A.text()];case 10:return O=s.sent(),[3,12];case 11:return s.sent(),[3,12];case 12:return[2,{shouldRetry:!1,success:!1,message:u,payloadTooLarge:!0,isWaf:a.test(O)}];case 13:return A.status>=500||408===A.status||429===A.status||499===A.status?[2,{shouldRetry:!0,success:!1,message:"HTTP ".concat(A.status)}]:[2,{shouldRetry:!1,success:!1,message:u}];case 14:return(U=s.sent())&&"object"==typeof U&&"AbortError"===U.name?[2,{shouldRetry:!0,success:!1,message:"Session replay worker request timed out after ".concat(n,"ms")}]:[2,{shouldRetry:!1,success:!1,message:String(U)}];case 15:return[2]}var P,_})})}function y(e,t,r,o,a){var i;return n(this,void 0,void 0,function(){var n,u,c;return s(this,function(s){switch(s.label){case 0:n=1,s.label=1;case 1:return[4,h(t,r,a)];case 2:return(u=s.sent()).success?(postMessage({type:"log",id:e,message:u.message}),postMessage({type:"complete",id:e,skipCode:null!==(i=u.skipCode)&&void 0!==i?i:null}),[2]):u.payloadTooLarge&&o?(postMessage({type:"payload_too_large",id:e,isWaf:!0===u.isWaf}),[2]):o&&u.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":u.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,o,a,i,u,c;return s(this,function(s){switch(s.label){case 0:return"fetch-response"===(t=e.data).type?((r=p.get(t.requestId))&&(p.delete(t.requestId),r(t)),[2]):"send"!==t.type?[3,2]:(n=t.id,o=t.payload,a=t.context,i=t.useRetry,u=t.useCustomTransport,c=JSON.stringify(o),[4,y(n,c,a,i,u?v:f)]);case 1:s.sent(),s.label=2;case 2:return[2]}})})};var b=onmessage;return e.trackDestinationOnMessage=b,Object.defineProperty(e,"__esModule",{value:!0}),e}({});\n'}),Js=Object.defineProperty,Ks=(e,t,r)=>((e,t,r)=>t in e?Js(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Ys=Object.defineProperty,Xs=(e,t,r)=>((e,t,r)=>t in e?Ys(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Qs=Object.defineProperty,Zs=(e,t,r)=>((e,t,r)=>t in e?Qs(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);const ei={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},ti={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},ri={};function ni(e){if(ri[e])return ri[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 ei?ei[e]:void 0,s=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]"))})),i=e in ti?ti[e]:void 0,o=Boolean(i&&i.every(e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))}));if(s&&o)return ri[e]=t.prototype,t.prototype;try{const n=document.createElement("iframe");document.body.appendChild(n);const s=n.contentWindow;if(!s)return t.prototype;const i=s[e].prototype;return document.body.removeChild(n),i?ri[e]=i:r}catch{return r}}const si={};function ii(e,t,r){var n;const s=`${e}.${String(r)}`;if(si[s])return si[s].call(t);const i=ni(e),o=null==(n=Object.getOwnPropertyDescriptor(i,r))?void 0:n.get;return o?(si[s]=o,o.call(t)):t[r]}const oi={};function ai(e,t,r){const n=`${e}.${String(r)}`;if(oi[n])return oi[n].bind(t);const s=ni(e)[r];return"function"!=typeof s?t[r]:(oi[n]=s,s.bind(t))}const li={childNodes:function(e){return ii("Node",e,"childNodes")},parentNode:function(e){return ii("Node",e,"parentNode")},parentElement:function(e){return ii("Node",e,"parentElement")},textContent:function(e){return ii("Node",e,"textContent")},contains:function(e,t){return ai("Node",e,"contains")(t)},getRootNode:function(e){return ai("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?ii("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?ii("Element",e,"shadowRoot"):null},querySelector:function(e,t){return ii("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return ii("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return ni("MutationObserver").constructor}};class ci{constructor(){Zs(this,"idNodeMap",new Map),Zs(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;return(null==(t=this.getMeta(e))?void 0:t.id)??-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}}function ui(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&ui(li.parentNode(e),t,r);for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!!r&&ui(li.parentNode(e),t,r)}function hi(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function di(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}var pi,fi={exports:{}};function mi(){if(pi)return fi.exports;pi=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,blackBright:e,redBright:e,greenBright:e,yellowBright:e,blueBright:e,magentaBright:e,cyanBright:e,whiteBright:e,bgBlackBright:e,bgRedBright:e,bgGreenBright:e,bgYellowBright:e,bgBlueBright:e,bgMagentaBright:e,bgCyanBright:e,bgWhiteBright:e}};return fi.exports=t(),fi.exports.createColors=t,fi.exports}const gi=di(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var vi,yi,bi,wi,Si,Ci;function xi(){if(yi)return vi;yi=1;let e=mi(),t=gi;class r extends Error{constructor(e,t,n,s,i,o){super(e),this.name="CssSyntaxError",this.reason=e,i&&(this.file=i),s&&(this.source=s),o&&(this.plugin=o),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);let s=e=>e,i=e=>e,o=e=>e;if(r){let{bold:r,gray:n,red:a}=e.createColors(!0);i=e=>r(a(e)),s=e=>n(e),t&&(o=e=>t(e))}let a=n.split(/\r?\n/),l=Math.max(this.line-3,0),c=Math.min(this.line+2,a.length),u=String(c).length;return a.slice(l,c).map((e,t)=>{let r=l+1+t,n=" "+(" "+r).slice(-u)+" | ";if(r===this.line){if(e.length>160){let t=20,r=Math.max(0,this.column-t),a=Math.max(this.column+t,this.endColumn+t),l=e.slice(r,a),c=s(n.replace(/\d/g," "))+e.slice(0,Math.min(this.column-1,t-1)).replace(/[^\t]/g," ");return i(">")+s(n)+o(l)+"\n "+c+i("^")}let t=s(n.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return i(">")+s(n)+o(e)+"\n "+t+i("^")}return" "+s(n)+o(e)}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}return vi=r,r.default=r,vi}function ki(){if(wi)return bi;wi=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 s=(e.raws.between||"")+(t?";":"");this.builder(r+n+s,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,s=0;for(;n&&"root"!==n.type;)s+=1,n=n.parent;if(r.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<s;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 s=e.nodes[n],i=this.raw(s,"before");i&&this.builder(i),this.stringify(s,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 s;if(n||(n=r),r&&(s=t.raws[r],void 0!==s))return s;let i=t.parent;if("before"===n){if(!i||"root"===i.type&&i.first===t)return"";if(i&&"document"===i.type)return""}if(!i)return e[n];let o=t.root();if(o.rawCache||(o.rawCache={}),void 0!==o.rawCache[n])return o.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(t,n);{let e="raw"+((a=n)[0].toUpperCase()+a.slice(1));this[e]?s=this[e](o,t):o.walk(e=>{if(s=e.raws[r],void 0!==s)return!1})}var a;return void 0===s&&(s=e[n]),o.rawCache[n]=s,s}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 bi=t,t.default=t,bi}function Ii(){if(Ci)return Si;Ci=1;let e=ki();function t(t,r){new e(r).stringify(t)}return Si=t,t.default=t,Si}var Ei,Oi,Mi,Ri,Pi,Ai,Ti,Ni,Li,_i,Di,Fi,Bi,Ui,ji,zi,Wi,qi,$i,Vi,Gi,Hi,Ji,Ki,Yi,Xi,Qi,Zi,eo,to,ro,no,so,io,oo,ao,lo,co,uo,ho,po,fo,mo,go,vo,yo,bo,wo,So,Co={};function xo(){return Ei||(Ei=1,Co.isClean=Symbol("isClean"),Co.my=Symbol("my")),Co}function ko(){if(Mi)return Oi;Mi=1;let e=xi(),t=ki(),r=Ii(),{isClean:n,my:s}=xo();function i(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 s=e[n],o=typeof s;"parent"===n&&"object"===o?t&&(r[n]=t):"source"===n?r[n]=s:Array.isArray(s)?r[n]=s.map(e=>i(e,r)):("object"===o&&null!==s&&(s=i(s)),r[n]=s)}return r}function o(e,t){if(t&&void 0!==t.offset)return t.offset;let r=1,n=1,s=0;for(let i=0;i<e.length;i++){if(n===t.line&&r===t.column){s=i;break}"\n"===e[i]?(r=1,n+=1):r+=1}return s}class a{get proxyOf(){return this}constructor(e={}){this.raws={},this[n]=!1,this[s]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let r of e[t])"function"==typeof r.clone?this.append(r.clone()):this.append(r)}else this[t]=e[t]}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=i(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(t,r={}){if(this.source){let{end:e,start:n}=this.rangeBy(r);return this.source.input.error(t,{column:n.column,line:n.line},{column:e.column,line:e.line},r)}return new e(t)}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)}}markClean(){this[n]=!0}markDirty(){if(this[n]){this[n]=!1;let e=this;for(;e=e.parent;)e[n]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e={}){let t=this.source.start;if(e.index)t=this.positionInside(e.index);else if(e.word){let r="document"in this.source.input?this.source.input.document:this.source.input.css,n=r.slice(o(r,this.source.start),o(r,this.source.end)).indexOf(e.word);-1!==n&&(t=this.positionInside(n))}return t}positionInside(e){let t=this.source.start.column,r=this.source.start.line,n="document"in this.source.input?this.source.input.document:this.source.input.css,s=o(n,this.source.start),i=s+e;for(let e=s;e<i;e++)"\n"===n[e]?(t=1,r+=1):t+=1;return{column:t,line:r,offset:i}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e={}){let t="document"in this.source.input?this.source.input.document:this.source.input.css,r={column:this.source.start.column,line:this.source.start.line,offset:o(t,this.source.start)},n=this.source.end?{column:this.source.end.column+1,line:this.source.end.line,offset:"number"==typeof this.source.end.offset?this.source.end.offset:o(t,this.source.end)+1}:{column:r.column+1,line:r.line,offset:r.offset+1};if(e.word){let s=t.slice(o(t,this.source.start),o(t,this.source.end)).indexOf(e.word);-1!==s&&(r=this.positionInside(s),n=this.positionInside(s+e.word.length))}else e.start?r={column:e.start.column,line:e.start.line,offset:o(t,e.start)}:e.index&&(r=this.positionInside(e.index)),e.end?n={column:e.end.column,line:e.end.line,offset:o(t,e.end)}:"number"==typeof e.endIndex?n=this.positionInside(e.endIndex):e.index&&(n=this.positionInside(e.index+1));return(n.line<r.line||n.line===r.line&&n.column<=r.column)&&(n={column:r.column+1,line:r.line,offset:r.offset+1}),{end:n,start:r}}raw(e,r){return(new t).raw(this,e,r)}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 s=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){if(null==n)continue;let i=t.get(n.input);null==i&&(i=s,t.set(n.input,s),s++),r[e]={end:n.end,inputId:i,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=r){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)}}return Oi=a,a.default=a,Oi}function Io(){if(Pi)return Ri;Pi=1;let e=ko();class t extends e{constructor(e){super(e),this.type="comment"}}return Ri=t,t.default=t,Ri}function Eo(){if(Ti)return Ai;Ti=1;let e=ko();class t extends e{get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}}return Ai=t,t.default=t,Ai}function Oo(){if(Li)return Ni;Li=1;let e,t,r,n,s=Io(),i=Eo(),o=ko(),{isClean:a,my:l}=xo();function c(e){return e.map(e=>(e.nodes&&(e.nodes=c(e.nodes)),delete e.source,e))}function u(e){if(e[a]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)u(t)}class h extends o{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]}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),s=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let e of s)this.proxyOf.nodes.splice(n+1,0,e);for(let e in this.indexes)r=this.indexes[e],n<r&&(this.indexes[e]=r+s.length);return this.markDirty(),this}insertBefore(e,t){let r,n=this.index(e),s=0===n&&"prepend",i=this.normalize(t,this.proxyOf.nodes[n],s).reverse();n=this.index(e);for(let e of i)this.proxyOf.nodes.splice(n,0,e);for(let e in this.indexes)r=this.indexes[e],n<=r&&(this.indexes[e]=r+i.length);return this.markDirty(),this}normalize(r,o){if("string"==typeof r)r=c(t(r).nodes);else if(void 0===r)r=[];else if(Array.isArray(r)){r=r.slice(0);for(let e of r)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===r.type&&"document"!==this.type){r=r.nodes.slice(0);for(let e of r)e.parent&&e.parent.removeChild(e,"ignore")}else if(r.type)r=[r];else if(r.prop){if(void 0===r.value)throw new Error("Value field is missed in node creation");"string"!=typeof r.value&&(r.value=String(r.value)),r=[new i(r)]}else if(r.selector||r.selectors)r=[new n(r)];else if(r.name)r=[new e(r)];else{if(!r.text)throw new Error("Unknown node type in node creation");r=[new s(r)]}return r.map(e=>(e[l]||h.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[a]&&u(e),e.raws||(e.raws={}),void 0===e.raws.before&&o&&void 0!==o.raws.before&&(e.raws.before=o.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)}))}}return h.registerParse=e=>{t=e},h.registerRule=e=>{n=e},h.registerAtRule=t=>{e=t},h.registerRoot=e=>{r=e},Ni=h,h.default=h,h.rebuild=t=>{"atrule"===t.type?Object.setPrototypeOf(t,e.prototype):"rule"===t.type?Object.setPrototypeOf(t,n.prototype):"decl"===t.type?Object.setPrototypeOf(t,i.prototype):"comment"===t.type?Object.setPrototypeOf(t,s.prototype):"root"===t.type&&Object.setPrototypeOf(t,r.prototype),t[l]=!0,t.nodes&&t.nodes.forEach(e=>{h.rebuild(e)})},Ni}function Mo(){if(Di)return _i;Di=1;let e=Oo();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 _i=t,t.default=t,e.registerAtRule(t),_i}function Ro(){if(Bi)return Fi;Bi=1;let e,t,r=Oo();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},Fi=n,n.default=n,Fi}function Po(){if(ji)return Ui;ji=1;return Ui={nanoid:(e=21)=>{let t="",r=0|e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(r=t)=>{let n="",s=0|r;for(;s--;)n+=e[Math.random()*e.length|0];return n}},Ui}function Ao(){if(Wi)return zi;Wi=1;let{existsSync:e,readFileSync:t}=gi,{dirname:r,join:n}=gi,{SourceMapConsumer:s,SourceMapGenerator:i}=gi;class o{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let n=t.map?t.map.prev:void 0,s=this.loadMap(t.from,n);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=r(this.mapFile)),s&&(this.text=s)}consumer(){return this.consumerCache||(this.consumerCache=new s(this.text)),this.consumerCache}decodeInline(e){let t=e.match(/^data:application\/json;charset=utf-?8,/)||e.match(/^data:application\/json,/);if(t)return decodeURIComponent(e.substr(t[0].length));let r=e.match(/^data:application\/json;charset=utf-?8;base64,/)||e.match(/^data:application\/json;base64,/);if(r)return n=e.substr(r[0].length),Buffer?Buffer.from(n,"base64").toString():window.atob(n);var n;let s=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+s)}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=/g);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(n){if(this.root=r(n),e(n))return this.mapFile=n,t(n,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof s)return i.fromSourceMap(t).toString();if(t instanceof i)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let r=t(e);if(r){let e=this.loadFile(r);if(!e)throw new Error("Unable to load previous source map: "+r.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=n(r(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return zi=o,o.default=o,zi}function To(){if($i)return qi;$i=1;let{nanoid:e}=Po(),{isAbsolute:t,resolve:r}=gi,{SourceMapConsumer:n,SourceMapGenerator:s}=gi,{fileURLToPath:i,pathToFileURL:o}=gi,a=xi(),l=Ao(),c=gi,u=Symbol("lineToIndexCache"),h=Boolean(n&&s),d=Boolean(r&&t);function p(e){if(e[u])return e[u];let t=e.css.split("\n"),r=new Array(t.length),n=0;for(let e=0,s=t.length;e<s;e++)r[e]=n,n+=t[e].length+1;return e[u]=r,r}class f{get from(){return this.file||this.id}constructor(n,s={}){if(null==n||"object"==typeof n&&!n.toString)throw new Error(`PostCSS received ${n} instead of CSS string`);if(this.css=n.toString(),"\ufeff"===this.css[0]||""===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,this.document=this.css,s.document&&(this.document=s.document.toString()),s.from&&(!d||/^\w+:\/\//.test(s.from)||t(s.from)?this.file=s.from:this.file=r(s.from)),d&&h){let e=new l(this.css,s);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 "+e(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let s,i,l,c,u;if(t&&"object"==typeof t){let e=t,n=r;if("number"==typeof e.offset){c=e.offset;let n=this.fromOffset(c);t=n.line,r=n.col}else t=e.line,r=e.column,c=this.fromLineAndColumn(t,r);if("number"==typeof n.offset){l=n.offset;let e=this.fromOffset(l);i=e.line,s=e.col}else i=n.line,s=n.column,l=this.fromLineAndColumn(n.line,n.column)}else if(r)c=this.fromLineAndColumn(t,r);else{c=t;let e=this.fromOffset(c);t=e.line,r=e.col}let h=this.origin(t,r,i,s);return u=h?new a(e,void 0===h.endLine?h.line:{column:h.column,line:h.line},void 0===h.endLine?h.column:{column:h.endColumn,line:h.endLine},h.source,h.file,n.plugin):new a(e,void 0===i?t:{column:r,line:t},void 0===i?r:{column:s,line:i},this.css,this.file,n.plugin),u.input={column:r,endColumn:s,endLine:i,endOffset:l,line:t,offset:c,source:this.css},this.file&&(o&&(u.input.url=o(this.file).toString()),u.input.file=this.file),u}fromLineAndColumn(e,t){return p(this)[e-1]+t-1}fromOffset(e){let t=p(this),r=0;if(e>=t[t.length-1])r=t.length-1;else{let n,s=t.length-2;for(;r<s;)if(n=r+(s-r>>1),e<t[n])s=n-1;else{if(!(e>=t[n+1])){r=n;break}r=n+1}}return{col:e-t[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:r(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,r,n,s){if(!this.map)return!1;let a,l,c=this.map.consumer(),u=c.originalPositionFor({column:r,line:e});if(!u.source)return!1;"number"==typeof n&&(a=c.originalPositionFor({column:s,line:n})),l=t(u.source)?o(u.source):new URL(u.source,this.map.consumer().sourceRoot||o(this.map.mapFile));let h={column:u.column,endColumn:a&&a.column,endLine:a&&a.line,line:u.line,url:l.toString()};if("file:"===l.protocol){if(!i)throw new Error("file: protocol is not available in this PostCSS build");h.file=i(l)}let d=c.sourceContentFor(u.source);return d&&(h.source=d),h}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}}return qi=f,f.default=f,c&&c.registerInput&&c.registerInput(f),qi}function No(){if(Gi)return Vi;Gi=1;let e,t,r=Oo();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},Vi=n,n.default=n,r.registerRoot(n),Vi}function Lo(){if(Ji)return Hi;Ji=1;let e={comma:t=>e.split(t,[","],!0),space:t=>e.split(t,[" ","\n","\t"]),split(e,t,r){let n=[],s="",i=!1,o=0,a=!1,l="",c=!1;for(let r of e)c?c=!1:"\\"===r?c=!0:a?r===l&&(a=!1):'"'===r||"'"===r?(a=!0,l=r):"("===r?o+=1:")"===r?o>0&&(o-=1):0===o&&t.includes(r)&&(i=!0),i?(""!==s&&n.push(s.trim()),s="",i=!1):s+=r;return(r||""!==s)&&n.push(s.trim()),n}};return Hi=e,e.default=e,Hi}function _o(){if(Yi)return Ki;Yi=1;let e=Oo(),t=Lo();class r extends e{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)}constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}}return Ki=r,r.default=r,e.registerRule(r),Ki}function Do(){if(eo)return Zi;eo=1;let{dirname:e,relative:t,resolve:r,sep:n}=gi,{SourceMapConsumer:s,SourceMapGenerator:i}=gi,{pathToFileURL:o}=gi,a=To(),l=Boolean(s&&i),c=Boolean(e&&r&&t&&n);return Zi=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 r,n=this.toUrl(this.path(t.file)),i=t.root||e(t.file);!1===this.mapOpts.sourcesContent?(r=new s(t.text),r.sourcesContent&&(r.sourcesContent=null)):r=t.consumer(),this.map.applySourceMap(r,n,this.toUrl(this.path(i)))}}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&&e.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),c&&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=i.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new i({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 i({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,r=1,n=1,s="<no source>",o={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(i,a,l)=>{if(this.css+=i,a&&"end"!==l&&(o.generated.line=r,o.generated.column=n-1,a.source&&a.source.start?(o.source=this.sourcePath(a),o.original.line=a.source.start.line,o.original.column=a.source.start.column-1,this.map.addMapping(o)):(o.source=s,o.original.line=1,o.original.column=0,this.map.addMapping(o))),t=i.match(/\n/g),t?(r+=t.length,e=i.lastIndexOf("\n"),n=i.length-e):n+=i.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?(o.source=this.sourcePath(a),o.original.line=a.source.end.line,o.original.column=a.source.end.column-1,o.generated.line=r,o.generated.column=n-2,this.map.addMapping(o)):(o.source=s,o.original.line=1,o.original.column=0,o.generated.line=r,o.generated.column=n-1,this.map.addMapping(o)))}})}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(n){if(this.mapOpts.absolute)return n;if(60===n.charCodeAt(0))return n;if(/^\w+:\/\//.test(n))return n;let s=this.memoizedPaths.get(n);if(s)return s;let i=this.opts.to?e(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(i=e(r(i,this.mapOpts.annotation)));let o=t(i,n);return this.memoizedPaths.set(n,o),o}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(o){let t=o(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;"\\"===n&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}}}function Fo(){if(so)return no;so=1;let e=Mo(),t=Io(),r=Eo(),n=No(),s=_o(),i=function(){if(ro)return to;ro=1;const e="'".charCodeAt(0),t='"'.charCodeAt(0),r="\\".charCodeAt(0),n="/".charCodeAt(0),s="\n".charCodeAt(0),i=" ".charCodeAt(0),o="\f".charCodeAt(0),a="\t".charCodeAt(0),l="\r".charCodeAt(0),c="[".charCodeAt(0),u="]".charCodeAt(0),h="(".charCodeAt(0),d=")".charCodeAt(0),p="{".charCodeAt(0),f="}".charCodeAt(0),m=";".charCodeAt(0),g="*".charCodeAt(0),v=":".charCodeAt(0),y="@".charCodeAt(0),b=/[\t\n\f\r "#'()/;[\\\]{}]/g,w=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,S=/.[\r\n"'(/\\]/,C=/[\da-f]/i;return to=function(x,k={}){let I,E,O,M,R,P,A,T,N,L,_=x.css.valueOf(),D=k.ignoreErrors,F=_.length,B=0,U=[],j=[];function z(e){throw x.error("Unclosed "+e,B)}return{back:function(e){j.push(e)},endOfFile:function(){return 0===j.length&&B>=F},nextToken:function(x){if(j.length)return j.pop();if(B>=F)return;let k=!!x&&x.ignoreUnclosed;switch(I=_.charCodeAt(B),I){case s:case i:case a:case l:case o:M=B;do{M+=1,I=_.charCodeAt(M)}while(I===i||I===s||I===a||I===l||I===o);P=["space",_.slice(B,M)],B=M-1;break;case c:case u:case p:case f:case v:case m:case d:{let e=String.fromCharCode(I);P=[e,e,B];break}case h:if(L=U.length?U.pop()[1]:"",N=_.charCodeAt(B+1),"url"===L&&N!==e&&N!==t&&N!==i&&N!==s&&N!==a&&N!==o&&N!==l){M=B;do{if(A=!1,M=_.indexOf(")",M+1),-1===M){if(D||k){M=B;break}z("bracket")}for(T=M;_.charCodeAt(T-1)===r;)T-=1,A=!A}while(A);P=["brackets",_.slice(B,M+1),B,M],B=M}else M=_.indexOf(")",B+1),E=_.slice(B,M+1),-1===M||S.test(E)?P=["(","(",B]:(P=["brackets",E,B,M],B=M);break;case e:case t:R=I===e?"'":'"',M=B;do{if(A=!1,M=_.indexOf(R,M+1),-1===M){if(D||k){M=B+1;break}z("string")}for(T=M;_.charCodeAt(T-1)===r;)T-=1,A=!A}while(A);P=["string",_.slice(B,M+1),B,M],B=M;break;case y:b.lastIndex=B+1,b.test(_),M=0===b.lastIndex?_.length-1:b.lastIndex-2,P=["at-word",_.slice(B,M+1),B,M],B=M;break;case r:for(M=B,O=!0;_.charCodeAt(M+1)===r;)M+=1,O=!O;if(I=_.charCodeAt(M+1),O&&I!==n&&I!==i&&I!==s&&I!==a&&I!==l&&I!==o&&(M+=1,C.test(_.charAt(M)))){for(;C.test(_.charAt(M+1));)M+=1;_.charCodeAt(M+1)===i&&(M+=1)}P=["word",_.slice(B,M+1),B,M],B=M;break;default:I===n&&_.charCodeAt(B+1)===g?(M=_.indexOf("*/",B+2)+1,0===M&&(D||k?M=_.length:z("comment")),P=["comment",_.slice(B,M+1),B,M],B=M):(w.lastIndex=B+1,w.test(_),M=0===w.lastIndex?_.length-1:w.lastIndex-2,P=["word",_.slice(B,M+1),B,M],U.push(P),B=M)}return B++,P},position:function(){return B}}}}();const o={empty:!0,space:!0};return no=class{constructor(e){this.input=e,this.root=new n,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(t){let r,n,s,i=new e;i.name=t[1].slice(1),""===i.name&&this.unnamedAtrule(i,t),this.init(i,t[2]);let o=!1,a=!1,l=[],c=[];for(;!this.tokenizer.endOfFile();){if(r=(t=this.tokenizer.nextToken())[0],"("===r||"["===r?c.push("("===r?")":"]"):"{"===r&&c.length>0?c.push("}"):r===c[c.length-1]&&c.pop(),0===c.length){if(";"===r){i.source.end=this.getPosition(t[2]),i.source.end.offset++,this.semicolon=!0;break}if("{"===r){a=!0;break}if("}"===r){if(l.length>0){for(s=l.length-1,n=l[s];n&&"space"===n[0];)n=l[--s];n&&(i.source.end=this.getPosition(n[3]||n[2]),i.source.end.offset++)}this.end(t);break}l.push(t)}else l.push(t);if(this.tokenizer.endOfFile()){o=!0;break}}i.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(i.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(i,"params",l),o&&(t=l[l.length-1],i.source.end=this.getPosition(t[3]||t[2]),i.source.end.offset++,this.spaces=i.raws.between,i.raws.between="")):(i.raws.afterName="",i.params=""),a&&(i.nodes=[],this.current=i)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let r,n=0;for(let s=t-1;s>=0&&(r=e[s],"space"===r[0]||(n+=1,2!==n));s--);throw this.input.error("Missed semicolon","word"===r[0]?r[3]+1:r[2])}colon(e){let t,r,n,s=0;for(let[i,o]of e.entries()){if(r=o,n=r[0],"("===n&&(s+=1),")"===n&&(s-=1),0===s&&":"===n){if(t){if("word"===t[0]&&"progid"===t[1])continue;return i}this.doubleColon(r)}t=r}return!1}comment(e){let r=new t;this.init(r,e[2]),r.source.end=this.getPosition(e[3]||e[2]),r.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))r.text="",r.raws.left=n,r.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);r.text=e[2],r.raws.left=e[1],r.raws.right=e[3]}}createTokenizer(){this.tokenizer=i(this.input)}decl(e,t){let n=new r;this.init(n,e[0][2]);let s,i=e[e.length-1];for(";"===i[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(i[3]||i[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}}(e)),n.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),n.raws.before+=e.shift()[1];for(n.source.start=this.getPosition(e[0][2]),n.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;n.prop+=e.shift()[1]}for(n.raws.between="";e.length;){if(s=e.shift(),":"===s[0]){n.raws.between+=s[1];break}"word"===s[0]&&/\w/.test(s[1])&&this.unknownWord([s]),n.raws.between+=s[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let o,a=[];for(;e.length&&(o=e[0][0],"space"===o||"comment"===o);)a.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(s=e[t],"!important"===s[1].toLowerCase()){n.important=!0;let r=this.stringFrom(e,t);r=this.spacesFromEnd(e)+r," !important"!==r&&(n.raws.important=r);break}if("important"===s[1].toLowerCase()){let r=e.slice(0),s="";for(let e=t;e>0;e--){let t=r[e][0];if(s.trim().startsWith("!")&&"space"!==t)break;s=r.pop()[1]+s}s.trim().startsWith("!")&&(n.important=!0,n.raws.important=s,e=r)}if("space"!==s[0]&&"comment"!==s[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(n,"value",a.concat(e),t),n.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new s;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 t=this.current.nodes[this.current.nodes.length-1];t&&"rule"===t.type&&!t.raws.ownSemicolon&&(t.raws.ownSemicolon=this.spaces,this.spaces="",t.source.end=this.getPosition(e[2]),t.source.end.offset+=t.raws.ownSemicolon.length)}}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,s=null,i=[],o=e[1].startsWith("--"),a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)s||(s=l),i.push("("===r?")":"]");else if(o&&n&&"{"===r)s||(s=l),i.push("}");else if(0===i.length){if(";"===r){if(n)return void this.decl(a,o);break}if("{"===r)return void this.rule(a);if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}":"===r&&(n=!0)}else r===i[i.length-1]&&(i.pop(),0===i.length&&(s=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),i.length>0&&this.unclosedBracket(s),t&&n){if(!o)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,o)}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 s,i,a,l,c=r.length,u="",h=!0;for(let e=0;e<c;e+=1)s=r[e],i=s[0],"space"!==i||e!==c-1||n?"comment"===i?(l=r[e-1]?r[e-1][0]:"empty",a=r[e+1]?r[e+1][0]:"empty",o[l]||o[a]||","===u.slice(-1)?h=!1:u+=s[1]):u+=s[1]:h=!1;if(!h){let n=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:n,value:u}}e[t]=u}rule(e){e.pop();let t=new s;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 "+e[0][1],{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})}},no}function Bo(){if(oo)return io;oo=1;let e=Oo(),t=To(),r=Fo();function n(e,n){let s=new t(e,n),i=new r(s);try{i.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 i.root}return io=n,n.default=n,e.registerParse(n),io}function Uo(){if(lo)return ao;lo=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 ao=e,e.default=e,ao}function jo(){if(uo)return co;uo=1;let e=Uo();class t{get content(){return this.css}constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css="",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)}}return co=t,t.default=t,co}function zo(){if(po)return ho;po=1;let e={};return ho=function(t){e[t]||(e[t]=!0,"undefined"!=typeof console&&console.warn&&console.warn(t))}}function Wo(){if(mo)return fo;mo=1;let e=Oo(),t=Ro(),r=Do(),n=Bo(),s=jo(),i=No(),o=Ii(),{isClean:a,my:l}=xo(),c=zo();const u={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},h={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},d={Once:!0,postcssPlugin:!0,prepare:!0};function p(e){return"object"==typeof e&&"function"==typeof e.then}function f(e){let t=!1,r=u[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 m(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 g(e){return e[a]=!1,e.nodes&&e.nodes.forEach(e=>g(e)),e}let v={};class y{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"}constructor(t,r,i){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 s)o=g(r.root),r.map&&(void 0===i.map&&(i.map={}),i.map.inline||(i.map.inline=!1),i.map.prev=r.map);else{let t=n;i.syntax&&(t=i.syntax.parse),i.parser&&(t=i.parser),t.parse&&(t=t.parse);try{o=t(r,i)}catch(e){this.processed=!0,this.error=e}o&&!o[l]&&e.rebuild(o)}else o=g(r);this.result=new s(t,o,i),this.helpers={...v,postcss:v,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,s=t.split("."),i=n.split(".");(s[0]!==i[0]||parseInt(s[1])>parseInt(i[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(!h[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!d[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 e=this.result.root;for(;!e[a];){e[a]=!0;let t=[m(e)];for(;t.length>0;){let e=this.visitTick(t);if(p(e))try{await e}catch(e){let r=t[t.length-1].node;throw this.handleError(e,r)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map(e=>r(e,this.helpers));await Promise.all(t)}else await r(e,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=o;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let n=new r(t,this.result.root,this.result.opts).generate();return this.result.css=n[0],this.result.map=n[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 e=this.result.root;for(;!e[a];)e[a]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||c("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(e){let t=e[e.length-1],{node:r,visitors:n}=t;if("root"!==r.type&&"document"!==r.type&&!r.parent)return void e.pop();if(n.length>0&&t.visitorIndex<n.length){let[e,s]=n[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===n.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return s(r.toProxy(),this.helpers)}catch(e){throw this.handleError(e,r)}}if(0!==t.iterator){let n,s=t.iterator;for(;n=r.nodes[r.indexes[s]];)if(r.indexes[s]+=1,!n[a])return n[a]=!0,void e.push(m(n));t.iterator=0,delete r.indexes[s]}let s=t.events;for(;t.eventIndex<s.length;){let e=s[t.eventIndex];if(t.eventIndex+=1,0===e)return void(r.nodes&&r.nodes.length&&(r[a]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[a]=!0;let t=f(e);for(let r of t)if(0===r)e.nodes&&e.each(e=>{e[a]||this.walkSync(e)});else{let t=this.listeners[r];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}}return y.registerPostcss=e=>{v=e},fo=y,y.default=y,i.registerLazyResult(y),t.registerLazyResult(y),fo}function qo(){if(bo)return yo;bo=1;let e=Ro(),t=Wo(),r=function(){if(vo)return go;vo=1;let e=Do(),t=Bo();const r=jo();let n=Ii(),s=zo();class i{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,r=t;try{e=r(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"}constructor(t,s,i){let o;s=s.toString(),this.stringified=!1,this._processor=t,this._css=s,this._opts=i,this._map=void 0;let a=n;this.result=new r(this._processor,o,this._opts),this.result.css=s;let l=this;Object.defineProperty(this.result,"root",{get:()=>l.root});let c=new e(a,o,this._opts,s);if(c.isMap()){let[e,t]=c.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else c.clearAnnotation(),this.result.css=c.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||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}warnings(){return[]}}return go=i,i.default=i,go}(),n=No();class s{constructor(e=[]){this.version="8.5.6",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(e,n={}){return this.plugins.length||n.parser||n.stringifier||n.syntax?new t(this,e,n):new r(this,e,n)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}return yo=s,s.default=s,n.registerProcessor(s),e.registerProcessor(s),yo}const $o=hi(function(){if(So)return wo;So=1;let e=Mo(),t=Io(),r=Oo(),n=xi(),s=Eo(),i=Ro(),o=function(){if(Qi)return Xi;Qi=1;let e=Mo(),t=Io(),r=Eo(),n=To(),s=Ao(),i=No(),o=_o();function a(l,c){if(Array.isArray(l))return l.map(e=>a(e));let{inputs:u,...h}=l;if(u){c=[];for(let e of u){let t={...e,__proto__:n.prototype};t.map&&(t.map={...t.map,__proto__:s.prototype}),c.push(t)}}if(h.nodes&&(h.nodes=l.nodes.map(e=>a(e,c))),h.source){let{inputId:e,...t}=h.source;h.source=t,null!=e&&(h.source.input=c[e])}if("root"===h.type)return new i(h);if("decl"===h.type)return new r(h);if("rule"===h.type)return new o(h);if("comment"===h.type)return new t(h);if("atrule"===h.type)return new e(h);throw new Error("Unknown node type: "+l.type)}return Xi=a,a.default=a,Xi}(),a=To(),l=Wo(),c=Lo(),u=ko(),h=Bo(),d=qo(),p=jo(),f=No(),m=_o(),g=Ii(),v=Uo();function y(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new d(e)}return y.plugin=function(e,t){let r,n=!1;function s(...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 s=t(...r);return s.postcssPlugin=e,s.postcssVersion=(new d).version,s}return Object.defineProperty(s,"postcss",{get:()=>(r||(r=s()),r)}),s.process=function(e,t,r){return y([s(r)]).process(e,t)},s},y.stringify=g,y.parse=h,y.fromJSON=o,y.list=c,y.comment=e=>new t(e),y.atRule=t=>new e(t),y.decl=e=>new s(e),y.rule=e=>new m(e),y.root=e=>new f(e),y.document=e=>new i(e),y.CssSyntaxError=n,y.Declaration=s,y.Container=r,y.Processor=d,y.Document=i,y.Comment=t,y.Warning=v,y.AtRule=e,y.Result=p,y.Input=a,y.Rule=m,y.Root=f,y.Node=u,l.registerPostcss(y),wo=y,y.default=y,wo}());$o.stringify,$o.fromJSON,$o.plugin,$o.parse,$o.list,$o.document,$o.comment,$o.atRule,$o.rule,$o.decl,$o.root,$o.CssSyntaxError,$o.Declaration,$o.Container,$o.Processor,$o.Document,$o.Comment,$o.Warning,$o.AtRule,$o.Result,$o.Input,$o.Rule,$o.Root,$o.Node;var Vo=Object.defineProperty,Go=(e,t,r)=>((e,t,r)=>t in e?Vo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);function Ho(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Jo(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}var Ko,Yo={exports:{}};function Xo(){if(Ko)return Yo.exports;Ko=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,blackBright:e,redBright:e,greenBright:e,yellowBright:e,blueBright:e,magentaBright:e,cyanBright:e,whiteBright:e,bgBlackBright:e,bgRedBright:e,bgGreenBright:e,bgYellowBright:e,bgBlueBright:e,bgMagentaBright:e,bgCyanBright:e,bgWhiteBright:e}};return Yo.exports=t(),Yo.exports.createColors=t,Yo.exports}const Qo=Jo(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Zo,ea,ta,ra,na,sa;function ia(){if(ea)return Zo;ea=1;let e=Xo(),t=Qo;class r extends Error{constructor(e,t,n,s,i,o){super(e),this.name="CssSyntaxError",this.reason=e,i&&(this.file=i),s&&(this.source=s),o&&(this.plugin=o),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);let s=e=>e,i=e=>e,o=e=>e;if(r){let{bold:r,gray:n,red:a}=e.createColors(!0);i=e=>r(a(e)),s=e=>n(e),t&&(o=e=>t(e))}let a=n.split(/\r?\n/),l=Math.max(this.line-3,0),c=Math.min(this.line+2,a.length),u=String(c).length;return a.slice(l,c).map((e,t)=>{let r=l+1+t,n=" "+(" "+r).slice(-u)+" | ";if(r===this.line){if(e.length>160){let t=20,r=Math.max(0,this.column-t),a=Math.max(this.column+t,this.endColumn+t),l=e.slice(r,a),c=s(n.replace(/\d/g," "))+e.slice(0,Math.min(this.column-1,t-1)).replace(/[^\t]/g," ");return i(">")+s(n)+o(l)+"\n "+c+i("^")}let t=s(n.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return i(">")+s(n)+o(e)+"\n "+t+i("^")}return" "+s(n)+o(e)}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}return Zo=r,r.default=r,Zo}function oa(){if(ra)return ta;ra=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 s=(e.raws.between||"")+(t?";":"");this.builder(r+n+s,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,s=0;for(;n&&"root"!==n.type;)s+=1,n=n.parent;if(r.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<s;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 s=e.nodes[n],i=this.raw(s,"before");i&&this.builder(i),this.stringify(s,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 s;if(n||(n=r),r&&(s=t.raws[r],void 0!==s))return s;let i=t.parent;if("before"===n){if(!i||"root"===i.type&&i.first===t)return"";if(i&&"document"===i.type)return""}if(!i)return e[n];let o=t.root();if(o.rawCache||(o.rawCache={}),void 0!==o.rawCache[n])return o.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(t,n);{let e="raw"+((a=n)[0].toUpperCase()+a.slice(1));this[e]?s=this[e](o,t):o.walk(e=>{if(s=e.raws[r],void 0!==s)return!1})}var a;return void 0===s&&(s=e[n]),o.rawCache[n]=s,s}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 ta=t,t.default=t,ta}function aa(){if(sa)return na;sa=1;let e=oa();function t(t,r){new e(r).stringify(t)}return na=t,t.default=t,na}var la,ca,ua,ha,da,pa,fa,ma,ga,va,ya,ba,wa,Sa,Ca,xa,ka,Ia,Ea,Oa,Ma,Ra,Pa,Aa,Ta,Na,La,_a,Da,Fa,Ba,Ua,ja,za,Wa,qa,$a,Va,Ga,Ha,Ja,Ka,Ya,Xa,Qa,Za,el,tl,rl,nl={};function sl(){return la||(la=1,nl.isClean=Symbol("isClean"),nl.my=Symbol("my")),nl}function il(){if(ua)return ca;ua=1;let e=ia(),t=oa(),r=aa(),{isClean:n,my:s}=sl();function i(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 s=e[n],o=typeof s;"parent"===n&&"object"===o?t&&(r[n]=t):"source"===n?r[n]=s:Array.isArray(s)?r[n]=s.map(e=>i(e,r)):("object"===o&&null!==s&&(s=i(s)),r[n]=s)}return r}function o(e,t){if(t&&void 0!==t.offset)return t.offset;let r=1,n=1,s=0;for(let i=0;i<e.length;i++){if(n===t.line&&r===t.column){s=i;break}"\n"===e[i]?(r=1,n+=1):r+=1}return s}class a{get proxyOf(){return this}constructor(e={}){this.raws={},this[n]=!1,this[s]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let r of e[t])"function"==typeof r.clone?this.append(r.clone()):this.append(r)}else this[t]=e[t]}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=i(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(t,r={}){if(this.source){let{end:e,start:n}=this.rangeBy(r);return this.source.input.error(t,{column:n.column,line:n.line},{column:e.column,line:e.line},r)}return new e(t)}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)}}markClean(){this[n]=!0}markDirty(){if(this[n]){this[n]=!1;let e=this;for(;e=e.parent;)e[n]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e={}){let t=this.source.start;if(e.index)t=this.positionInside(e.index);else if(e.word){let r="document"in this.source.input?this.source.input.document:this.source.input.css,n=r.slice(o(r,this.source.start),o(r,this.source.end)).indexOf(e.word);-1!==n&&(t=this.positionInside(n))}return t}positionInside(e){let t=this.source.start.column,r=this.source.start.line,n="document"in this.source.input?this.source.input.document:this.source.input.css,s=o(n,this.source.start),i=s+e;for(let e=s;e<i;e++)"\n"===n[e]?(t=1,r+=1):t+=1;return{column:t,line:r,offset:i}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e={}){let t="document"in this.source.input?this.source.input.document:this.source.input.css,r={column:this.source.start.column,line:this.source.start.line,offset:o(t,this.source.start)},n=this.source.end?{column:this.source.end.column+1,line:this.source.end.line,offset:"number"==typeof this.source.end.offset?this.source.end.offset:o(t,this.source.end)+1}:{column:r.column+1,line:r.line,offset:r.offset+1};if(e.word){let s=t.slice(o(t,this.source.start),o(t,this.source.end)).indexOf(e.word);-1!==s&&(r=this.positionInside(s),n=this.positionInside(s+e.word.length))}else e.start?r={column:e.start.column,line:e.start.line,offset:o(t,e.start)}:e.index&&(r=this.positionInside(e.index)),e.end?n={column:e.end.column,line:e.end.line,offset:o(t,e.end)}:"number"==typeof e.endIndex?n=this.positionInside(e.endIndex):e.index&&(n=this.positionInside(e.index+1));return(n.line<r.line||n.line===r.line&&n.column<=r.column)&&(n={column:r.column+1,line:r.line,offset:r.offset+1}),{end:n,start:r}}raw(e,r){return(new t).raw(this,e,r)}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 s=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){if(null==n)continue;let i=t.get(n.input);null==i&&(i=s,t.set(n.input,s),s++),r[e]={end:n.end,inputId:i,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=r){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)}}return ca=a,a.default=a,ca}function ol(){if(da)return ha;da=1;let e=il();class t extends e{constructor(e){super(e),this.type="comment"}}return ha=t,t.default=t,ha}function al(){if(fa)return pa;fa=1;let e=il();class t extends e{get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}}return pa=t,t.default=t,pa}function ll(){if(ga)return ma;ga=1;let e,t,r,n,s=ol(),i=al(),o=il(),{isClean:a,my:l}=sl();function c(e){return e.map(e=>(e.nodes&&(e.nodes=c(e.nodes)),delete e.source,e))}function u(e){if(e[a]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)u(t)}class h extends o{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]}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),s=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let e of s)this.proxyOf.nodes.splice(n+1,0,e);for(let e in this.indexes)r=this.indexes[e],n<r&&(this.indexes[e]=r+s.length);return this.markDirty(),this}insertBefore(e,t){let r,n=this.index(e),s=0===n&&"prepend",i=this.normalize(t,this.proxyOf.nodes[n],s).reverse();n=this.index(e);for(let e of i)this.proxyOf.nodes.splice(n,0,e);for(let e in this.indexes)r=this.indexes[e],n<=r&&(this.indexes[e]=r+i.length);return this.markDirty(),this}normalize(r,o){if("string"==typeof r)r=c(t(r).nodes);else if(void 0===r)r=[];else if(Array.isArray(r)){r=r.slice(0);for(let e of r)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===r.type&&"document"!==this.type){r=r.nodes.slice(0);for(let e of r)e.parent&&e.parent.removeChild(e,"ignore")}else if(r.type)r=[r];else if(r.prop){if(void 0===r.value)throw new Error("Value field is missed in node creation");"string"!=typeof r.value&&(r.value=String(r.value)),r=[new i(r)]}else if(r.selector||r.selectors)r=[new n(r)];else if(r.name)r=[new e(r)];else{if(!r.text)throw new Error("Unknown node type in node creation");r=[new s(r)]}return r.map(e=>(e[l]||h.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[a]&&u(e),e.raws||(e.raws={}),void 0===e.raws.before&&o&&void 0!==o.raws.before&&(e.raws.before=o.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)}))}}return h.registerParse=e=>{t=e},h.registerRule=e=>{n=e},h.registerAtRule=t=>{e=t},h.registerRoot=e=>{r=e},ma=h,h.default=h,h.rebuild=t=>{"atrule"===t.type?Object.setPrototypeOf(t,e.prototype):"rule"===t.type?Object.setPrototypeOf(t,n.prototype):"decl"===t.type?Object.setPrototypeOf(t,i.prototype):"comment"===t.type?Object.setPrototypeOf(t,s.prototype):"root"===t.type&&Object.setPrototypeOf(t,r.prototype),t[l]=!0,t.nodes&&t.nodes.forEach(e=>{h.rebuild(e)})},ma}function cl(){if(ya)return va;ya=1;let e=ll();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 va=t,t.default=t,e.registerAtRule(t),va}function ul(){if(wa)return ba;wa=1;let e,t,r=ll();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},ba=n,n.default=n,ba}function hl(){if(Ca)return Sa;Ca=1;return Sa={nanoid:(e=21)=>{let t="",r=0|e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(r=t)=>{let n="",s=0|r;for(;s--;)n+=e[Math.random()*e.length|0];return n}},Sa}function dl(){if(ka)return xa;ka=1;let{existsSync:e,readFileSync:t}=Qo,{dirname:r,join:n}=Qo,{SourceMapConsumer:s,SourceMapGenerator:i}=Qo;class o{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let n=t.map?t.map.prev:void 0,s=this.loadMap(t.from,n);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=r(this.mapFile)),s&&(this.text=s)}consumer(){return this.consumerCache||(this.consumerCache=new s(this.text)),this.consumerCache}decodeInline(e){let t=e.match(/^data:application\/json;charset=utf-?8,/)||e.match(/^data:application\/json,/);if(t)return decodeURIComponent(e.substr(t[0].length));let r=e.match(/^data:application\/json;charset=utf-?8;base64,/)||e.match(/^data:application\/json;base64,/);if(r)return n=e.substr(r[0].length),Buffer?Buffer.from(n,"base64").toString():window.atob(n);var n;let s=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+s)}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=/g);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(n){if(this.root=r(n),e(n))return this.mapFile=n,t(n,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof s)return i.fromSourceMap(t).toString();if(t instanceof i)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let r=t(e);if(r){let e=this.loadFile(r);if(!e)throw new Error("Unable to load previous source map: "+r.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=n(r(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return xa=o,o.default=o,xa}function pl(){if(Ea)return Ia;Ea=1;let{nanoid:e}=hl(),{isAbsolute:t,resolve:r}=Qo,{SourceMapConsumer:n,SourceMapGenerator:s}=Qo,{fileURLToPath:i,pathToFileURL:o}=Qo,a=ia(),l=dl(),c=Qo,u=Symbol("lineToIndexCache"),h=Boolean(n&&s),d=Boolean(r&&t);function p(e){if(e[u])return e[u];let t=e.css.split("\n"),r=new Array(t.length),n=0;for(let e=0,s=t.length;e<s;e++)r[e]=n,n+=t[e].length+1;return e[u]=r,r}class f{get from(){return this.file||this.id}constructor(n,s={}){if(null==n||"object"==typeof n&&!n.toString)throw new Error(`PostCSS received ${n} instead of CSS string`);if(this.css=n.toString(),"\ufeff"===this.css[0]||""===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,this.document=this.css,s.document&&(this.document=s.document.toString()),s.from&&(!d||/^\w+:\/\//.test(s.from)||t(s.from)?this.file=s.from:this.file=r(s.from)),d&&h){let e=new l(this.css,s);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 "+e(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let s,i,l,c,u;if(t&&"object"==typeof t){let e=t,n=r;if("number"==typeof e.offset){c=e.offset;let n=this.fromOffset(c);t=n.line,r=n.col}else t=e.line,r=e.column,c=this.fromLineAndColumn(t,r);if("number"==typeof n.offset){l=n.offset;let e=this.fromOffset(l);i=e.line,s=e.col}else i=n.line,s=n.column,l=this.fromLineAndColumn(n.line,n.column)}else if(r)c=this.fromLineAndColumn(t,r);else{c=t;let e=this.fromOffset(c);t=e.line,r=e.col}let h=this.origin(t,r,i,s);return u=h?new a(e,void 0===h.endLine?h.line:{column:h.column,line:h.line},void 0===h.endLine?h.column:{column:h.endColumn,line:h.endLine},h.source,h.file,n.plugin):new a(e,void 0===i?t:{column:r,line:t},void 0===i?r:{column:s,line:i},this.css,this.file,n.plugin),u.input={column:r,endColumn:s,endLine:i,endOffset:l,line:t,offset:c,source:this.css},this.file&&(o&&(u.input.url=o(this.file).toString()),u.input.file=this.file),u}fromLineAndColumn(e,t){return p(this)[e-1]+t-1}fromOffset(e){let t=p(this),r=0;if(e>=t[t.length-1])r=t.length-1;else{let n,s=t.length-2;for(;r<s;)if(n=r+(s-r>>1),e<t[n])s=n-1;else{if(!(e>=t[n+1])){r=n;break}r=n+1}}return{col:e-t[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:r(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,r,n,s){if(!this.map)return!1;let a,l,c=this.map.consumer(),u=c.originalPositionFor({column:r,line:e});if(!u.source)return!1;"number"==typeof n&&(a=c.originalPositionFor({column:s,line:n})),l=t(u.source)?o(u.source):new URL(u.source,this.map.consumer().sourceRoot||o(this.map.mapFile));let h={column:u.column,endColumn:a&&a.column,endLine:a&&a.line,line:u.line,url:l.toString()};if("file:"===l.protocol){if(!i)throw new Error("file: protocol is not available in this PostCSS build");h.file=i(l)}let d=c.sourceContentFor(u.source);return d&&(h.source=d),h}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}}return Ia=f,f.default=f,c&&c.registerInput&&c.registerInput(f),Ia}function fl(){if(Ma)return Oa;Ma=1;let e,t,r=ll();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},Oa=n,n.default=n,r.registerRoot(n),Oa}function ml(){if(Pa)return Ra;Pa=1;let e={comma:t=>e.split(t,[","],!0),space:t=>e.split(t,[" ","\n","\t"]),split(e,t,r){let n=[],s="",i=!1,o=0,a=!1,l="",c=!1;for(let r of e)c?c=!1:"\\"===r?c=!0:a?r===l&&(a=!1):'"'===r||"'"===r?(a=!0,l=r):"("===r?o+=1:")"===r?o>0&&(o-=1):0===o&&t.includes(r)&&(i=!0),i?(""!==s&&n.push(s.trim()),s="",i=!1):s+=r;return(r||""!==s)&&n.push(s.trim()),n}};return Ra=e,e.default=e,Ra}function gl(){if(Ta)return Aa;Ta=1;let e=ll(),t=ml();class r extends e{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)}constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}}return Aa=r,r.default=r,e.registerRule(r),Aa}function vl(){if(Da)return _a;Da=1;let{dirname:e,relative:t,resolve:r,sep:n}=Qo,{SourceMapConsumer:s,SourceMapGenerator:i}=Qo,{pathToFileURL:o}=Qo,a=pl(),l=Boolean(s&&i),c=Boolean(e&&r&&t&&n);return _a=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 r,n=this.toUrl(this.path(t.file)),i=t.root||e(t.file);!1===this.mapOpts.sourcesContent?(r=new s(t.text),r.sourcesContent&&(r.sourcesContent=null)):r=t.consumer(),this.map.applySourceMap(r,n,this.toUrl(this.path(i)))}}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&&e.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),c&&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=i.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new i({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 i({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,r=1,n=1,s="<no source>",o={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(i,a,l)=>{if(this.css+=i,a&&"end"!==l&&(o.generated.line=r,o.generated.column=n-1,a.source&&a.source.start?(o.source=this.sourcePath(a),o.original.line=a.source.start.line,o.original.column=a.source.start.column-1,this.map.addMapping(o)):(o.source=s,o.original.line=1,o.original.column=0,this.map.addMapping(o))),t=i.match(/\n/g),t?(r+=t.length,e=i.lastIndexOf("\n"),n=i.length-e):n+=i.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?(o.source=this.sourcePath(a),o.original.line=a.source.end.line,o.original.column=a.source.end.column-1,o.generated.line=r,o.generated.column=n-2,this.map.addMapping(o)):(o.source=s,o.original.line=1,o.original.column=0,o.generated.line=r,o.generated.column=n-1,this.map.addMapping(o)))}})}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(n){if(this.mapOpts.absolute)return n;if(60===n.charCodeAt(0))return n;if(/^\w+:\/\//.test(n))return n;let s=this.memoizedPaths.get(n);if(s)return s;let i=this.opts.to?e(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(i=e(r(i,this.mapOpts.annotation)));let o=t(i,n);return this.memoizedPaths.set(n,o),o}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(o){let t=o(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;"\\"===n&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}}}function yl(){if(ja)return Ua;ja=1;let e=cl(),t=ol(),r=al(),n=fl(),s=gl(),i=function(){if(Ba)return Fa;Ba=1;const e="'".charCodeAt(0),t='"'.charCodeAt(0),r="\\".charCodeAt(0),n="/".charCodeAt(0),s="\n".charCodeAt(0),i=" ".charCodeAt(0),o="\f".charCodeAt(0),a="\t".charCodeAt(0),l="\r".charCodeAt(0),c="[".charCodeAt(0),u="]".charCodeAt(0),h="(".charCodeAt(0),d=")".charCodeAt(0),p="{".charCodeAt(0),f="}".charCodeAt(0),m=";".charCodeAt(0),g="*".charCodeAt(0),v=":".charCodeAt(0),y="@".charCodeAt(0),b=/[\t\n\f\r "#'()/;[\\\]{}]/g,w=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,S=/.[\r\n"'(/\\]/,C=/[\da-f]/i;return Fa=function(x,k={}){let I,E,O,M,R,P,A,T,N,L,_=x.css.valueOf(),D=k.ignoreErrors,F=_.length,B=0,U=[],j=[];function z(e){throw x.error("Unclosed "+e,B)}return{back:function(e){j.push(e)},endOfFile:function(){return 0===j.length&&B>=F},nextToken:function(x){if(j.length)return j.pop();if(B>=F)return;let k=!!x&&x.ignoreUnclosed;switch(I=_.charCodeAt(B),I){case s:case i:case a:case l:case o:M=B;do{M+=1,I=_.charCodeAt(M)}while(I===i||I===s||I===a||I===l||I===o);P=["space",_.slice(B,M)],B=M-1;break;case c:case u:case p:case f:case v:case m:case d:{let e=String.fromCharCode(I);P=[e,e,B];break}case h:if(L=U.length?U.pop()[1]:"",N=_.charCodeAt(B+1),"url"===L&&N!==e&&N!==t&&N!==i&&N!==s&&N!==a&&N!==o&&N!==l){M=B;do{if(A=!1,M=_.indexOf(")",M+1),-1===M){if(D||k){M=B;break}z("bracket")}for(T=M;_.charCodeAt(T-1)===r;)T-=1,A=!A}while(A);P=["brackets",_.slice(B,M+1),B,M],B=M}else M=_.indexOf(")",B+1),E=_.slice(B,M+1),-1===M||S.test(E)?P=["(","(",B]:(P=["brackets",E,B,M],B=M);break;case e:case t:R=I===e?"'":'"',M=B;do{if(A=!1,M=_.indexOf(R,M+1),-1===M){if(D||k){M=B+1;break}z("string")}for(T=M;_.charCodeAt(T-1)===r;)T-=1,A=!A}while(A);P=["string",_.slice(B,M+1),B,M],B=M;break;case y:b.lastIndex=B+1,b.test(_),M=0===b.lastIndex?_.length-1:b.lastIndex-2,P=["at-word",_.slice(B,M+1),B,M],B=M;break;case r:for(M=B,O=!0;_.charCodeAt(M+1)===r;)M+=1,O=!O;if(I=_.charCodeAt(M+1),O&&I!==n&&I!==i&&I!==s&&I!==a&&I!==l&&I!==o&&(M+=1,C.test(_.charAt(M)))){for(;C.test(_.charAt(M+1));)M+=1;_.charCodeAt(M+1)===i&&(M+=1)}P=["word",_.slice(B,M+1),B,M],B=M;break;default:I===n&&_.charCodeAt(B+1)===g?(M=_.indexOf("*/",B+2)+1,0===M&&(D||k?M=_.length:z("comment")),P=["comment",_.slice(B,M+1),B,M],B=M):(w.lastIndex=B+1,w.test(_),M=0===w.lastIndex?_.length-1:w.lastIndex-2,P=["word",_.slice(B,M+1),B,M],U.push(P),B=M)}return B++,P},position:function(){return B}}}}();const o={empty:!0,space:!0};return Ua=class{constructor(e){this.input=e,this.root=new n,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(t){let r,n,s,i=new e;i.name=t[1].slice(1),""===i.name&&this.unnamedAtrule(i,t),this.init(i,t[2]);let o=!1,a=!1,l=[],c=[];for(;!this.tokenizer.endOfFile();){if(r=(t=this.tokenizer.nextToken())[0],"("===r||"["===r?c.push("("===r?")":"]"):"{"===r&&c.length>0?c.push("}"):r===c[c.length-1]&&c.pop(),0===c.length){if(";"===r){i.source.end=this.getPosition(t[2]),i.source.end.offset++,this.semicolon=!0;break}if("{"===r){a=!0;break}if("}"===r){if(l.length>0){for(s=l.length-1,n=l[s];n&&"space"===n[0];)n=l[--s];n&&(i.source.end=this.getPosition(n[3]||n[2]),i.source.end.offset++)}this.end(t);break}l.push(t)}else l.push(t);if(this.tokenizer.endOfFile()){o=!0;break}}i.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(i.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(i,"params",l),o&&(t=l[l.length-1],i.source.end=this.getPosition(t[3]||t[2]),i.source.end.offset++,this.spaces=i.raws.between,i.raws.between="")):(i.raws.afterName="",i.params=""),a&&(i.nodes=[],this.current=i)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let r,n=0;for(let s=t-1;s>=0&&(r=e[s],"space"===r[0]||(n+=1,2!==n));s--);throw this.input.error("Missed semicolon","word"===r[0]?r[3]+1:r[2])}colon(e){let t,r,n,s=0;for(let[i,o]of e.entries()){if(r=o,n=r[0],"("===n&&(s+=1),")"===n&&(s-=1),0===s&&":"===n){if(t){if("word"===t[0]&&"progid"===t[1])continue;return i}this.doubleColon(r)}t=r}return!1}comment(e){let r=new t;this.init(r,e[2]),r.source.end=this.getPosition(e[3]||e[2]),r.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))r.text="",r.raws.left=n,r.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);r.text=e[2],r.raws.left=e[1],r.raws.right=e[3]}}createTokenizer(){this.tokenizer=i(this.input)}decl(e,t){let n=new r;this.init(n,e[0][2]);let s,i=e[e.length-1];for(";"===i[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(i[3]||i[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}}(e)),n.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),n.raws.before+=e.shift()[1];for(n.source.start=this.getPosition(e[0][2]),n.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;n.prop+=e.shift()[1]}for(n.raws.between="";e.length;){if(s=e.shift(),":"===s[0]){n.raws.between+=s[1];break}"word"===s[0]&&/\w/.test(s[1])&&this.unknownWord([s]),n.raws.between+=s[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let o,a=[];for(;e.length&&(o=e[0][0],"space"===o||"comment"===o);)a.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(s=e[t],"!important"===s[1].toLowerCase()){n.important=!0;let r=this.stringFrom(e,t);r=this.spacesFromEnd(e)+r," !important"!==r&&(n.raws.important=r);break}if("important"===s[1].toLowerCase()){let r=e.slice(0),s="";for(let e=t;e>0;e--){let t=r[e][0];if(s.trim().startsWith("!")&&"space"!==t)break;s=r.pop()[1]+s}s.trim().startsWith("!")&&(n.important=!0,n.raws.important=s,e=r)}if("space"!==s[0]&&"comment"!==s[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(n,"value",a.concat(e),t),n.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new s;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 t=this.current.nodes[this.current.nodes.length-1];t&&"rule"===t.type&&!t.raws.ownSemicolon&&(t.raws.ownSemicolon=this.spaces,this.spaces="",t.source.end=this.getPosition(e[2]),t.source.end.offset+=t.raws.ownSemicolon.length)}}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,s=null,i=[],o=e[1].startsWith("--"),a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)s||(s=l),i.push("("===r?")":"]");else if(o&&n&&"{"===r)s||(s=l),i.push("}");else if(0===i.length){if(";"===r){if(n)return void this.decl(a,o);break}if("{"===r)return void this.rule(a);if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}":"===r&&(n=!0)}else r===i[i.length-1]&&(i.pop(),0===i.length&&(s=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),i.length>0&&this.unclosedBracket(s),t&&n){if(!o)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,o)}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 s,i,a,l,c=r.length,u="",h=!0;for(let e=0;e<c;e+=1)s=r[e],i=s[0],"space"!==i||e!==c-1||n?"comment"===i?(l=r[e-1]?r[e-1][0]:"empty",a=r[e+1]?r[e+1][0]:"empty",o[l]||o[a]||","===u.slice(-1)?h=!1:u+=s[1]):u+=s[1]:h=!1;if(!h){let n=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:n,value:u}}e[t]=u}rule(e){e.pop();let t=new s;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 "+e[0][1],{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})}},Ua}function bl(){if(Wa)return za;Wa=1;let e=ll(),t=pl(),r=yl();function n(e,n){let s=new t(e,n),i=new r(s);try{i.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 i.root}return za=n,n.default=n,e.registerParse(n),za}function wl(){if($a)return qa;$a=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 qa=e,e.default=e,qa}function Sl(){if(Ga)return Va;Ga=1;let e=wl();class t{get content(){return this.css}constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css="",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)}}return Va=t,t.default=t,Va}function Cl(){if(Ja)return Ha;Ja=1;let e={};return Ha=function(t){e[t]||(e[t]=!0,"undefined"!=typeof console&&console.warn&&console.warn(t))}}function xl(){if(Ya)return Ka;Ya=1;let e=ll(),t=ul(),r=vl(),n=bl(),s=Sl(),i=fl(),o=aa(),{isClean:a,my:l}=sl(),c=Cl();const u={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},h={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},d={Once:!0,postcssPlugin:!0,prepare:!0};function p(e){return"object"==typeof e&&"function"==typeof e.then}function f(e){let t=!1,r=u[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 m(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 g(e){return e[a]=!1,e.nodes&&e.nodes.forEach(e=>g(e)),e}let v={};class y{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"}constructor(t,r,i){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 s)o=g(r.root),r.map&&(void 0===i.map&&(i.map={}),i.map.inline||(i.map.inline=!1),i.map.prev=r.map);else{let t=n;i.syntax&&(t=i.syntax.parse),i.parser&&(t=i.parser),t.parse&&(t=t.parse);try{o=t(r,i)}catch(e){this.processed=!0,this.error=e}o&&!o[l]&&e.rebuild(o)}else o=g(r);this.result=new s(t,o,i),this.helpers={...v,postcss:v,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,s=t.split("."),i=n.split(".");(s[0]!==i[0]||parseInt(s[1])>parseInt(i[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(!h[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!d[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 e=this.result.root;for(;!e[a];){e[a]=!0;let t=[m(e)];for(;t.length>0;){let e=this.visitTick(t);if(p(e))try{await e}catch(e){let r=t[t.length-1].node;throw this.handleError(e,r)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map(e=>r(e,this.helpers));await Promise.all(t)}else await r(e,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=o;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let n=new r(t,this.result.root,this.result.opts).generate();return this.result.css=n[0],this.result.map=n[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 e=this.result.root;for(;!e[a];)e[a]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||c("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(e){let t=e[e.length-1],{node:r,visitors:n}=t;if("root"!==r.type&&"document"!==r.type&&!r.parent)return void e.pop();if(n.length>0&&t.visitorIndex<n.length){let[e,s]=n[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===n.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return s(r.toProxy(),this.helpers)}catch(e){throw this.handleError(e,r)}}if(0!==t.iterator){let n,s=t.iterator;for(;n=r.nodes[r.indexes[s]];)if(r.indexes[s]+=1,!n[a])return n[a]=!0,void e.push(m(n));t.iterator=0,delete r.indexes[s]}let s=t.events;for(;t.eventIndex<s.length;){let e=s[t.eventIndex];if(t.eventIndex+=1,0===e)return void(r.nodes&&r.nodes.length&&(r[a]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[a]=!0;let t=f(e);for(let r of t)if(0===r)e.nodes&&e.each(e=>{e[a]||this.walkSync(e)});else{let t=this.listeners[r];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}}return y.registerPostcss=e=>{v=e},Ka=y,y.default=y,i.registerLazyResult(y),t.registerLazyResult(y),Ka}function kl(){if(el)return Za;el=1;let e=ul(),t=xl(),r=function(){if(Qa)return Xa;Qa=1;let e=vl(),t=bl();const r=Sl();let n=aa(),s=Cl();class i{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,r=t;try{e=r(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"}constructor(t,s,i){let o;s=s.toString(),this.stringified=!1,this._processor=t,this._css=s,this._opts=i,this._map=void 0;let a=n;this.result=new r(this._processor,o,this._opts),this.result.css=s;let l=this;Object.defineProperty(this.result,"root",{get:()=>l.root});let c=new e(a,o,this._opts,s);if(c.isMap()){let[e,t]=c.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else c.clearAnnotation(),this.result.css=c.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||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}warnings(){return[]}}return Xa=i,i.default=i,Xa}(),n=fl();class s{constructor(e=[]){this.version="8.5.6",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(e,n={}){return this.plugins.length||n.parser||n.stringifier||n.syntax?new t(this,e,n):new r(this,e,n)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}return Za=s,s.default=s,n.registerProcessor(s),e.registerProcessor(s),Za}const Il=Ho(function(){if(rl)return tl;rl=1;let e=cl(),t=ol(),r=ll(),n=ia(),s=al(),i=ul(),o=function(){if(La)return Na;La=1;let e=cl(),t=ol(),r=al(),n=pl(),s=dl(),i=fl(),o=gl();function a(l,c){if(Array.isArray(l))return l.map(e=>a(e));let{inputs:u,...h}=l;if(u){c=[];for(let e of u){let t={...e,__proto__:n.prototype};t.map&&(t.map={...t.map,__proto__:s.prototype}),c.push(t)}}if(h.nodes&&(h.nodes=l.nodes.map(e=>a(e,c))),h.source){let{inputId:e,...t}=h.source;h.source=t,null!=e&&(h.source.input=c[e])}if("root"===h.type)return new i(h);if("decl"===h.type)return new r(h);if("rule"===h.type)return new o(h);if("comment"===h.type)return new t(h);if("atrule"===h.type)return new e(h);throw new Error("Unknown node type: "+l.type)}return Na=a,a.default=a,Na}(),a=pl(),l=xl(),c=ml(),u=il(),h=bl(),d=kl(),p=Sl(),f=fl(),m=gl(),g=aa(),v=wl();function y(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new d(e)}return y.plugin=function(e,t){let r,n=!1;function s(...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 s=t(...r);return s.postcssPlugin=e,s.postcssVersion=(new d).version,s}return Object.defineProperty(s,"postcss",{get:()=>(r||(r=s()),r)}),s.process=function(e,t,r){return y([s(r)]).process(e,t)},s},y.stringify=g,y.parse=h,y.fromJSON=o,y.list=c,y.comment=e=>new t(e),y.atRule=t=>new e(t),y.decl=e=>new s(e),y.rule=e=>new m(e),y.root=e=>new f(e),y.document=e=>new i(e),y.CssSyntaxError=n,y.Declaration=s,y.Container=r,y.Processor=d,y.Document=i,y.Comment=t,y.Warning=v,y.AtRule=e,y.Result=p,y.Input=a,y.Rule=m,y.Root=f,y.Node=u,l.registerPostcss(y),tl=y,y.default=y,tl}());Il.stringify,Il.fromJSON,Il.plugin,Il.parse,Il.list,Il.document,Il.comment,Il.atRule,Il.rule,Il.decl,Il.root,Il.CssSyntaxError,Il.Declaration,Il.Container,Il.Processor,Il.Document,Il.Comment,Il.Warning,Il.AtRule,Il.Result,Il.Input,Il.Rule,Il.Root,Il.Node;class El{constructor(...e){Go(this,"parentElement",null),Go(this,"parentNode",null),Go(this,"ownerDocument"),Go(this,"firstChild",null),Go(this,"lastChild",null),Go(this,"previousSibling",null),Go(this,"nextSibling",null),Go(this,"ELEMENT_NODE",1),Go(this,"TEXT_NODE",3),Go(this,"nodeType"),Go(this,"nodeName"),Go(this,"RRNodeType")}get childNodes(){const e=[];let t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(!(e instanceof El))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.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"}}const Ol={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Ml={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Rl={};function Pl(e){if(Rl[e])return Rl[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 Ol?Ol[e]:void 0,s=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]"))})),i=e in Ml?Ml[e]:void 0,o=Boolean(i&&i.every(e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))}));if(s&&o)return Rl[e]=t.prototype,t.prototype;try{const n=document.createElement("iframe");document.body.appendChild(n);const s=n.contentWindow;if(!s)return t.prototype;const i=s[e].prototype;return document.body.removeChild(n),i?Rl[e]=i:r}catch{return r}}const Al={};function Tl(e,t,r){var n;const s=`${e}.${String(r)}`;if(Al[s])return Al[s].call(t);const i=Pl(e),o=null==(n=Object.getOwnPropertyDescriptor(i,r))?void 0:n.get;return o?(Al[s]=o,o.call(t)):t[r]}const Nl={};function Ll(e,t,r){const n=`${e}.${String(r)}`;if(Nl[n])return Nl[n].bind(t);const s=Pl(e)[r];return"function"!=typeof s?t[r]:(Nl[n]=s,s.bind(t))}const _l={childNodes:function(e){return Tl("Node",e,"childNodes")},parentNode:function(e){return Tl("Node",e,"parentNode")},parentElement:function(e){return Tl("Node",e,"parentElement")},textContent:function(e){return Tl("Node",e,"textContent")},contains:function(e,t){return Ll("Node",e,"contains")(t)},getRootNode:function(e){return Ll("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Tl("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Tl("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Tl("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Tl("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return Pl("MutationObserver").constructor}};const Dl="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.";let Fl={map:{},getId:()=>(console.error(Dl),-1),getNode:()=>(console.error(Dl),null),removeNodeFromMap(){console.error(Dl)},has:()=>(console.error(Dl),!1),reset(){console.error(Dl)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Fl=new Proxy(Fl,{get:(e,t,r)=>("map"===t&&console.error(Dl),Reflect.get(e,t,r))}));let Bl=Date.now;function Ul(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:_l.parentElement(e)}/[1-9][0-9]{12}/.test(Date.now().toString())||(Bl=()=>(new Date).getTime());function jl(e){var t;let r=null;return"getRootNode"in e&&(null==(t=_l.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&_l.host(_l.getRootNode(e))&&(r=_l.host(_l.getRootNode(e))),r}function zl(e){let t,r=e;for(;t=jl(r);)r=t;return r}function Wl(e){const t=e.ownerDocument;if(!t)return!1;const r=zl(e);return _l.contains(t,r)}const ql=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){Xs(this,"id",1),Xs(this,"styleIDMap",new WeakMap),Xs(this,"idStyleMap",new Map)}getId(e){return this.styleIDMap.get(e)??-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++}},get _mirror(){return Fl},closestElementOfNode:Ul,getBaseDimension:function e(t,r){var n,s;const i=null==(s=null==(n=t.ownerDocument)?void 0:n.defaultView)?void 0:s.frameElement;if(!i||i===r)return{x:0,y:0,relativeScale:1,absoluteScale:1};const o=i.getBoundingClientRect(),a=e(i,r),l=o.height/i.clientHeight;return{x:o.x*a.relativeScale+a.x,y:o.y*a.relativeScale+a.y,relativeScale:l,absoluteScale:a.absoluteScale*l}},getNestedRule:function e(t,r){const n=t[r[0]];return 1===r.length?n:e(n.cssRules[r[1]].cssRules,r.slice(2))},getPositionsAndIndex:function(e){const t=[...e],r=t.pop();return{positions:t,index:r}},getRootShadowHost:zl,getShadowHost:jl,getWindowHeight:function(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight},getWindowScroll:function(e){var t,r,n,s;const i=e.document;return{left:i.scrollingElement?i.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:i.documentElement.scrollLeft||(null==i?void 0:i.body)&&(null==(t=_l.parentElement(i.body))?void 0:t.scrollLeft)||(null==(r=null==i?void 0:i.body)?void 0:r.scrollLeft)||0,top:i.scrollingElement?i.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==i?void 0:i.documentElement.scrollTop)||(null==i?void 0:i.body)&&(null==(n=_l.parentElement(i.body))?void 0:n.scrollTop)||(null==(s=null==i?void 0:i.body)?void 0:s.scrollTop)||0}},getWindowWidth:function(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth},hasShadowRoot:function(e){return!!e&&(e instanceof El&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(_l.shadowRoot(e)))},hookSetter:function e(t,r,n,s,i=window){const o=i.Object.getOwnPropertyDescriptor(t,r);return i.Object.defineProperty(t,r,s?n:{set(e){setTimeout(()=>{n.set.call(this,e)},0),o&&o.set&&o.set.call(this,e)}}),()=>e(t,r,o||{},!0)},inDom:function(e){const t=e.ownerDocument;return!!t&&(_l.contains(t,e)||Wl(e))},isAncestorRemoved:function e(t,r){if(function(e){const t=e&&"host"in e&&"mode"in e&&li.host(e)||null;return Boolean(t&&"shadowRoot"in t&&li.shadowRoot(t)===e)}(t))return!1;const n=r.getId(t);if(!r.has(n))return!0;const s=_l.parentNode(t);return(!s||s.nodeType!==t.DOCUMENT_NODE)&&(!s||e(s,r))},isBlocked:function(e,t,r,n){if(!e)return!1;const s=Ul(e);if(!s)return!1;try{if("string"==typeof t){if(s.classList.contains(t))return!0;if(n&&null!==s.closest("."+t))return!0}else if(ui(s,t,n))return!0}catch(e){}if(r){if(s.matches(r))return!0;if(n&&null!==s.closest(r))return!0}return!1},isIgnored:function(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||-2===t.getId(e)},isSerialized:function(e,t){return-1!==t.getId(e)},isSerializedIframe:function(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))},isSerializedStylesheet:function(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))},iterateResolveTree:function e(t,r){r(t.value);for(let n=t.children.length-1;n>=0;n--)e(t.children[n],r)},legacy_isTouchEvent:function(e){return Boolean(e.changedTouches)},get nowTimestamp(){return Bl},on:function(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)},patch:function(e,t,r){try{if(!(t in e))return()=>{};const n=e[t],s=r(n);return"function"==typeof s&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=s,()=>{e[t]=n}}catch{return()=>{}}},polyfill: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)},queueToResolveTrees:function(e){const t={},r=(e,r)=>{const n={value:e,parent:r,children:[]};return t[e.node.id]=n,n},n=[];for(const s of e){const{nextId:e,parentId:i}=s;if(e&&e in t){const i=t[e];if(i.parent){const e=i.parent.children.indexOf(i);i.parent.children.splice(e,0,r(s,i.parent))}else{const e=n.indexOf(i);n.splice(e,0,r(s,null))}continue}if(i in t){const e=t[i];e.children.push(r(s,e));continue}n.push(r(s,null))}return n},shadowHostInDom:Wl,throttle:function(e,t,r={}){let n=null,s=0;return function(...i){const o=Date.now();s||!1!==r.leading||(s=o);const a=t-(o-s),l=this;a<=0||a>t?(n&&(clearTimeout(n),n=null),s=o,e.apply(l,i)):n||!1===r.trailing||(n=setTimeout(()=>{s=!1===r.leading?0:Date.now(),n=null,e.apply(l,i)},a))}},uniqueTextMutations:function(e){const t=new Set,r=[];for(let n=e.length;n--;){const s=e[n];t.has(s.id)||(r.push(s),t.add(s.id))}return r}},Symbol.toStringTag,{value:"Module"}));for(var $l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Vl="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Gl=0;Gl<64;Gl++)Vl[$l.charCodeAt(Gl)]=Gl;"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==(zs=e.contentWindow)?void 0:zs.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}var Hl,Jl;new ci,(Jl=Hl||(Hl={}))[Jl.NotStarted=0]="NotStarted",Jl[Jl.Running=1]="Running",Jl[Jl.Stopped=2]="Stopped";class Kl{constructor(e){Ks(this,"fileName"),Ks(this,"functionName"),Ks(this,"lineNumber"),Ks(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}`}}const Yl=/(^|@)\S+:\d+/,Xl=/^\s*at .*(\S+:\d+|\(native\))/m,Ql=/^(eval@)?(\[native code])?$/,Zl={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(Xl)?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(Xl)},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),s=this.extractLocation(r?r[1]:n.pop()),i=n.join(" ")||void 0,o=["eval","<anonymous>"].indexOf(s[0])>-1?void 0:s[0];return new Kl({functionName:i,fileName:o,lineNumber:s[1],columnNumber:s[2]})},this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter(function(e){return!e.match(Ql)},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 Kl({functionName:e});{const t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),n=r&&r[1]?r[1]:void 0,s=this.extractLocation(e.replace(t,""));return new Kl({functionName:n,fileName:s[0],lineNumber:s[1],columnNumber:s[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,s=r.length;e<s;e+=2){const s=t.exec(r[e]);s&&n.push(new Kl({fileName:s[2],lineNumber:parseFloat(s[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,s=r.length;e<s;e+=2){const s=t.exec(r[e]);s&&n.push(new Kl({functionName:s[3]||void 0,fileName:s[2],lineNumber:parseFloat(s[1])}))}return n},parseOpera11:function(e){return e.stack.split("\n").filter(function(e){return!!e.match(Yl)&&!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 Kl({functionName:n,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})},this)}};function ec(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,s=[];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&&s.push(t)}s.length>1&&(r+=`:eq(${s.indexOf(e)})`),t=r+(t?">"+t:""),e=n}return t}function tc(e){return"[object Object]"===Object.prototype.toString.call(e)}function rc(e,t){if(0===t)return!0;const r=Object.keys(e);for(const n of r)if(tc(e[n])&&rc(e[n],t-1))return!0;return!1}function nc(e,t){const r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,t);const n=[],s=[];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?s.splice(r,1/0,e):s.push(e),~n.indexOf(t)&&(t=n[0]===t?"[Circular ~]":"[Circular ~."+s.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(tc(e)&&Object.keys(e).length>r.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(tc(e)&&rc(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]=ec(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})}const sc={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};function ic(e,t,r){const n=r?Object.assign({},sc,r):sc,s=n.logger;if(!s)return()=>{};let i;i="string"==typeof s?t[s]:s;let o=0,a=!1;const l=[];if(n.level.includes("error")){const r=t=>{const r=t.message,s=t.error,i=Zl.parse(s).map(e=>e.toString()),o=[nc(r,n.stringifyOptions)];e({level:"error",trace:i,payload:o})};t.addEventListener("error",r),l.push(()=>{t.removeEventListener("error",r)});const s=t=>{let r,s;t.reason instanceof Error?(r=t.reason,s=[nc(`Uncaught (in promise) ${r.name}: ${r.message}`,n.stringifyOptions)]):(r=new Error,s=[nc("Uncaught (in promise)",n.stringifyOptions),nc(t.reason,n.stringifyOptions)]);const i=Zl.parse(r).map(e=>e.toString());e({level:"error",trace:i,payload:s})};t.addEventListener("unhandledrejection",s),l.push(()=>{t.removeEventListener("unhandledrejection",s)})}for(const e of n.level)l.push(c(i,e));return()=>{l.forEach(e=>e())};function c(t,r){return t[r]?ql.patch(t,r,t=>(...s)=>{if(t.apply(this,s),!("assert"===r&&s[0]||a)){a=!0;try{const t=Zl.parse(new Error).map(e=>e.toString()).splice(1),i=("assert"===r?s.slice(1):s).map(e=>nc(e,n.stringifyOptions));o++,o<n.lengthThreshold?e({level:r,trace:t,payload:i}):o===n.lengthThreshold&&e({level:"warn",trace:[],payload:[nc("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...s)}finally{a=!1}}}):()=>{}}}const oc="rrweb/console@1";var ac,lc=Object.freeze({__proto__:null,PLUGIN_NAME:oc,getRecordConsolePlugin:e=>({name:oc,observer:ic,options:e})}),cc=Object.defineProperty,uc=(e,t,r)=>((e,t,r)=>t in e?cc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),hc=Object.defineProperty,dc=(e,t,r)=>((e,t,r)=>t in e?hc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),pc=(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))(pc||{});const fc={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},mc={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},gc={};function vc(e){if(gc[e])return gc[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 fc?fc[e]:void 0,s=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]"))})),i=e in mc?mc[e]:void 0,o=Boolean(i&&i.every(e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))}));if(s&&o)return gc[e]=t.prototype,t.prototype;try{const n=document.createElement("iframe");document.body.appendChild(n);const s=n.contentWindow;if(!s)return t.prototype;const i=s[e].prototype;return document.body.removeChild(n),i?gc[e]=i:r}catch{return r}}const yc={};function bc(e,t,r){var n;const s=`${e}.${String(r)}`;if(yc[s])return yc[s].call(t);const i=vc(e),o=null==(n=Object.getOwnPropertyDescriptor(i,r))?void 0:n.get;return o?(yc[s]=o,o.call(t)):t[r]}const wc={};function Sc(e,t,r){const n=`${e}.${String(r)}`;if(wc[n])return wc[n].bind(t);const s=vc(e)[r];return"function"!=typeof s?t[r]:(wc[n]=s,s.bind(t))}const Cc={childNodes:function(e){return bc("Node",e,"childNodes")},parentNode:function(e){return bc("Node",e,"parentNode")},parentElement:function(e){return bc("Node",e,"parentElement")},textContent:function(e){return bc("Node",e,"textContent")},contains:function(e,t){return Sc("Node",e,"contains")(t)},getRootNode:function(e){return Sc("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?bc("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?bc("Element",e,"shadowRoot"):null},querySelector:function(e,t){return bc("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return bc("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return vc("MutationObserver").constructor}};function xc(e){return e.nodeType===e.ELEMENT_NODE}function kc(e){const t=e&&"host"in e&&"mode"in e&&Cc.host(e)||null;return Boolean(t&&"shadowRoot"in t&&Cc.shadowRoot(t)===e)}function Ic(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function Ec(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 s=Array.from(r,e=>Oc(e,n)).join("");return(t=s).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 Oc(e,t){if(function(e){return"styleSheet"in e}(e)){let t;try{t=Ec(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?Bc(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?Bc(r,t):r}}class Mc{constructor(){dc(this,"idNodeMap",new Map),dc(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;return(null==(t=this.getMeta(e))?void 0:t.id)??-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}}function Rc({element:e,maskInputOptions:t,tagName:r,type:n,value:s,maskInputFn:i}){let o=s||"";const a=n&&Pc(n);return(t[r.toLowerCase()]||a&&t[a])&&(o=i?i(o,e):"*".repeat(o.length)),o}function Pc(e){return e.toLowerCase()}const Ac="__rrweb_original__";function Tc(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Pc(t):null}function Nc(e,t){let r;try{r=new URL(e,t??window.location.href)}catch(e){return null}const n=r.pathname.match(/\.([0-9a-z]+)(?:$)/i);return(null==n?void 0:n[1])??null}const Lc=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,_c=/^(?:[a-z+]+:)?\/\//i,Dc=/^www\..*/i,Fc=/^(data:)([^,]*),(.*)/i;function Bc(e,t){return(e||"").replace(Lc,(e,r,n,s,i,o)=>{const a=n||i||o,l=r||s||"";if(!a)return e;if(_c.test(a)||Dc.test(a))return`url(${l}${a}${l})`;if(Fc.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 c=t.split("/"),u=a.split("/");c.pop();for(const e of u)"."!==e&&(".."===e?c.pop():c.push(e));return`url(${l}${c.join("/")}${l})`})}function Uc(e,t=!1){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function jc(e,t){return function(e,t,r=!1){const n=Array.from(t.childNodes),s=[];let i=0;if(n.length>1&&e&&"string"==typeof e){let t=Uc(e,r);const o=t.length/e.length;for(let a=1;a<n.length;a++)if(n[a].textContent&&"string"==typeof n[a].textContent){const l=Uc(n[a].textContent,r),c=100;let u=3;for(;u<l.length&&(l[u].match(/[a-zA-Z0-9]/)||-1!==l.indexOf(l.substring(0,u),1));u++);for(;u<l.length;u++){let h=l.substring(0,u),d=t.split(h),p=-1;if(2===d.length)p=d[0].length;else if(d.length>2&&""===d[0]&&""!==n[a-1].textContent)p=t.indexOf(h,1);else if(1===d.length){if(h=h.substring(0,h.length-1),d=t.split(h),d.length<=1)return s.push(e),s;u=c+1}else u===l.length-1&&(p=t.indexOf(h));if(d.length>=2&&u>c){const e=n[a-1].textContent;if(e&&"string"==typeof e){const r=Uc(e).length;p=t.indexOf(h,r)}-1===p&&(p=d[0].length)}if(-1!==p){let a=Math.floor(p/o);for(;a>0&&a<e.length;){if(i+=1,i>50*n.length)return s.push(e),s;const l=Uc(e.substring(0,a),r);if(l.length===p){s.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)/o)):a-=Math.max(1,Math.floor((l.length-p)*o))}break}}}}return s.push(e),s}(e,t).join("/* rr_split */")}const zc="lightgrey";let Wc=1;const qc=new RegExp("[^a-z0-9-_:]");function $c(){return Wc++}let Vc,Gc;const Hc=/^[^ \t\n\r\u000c]+/,Jc=/^[, \t\n\r\u000c]+/;const Kc=new WeakMap;function Yc(e,t){return t&&""!==t.trim()?Qc(e,t):t}function Xc(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function Qc(e,t){let r=Kc.get(e);if(r||(r=e.createElement("a"),Kc.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function Zc(e,t,r,n){return n?"src"===r||"href"===r&&("use"!==t||"#"!==n[0])||"xlink:href"===r&&"#"!==n[0]?Yc(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 s=e.exec(t.substring(r));return s?(n=s[0],r+=n.length,n):""}const s=[];for(;n(Jc),!(r>=t.length);){let i=n(Hc);if(","===i.slice(-1))i=Yc(e,i.substring(0,i.length-1)),s.push(i);else{let n="";i=Yc(e,i);let o=!1;for(;;){const e=t.charAt(r);if(""===e){s.push((i+n).trim());break}if(o)")"===e&&(o=!1);else{if(","===e){r+=1,s.push((i+n).trim());break}"("===e&&(o=!0)}n+=e,r+=1}}}return s.join(", ")}(e,n):"style"===r?Bc(n,Qc(e)):"object"===t&&"data"===r?Yc(e,n):n:Yc(e,n):n}function eu(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function tu(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&tu(Cc.parentNode(e),t,r);for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!!r&&tu(Cc.parentNode(e),t,r)}function ru(e,t,r,n){let s;if(xc(e)){if(s=e,!Cc.childNodes(s).length)return!1}else{if(null===Cc.parentElement(e))return!1;s=Cc.parentElement(e)}try{if("string"==typeof t){if(n){if(s.closest(`.${t}`))return!0}else if(s.classList.contains(t))return!0}else if(tu(s,t,n))return!0;if(r)if(n){if(s.closest(r))return!0}else if(s.matches(r))return!0}catch(e){}return!1}function nu(e,t){const{doc:r,mirror:n,blockClass:s,blockSelector:i,needsMask:o,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:c,maskInputFn:u,maskAttributeFn:h,dataURLOptions:d={},inlineImages:p,recordCanvas:f,keepIframeSrcFn:m,newlyAddedElement:g=!1,cssCaptured:v=!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:pc.Document,childNodes:[],compatMode:e.compatMode}:{type:pc.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:pc.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:s,inlineStylesheet:i,maskInputOptions:o={},maskInputFn:a,maskAttributeFn:l,dataURLOptions:c={},inlineImages:u,recordCanvas:h,keepIframeSrcFn:d,newlyAddedElement:p=!1,rootId:f,applyBackgroundColorToBlockedElements:m=!1}=t,g=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,s),v=function(e){if(e instanceof HTMLFormElement)return"form";const t=Pc(e.tagName);return qc.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(!eu(v,n.name,n.value)){const t=Zc(r,v,Pc(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"===v&&i){const t=Array.from(r.styleSheets).find(t=>t.href===e.href);let n=null;t&&(n=Ec(t)),n&&(delete y.rel,delete y.href,y._cssText=n)}if("style"===v&&e.sheet){let t=Ec(e.sheet);t&&(e.childNodes.length>1&&(t=jc(t,e)),y._cssText=t)}if("input"===v||"textarea"===v||"select"===v){const t=e.value,r=e.checked;"radio"!==y.type&&"checkbox"!==y.type&&"submit"!==y.type&&"button"!==y.type&&t?y.value=Rc({element:e,type:Tc(e),tagName:v,value:t,maskInputOptions:o,maskInputFn:a}):r&&(y.checked=r)}"option"===v&&(e.selected&&!o.select?y.selected=!0:delete y.selected);"dialog"===v&&e.open&&(y.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal");if("canvas"===v&&h)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 s=t.getImageData,i=Ac in s?s[Ac]:s;if(new Uint32Array(i.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(c.type,c.quality));else if(!("__context"in e)){const t=e.toDataURL(c.type,c.quality),n=r.createElement("canvas");n.width=e.width,n.height=e.height;t!==n.toDataURL(c.type,c.quality)&&(y.rr_dataURL=t)}if("img"===v&&u){Vc||(Vc=r.createElement("canvas"),Gc=Vc.getContext("2d"));const t=e,n=t.currentSrc||t.getAttribute("src")||"<unknown-src>",s=t.crossOrigin,i=()=>{t.removeEventListener("load",i);try{Vc.width=t.naturalWidth,Vc.height=t.naturalHeight,Gc.drawImage(t,0,0),y.rr_dataURL=Vc.toDataURL(c.type,c.quality)}catch(e){if("anonymous"!==t.crossOrigin)return t.crossOrigin="anonymous",void(t.complete&&0!==t.naturalWidth?i():t.addEventListener("load",i));console.warn(`Cannot inline img src=${n}! Error: ${e}`)}"anonymous"===t.crossOrigin&&(s?y.crossOrigin=s:t.removeAttribute("crossorigin"))};t.complete&&0!==t.naturalWidth?i():t.addEventListener("load",i)}if("audio"===v||"video"===v){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(g){const{width:t,height:r}=e.getBoundingClientRect();y={class:y.class,rr_width:`${t}px`,rr_height:`${r}px`,...m?{rr_background_color:zc}:{}}}"iframe"!==v||d(y.src)||(e.contentDocument||(y.rr_src=y.src),delete y.src);let w;try{customElements.get(v)&&(w=!0)}catch(e){}return{type:pc.Element,tagName:v,attributes:y,childNodes:[],isSVG:Xc(e)||void 0,needBlock:g,rootId:f,isCustom:w}}(e,{doc:r,blockClass:s,blockSelector:i,inlineStylesheet:a,maskInputOptions:l,maskInputFn:u,maskAttributeFn:h,dataURLOptions:d,inlineImages:p,recordCanvas:f,keepIframeSrcFn:m,newlyAddedElement:g,rootId:b,applyBackgroundColorToBlockedElements:y});case e.TEXT_NODE:return function(e,t){const{needsMask:r,maskTextFn:n,rootId:s,cssCaptured:i}=t,o=Cc.parentNode(e),a=o&&o.tagName;let l="";const c="STYLE"===a||void 0,u="SCRIPT"===a||void 0;u?l="SCRIPT_PLACEHOLDER":i||(l=Cc.textContent(e),c&&l&&(l=Bc(l,Qc(t.doc))));!c&&!u&&l&&r&&(l=n?n(l,Cc.parentElement(e)):l.replace(/[\S]/g,"*"));return{type:pc.Text,textContent:l||"",rootId:s}}(e,{doc:r,needsMask:o,maskTextFn:c,rootId:b,cssCaptured:v});case e.CDATA_SECTION_NODE:return{type:pc.CDATA,textContent:"",rootId:b};case e.COMMENT_NODE:return{type:pc.Comment,textContent:Cc.textContent(e)||"",rootId:b};default:return!1}}function su(e){return null==e?"":e.toLowerCase()}function iu(e,t,r){return Array.from(e).map(e=>{const n=t(e);let s=[];if(!r.has(n)){r.add(n);try{s=Array.from(e.cssRules,(t,r)=>({rule:Oc(t,e.href),index:r}))}catch(e){if(!(e instanceof DOMException&&"SecurityError"===e.name))throw e}}return{styleId:n,rules:s}})}function ou(e,t){var r,n;const{doc:s,mirror:i,blockClass:o,blockSelector:a,maskTextClass:l,maskTextSelector:c,skipChild:u=!1,inlineStylesheet:h=!0,maskInputOptions:d={},maskTextFn:p,maskInputFn:f,maskAttributeFn:m,slimDOMOptions:g,dataURLOptions:v={},inlineImages:y=!1,recordCanvas:b=!1,onSerialize:w,onAdoptedStyleSheet:S,onIframeLoad:C,iframeLoadTimeout:x=5e3,onStylesheetLoad:k,stylesheetLoadTimeout:I=5e3,keepIframeSrcFn:E=()=>!1,newlyAddedElement:O=!1,cssCaptured:M=!1,applyBackgroundColorToBlockedElements:R=!1}=t,P=t._emittedStyleIds??new Set;let{needsMask:A}=t,{preserveWhiteSpace:T=!0}=t;if(!A){A=ru(e,l,c,void 0===A)}const N=nu(e,{doc:s,mirror:i,blockClass:o,blockSelector:a,needsMask:A,inlineStylesheet:h,maskInputOptions:d,maskTextFn:p,maskInputFn:f,maskAttributeFn:m,dataURLOptions:v,inlineImages:y,recordCanvas:b,keepIframeSrcFn:E,newlyAddedElement:O,cssCaptured:M,applyBackgroundColorToBlockedElements:R});if(!N)return console.warn(e,"not serialized"),null;let L;L=i.hasNode(e)?i.getId(e):function(e,t){if(t.comment&&e.type===pc.Comment)return!0;if(e.type===pc.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"===Nc(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(su(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===su(e.attributes.name)||"icon"===su(e.attributes.rel)||"apple-touch-icon"===su(e.attributes.rel)||"shortcut icon"===su(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&su(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(su(e.attributes.property).match(/^(og|twitter|fb):/)||su(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===su(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===su(e.attributes.name)||"googlebot"===su(e.attributes.name)||"bingbot"===su(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===su(e.attributes.name)||"generator"===su(e.attributes.name)||"framework"===su(e.attributes.name)||"publisher"===su(e.attributes.name)||"progid"===su(e.attributes.name)||su(e.attributes.property).match(/^article:/)||su(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===su(e.attributes.name)||"yandex-verification"===su(e.attributes.name)||"csrf-token"===su(e.attributes.name)||"p:domain_verify"===su(e.attributes.name)||"verify-v1"===su(e.attributes.name)||"verification"===su(e.attributes.name)||"shopify-checkout-api-token"===su(e.attributes.name)))return!0}}return!1}(N,g)||!T&&N.type===pc.Text&&!N.textContent.replace(/^\s+|\s+$/gm,"").length?-2:$c();const _=Object.assign(N,{id:L});if(i.add(e,_),-2===L)return null;w&&w(e);let D=!u;if(_.type===pc.Element){D=D&&!_.needBlock,delete _.needBlock;const t=Cc.shadowRoot(e);t&&Ic(t)&&(_.isShadowHost=!0,S&&(null==(r=t.adoptedStyleSheets)?void 0:r.length)&&(_.adoptedStyleSheets=iu(t.adoptedStyleSheets,S,P)))}if(_.type===pc.Document&&S){const t=e;(null==(n=t.adoptedStyleSheets)?void 0:n.length)&&(_.adoptedStyleSheets=iu(t.adoptedStyleSheets,S,P))}if((_.type===pc.Document||_.type===pc.Element)&&D){g.headWhitespace&&_.type===pc.Element&&"head"===_.tagName&&(T=!1);const t={doc:s,mirror:i,blockClass:o,blockSelector:a,needsMask:A,maskTextClass:l,maskTextSelector:c,skipChild:u,inlineStylesheet:h,maskInputOptions:d,maskTextFn:p,maskInputFn:f,maskAttributeFn:m,slimDOMOptions:g,dataURLOptions:v,inlineImages:y,recordCanvas:b,preserveWhiteSpace:T,onSerialize:w,onAdoptedStyleSheet:S,_emittedStyleIds:P,onIframeLoad:C,iframeLoadTimeout:x,onStylesheetLoad:k,stylesheetLoadTimeout:I,keepIframeSrcFn:E,cssCaptured:!1,applyBackgroundColorToBlockedElements:R};if(_.type===pc.Element&&"textarea"===_.tagName&&void 0!==_.attributes.value);else{_.type===pc.Element&&void 0!==_.attributes._cssText&&"string"==typeof _.attributes._cssText&&(t.cssCaptured=!0);for(const r of Array.from(Cc.childNodes(e))){const e=ou(r,t);e&&_.childNodes.push(e)}}let r=null;if(xc(e)&&(r=Cc.shadowRoot(e)))for(const e of Array.from(Cc.childNodes(r))){const n=ou(e,t);n&&(Ic(r)&&(n.isShadow=!0),_.childNodes.push(n))}}const F=Cc.parentNode(e);return F&&kc(F)&&Ic(F)&&(_.isShadow=!0),_.type===pc.Element&&"iframe"===_.tagName&&function(e,t,r){const n=e.contentWindow;if(!n)return;let s,i=!1;try{s=n.document.readyState}catch(e){return}if("complete"!==s){const n=setTimeout(()=>{i||(t(),i=!0)},r);return void e.addEventListener("load",()=>{clearTimeout(n),i=!0,t()})}const o="about:blank";if(n.location.href!==o||e.src===o||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}(e,()=>{const t=e.contentDocument;if(t&&C){const r=ou(t,{doc:t,mirror:i,blockClass:o,blockSelector:a,needsMask:A,maskTextClass:l,maskTextSelector:c,skipChild:!1,inlineStylesheet:h,maskInputOptions:d,maskTextFn:p,maskInputFn:f,maskAttributeFn:m,slimDOMOptions:g,dataURLOptions:v,inlineImages:y,recordCanvas:b,preserveWhiteSpace:T,onSerialize:w,onAdoptedStyleSheet:S,_emittedStyleIds:P,onIframeLoad:C,iframeLoadTimeout:x,onStylesheetLoad:k,stylesheetLoadTimeout:I,keepIframeSrcFn:E});r&&C(e,r)}},x),_.type===pc.Element&&"link"===_.tagName&&"string"==typeof _.attributes.rel&&("stylesheet"===_.attributes.rel||"preload"===_.attributes.rel&&"string"==typeof _.attributes.href&&"css"===Nc(_.attributes.href))&&function(e,t,r){let n,s=!1;try{n=e.sheet}catch(e){return}if(n)return;const i=setTimeout(()=>{s||(t(),s=!0)},r);e.addEventListener("load",()=>{clearTimeout(i),s=!0,t()})}(e,()=>{if(k){const t=ou(e,{doc:s,mirror:i,blockClass:o,blockSelector:a,needsMask:A,maskTextClass:l,maskTextSelector:c,skipChild:!1,inlineStylesheet:h,maskInputOptions:d,maskTextFn:p,maskInputFn:f,maskAttributeFn:m,slimDOMOptions:g,dataURLOptions:v,inlineImages:y,recordCanvas:b,preserveWhiteSpace:T,onSerialize:w,onIframeLoad:C,iframeLoadTimeout:x,onStylesheetLoad:k,stylesheetLoadTimeout:I,keepIframeSrcFn:E});t&&k(e,t)}},I),_}function au(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function lu(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}var cu,uu={exports:{}};function hu(){if(cu)return uu.exports;cu=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,blackBright:e,redBright:e,greenBright:e,yellowBright:e,blueBright:e,magentaBright:e,cyanBright:e,whiteBright:e,bgBlackBright:e,bgRedBright:e,bgGreenBright:e,bgYellowBright:e,bgBlueBright:e,bgMagentaBright:e,bgCyanBright:e,bgWhiteBright:e}};return uu.exports=t(),uu.exports.createColors=t,uu.exports}const du=lu(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var pu,fu,mu,gu,vu,yu;function bu(){if(fu)return pu;fu=1;let e=hu(),t=du;class r extends Error{constructor(e,t,n,s,i,o){super(e),this.name="CssSyntaxError",this.reason=e,i&&(this.file=i),s&&(this.source=s),o&&(this.plugin=o),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);let s=e=>e,i=e=>e,o=e=>e;if(r){let{bold:r,gray:n,red:a}=e.createColors(!0);i=e=>r(a(e)),s=e=>n(e),t&&(o=e=>t(e))}let a=n.split(/\r?\n/),l=Math.max(this.line-3,0),c=Math.min(this.line+2,a.length),u=String(c).length;return a.slice(l,c).map((e,t)=>{let r=l+1+t,n=" "+(" "+r).slice(-u)+" | ";if(r===this.line){if(e.length>160){let t=20,r=Math.max(0,this.column-t),a=Math.max(this.column+t,this.endColumn+t),l=e.slice(r,a),c=s(n.replace(/\d/g," "))+e.slice(0,Math.min(this.column-1,t-1)).replace(/[^\t]/g," ");return i(">")+s(n)+o(l)+"\n "+c+i("^")}let t=s(n.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return i(">")+s(n)+o(e)+"\n "+t+i("^")}return" "+s(n)+o(e)}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}return pu=r,r.default=r,pu}function wu(){if(gu)return mu;gu=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 s=(e.raws.between||"")+(t?";":"");this.builder(r+n+s,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,s=0;for(;n&&"root"!==n.type;)s+=1,n=n.parent;if(r.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<s;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 s=e.nodes[n],i=this.raw(s,"before");i&&this.builder(i),this.stringify(s,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 s;if(n||(n=r),r&&(s=t.raws[r],void 0!==s))return s;let i=t.parent;if("before"===n){if(!i||"root"===i.type&&i.first===t)return"";if(i&&"document"===i.type)return""}if(!i)return e[n];let o=t.root();if(o.rawCache||(o.rawCache={}),void 0!==o.rawCache[n])return o.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(t,n);{let e="raw"+((a=n)[0].toUpperCase()+a.slice(1));this[e]?s=this[e](o,t):o.walk(e=>{if(s=e.raws[r],void 0!==s)return!1})}var a;return void 0===s&&(s=e[n]),o.rawCache[n]=s,s}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 mu=t,t.default=t,mu}function Su(){if(yu)return vu;yu=1;let e=wu();function t(t,r){new e(r).stringify(t)}return vu=t,t.default=t,vu}var Cu,xu,ku,Iu,Eu,Ou,Mu,Ru,Pu,Au,Tu,Nu,Lu,_u,Du,Fu,Bu,Uu,ju,zu,Wu,qu,$u,Vu,Gu,Hu,Ju,Ku,Yu,Xu,Qu,Zu,eh,th,rh,nh,sh,ih,oh,ah,lh,ch,uh,hh,dh,ph,fh,mh,gh,vh={};function yh(){return Cu||(Cu=1,vh.isClean=Symbol("isClean"),vh.my=Symbol("my")),vh}function bh(){if(ku)return xu;ku=1;let e=bu(),t=wu(),r=Su(),{isClean:n,my:s}=yh();function i(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 s=e[n],o=typeof s;"parent"===n&&"object"===o?t&&(r[n]=t):"source"===n?r[n]=s:Array.isArray(s)?r[n]=s.map(e=>i(e,r)):("object"===o&&null!==s&&(s=i(s)),r[n]=s)}return r}function o(e,t){if(t&&void 0!==t.offset)return t.offset;let r=1,n=1,s=0;for(let i=0;i<e.length;i++){if(n===t.line&&r===t.column){s=i;break}"\n"===e[i]?(r=1,n+=1):r+=1}return s}class a{get proxyOf(){return this}constructor(e={}){this.raws={},this[n]=!1,this[s]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let r of e[t])"function"==typeof r.clone?this.append(r.clone()):this.append(r)}else this[t]=e[t]}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=i(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(t,r={}){if(this.source){let{end:e,start:n}=this.rangeBy(r);return this.source.input.error(t,{column:n.column,line:n.line},{column:e.column,line:e.line},r)}return new e(t)}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)}}markClean(){this[n]=!0}markDirty(){if(this[n]){this[n]=!1;let e=this;for(;e=e.parent;)e[n]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e={}){let t=this.source.start;if(e.index)t=this.positionInside(e.index);else if(e.word){let r="document"in this.source.input?this.source.input.document:this.source.input.css,n=r.slice(o(r,this.source.start),o(r,this.source.end)).indexOf(e.word);-1!==n&&(t=this.positionInside(n))}return t}positionInside(e){let t=this.source.start.column,r=this.source.start.line,n="document"in this.source.input?this.source.input.document:this.source.input.css,s=o(n,this.source.start),i=s+e;for(let e=s;e<i;e++)"\n"===n[e]?(t=1,r+=1):t+=1;return{column:t,line:r,offset:i}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e={}){let t="document"in this.source.input?this.source.input.document:this.source.input.css,r={column:this.source.start.column,line:this.source.start.line,offset:o(t,this.source.start)},n=this.source.end?{column:this.source.end.column+1,line:this.source.end.line,offset:"number"==typeof this.source.end.offset?this.source.end.offset:o(t,this.source.end)+1}:{column:r.column+1,line:r.line,offset:r.offset+1};if(e.word){let s=t.slice(o(t,this.source.start),o(t,this.source.end)).indexOf(e.word);-1!==s&&(r=this.positionInside(s),n=this.positionInside(s+e.word.length))}else e.start?r={column:e.start.column,line:e.start.line,offset:o(t,e.start)}:e.index&&(r=this.positionInside(e.index)),e.end?n={column:e.end.column,line:e.end.line,offset:o(t,e.end)}:"number"==typeof e.endIndex?n=this.positionInside(e.endIndex):e.index&&(n=this.positionInside(e.index+1));return(n.line<r.line||n.line===r.line&&n.column<=r.column)&&(n={column:r.column+1,line:r.line,offset:r.offset+1}),{end:n,start:r}}raw(e,r){return(new t).raw(this,e,r)}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 s=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){if(null==n)continue;let i=t.get(n.input);null==i&&(i=s,t.set(n.input,s),s++),r[e]={end:n.end,inputId:i,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=r){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)}}return xu=a,a.default=a,xu}function wh(){if(Eu)return Iu;Eu=1;let e=bh();class t extends e{constructor(e){super(e),this.type="comment"}}return Iu=t,t.default=t,Iu}function Sh(){if(Mu)return Ou;Mu=1;let e=bh();class t extends e{get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}}return Ou=t,t.default=t,Ou}function Ch(){if(Pu)return Ru;Pu=1;let e,t,r,n,s=wh(),i=Sh(),o=bh(),{isClean:a,my:l}=yh();function c(e){return e.map(e=>(e.nodes&&(e.nodes=c(e.nodes)),delete e.source,e))}function u(e){if(e[a]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)u(t)}class h extends o{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]}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),s=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let e of s)this.proxyOf.nodes.splice(n+1,0,e);for(let e in this.indexes)r=this.indexes[e],n<r&&(this.indexes[e]=r+s.length);return this.markDirty(),this}insertBefore(e,t){let r,n=this.index(e),s=0===n&&"prepend",i=this.normalize(t,this.proxyOf.nodes[n],s).reverse();n=this.index(e);for(let e of i)this.proxyOf.nodes.splice(n,0,e);for(let e in this.indexes)r=this.indexes[e],n<=r&&(this.indexes[e]=r+i.length);return this.markDirty(),this}normalize(r,o){if("string"==typeof r)r=c(t(r).nodes);else if(void 0===r)r=[];else if(Array.isArray(r)){r=r.slice(0);for(let e of r)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===r.type&&"document"!==this.type){r=r.nodes.slice(0);for(let e of r)e.parent&&e.parent.removeChild(e,"ignore")}else if(r.type)r=[r];else if(r.prop){if(void 0===r.value)throw new Error("Value field is missed in node creation");"string"!=typeof r.value&&(r.value=String(r.value)),r=[new i(r)]}else if(r.selector||r.selectors)r=[new n(r)];else if(r.name)r=[new e(r)];else{if(!r.text)throw new Error("Unknown node type in node creation");r=[new s(r)]}return r.map(e=>(e[l]||h.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[a]&&u(e),e.raws||(e.raws={}),void 0===e.raws.before&&o&&void 0!==o.raws.before&&(e.raws.before=o.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)}))}}return h.registerParse=e=>{t=e},h.registerRule=e=>{n=e},h.registerAtRule=t=>{e=t},h.registerRoot=e=>{r=e},Ru=h,h.default=h,h.rebuild=t=>{"atrule"===t.type?Object.setPrototypeOf(t,e.prototype):"rule"===t.type?Object.setPrototypeOf(t,n.prototype):"decl"===t.type?Object.setPrototypeOf(t,i.prototype):"comment"===t.type?Object.setPrototypeOf(t,s.prototype):"root"===t.type&&Object.setPrototypeOf(t,r.prototype),t[l]=!0,t.nodes&&t.nodes.forEach(e=>{h.rebuild(e)})},Ru}function xh(){if(Tu)return Au;Tu=1;let e=Ch();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 Au=t,t.default=t,e.registerAtRule(t),Au}function kh(){if(Lu)return Nu;Lu=1;let e,t,r=Ch();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},Nu=n,n.default=n,Nu}function Ih(){if(Du)return _u;Du=1;return _u={nanoid:(e=21)=>{let t="",r=0|e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(r=t)=>{let n="",s=0|r;for(;s--;)n+=e[Math.random()*e.length|0];return n}},_u}function Eh(){if(Bu)return Fu;Bu=1;let{existsSync:e,readFileSync:t}=du,{dirname:r,join:n}=du,{SourceMapConsumer:s,SourceMapGenerator:i}=du;class o{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let n=t.map?t.map.prev:void 0,s=this.loadMap(t.from,n);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=r(this.mapFile)),s&&(this.text=s)}consumer(){return this.consumerCache||(this.consumerCache=new s(this.text)),this.consumerCache}decodeInline(e){let t=e.match(/^data:application\/json;charset=utf-?8,/)||e.match(/^data:application\/json,/);if(t)return decodeURIComponent(e.substr(t[0].length));let r=e.match(/^data:application\/json;charset=utf-?8;base64,/)||e.match(/^data:application\/json;base64,/);if(r)return n=e.substr(r[0].length),Buffer?Buffer.from(n,"base64").toString():window.atob(n);var n;let s=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+s)}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=/g);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(n){if(this.root=r(n),e(n))return this.mapFile=n,t(n,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof s)return i.fromSourceMap(t).toString();if(t instanceof i)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let r=t(e);if(r){let e=this.loadFile(r);if(!e)throw new Error("Unable to load previous source map: "+r.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=n(r(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return Fu=o,o.default=o,Fu}function Oh(){if(ju)return Uu;ju=1;let{nanoid:e}=Ih(),{isAbsolute:t,resolve:r}=du,{SourceMapConsumer:n,SourceMapGenerator:s}=du,{fileURLToPath:i,pathToFileURL:o}=du,a=bu(),l=Eh(),c=du,u=Symbol("lineToIndexCache"),h=Boolean(n&&s),d=Boolean(r&&t);function p(e){if(e[u])return e[u];let t=e.css.split("\n"),r=new Array(t.length),n=0;for(let e=0,s=t.length;e<s;e++)r[e]=n,n+=t[e].length+1;return e[u]=r,r}class f{get from(){return this.file||this.id}constructor(n,s={}){if(null==n||"object"==typeof n&&!n.toString)throw new Error(`PostCSS received ${n} instead of CSS string`);if(this.css=n.toString(),"\ufeff"===this.css[0]||""===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,this.document=this.css,s.document&&(this.document=s.document.toString()),s.from&&(!d||/^\w+:\/\//.test(s.from)||t(s.from)?this.file=s.from:this.file=r(s.from)),d&&h){let e=new l(this.css,s);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 "+e(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let s,i,l,c,u;if(t&&"object"==typeof t){let e=t,n=r;if("number"==typeof e.offset){c=e.offset;let n=this.fromOffset(c);t=n.line,r=n.col}else t=e.line,r=e.column,c=this.fromLineAndColumn(t,r);if("number"==typeof n.offset){l=n.offset;let e=this.fromOffset(l);i=e.line,s=e.col}else i=n.line,s=n.column,l=this.fromLineAndColumn(n.line,n.column)}else if(r)c=this.fromLineAndColumn(t,r);else{c=t;let e=this.fromOffset(c);t=e.line,r=e.col}let h=this.origin(t,r,i,s);return u=h?new a(e,void 0===h.endLine?h.line:{column:h.column,line:h.line},void 0===h.endLine?h.column:{column:h.endColumn,line:h.endLine},h.source,h.file,n.plugin):new a(e,void 0===i?t:{column:r,line:t},void 0===i?r:{column:s,line:i},this.css,this.file,n.plugin),u.input={column:r,endColumn:s,endLine:i,endOffset:l,line:t,offset:c,source:this.css},this.file&&(o&&(u.input.url=o(this.file).toString()),u.input.file=this.file),u}fromLineAndColumn(e,t){return p(this)[e-1]+t-1}fromOffset(e){let t=p(this),r=0;if(e>=t[t.length-1])r=t.length-1;else{let n,s=t.length-2;for(;r<s;)if(n=r+(s-r>>1),e<t[n])s=n-1;else{if(!(e>=t[n+1])){r=n;break}r=n+1}}return{col:e-t[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:r(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,r,n,s){if(!this.map)return!1;let a,l,c=this.map.consumer(),u=c.originalPositionFor({column:r,line:e});if(!u.source)return!1;"number"==typeof n&&(a=c.originalPositionFor({column:s,line:n})),l=t(u.source)?o(u.source):new URL(u.source,this.map.consumer().sourceRoot||o(this.map.mapFile));let h={column:u.column,endColumn:a&&a.column,endLine:a&&a.line,line:u.line,url:l.toString()};if("file:"===l.protocol){if(!i)throw new Error("file: protocol is not available in this PostCSS build");h.file=i(l)}let d=c.sourceContentFor(u.source);return d&&(h.source=d),h}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}}return Uu=f,f.default=f,c&&c.registerInput&&c.registerInput(f),Uu}function Mh(){if(Wu)return zu;Wu=1;let e,t,r=Ch();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},zu=n,n.default=n,r.registerRoot(n),zu}function Rh(){if($u)return qu;$u=1;let e={comma:t=>e.split(t,[","],!0),space:t=>e.split(t,[" ","\n","\t"]),split(e,t,r){let n=[],s="",i=!1,o=0,a=!1,l="",c=!1;for(let r of e)c?c=!1:"\\"===r?c=!0:a?r===l&&(a=!1):'"'===r||"'"===r?(a=!0,l=r):"("===r?o+=1:")"===r?o>0&&(o-=1):0===o&&t.includes(r)&&(i=!0),i?(""!==s&&n.push(s.trim()),s="",i=!1):s+=r;return(r||""!==s)&&n.push(s.trim()),n}};return qu=e,e.default=e,qu}function Ph(){if(Gu)return Vu;Gu=1;let e=Ch(),t=Rh();class r extends e{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)}constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}}return Vu=r,r.default=r,e.registerRule(r),Vu}function Ah(){if(Yu)return Ku;Yu=1;let{dirname:e,relative:t,resolve:r,sep:n}=du,{SourceMapConsumer:s,SourceMapGenerator:i}=du,{pathToFileURL:o}=du,a=Oh(),l=Boolean(s&&i),c=Boolean(e&&r&&t&&n);return Ku=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 r,n=this.toUrl(this.path(t.file)),i=t.root||e(t.file);!1===this.mapOpts.sourcesContent?(r=new s(t.text),r.sourcesContent&&(r.sourcesContent=null)):r=t.consumer(),this.map.applySourceMap(r,n,this.toUrl(this.path(i)))}}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&&e.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),c&&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=i.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new i({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 i({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,r=1,n=1,s="<no source>",o={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(i,a,l)=>{if(this.css+=i,a&&"end"!==l&&(o.generated.line=r,o.generated.column=n-1,a.source&&a.source.start?(o.source=this.sourcePath(a),o.original.line=a.source.start.line,o.original.column=a.source.start.column-1,this.map.addMapping(o)):(o.source=s,o.original.line=1,o.original.column=0,this.map.addMapping(o))),t=i.match(/\n/g),t?(r+=t.length,e=i.lastIndexOf("\n"),n=i.length-e):n+=i.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?(o.source=this.sourcePath(a),o.original.line=a.source.end.line,o.original.column=a.source.end.column-1,o.generated.line=r,o.generated.column=n-2,this.map.addMapping(o)):(o.source=s,o.original.line=1,o.original.column=0,o.generated.line=r,o.generated.column=n-1,this.map.addMapping(o)))}})}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(n){if(this.mapOpts.absolute)return n;if(60===n.charCodeAt(0))return n;if(/^\w+:\/\//.test(n))return n;let s=this.memoizedPaths.get(n);if(s)return s;let i=this.opts.to?e(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(i=e(r(i,this.mapOpts.annotation)));let o=t(i,n);return this.memoizedPaths.set(n,o),o}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(o){let t=o(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;"\\"===n&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}},Ku}function Th(){if(eh)return Zu;eh=1;let e=xh(),t=wh(),r=Sh(),n=Mh(),s=Ph(),i=function(){if(Qu)return Xu;Qu=1;const e="'".charCodeAt(0),t='"'.charCodeAt(0),r="\\".charCodeAt(0),n="/".charCodeAt(0),s="\n".charCodeAt(0),i=" ".charCodeAt(0),o="\f".charCodeAt(0),a="\t".charCodeAt(0),l="\r".charCodeAt(0),c="[".charCodeAt(0),u="]".charCodeAt(0),h="(".charCodeAt(0),d=")".charCodeAt(0),p="{".charCodeAt(0),f="}".charCodeAt(0),m=";".charCodeAt(0),g="*".charCodeAt(0),v=":".charCodeAt(0),y="@".charCodeAt(0),b=/[\t\n\f\r "#'()/;[\\\]{}]/g,w=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,S=/.[\r\n"'(/\\]/,C=/[\da-f]/i;return Xu=function(x,k={}){let I,E,O,M,R,P,A,T,N,L,_=x.css.valueOf(),D=k.ignoreErrors,F=_.length,B=0,U=[],j=[];function z(e){throw x.error("Unclosed "+e,B)}return{back:function(e){j.push(e)},endOfFile:function(){return 0===j.length&&B>=F},nextToken:function(x){if(j.length)return j.pop();if(B>=F)return;let k=!!x&&x.ignoreUnclosed;switch(I=_.charCodeAt(B),I){case s:case i:case a:case l:case o:M=B;do{M+=1,I=_.charCodeAt(M)}while(I===i||I===s||I===a||I===l||I===o);P=["space",_.slice(B,M)],B=M-1;break;case c:case u:case p:case f:case v:case m:case d:{let e=String.fromCharCode(I);P=[e,e,B];break}case h:if(L=U.length?U.pop()[1]:"",N=_.charCodeAt(B+1),"url"===L&&N!==e&&N!==t&&N!==i&&N!==s&&N!==a&&N!==o&&N!==l){M=B;do{if(A=!1,M=_.indexOf(")",M+1),-1===M){if(D||k){M=B;break}z("bracket")}for(T=M;_.charCodeAt(T-1)===r;)T-=1,A=!A}while(A);P=["brackets",_.slice(B,M+1),B,M],B=M}else M=_.indexOf(")",B+1),E=_.slice(B,M+1),-1===M||S.test(E)?P=["(","(",B]:(P=["brackets",E,B,M],B=M);break;case e:case t:R=I===e?"'":'"',M=B;do{if(A=!1,M=_.indexOf(R,M+1),-1===M){if(D||k){M=B+1;break}z("string")}for(T=M;_.charCodeAt(T-1)===r;)T-=1,A=!A}while(A);P=["string",_.slice(B,M+1),B,M],B=M;break;case y:b.lastIndex=B+1,b.test(_),M=0===b.lastIndex?_.length-1:b.lastIndex-2,P=["at-word",_.slice(B,M+1),B,M],B=M;break;case r:for(M=B,O=!0;_.charCodeAt(M+1)===r;)M+=1,O=!O;if(I=_.charCodeAt(M+1),O&&I!==n&&I!==i&&I!==s&&I!==a&&I!==l&&I!==o&&(M+=1,C.test(_.charAt(M)))){for(;C.test(_.charAt(M+1));)M+=1;_.charCodeAt(M+1)===i&&(M+=1)}P=["word",_.slice(B,M+1),B,M],B=M;break;default:I===n&&_.charCodeAt(B+1)===g?(M=_.indexOf("*/",B+2)+1,0===M&&(D||k?M=_.length:z("comment")),P=["comment",_.slice(B,M+1),B,M],B=M):(w.lastIndex=B+1,w.test(_),M=0===w.lastIndex?_.length-1:w.lastIndex-2,P=["word",_.slice(B,M+1),B,M],U.push(P),B=M)}return B++,P},position:function(){return B}}}}();const o={empty:!0,space:!0};return Zu=class{constructor(e){this.input=e,this.root=new n,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(t){let r,n,s,i=new e;i.name=t[1].slice(1),""===i.name&&this.unnamedAtrule(i,t),this.init(i,t[2]);let o=!1,a=!1,l=[],c=[];for(;!this.tokenizer.endOfFile();){if(r=(t=this.tokenizer.nextToken())[0],"("===r||"["===r?c.push("("===r?")":"]"):"{"===r&&c.length>0?c.push("}"):r===c[c.length-1]&&c.pop(),0===c.length){if(";"===r){i.source.end=this.getPosition(t[2]),i.source.end.offset++,this.semicolon=!0;break}if("{"===r){a=!0;break}if("}"===r){if(l.length>0){for(s=l.length-1,n=l[s];n&&"space"===n[0];)n=l[--s];n&&(i.source.end=this.getPosition(n[3]||n[2]),i.source.end.offset++)}this.end(t);break}l.push(t)}else l.push(t);if(this.tokenizer.endOfFile()){o=!0;break}}i.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(i.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(i,"params",l),o&&(t=l[l.length-1],i.source.end=this.getPosition(t[3]||t[2]),i.source.end.offset++,this.spaces=i.raws.between,i.raws.between="")):(i.raws.afterName="",i.params=""),a&&(i.nodes=[],this.current=i)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let r,n=0;for(let s=t-1;s>=0&&(r=e[s],"space"===r[0]||(n+=1,2!==n));s--);throw this.input.error("Missed semicolon","word"===r[0]?r[3]+1:r[2])}colon(e){let t,r,n,s=0;for(let[i,o]of e.entries()){if(r=o,n=r[0],"("===n&&(s+=1),")"===n&&(s-=1),0===s&&":"===n){if(t){if("word"===t[0]&&"progid"===t[1])continue;return i}this.doubleColon(r)}t=r}return!1}comment(e){let r=new t;this.init(r,e[2]),r.source.end=this.getPosition(e[3]||e[2]),r.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))r.text="",r.raws.left=n,r.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);r.text=e[2],r.raws.left=e[1],r.raws.right=e[3]}}createTokenizer(){this.tokenizer=i(this.input)}decl(e,t){let n=new r;this.init(n,e[0][2]);let s,i=e[e.length-1];for(";"===i[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(i[3]||i[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}}(e)),n.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),n.raws.before+=e.shift()[1];for(n.source.start=this.getPosition(e[0][2]),n.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;n.prop+=e.shift()[1]}for(n.raws.between="";e.length;){if(s=e.shift(),":"===s[0]){n.raws.between+=s[1];break}"word"===s[0]&&/\w/.test(s[1])&&this.unknownWord([s]),n.raws.between+=s[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let o,a=[];for(;e.length&&(o=e[0][0],"space"===o||"comment"===o);)a.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(s=e[t],"!important"===s[1].toLowerCase()){n.important=!0;let r=this.stringFrom(e,t);r=this.spacesFromEnd(e)+r," !important"!==r&&(n.raws.important=r);break}if("important"===s[1].toLowerCase()){let r=e.slice(0),s="";for(let e=t;e>0;e--){let t=r[e][0];if(s.trim().startsWith("!")&&"space"!==t)break;s=r.pop()[1]+s}s.trim().startsWith("!")&&(n.important=!0,n.raws.important=s,e=r)}if("space"!==s[0]&&"comment"!==s[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(n,"value",a.concat(e),t),n.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new s;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 t=this.current.nodes[this.current.nodes.length-1];t&&"rule"===t.type&&!t.raws.ownSemicolon&&(t.raws.ownSemicolon=this.spaces,this.spaces="",t.source.end=this.getPosition(e[2]),t.source.end.offset+=t.raws.ownSemicolon.length)}}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,s=null,i=[],o=e[1].startsWith("--"),a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)s||(s=l),i.push("("===r?")":"]");else if(o&&n&&"{"===r)s||(s=l),i.push("}");else if(0===i.length){if(";"===r){if(n)return void this.decl(a,o);break}if("{"===r)return void this.rule(a);if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}":"===r&&(n=!0)}else r===i[i.length-1]&&(i.pop(),0===i.length&&(s=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),i.length>0&&this.unclosedBracket(s),t&&n){if(!o)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,o)}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 s,i,a,l,c=r.length,u="",h=!0;for(let e=0;e<c;e+=1)s=r[e],i=s[0],"space"!==i||e!==c-1||n?"comment"===i?(l=r[e-1]?r[e-1][0]:"empty",a=r[e+1]?r[e+1][0]:"empty",o[l]||o[a]||","===u.slice(-1)?h=!1:u+=s[1]):u+=s[1]:h=!1;if(!h){let n=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:n,value:u}}e[t]=u}rule(e){e.pop();let t=new s;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 "+e[0][1],{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})}},Zu}function Nh(){if(rh)return th;rh=1;let e=Ch(),t=Oh(),r=Th();function n(e,n){let s=new t(e,n),i=new r(s);try{i.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 i.root}return th=n,n.default=n,e.registerParse(n),th}function Lh(){if(sh)return nh;sh=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 nh=e,e.default=e,nh}function _h(){if(oh)return ih;oh=1;let e=Lh();class t{get content(){return this.css}constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css="",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)}}return ih=t,t.default=t,ih}function Dh(){if(lh)return ah;lh=1;let e={};return ah=function(t){e[t]||(e[t]=!0,"undefined"!=typeof console&&console.warn&&console.warn(t))}}function Fh(){if(uh)return ch;uh=1;let e=Ch(),t=kh(),r=Ah(),n=Nh(),s=_h(),i=Mh(),o=Su(),{isClean:a,my:l}=yh(),c=Dh();const u={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},h={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},d={Once:!0,postcssPlugin:!0,prepare:!0};function p(e){return"object"==typeof e&&"function"==typeof e.then}function f(e){let t=!1,r=u[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 m(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 g(e){return e[a]=!1,e.nodes&&e.nodes.forEach(e=>g(e)),e}let v={};class y{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"}constructor(t,r,i){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 s)o=g(r.root),r.map&&(void 0===i.map&&(i.map={}),i.map.inline||(i.map.inline=!1),i.map.prev=r.map);else{let t=n;i.syntax&&(t=i.syntax.parse),i.parser&&(t=i.parser),t.parse&&(t=t.parse);try{o=t(r,i)}catch(e){this.processed=!0,this.error=e}o&&!o[l]&&e.rebuild(o)}else o=g(r);this.result=new s(t,o,i),this.helpers={...v,postcss:v,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,s=t.split("."),i=n.split(".");(s[0]!==i[0]||parseInt(s[1])>parseInt(i[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(!h[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!d[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 e=this.result.root;for(;!e[a];){e[a]=!0;let t=[m(e)];for(;t.length>0;){let e=this.visitTick(t);if(p(e))try{await e}catch(e){let r=t[t.length-1].node;throw this.handleError(e,r)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map(e=>r(e,this.helpers));await Promise.all(t)}else await r(e,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=o;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let n=new r(t,this.result.root,this.result.opts).generate();return this.result.css=n[0],this.result.map=n[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 e=this.result.root;for(;!e[a];)e[a]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||c("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(e){let t=e[e.length-1],{node:r,visitors:n}=t;if("root"!==r.type&&"document"!==r.type&&!r.parent)return void e.pop();if(n.length>0&&t.visitorIndex<n.length){let[e,s]=n[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===n.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return s(r.toProxy(),this.helpers)}catch(e){throw this.handleError(e,r)}}if(0!==t.iterator){let n,s=t.iterator;for(;n=r.nodes[r.indexes[s]];)if(r.indexes[s]+=1,!n[a])return n[a]=!0,void e.push(m(n));t.iterator=0,delete r.indexes[s]}let s=t.events;for(;t.eventIndex<s.length;){let e=s[t.eventIndex];if(t.eventIndex+=1,0===e)return void(r.nodes&&r.nodes.length&&(r[a]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[a]=!0;let t=f(e);for(let r of t)if(0===r)e.nodes&&e.each(e=>{e[a]||this.walkSync(e)});else{let t=this.listeners[r];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}}return y.registerPostcss=e=>{v=e},ch=y,y.default=y,i.registerLazyResult(y),t.registerLazyResult(y),ch}function Bh(){if(fh)return ph;fh=1;let e=kh(),t=Fh(),r=function(){if(dh)return hh;dh=1;let e=Ah(),t=Nh();const r=_h();let n=Su(),s=Dh();class i{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,r=t;try{e=r(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"}constructor(t,s,i){let o;s=s.toString(),this.stringified=!1,this._processor=t,this._css=s,this._opts=i,this._map=void 0;let a=n;this.result=new r(this._processor,o,this._opts),this.result.css=s;let l=this;Object.defineProperty(this.result,"root",{get:()=>l.root});let c=new e(a,o,this._opts,s);if(c.isMap()){let[e,t]=c.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else c.clearAnnotation(),this.result.css=c.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||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}warnings(){return[]}}return hh=i,i.default=i,hh}(),n=Mh();class s{constructor(e=[]){this.version="8.5.6",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(e,n={}){return this.plugins.length||n.parser||n.stringifier||n.syntax?new t(this,e,n):new r(this,e,n)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}return ph=s,s.default=s,n.registerProcessor(s),e.registerProcessor(s),ph}var Uh=function(){if(gh)return mh;gh=1;let e=xh(),t=wh(),r=Ch(),n=bu(),s=Sh(),i=kh(),o=function(){if(Ju)return Hu;Ju=1;let e=xh(),t=wh(),r=Sh(),n=Oh(),s=Eh(),i=Mh(),o=Ph();function a(l,c){if(Array.isArray(l))return l.map(e=>a(e));let{inputs:u,...h}=l;if(u){c=[];for(let e of u){let t={...e,__proto__:n.prototype};t.map&&(t.map={...t.map,__proto__:s.prototype}),c.push(t)}}if(h.nodes&&(h.nodes=l.nodes.map(e=>a(e,c))),h.source){let{inputId:e,...t}=h.source;h.source=t,null!=e&&(h.source.input=c[e])}if("root"===h.type)return new i(h);if("decl"===h.type)return new r(h);if("rule"===h.type)return new o(h);if("comment"===h.type)return new t(h);if("atrule"===h.type)return new e(h);throw new Error("Unknown node type: "+l.type)}return Hu=a,a.default=a,Hu}(),a=Oh(),l=Fh(),c=Rh(),u=bh(),h=Nh(),d=Bh(),p=_h(),f=Mh(),m=Ph(),g=Su(),v=Lh();function y(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new d(e)}return y.plugin=function(e,t){let r,n=!1;function s(...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 s=t(...r);return s.postcssPlugin=e,s.postcssVersion=(new d).version,s}return Object.defineProperty(s,"postcss",{get:()=>(r||(r=s()),r)}),s.process=function(e,t,r){return y([s(r)]).process(e,t)},s},y.stringify=g,y.parse=h,y.fromJSON=o,y.list=c,y.comment=e=>new t(e),y.atRule=t=>new e(t),y.decl=e=>new s(e),y.rule=e=>new m(e),y.root=e=>new f(e),y.document=e=>new i(e),y.CssSyntaxError=n,y.Declaration=s,y.Container=r,y.Processor=d,y.Document=i,y.Comment=t,y.Warning=v,y.AtRule=e,y.Result=p,y.Input=a,y.Rule=m,y.Root=f,y.Node=u,l.registerPostcss(y),mh=y,y.default=y,mh}();const jh=au(Uh);jh.stringify,jh.fromJSON,jh.plugin,jh.parse,jh.list,jh.document,jh.comment,jh.atRule,jh.rule,jh.decl,jh.root,jh.CssSyntaxError,jh.Declaration,jh.Container,jh.Processor,jh.Document,jh.Comment,jh.Warning,jh.AtRule,jh.Result,jh.Input,jh.Rule,jh.Root,jh.Node;var zh=Object.defineProperty,Wh=(e,t,r)=>((e,t,r)=>t in e?zh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);function qh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function $h(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}var Vh,Gh={exports:{}};function Hh(){if(Vh)return Gh.exports;Vh=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,blackBright:e,redBright:e,greenBright:e,yellowBright:e,blueBright:e,magentaBright:e,cyanBright:e,whiteBright:e,bgBlackBright:e,bgRedBright:e,bgGreenBright:e,bgYellowBright:e,bgBlueBright:e,bgMagentaBright:e,bgCyanBright:e,bgWhiteBright:e}};return Gh.exports=t(),Gh.exports.createColors=t,Gh.exports}const Jh=$h(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Kh,Yh,Xh,Qh,Zh,ed;function td(){if(Yh)return Kh;Yh=1;let e=Hh(),t=Jh;class r extends Error{constructor(e,t,n,s,i,o){super(e),this.name="CssSyntaxError",this.reason=e,i&&(this.file=i),s&&(this.source=s),o&&(this.plugin=o),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);let s=e=>e,i=e=>e,o=e=>e;if(r){let{bold:r,gray:n,red:a}=e.createColors(!0);i=e=>r(a(e)),s=e=>n(e),t&&(o=e=>t(e))}let a=n.split(/\r?\n/),l=Math.max(this.line-3,0),c=Math.min(this.line+2,a.length),u=String(c).length;return a.slice(l,c).map((e,t)=>{let r=l+1+t,n=" "+(" "+r).slice(-u)+" | ";if(r===this.line){if(e.length>160){let t=20,r=Math.max(0,this.column-t),a=Math.max(this.column+t,this.endColumn+t),l=e.slice(r,a),c=s(n.replace(/\d/g," "))+e.slice(0,Math.min(this.column-1,t-1)).replace(/[^\t]/g," ");return i(">")+s(n)+o(l)+"\n "+c+i("^")}let t=s(n.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return i(">")+s(n)+o(e)+"\n "+t+i("^")}return" "+s(n)+o(e)}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}return Kh=r,r.default=r,Kh}function rd(){if(Qh)return Xh;Qh=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 s=(e.raws.between||"")+(t?";":"");this.builder(r+n+s,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,s=0;for(;n&&"root"!==n.type;)s+=1,n=n.parent;if(r.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<s;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 s=e.nodes[n],i=this.raw(s,"before");i&&this.builder(i),this.stringify(s,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 s;if(n||(n=r),r&&(s=t.raws[r],void 0!==s))return s;let i=t.parent;if("before"===n){if(!i||"root"===i.type&&i.first===t)return"";if(i&&"document"===i.type)return""}if(!i)return e[n];let o=t.root();if(o.rawCache||(o.rawCache={}),void 0!==o.rawCache[n])return o.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(t,n);{let e="raw"+((a=n)[0].toUpperCase()+a.slice(1));this[e]?s=this[e](o,t):o.walk(e=>{if(s=e.raws[r],void 0!==s)return!1})}var a;return void 0===s&&(s=e[n]),o.rawCache[n]=s,s}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 Xh=t,t.default=t,Xh}function nd(){if(ed)return Zh;ed=1;let e=rd();function t(t,r){new e(r).stringify(t)}return Zh=t,t.default=t,Zh}var sd,id,od,ad,ld,cd,ud,hd,dd,pd,fd,md,gd,vd,yd,bd,wd,Sd,Cd,xd,kd,Id,Ed,Od,Md,Rd,Pd,Ad,Td,Nd,Ld,_d,Dd,Fd,Bd,Ud,jd,zd,Wd,qd,$d,Vd,Gd,Hd,Jd,Kd,Yd,Xd,Qd,Zd={};function ep(){return sd||(sd=1,Zd.isClean=Symbol("isClean"),Zd.my=Symbol("my")),Zd}function tp(){if(od)return id;od=1;let e=td(),t=rd(),r=nd(),{isClean:n,my:s}=ep();function i(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 s=e[n],o=typeof s;"parent"===n&&"object"===o?t&&(r[n]=t):"source"===n?r[n]=s:Array.isArray(s)?r[n]=s.map(e=>i(e,r)):("object"===o&&null!==s&&(s=i(s)),r[n]=s)}return r}function o(e,t){if(t&&void 0!==t.offset)return t.offset;let r=1,n=1,s=0;for(let i=0;i<e.length;i++){if(n===t.line&&r===t.column){s=i;break}"\n"===e[i]?(r=1,n+=1):r+=1}return s}class a{get proxyOf(){return this}constructor(e={}){this.raws={},this[n]=!1,this[s]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let r of e[t])"function"==typeof r.clone?this.append(r.clone()):this.append(r)}else this[t]=e[t]}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=i(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(t,r={}){if(this.source){let{end:e,start:n}=this.rangeBy(r);return this.source.input.error(t,{column:n.column,line:n.line},{column:e.column,line:e.line},r)}return new e(t)}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)}}markClean(){this[n]=!0}markDirty(){if(this[n]){this[n]=!1;let e=this;for(;e=e.parent;)e[n]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e={}){let t=this.source.start;if(e.index)t=this.positionInside(e.index);else if(e.word){let r="document"in this.source.input?this.source.input.document:this.source.input.css,n=r.slice(o(r,this.source.start),o(r,this.source.end)).indexOf(e.word);-1!==n&&(t=this.positionInside(n))}return t}positionInside(e){let t=this.source.start.column,r=this.source.start.line,n="document"in this.source.input?this.source.input.document:this.source.input.css,s=o(n,this.source.start),i=s+e;for(let e=s;e<i;e++)"\n"===n[e]?(t=1,r+=1):t+=1;return{column:t,line:r,offset:i}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e={}){let t="document"in this.source.input?this.source.input.document:this.source.input.css,r={column:this.source.start.column,line:this.source.start.line,offset:o(t,this.source.start)},n=this.source.end?{column:this.source.end.column+1,line:this.source.end.line,offset:"number"==typeof this.source.end.offset?this.source.end.offset:o(t,this.source.end)+1}:{column:r.column+1,line:r.line,offset:r.offset+1};if(e.word){let s=t.slice(o(t,this.source.start),o(t,this.source.end)).indexOf(e.word);-1!==s&&(r=this.positionInside(s),n=this.positionInside(s+e.word.length))}else e.start?r={column:e.start.column,line:e.start.line,offset:o(t,e.start)}:e.index&&(r=this.positionInside(e.index)),e.end?n={column:e.end.column,line:e.end.line,offset:o(t,e.end)}:"number"==typeof e.endIndex?n=this.positionInside(e.endIndex):e.index&&(n=this.positionInside(e.index+1));return(n.line<r.line||n.line===r.line&&n.column<=r.column)&&(n={column:r.column+1,line:r.line,offset:r.offset+1}),{end:n,start:r}}raw(e,r){return(new t).raw(this,e,r)}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 s=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){if(null==n)continue;let i=t.get(n.input);null==i&&(i=s,t.set(n.input,s),s++),r[e]={end:n.end,inputId:i,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=r){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)}}return id=a,a.default=a,id}function rp(){if(ld)return ad;ld=1;let e=tp();class t extends e{constructor(e){super(e),this.type="comment"}}return ad=t,t.default=t,ad}function np(){if(ud)return cd;ud=1;let e=tp();class t extends e{get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}}return cd=t,t.default=t,cd}function sp(){if(dd)return hd;dd=1;let e,t,r,n,s=rp(),i=np(),o=tp(),{isClean:a,my:l}=ep();function c(e){return e.map(e=>(e.nodes&&(e.nodes=c(e.nodes)),delete e.source,e))}function u(e){if(e[a]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)u(t)}class h extends o{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]}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),s=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let e of s)this.proxyOf.nodes.splice(n+1,0,e);for(let e in this.indexes)r=this.indexes[e],n<r&&(this.indexes[e]=r+s.length);return this.markDirty(),this}insertBefore(e,t){let r,n=this.index(e),s=0===n&&"prepend",i=this.normalize(t,this.proxyOf.nodes[n],s).reverse();n=this.index(e);for(let e of i)this.proxyOf.nodes.splice(n,0,e);for(let e in this.indexes)r=this.indexes[e],n<=r&&(this.indexes[e]=r+i.length);return this.markDirty(),this}normalize(r,o){if("string"==typeof r)r=c(t(r).nodes);else if(void 0===r)r=[];else if(Array.isArray(r)){r=r.slice(0);for(let e of r)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===r.type&&"document"!==this.type){r=r.nodes.slice(0);for(let e of r)e.parent&&e.parent.removeChild(e,"ignore")}else if(r.type)r=[r];else if(r.prop){if(void 0===r.value)throw new Error("Value field is missed in node creation");"string"!=typeof r.value&&(r.value=String(r.value)),r=[new i(r)]}else if(r.selector||r.selectors)r=[new n(r)];else if(r.name)r=[new e(r)];else{if(!r.text)throw new Error("Unknown node type in node creation");r=[new s(r)]}return r.map(e=>(e[l]||h.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[a]&&u(e),e.raws||(e.raws={}),void 0===e.raws.before&&o&&void 0!==o.raws.before&&(e.raws.before=o.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)}))}}return h.registerParse=e=>{t=e},h.registerRule=e=>{n=e},h.registerAtRule=t=>{e=t},h.registerRoot=e=>{r=e},hd=h,h.default=h,h.rebuild=t=>{"atrule"===t.type?Object.setPrototypeOf(t,e.prototype):"rule"===t.type?Object.setPrototypeOf(t,n.prototype):"decl"===t.type?Object.setPrototypeOf(t,i.prototype):"comment"===t.type?Object.setPrototypeOf(t,s.prototype):"root"===t.type&&Object.setPrototypeOf(t,r.prototype),t[l]=!0,t.nodes&&t.nodes.forEach(e=>{h.rebuild(e)})},hd}function ip(){if(fd)return pd;fd=1;let e=sp();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 pd=t,t.default=t,e.registerAtRule(t),pd}function op(){if(gd)return md;gd=1;let e,t,r=sp();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},md=n,n.default=n,md}function ap(){if(yd)return vd;yd=1;return vd={nanoid:(e=21)=>{let t="",r=0|e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(r=t)=>{let n="",s=0|r;for(;s--;)n+=e[Math.random()*e.length|0];return n}},vd}function lp(){if(wd)return bd;wd=1;let{existsSync:e,readFileSync:t}=Jh,{dirname:r,join:n}=Jh,{SourceMapConsumer:s,SourceMapGenerator:i}=Jh;class o{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let n=t.map?t.map.prev:void 0,s=this.loadMap(t.from,n);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=r(this.mapFile)),s&&(this.text=s)}consumer(){return this.consumerCache||(this.consumerCache=new s(this.text)),this.consumerCache}decodeInline(e){let t=e.match(/^data:application\/json;charset=utf-?8,/)||e.match(/^data:application\/json,/);if(t)return decodeURIComponent(e.substr(t[0].length));let r=e.match(/^data:application\/json;charset=utf-?8;base64,/)||e.match(/^data:application\/json;base64,/);if(r)return n=e.substr(r[0].length),Buffer?Buffer.from(n,"base64").toString():window.atob(n);var n;let s=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+s)}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=/g);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(n){if(this.root=r(n),e(n))return this.mapFile=n,t(n,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof s)return i.fromSourceMap(t).toString();if(t instanceof i)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let r=t(e);if(r){let e=this.loadFile(r);if(!e)throw new Error("Unable to load previous source map: "+r.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=n(r(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return bd=o,o.default=o,bd}function cp(){if(Cd)return Sd;Cd=1;let{nanoid:e}=ap(),{isAbsolute:t,resolve:r}=Jh,{SourceMapConsumer:n,SourceMapGenerator:s}=Jh,{fileURLToPath:i,pathToFileURL:o}=Jh,a=td(),l=lp(),c=Jh,u=Symbol("lineToIndexCache"),h=Boolean(n&&s),d=Boolean(r&&t);function p(e){if(e[u])return e[u];let t=e.css.split("\n"),r=new Array(t.length),n=0;for(let e=0,s=t.length;e<s;e++)r[e]=n,n+=t[e].length+1;return e[u]=r,r}class f{get from(){return this.file||this.id}constructor(n,s={}){if(null==n||"object"==typeof n&&!n.toString)throw new Error(`PostCSS received ${n} instead of CSS string`);if(this.css=n.toString(),"\ufeff"===this.css[0]||""===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,this.document=this.css,s.document&&(this.document=s.document.toString()),s.from&&(!d||/^\w+:\/\//.test(s.from)||t(s.from)?this.file=s.from:this.file=r(s.from)),d&&h){let e=new l(this.css,s);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 "+e(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let s,i,l,c,u;if(t&&"object"==typeof t){let e=t,n=r;if("number"==typeof e.offset){c=e.offset;let n=this.fromOffset(c);t=n.line,r=n.col}else t=e.line,r=e.column,c=this.fromLineAndColumn(t,r);if("number"==typeof n.offset){l=n.offset;let e=this.fromOffset(l);i=e.line,s=e.col}else i=n.line,s=n.column,l=this.fromLineAndColumn(n.line,n.column)}else if(r)c=this.fromLineAndColumn(t,r);else{c=t;let e=this.fromOffset(c);t=e.line,r=e.col}let h=this.origin(t,r,i,s);return u=h?new a(e,void 0===h.endLine?h.line:{column:h.column,line:h.line},void 0===h.endLine?h.column:{column:h.endColumn,line:h.endLine},h.source,h.file,n.plugin):new a(e,void 0===i?t:{column:r,line:t},void 0===i?r:{column:s,line:i},this.css,this.file,n.plugin),u.input={column:r,endColumn:s,endLine:i,endOffset:l,line:t,offset:c,source:this.css},this.file&&(o&&(u.input.url=o(this.file).toString()),u.input.file=this.file),u}fromLineAndColumn(e,t){return p(this)[e-1]+t-1}fromOffset(e){let t=p(this),r=0;if(e>=t[t.length-1])r=t.length-1;else{let n,s=t.length-2;for(;r<s;)if(n=r+(s-r>>1),e<t[n])s=n-1;else{if(!(e>=t[n+1])){r=n;break}r=n+1}}return{col:e-t[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:r(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,r,n,s){if(!this.map)return!1;let a,l,c=this.map.consumer(),u=c.originalPositionFor({column:r,line:e});if(!u.source)return!1;"number"==typeof n&&(a=c.originalPositionFor({column:s,line:n})),l=t(u.source)?o(u.source):new URL(u.source,this.map.consumer().sourceRoot||o(this.map.mapFile));let h={column:u.column,endColumn:a&&a.column,endLine:a&&a.line,line:u.line,url:l.toString()};if("file:"===l.protocol){if(!i)throw new Error("file: protocol is not available in this PostCSS build");h.file=i(l)}let d=c.sourceContentFor(u.source);return d&&(h.source=d),h}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}}return Sd=f,f.default=f,c&&c.registerInput&&c.registerInput(f),Sd}function up(){if(kd)return xd;kd=1;let e,t,r=sp();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},xd=n,n.default=n,r.registerRoot(n),xd}function hp(){if(Ed)return Id;Ed=1;let e={comma:t=>e.split(t,[","],!0),space:t=>e.split(t,[" ","\n","\t"]),split(e,t,r){let n=[],s="",i=!1,o=0,a=!1,l="",c=!1;for(let r of e)c?c=!1:"\\"===r?c=!0:a?r===l&&(a=!1):'"'===r||"'"===r?(a=!0,l=r):"("===r?o+=1:")"===r?o>0&&(o-=1):0===o&&t.includes(r)&&(i=!0),i?(""!==s&&n.push(s.trim()),s="",i=!1):s+=r;return(r||""!==s)&&n.push(s.trim()),n}};return Id=e,e.default=e,Id}function dp(){if(Md)return Od;Md=1;let e=sp(),t=hp();class r extends e{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)}constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}}return Od=r,r.default=r,e.registerRule(r),Od}function pp(){if(Td)return Ad;Td=1;let{dirname:e,relative:t,resolve:r,sep:n}=Jh,{SourceMapConsumer:s,SourceMapGenerator:i}=Jh,{pathToFileURL:o}=Jh,a=cp(),l=Boolean(s&&i),c=Boolean(e&&r&&t&&n);return Ad=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 r,n=this.toUrl(this.path(t.file)),i=t.root||e(t.file);!1===this.mapOpts.sourcesContent?(r=new s(t.text),r.sourcesContent&&(r.sourcesContent=null)):r=t.consumer(),this.map.applySourceMap(r,n,this.toUrl(this.path(i)))}}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&&e.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),c&&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=i.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new i({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 i({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,r=1,n=1,s="<no source>",o={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(i,a,l)=>{if(this.css+=i,a&&"end"!==l&&(o.generated.line=r,o.generated.column=n-1,a.source&&a.source.start?(o.source=this.sourcePath(a),o.original.line=a.source.start.line,o.original.column=a.source.start.column-1,this.map.addMapping(o)):(o.source=s,o.original.line=1,o.original.column=0,this.map.addMapping(o))),t=i.match(/\n/g),t?(r+=t.length,e=i.lastIndexOf("\n"),n=i.length-e):n+=i.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?(o.source=this.sourcePath(a),o.original.line=a.source.end.line,o.original.column=a.source.end.column-1,o.generated.line=r,o.generated.column=n-2,this.map.addMapping(o)):(o.source=s,o.original.line=1,o.original.column=0,o.generated.line=r,o.generated.column=n-1,this.map.addMapping(o)))}})}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(n){if(this.mapOpts.absolute)return n;if(60===n.charCodeAt(0))return n;if(/^\w+:\/\//.test(n))return n;let s=this.memoizedPaths.get(n);if(s)return s;let i=this.opts.to?e(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(i=e(r(i,this.mapOpts.annotation)));let o=t(i,n);return this.memoizedPaths.set(n,o),o}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(o){let t=o(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;"\\"===n&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}},Ad}function fp(){if(Dd)return _d;Dd=1;let e=ip(),t=rp(),r=np(),n=up(),s=dp(),i=function(){if(Ld)return Nd;Ld=1;const e="'".charCodeAt(0),t='"'.charCodeAt(0),r="\\".charCodeAt(0),n="/".charCodeAt(0),s="\n".charCodeAt(0),i=" ".charCodeAt(0),o="\f".charCodeAt(0),a="\t".charCodeAt(0),l="\r".charCodeAt(0),c="[".charCodeAt(0),u="]".charCodeAt(0),h="(".charCodeAt(0),d=")".charCodeAt(0),p="{".charCodeAt(0),f="}".charCodeAt(0),m=";".charCodeAt(0),g="*".charCodeAt(0),v=":".charCodeAt(0),y="@".charCodeAt(0),b=/[\t\n\f\r "#'()/;[\\\]{}]/g,w=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,S=/.[\r\n"'(/\\]/,C=/[\da-f]/i;return Nd=function(x,k={}){let I,E,O,M,R,P,A,T,N,L,_=x.css.valueOf(),D=k.ignoreErrors,F=_.length,B=0,U=[],j=[];function z(e){throw x.error("Unclosed "+e,B)}return{back:function(e){j.push(e)},endOfFile:function(){return 0===j.length&&B>=F},nextToken:function(x){if(j.length)return j.pop();if(B>=F)return;let k=!!x&&x.ignoreUnclosed;switch(I=_.charCodeAt(B),I){case s:case i:case a:case l:case o:M=B;do{M+=1,I=_.charCodeAt(M)}while(I===i||I===s||I===a||I===l||I===o);P=["space",_.slice(B,M)],B=M-1;break;case c:case u:case p:case f:case v:case m:case d:{let e=String.fromCharCode(I);P=[e,e,B];break}case h:if(L=U.length?U.pop()[1]:"",N=_.charCodeAt(B+1),"url"===L&&N!==e&&N!==t&&N!==i&&N!==s&&N!==a&&N!==o&&N!==l){M=B;do{if(A=!1,M=_.indexOf(")",M+1),-1===M){if(D||k){M=B;break}z("bracket")}for(T=M;_.charCodeAt(T-1)===r;)T-=1,A=!A}while(A);P=["brackets",_.slice(B,M+1),B,M],B=M}else M=_.indexOf(")",B+1),E=_.slice(B,M+1),-1===M||S.test(E)?P=["(","(",B]:(P=["brackets",E,B,M],B=M);break;case e:case t:R=I===e?"'":'"',M=B;do{if(A=!1,M=_.indexOf(R,M+1),-1===M){if(D||k){M=B+1;break}z("string")}for(T=M;_.charCodeAt(T-1)===r;)T-=1,A=!A}while(A);P=["string",_.slice(B,M+1),B,M],B=M;break;case y:b.lastIndex=B+1,b.test(_),M=0===b.lastIndex?_.length-1:b.lastIndex-2,P=["at-word",_.slice(B,M+1),B,M],B=M;break;case r:for(M=B,O=!0;_.charCodeAt(M+1)===r;)M+=1,O=!O;if(I=_.charCodeAt(M+1),O&&I!==n&&I!==i&&I!==s&&I!==a&&I!==l&&I!==o&&(M+=1,C.test(_.charAt(M)))){for(;C.test(_.charAt(M+1));)M+=1;_.charCodeAt(M+1)===i&&(M+=1)}P=["word",_.slice(B,M+1),B,M],B=M;break;default:I===n&&_.charCodeAt(B+1)===g?(M=_.indexOf("*/",B+2)+1,0===M&&(D||k?M=_.length:z("comment")),P=["comment",_.slice(B,M+1),B,M],B=M):(w.lastIndex=B+1,w.test(_),M=0===w.lastIndex?_.length-1:w.lastIndex-2,P=["word",_.slice(B,M+1),B,M],U.push(P),B=M)}return B++,P},position:function(){return B}}}}();const o={empty:!0,space:!0};return _d=class{constructor(e){this.input=e,this.root=new n,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(t){let r,n,s,i=new e;i.name=t[1].slice(1),""===i.name&&this.unnamedAtrule(i,t),this.init(i,t[2]);let o=!1,a=!1,l=[],c=[];for(;!this.tokenizer.endOfFile();){if(r=(t=this.tokenizer.nextToken())[0],"("===r||"["===r?c.push("("===r?")":"]"):"{"===r&&c.length>0?c.push("}"):r===c[c.length-1]&&c.pop(),0===c.length){if(";"===r){i.source.end=this.getPosition(t[2]),i.source.end.offset++,this.semicolon=!0;break}if("{"===r){a=!0;break}if("}"===r){if(l.length>0){for(s=l.length-1,n=l[s];n&&"space"===n[0];)n=l[--s];n&&(i.source.end=this.getPosition(n[3]||n[2]),i.source.end.offset++)}this.end(t);break}l.push(t)}else l.push(t);if(this.tokenizer.endOfFile()){o=!0;break}}i.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(i.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(i,"params",l),o&&(t=l[l.length-1],i.source.end=this.getPosition(t[3]||t[2]),i.source.end.offset++,this.spaces=i.raws.between,i.raws.between="")):(i.raws.afterName="",i.params=""),a&&(i.nodes=[],this.current=i)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let r,n=0;for(let s=t-1;s>=0&&(r=e[s],"space"===r[0]||(n+=1,2!==n));s--);throw this.input.error("Missed semicolon","word"===r[0]?r[3]+1:r[2])}colon(e){let t,r,n,s=0;for(let[i,o]of e.entries()){if(r=o,n=r[0],"("===n&&(s+=1),")"===n&&(s-=1),0===s&&":"===n){if(t){if("word"===t[0]&&"progid"===t[1])continue;return i}this.doubleColon(r)}t=r}return!1}comment(e){let r=new t;this.init(r,e[2]),r.source.end=this.getPosition(e[3]||e[2]),r.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))r.text="",r.raws.left=n,r.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);r.text=e[2],r.raws.left=e[1],r.raws.right=e[3]}}createTokenizer(){this.tokenizer=i(this.input)}decl(e,t){let n=new r;this.init(n,e[0][2]);let s,i=e[e.length-1];for(";"===i[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(i[3]||i[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}}(e)),n.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),n.raws.before+=e.shift()[1];for(n.source.start=this.getPosition(e[0][2]),n.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;n.prop+=e.shift()[1]}for(n.raws.between="";e.length;){if(s=e.shift(),":"===s[0]){n.raws.between+=s[1];break}"word"===s[0]&&/\w/.test(s[1])&&this.unknownWord([s]),n.raws.between+=s[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let o,a=[];for(;e.length&&(o=e[0][0],"space"===o||"comment"===o);)a.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(s=e[t],"!important"===s[1].toLowerCase()){n.important=!0;let r=this.stringFrom(e,t);r=this.spacesFromEnd(e)+r," !important"!==r&&(n.raws.important=r);break}if("important"===s[1].toLowerCase()){let r=e.slice(0),s="";for(let e=t;e>0;e--){let t=r[e][0];if(s.trim().startsWith("!")&&"space"!==t)break;s=r.pop()[1]+s}s.trim().startsWith("!")&&(n.important=!0,n.raws.important=s,e=r)}if("space"!==s[0]&&"comment"!==s[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(n,"value",a.concat(e),t),n.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new s;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 t=this.current.nodes[this.current.nodes.length-1];t&&"rule"===t.type&&!t.raws.ownSemicolon&&(t.raws.ownSemicolon=this.spaces,this.spaces="",t.source.end=this.getPosition(e[2]),t.source.end.offset+=t.raws.ownSemicolon.length)}}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,s=null,i=[],o=e[1].startsWith("--"),a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)s||(s=l),i.push("("===r?")":"]");else if(o&&n&&"{"===r)s||(s=l),i.push("}");else if(0===i.length){if(";"===r){if(n)return void this.decl(a,o);break}if("{"===r)return void this.rule(a);if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}":"===r&&(n=!0)}else r===i[i.length-1]&&(i.pop(),0===i.length&&(s=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),i.length>0&&this.unclosedBracket(s),t&&n){if(!o)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,o)}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 s,i,a,l,c=r.length,u="",h=!0;for(let e=0;e<c;e+=1)s=r[e],i=s[0],"space"!==i||e!==c-1||n?"comment"===i?(l=r[e-1]?r[e-1][0]:"empty",a=r[e+1]?r[e+1][0]:"empty",o[l]||o[a]||","===u.slice(-1)?h=!1:u+=s[1]):u+=s[1]:h=!1;if(!h){let n=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:n,value:u}}e[t]=u}rule(e){e.pop();let t=new s;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 "+e[0][1],{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})}},_d}function mp(){if(Bd)return Fd;Bd=1;let e=sp(),t=cp(),r=fp();function n(e,n){let s=new t(e,n),i=new r(s);try{i.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 i.root}return Fd=n,n.default=n,e.registerParse(n),Fd}function gp(){if(jd)return Ud;jd=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 Ud=e,e.default=e,Ud}function vp(){if(Wd)return zd;Wd=1;let e=gp();class t{get content(){return this.css}constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css="",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)}}return zd=t,t.default=t,zd}function yp(){if($d)return qd;$d=1;let e={};return qd=function(t){e[t]||(e[t]=!0,"undefined"!=typeof console&&console.warn&&console.warn(t))}}function bp(){if(Gd)return Vd;Gd=1;let e=sp(),t=op(),r=pp(),n=mp(),s=vp(),i=up(),o=nd(),{isClean:a,my:l}=ep(),c=yp();const u={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},h={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},d={Once:!0,postcssPlugin:!0,prepare:!0};function p(e){return"object"==typeof e&&"function"==typeof e.then}function f(e){let t=!1,r=u[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 m(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 g(e){return e[a]=!1,e.nodes&&e.nodes.forEach(e=>g(e)),e}let v={};class y{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"}constructor(t,r,i){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 s)o=g(r.root),r.map&&(void 0===i.map&&(i.map={}),i.map.inline||(i.map.inline=!1),i.map.prev=r.map);else{let t=n;i.syntax&&(t=i.syntax.parse),i.parser&&(t=i.parser),t.parse&&(t=t.parse);try{o=t(r,i)}catch(e){this.processed=!0,this.error=e}o&&!o[l]&&e.rebuild(o)}else o=g(r);this.result=new s(t,o,i),this.helpers={...v,postcss:v,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,s=t.split("."),i=n.split(".");(s[0]!==i[0]||parseInt(s[1])>parseInt(i[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(!h[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!d[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 e=this.result.root;for(;!e[a];){e[a]=!0;let t=[m(e)];for(;t.length>0;){let e=this.visitTick(t);if(p(e))try{await e}catch(e){let r=t[t.length-1].node;throw this.handleError(e,r)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map(e=>r(e,this.helpers));await Promise.all(t)}else await r(e,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=o;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let n=new r(t,this.result.root,this.result.opts).generate();return this.result.css=n[0],this.result.map=n[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 e=this.result.root;for(;!e[a];)e[a]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||c("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(e){let t=e[e.length-1],{node:r,visitors:n}=t;if("root"!==r.type&&"document"!==r.type&&!r.parent)return void e.pop();if(n.length>0&&t.visitorIndex<n.length){let[e,s]=n[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===n.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return s(r.toProxy(),this.helpers)}catch(e){throw this.handleError(e,r)}}if(0!==t.iterator){let n,s=t.iterator;for(;n=r.nodes[r.indexes[s]];)if(r.indexes[s]+=1,!n[a])return n[a]=!0,void e.push(m(n));t.iterator=0,delete r.indexes[s]}let s=t.events;for(;t.eventIndex<s.length;){let e=s[t.eventIndex];if(t.eventIndex+=1,0===e)return void(r.nodes&&r.nodes.length&&(r[a]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[a]=!0;let t=f(e);for(let r of t)if(0===r)e.nodes&&e.each(e=>{e[a]||this.walkSync(e)});else{let t=this.listeners[r];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}}return y.registerPostcss=e=>{v=e},Vd=y,y.default=y,i.registerLazyResult(y),t.registerLazyResult(y),Vd}function wp(){if(Yd)return Kd;Yd=1;let e=op(),t=bp(),r=function(){if(Jd)return Hd;Jd=1;let e=pp(),t=mp();const r=vp();let n=nd(),s=yp();class i{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,r=t;try{e=r(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"}constructor(t,s,i){let o;s=s.toString(),this.stringified=!1,this._processor=t,this._css=s,this._opts=i,this._map=void 0;let a=n;this.result=new r(this._processor,o,this._opts),this.result.css=s;let l=this;Object.defineProperty(this.result,"root",{get:()=>l.root});let c=new e(a,o,this._opts,s);if(c.isMap()){let[e,t]=c.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else c.clearAnnotation(),this.result.css=c.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||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}warnings(){return[]}}return Hd=i,i.default=i,Hd}(),n=up();class s{constructor(e=[]){this.version="8.5.6",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(e,n={}){return this.plugins.length||n.parser||n.stringifier||n.syntax?new t(this,e,n):new r(this,e,n)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}return Kd=s,s.default=s,n.registerProcessor(s),e.registerProcessor(s),Kd}var Sp=function(){if(Qd)return Xd;Qd=1;let e=ip(),t=rp(),r=sp(),n=td(),s=np(),i=op(),o=function(){if(Pd)return Rd;Pd=1;let e=ip(),t=rp(),r=np(),n=cp(),s=lp(),i=up(),o=dp();function a(l,c){if(Array.isArray(l))return l.map(e=>a(e));let{inputs:u,...h}=l;if(u){c=[];for(let e of u){let t={...e,__proto__:n.prototype};t.map&&(t.map={...t.map,__proto__:s.prototype}),c.push(t)}}if(h.nodes&&(h.nodes=l.nodes.map(e=>a(e,c))),h.source){let{inputId:e,...t}=h.source;h.source=t,null!=e&&(h.source.input=c[e])}if("root"===h.type)return new i(h);if("decl"===h.type)return new r(h);if("rule"===h.type)return new o(h);if("comment"===h.type)return new t(h);if("atrule"===h.type)return new e(h);throw new Error("Unknown node type: "+l.type)}return Rd=a,a.default=a,Rd}(),a=cp(),l=bp(),c=hp(),u=tp(),h=mp(),d=wp(),p=vp(),f=up(),m=dp(),g=nd(),v=gp();function y(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new d(e)}return y.plugin=function(e,t){let r,n=!1;function s(...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 s=t(...r);return s.postcssPlugin=e,s.postcssVersion=(new d).version,s}return Object.defineProperty(s,"postcss",{get:()=>(r||(r=s()),r)}),s.process=function(e,t,r){return y([s(r)]).process(e,t)},s},y.stringify=g,y.parse=h,y.fromJSON=o,y.list=c,y.comment=e=>new t(e),y.atRule=t=>new e(t),y.decl=e=>new s(e),y.rule=e=>new m(e),y.root=e=>new f(e),y.document=e=>new i(e),y.CssSyntaxError=n,y.Declaration=s,y.Container=r,y.Processor=d,y.Document=i,y.Comment=t,y.Warning=v,y.AtRule=e,y.Result=p,y.Input=a,y.Rule=m,y.Root=f,y.Node=u,l.registerPostcss(y),Xd=y,y.default=y,Xd}();const Cp=qh(Sp);Cp.stringify,Cp.fromJSON,Cp.plugin,Cp.parse,Cp.list,Cp.document,Cp.comment,Cp.atRule,Cp.rule,Cp.decl,Cp.root,Cp.CssSyntaxError,Cp.Declaration,Cp.Container,Cp.Processor,Cp.Document,Cp.Comment,Cp.Warning,Cp.AtRule,Cp.Result,Cp.Input,Cp.Rule,Cp.Root,Cp.Node;class xp{constructor(...e){Wh(this,"parentElement",null),Wh(this,"parentNode",null),Wh(this,"ownerDocument"),Wh(this,"firstChild",null),Wh(this,"lastChild",null),Wh(this,"previousSibling",null),Wh(this,"nextSibling",null),Wh(this,"ELEMENT_NODE",1),Wh(this,"TEXT_NODE",3),Wh(this,"nodeType"),Wh(this,"nodeName"),Wh(this,"RRNodeType")}get childNodes(){const e=[];let t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(!(e instanceof xp))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.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"}}const kp={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Ip={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Ep={};function Op(e){if(Ep[e])return Ep[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 kp?kp[e]:void 0,s=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]"))})),i=e in Ip?Ip[e]:void 0,o=Boolean(i&&i.every(e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))}));if(s&&o)return Ep[e]=t.prototype,t.prototype;try{const n=document.createElement("iframe");document.body.appendChild(n);const s=n.contentWindow;if(!s)return t.prototype;const i=s[e].prototype;return document.body.removeChild(n),i?Ep[e]=i:r}catch{return r}}const Mp={};function Rp(e,t,r){var n;const s=`${e}.${String(r)}`;if(Mp[s])return Mp[s].call(t);const i=Op(e),o=null==(n=Object.getOwnPropertyDescriptor(i,r))?void 0:n.get;return o?(Mp[s]=o,o.call(t)):t[r]}const Pp={};function Ap(e,t,r){const n=`${e}.${String(r)}`;if(Pp[n])return Pp[n].bind(t);const s=Op(e)[r];return"function"!=typeof s?t[r]:(Pp[n]=s,s.bind(t))}function Tp(){return Op("MutationObserver").constructor}const Np={childNodes:function(e){return Rp("Node",e,"childNodes")},parentNode:function(e){return Rp("Node",e,"parentNode")},parentElement:function(e){return Rp("Node",e,"parentElement")},textContent:function(e){return Rp("Node",e,"textContent")},contains:function(e,t){return Ap("Node",e,"contains")(t)},getRootNode:function(e){return Ap("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Rp("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Rp("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Rp("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Rp("Element",e,"querySelectorAll")(t)},mutationObserver:Tp};function Lp(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}const _p="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.";let Dp={map:{},getId:()=>(console.error(_p),-1),getNode:()=>(console.error(_p),null),removeNodeFromMap(){console.error(_p)},has:()=>(console.error(_p),!1),reset(){console.error(_p)}};function Fp(e,t,r={}){let n=null,s=0;return function(...i){const o=Date.now();s||!1!==r.leading||(s=o);const a=t-(o-s),l=this;a<=0||a>t?(n&&(clearTimeout(n),n=null),s=o,e.apply(l,i)):n||!1===r.trailing||(n=setTimeout(()=>{s=!1===r.leading?0:Date.now(),n=null,e.apply(l,i)},a))}}function Bp(e,t,r,n,s=window){const i=s.Object.getOwnPropertyDescriptor(e,t);return s.Object.defineProperty(e,t,n?r:{set(e){setTimeout(()=>{r.set.call(this,e)},0),i&&i.set&&i.set.call(this,e)}}),()=>Bp(e,t,i||{},!0)}function Up(e,t,r){try{if(!(t in e))return()=>{};const n=e[t],s=r(n);return"function"==typeof s&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=s,()=>{e[t]=n}}catch{return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Dp=new Proxy(Dp,{get:(e,t,r)=>("map"===t&&console.error(_p),Reflect.get(e,t,r))}));let jp=Date.now;function zp(e){var t,r,n,s;const i=e.document;return{left:i.scrollingElement?i.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:i.documentElement.scrollLeft||(null==i?void 0:i.body)&&(null==(t=Np.parentElement(i.body))?void 0:t.scrollLeft)||(null==(r=null==i?void 0:i.body)?void 0:r.scrollLeft)||0,top:i.scrollingElement?i.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==i?void 0:i.documentElement.scrollTop)||(null==i?void 0:i.body)&&(null==(n=Np.parentElement(i.body))?void 0:n.scrollTop)||(null==(s=null==i?void 0:i.body)?void 0:s.scrollTop)||0}}function Wp(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function qp(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function $p(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:Np.parentElement(e)}function Vp(e,t,r,n){if(!e)return!1;const s=$p(e);if(!s)return!1;try{if("string"==typeof t){if(s.classList.contains(t))return!0;if(n&&null!==s.closest("."+t))return!0}else if(tu(s,t,n))return!0}catch(e){}if(r){if(s.matches(r))return!0;if(n&&null!==s.closest(r))return!0}return!1}function Gp(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||-2===t.getId(e)}function Hp(e,t){if(kc(e))return!1;const r=t.getId(e);if(!t.has(r))return!0;const n=Np.parentNode(e);return(!n||n.nodeType!==e.DOCUMENT_NODE)&&(!n||Hp(n,t))}function Jp(e){return Boolean(e.changedTouches)}function Kp(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Yp(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Xp(e){return!!e&&(e instanceof xp&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(Np.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(jp=()=>(new Date).getTime());class Qp{constructor(){uc(this,"id",1),uc(this,"styleIDMap",new WeakMap),uc(this,"idStyleMap",new Map)}getId(e){return this.styleIDMap.get(e)??-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++}}function Zp(e){var t;let r=null;return"getRootNode"in e&&(null==(t=Np.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&Np.host(Np.getRootNode(e))&&(r=Np.host(Np.getRootNode(e))),r}function ef(e){const t=e.ownerDocument;if(!t)return!1;const r=function(e){let t,r=e;for(;t=Zp(r);)r=t;return r}(e);return Np.contains(t,r)}function tf(e){const t=e.ownerDocument;return!!t&&(Np.contains(t,e)||ef(e))}var rf=(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))(rf||{}),nf=(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))(nf||{}),sf=(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))(sf||{}),of=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(of||{}),af=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(af||{}),lf=(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))(lf||{}),cf=(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))(cf||{});function uf(e){return"__ln"in e}class hf{constructor(){uc(this,"length",0),uc(this,"head",null),uc(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&&uf(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&&uf(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--)}}const df=(e,t)=>`${e}@${t}`;class pf{constructor(){uc(this,"frozen",!1),uc(this,"locked",!1),uc(this,"texts",[]),uc(this,"attributes",[]),uc(this,"attributeMap",new WeakMap),uc(this,"removes",[]),uc(this,"mapRemoves",[]),uc(this,"movedMap",{}),uc(this,"addedSet",new Set),uc(this,"movedSet",new Set),uc(this,"droppedSet",new Set),uc(this,"removesSubTreeCache",new Set),uc(this,"mutationCb"),uc(this,"blockClass"),uc(this,"blockSelector"),uc(this,"maskTextClass"),uc(this,"maskTextSelector"),uc(this,"inlineStylesheet"),uc(this,"maskInputOptions"),uc(this,"maskTextFn"),uc(this,"maskInputFn"),uc(this,"maskAttributeFn"),uc(this,"keepIframeSrcFn"),uc(this,"recordCanvas"),uc(this,"inlineImages"),uc(this,"slimDOMOptions"),uc(this,"dataURLOptions"),uc(this,"doc"),uc(this,"mirror"),uc(this,"iframeManager"),uc(this,"stylesheetManager"),uc(this,"shadowDomManager"),uc(this,"canvasManager"),uc(this,"processedNodeManager"),uc(this,"captureAdoptedStyleSheets"),uc(this,"unattachedDoc"),uc(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),uc(this,"emit",()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,r=new hf,n=e=>{let t=e,r=-2;for(;-2===r;)t=t&&t.nextSibling,r=t&&this.mirror.getId(t);return r},s=s=>{const i=Np.parentNode(s);if(!i||!tf(s))return;let o=!1;if(s.nodeType===Node.TEXT_NODE){const e=i.tagName;if("TEXTAREA"===e)return;"STYLE"===e&&this.addedSet.has(i)&&(o=!0)}const a=kc(i)?this.mirror.getId(Zp(s)):this.mirror.getId(i),l=n(s);if(-1===a||-1===l)return r.addNode(s);const c=ou(s,{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=>{Kp(e,this.mirror)&&this.iframeManager.addIframe(e),Yp(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Xp(s)&&this.shadowDomManager.addShadowRoot(Np.shadowRoot(s),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)},onAdoptedStyleSheet:this.captureAdoptedStyleSheets?e=>this.stylesheetManager.styleMirror.add(e):void 0,_emittedStyleIds:this.captureAdoptedStyleSheets?this.stylesheetManager.getInlinedAdoptedStyleSheetRuleIds():void 0,cssCaptured:o});c&&(e.push({parentId:a,nextId:l,node:c}),t.add(c.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const e of this.movedSet)mf(this.removesSubTreeCache,e,this.mirror)&&!this.movedSet.has(Np.parentNode(e))||s(e);for(const e of this.addedSet)gf(this.droppedSet,e)||mf(this.removesSubTreeCache,e,this.mirror)?gf(this.movedSet,e)?s(e):this.droppedSet.add(e):s(e);let i=null;for(;r.length;){let e=null;if(i){const t=this.mirror.getId(Np.parentNode(i.value)),r=n(i.value);-1!==t&&-1!==r&&(e=i)}if(!e){let t=r.tail;for(;t;){const r=t;if(t=t.previous,r){const t=this.mirror.getId(Np.parentNode(r.value));if(-1===n(r.value))continue;if(-1!==t){e=r;break}{const t=r.value,n=Np.parentNode(t);if(n&&n.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const t=Np.host(n);if(-1!==this.mirror.getId(t)){e=r;break}}}}}}if(!e){for(;r.head;)r.removeNode(r.head.value);break}i=e.previous,r.removeNode(e.value),s(e.value)}const o={texts:this.texts.map(e=>{const t=e.node,r=Np.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};(o.texts.length||o.attributes.length||o.removes.length||o.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(o))}),uc(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(Np.childNodes(e),e=>Np.textContent(e)||"").join("");t.attributes.value=Rc({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:Tc(e),value:r,maskInputFn:this.maskInputFn})}),uc(this,"processMutation",e=>{if(!Gp(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=Np.textContent(e.target);Vp(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:ru(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,$p(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=Tc(t);n=Rc({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:e,value:n,maskInputFn:this.maskInputFn})}if(Vp(e.target,this.blockClass,this.blockSelector,!1)||n===e.oldValue)return;let s=this.attributeMap.get(e.target);if("IFRAME"===t.tagName&&"src"===r&&!this.keepIframeSrcFn(n)){if(t.contentDocument)return;r="rr_src"}if(s||(s={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(s),this.attributeMap.set(e.target,s)),"type"===r&&"INPUT"===t.tagName&&"password"===(e.oldValue||"").toLowerCase()&&t.setAttribute("data-rr-is-password","true"),!eu(t.tagName,r)){if(s.attributes[r]=Zc(this.doc,Pc(t.tagName),Pc(r),n),this.maskAttributeFn&&"string"==typeof s.attributes[r]){const e=this.maskAttributeFn(r,s.attributes[r],t);null!==e?s.attributes[r]=e:delete s.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),i=t.style.getPropertyPriority(e);n!==r.style.getPropertyValue(e)||i!==r.style.getPropertyPriority(e)?s.styleDiff[e]=""===i?n:[n,i]:s._unchangedStyles[e]=[n,i]}for(const e of Array.from(r.style))""===t.style.getPropertyValue(e)&&(s.styleDiff[e]=!1)}else"open"===r&&"DIALOG"===t.tagName&&(t.matches("dialog:modal")?s.attributes.rr_open_mode="modal":s.attributes.rr_open_mode="non-modal")}break}case"childList":if(Vp(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=kc(e.target)?this.mirror.getId(Np.host(e.target)):this.mirror.getId(e.target);Vp(e.target,this.blockClass,this.blockSelector,!1)||Gp(t,this.mirror,this.slimDOMOptions)||(!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(ff(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||Hp(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[df(r,n)]?ff(this.movedSet,t):(this.removes.push({parentId:n,id:r,isShadow:!(!kc(e.target)||!Ic(e.target))||void 0}),function(e,t){const r=[e];for(;r.length;){const e=r.pop();t.has(e)||(t.add(e),Np.childNodes(e).forEach(e=>r.push(e)))}}(t,this.removesSubTreeCache)))),this.mapRemoves.push(t))})}}),uc(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(Gp(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[df(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Vp(e,this.blockClass,this.blockSelector,!1)||(Np.childNodes(e).forEach(e=>this.genAdds(e)),Xp(e)&&Np.childNodes(Np.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","captureAdoptedStyleSheets"].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()}}function ff(e,t){e.delete(t),Np.childNodes(t).forEach(t=>ff(e,t))}function mf(e,t,r){return 0!==e.size&&function(e,t){const r=Np.parentNode(t);return!!r&&e.has(r)}(e,t)}function gf(e,t){return 0!==e.size&&vf(e,t)}function vf(e,t){const r=Np.parentNode(t);return!!r&&(!!e.has(r)||vf(e,r))}let yf;const bf=e=>{if(!yf)return e;return(...t)=>{try{return e(...t)}catch(e){if(yf&&!0===yf(e))return;throw e}}};function wf(e){return(...t)=>{try{return e(...t)}catch(e){try{e._external_=!0}catch{}throw e}}}const Sf=[];function Cf(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{}return e&&e.target}function xf(e,t){const r=new pf;Sf.push(r),r.init(e);const n=new(Tp())(bf(r.processMutations.bind(r)));return n.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),n}function kf({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,blockSelector:s,sampling:i}){if(!1===i.mouseInteraction)return()=>{};const o=!0===i.mouseInteraction||void 0===i.mouseInteraction?{}:i.mouseInteraction,a=[];let l=null;return Object.keys(sf).filter(e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==o[e]).forEach(i=>{let o=Pc(i);const c=(t=>i=>{const o=Cf(i);if(Vp(o,n,s,!0))return;let a=null,c=t;if("pointerType"in i){switch(i.pointerType){case"mouse":a=of.Mouse;break;case"touch":a=of.Touch;break;case"pen":a=of.Pen}a===of.Touch?sf[t]===sf.MouseDown?c="TouchStart":sf[t]===sf.MouseUp&&(c="TouchEnd"):of.Pen}else Jp(i)&&(a=of.Touch);null!==a?(l=a,(c.startsWith("Touch")&&a===of.Touch||c.startsWith("Mouse")&&a===of.Mouse)&&(a=null)):sf[t]===sf.Click&&(a=l,l=null);const u=Jp(i)?i.changedTouches[0]:i;if(!u)return;const h=r.getId(o),{clientX:d,clientY:p}=u;bf(e)({type:sf[c],id:h,x:d,y:p,...null!==a&&{pointerType:a}},i)})(i);if(window.PointerEvent)switch(sf[i]){case sf.MouseDown:case sf.MouseUp:o=o.replace("mouse","pointer");break;case sf.TouchStart:case sf.TouchEnd:return}a.push(Lp(o,c,t))}),bf(()=>{a.forEach(e=>e())})}function If({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:s,sampling:i}){const o=bf(Fp(bf(i=>{const o=Cf(i);if(!o||Vp(o,n,s,!0))return;const a=r.getId(o);if(o===t&&t.defaultView){const r=zp(t.defaultView);e({id:a,x:r.left,y:r.top})}else e({id:a,x:o.scrollLeft,y:o.scrollTop})}),i.scroll||100));return Lp("scroll",o,t)}const Ef=["INPUT","TEXTAREA","SELECT"],Of=new WeakMap;function Mf(e){return function(e,t){if(Tf("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||Tf("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||Tf("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||Tf("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 Rf(e,t,r){let n,s;return e?(e.ownerNode?n=t.getId(e.ownerNode):s=r.getId(e),{styleId:s,id:n}):{}}function Pf({mirror:e,stylesheetManager:t},r){var n,s,i;let o=null;o="#document"===r.nodeName?e.getId(r):e.getId(Np.host(r));const a="#document"===r.nodeName?null==(n=r.defaultView)?void 0:n.Document:null==(i=null==(s=r.ownerDocument)?void 0:s.defaultView)?void 0:i.ShadowRoot,l=(null==a?void 0:a.prototype)?Object.getOwnPropertyDescriptor(null==a?void 0:a.prototype,"adoptedStyleSheets"):void 0;return null!==o&&-1!==o&&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!==o&&-1!==o)try{t.adoptStyleSheets(e,o)}catch(e){}return n}}),bf(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})})):()=>{}}function Af(e,t={}){const r=e.doc.defaultView;if(!r)return()=>{};let n;!function(e,t){const{mutationCb:r,mousemoveCb:n,mouseInteractionCb:s,scrollCb:i,viewportResizeCb:o,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:c,styleDeclarationCb:u,canvasMutationCb:h,fontCb:d,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),s(e[0])},e.scrollCb=(...e)=>{t.scroll&&t.scroll(...e),i(...e)},e.viewportResizeCb=(...e)=>{t.viewportResize&&t.viewportResize(...e),o(...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),c(...e)},e.styleDeclarationCb=(...e)=>{t.styleDeclaration&&t.styleDeclaration(...e),u(...e)},e.canvasMutationCb=(...e)=>{t.canvasMutation&&t.canvasMutation(...e),h(...e)},e.fontCb=(...e)=>{t.font&&t.font(...e),d(...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=xf(e,e.doc));const s=function({mousemoveCb:e,sampling:t,doc:r,mirror:n}){if(!1===t.mousemove)return()=>{};const s="number"==typeof t.mousemove?t.mousemove:50,i="number"==typeof t.mousemoveCallback?t.mousemoveCallback:500;let o,a=[];const l=Fp(bf(t=>{const r=Date.now()-o;e(a.map(e=>(e.timeOffset-=r,e)),t),a=[],o=null}),i),c=bf(Fp(bf(e=>{const t=Cf(e),{clientX:r,clientY:s}=Jp(e)?e.changedTouches[0]:e;o||(o=jp()),a.push({x:r,y:s,id:n.getId(t),timeOffset:jp()-o}),l("undefined"!=typeof DragEvent&&e instanceof DragEvent?nf.Drag:e instanceof MouseEvent?nf.MouseMove:nf.TouchMove)}),s,{trailing:!1})),u=[Lp("mousemove",c,r),Lp("touchmove",c,r),Lp("drag",c,r)];return bf(()=>{u.forEach(e=>e())})}(e),i=kf(e),o=If(e),a=function({viewportResizeCb:e},{win:t}){let r=-1,n=-1;return Lp("resize",bf(Fp(bf(()=>{const t=Wp(),s=qp();r===t&&n===s||(e({width:Number(s),height:Number(t)}),r=t,n=s)}),200)),t)}(e,{win:r}),l=function({inputCb:e,doc:t,mirror:r,blockClass:n,blockSelector:s,ignoreClass:i,ignoreSelector:o,maskInputOptions:a,maskInputFn:l,sampling:c,userTriggeredOnInput:u}){function h(e){let r=Cf(e);const c=e.isTrusted,h=r&&r.tagName;if(r&&"OPTION"===h&&(r=Np.parentElement(r)),!r||!h||Ef.indexOf(h)<0||Vp(r,n,s,!0))return;if(r.classList.contains(i)||o&&r.matches(o))return;let p=r.value,f=!1;const m=Tc(r)||"";"radio"===m||"checkbox"===m?f=r.checked:(a[h.toLowerCase()]||a[m])&&(p=Rc({element:r,maskInputOptions:a,tagName:h,type:m,value:p,maskInputFn:l})),d(r,u?{text:p,isChecked:f,userTriggered:c}:{text:p,isChecked:f});const g=r.name;"radio"===m&&g&&f&&t.querySelectorAll(`input[type="radio"][name="${g}"]`).forEach(e=>{if(e!==r){const t=e.value;d(e,u?{text:t,isChecked:!f,userTriggered:!1}:{text:t,isChecked:!f})}})}function d(t,n){const s=Of.get(t);if(!s||s.text!==n.text||s.isChecked!==n.isChecked){Of.set(t,n);const s=r.getId(t);bf(e)({...n,id:s})}}const p=("last"===c.input?["change"]:["input","change"]).map(e=>Lp(e,bf(h),t)),f=t.defaultView;if(!f)return()=>{p.forEach(e=>e())};const m=f.Object.getOwnPropertyDescriptor(f.HTMLInputElement.prototype,"value"),g=[[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 m&&m.set&&p.push(...g.map(e=>Bp(e[0],e[1],{set(){bf(h)({target:this,isTrusted:!1})}},!1,f))),bf(()=>{p.forEach(e=>e())})}(e),c=function({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:s,doc:i}){const o=bf(i=>Fp(bf(s=>{const o=Cf(s);if(!o||Vp(o,t,r,!0))return;const{currentTime:a,volume:l,muted:c,playbackRate:u,loop:h}=o;e({type:i,id:n.getId(o),currentTime:a,volume:l,muted:c,playbackRate:u,loop:h})}),s.media||500)),a=[Lp("play",o(lf.Play),i),Lp("pause",o(lf.Pause),i),Lp("seeked",o(lf.Seeked),i),Lp("volumechange",o(lf.VolumeChange),i),Lp("ratechange",o(lf.RateChange),i)];return bf(()=>{a.forEach(e=>e())})}(e);let u=()=>{},h=()=>{},d=()=>{},p=()=>{};e.recordDOM&&(u=function({styleSheetRuleCb:e,mirror:t,stylesheetManager:r},{win:n}){if(!n.CSSStyleSheet||!n.CSSStyleSheet.prototype)return()=>{};const s=n.CSSStyleSheet.prototype.insertRule;n.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:bf((n,s,i)=>{const[o,a]=i,{id:l,styleId:c}=Rf(s,t,r.styleMirror);return(l&&-1!==l||c&&-1!==c)&&e({id:l,styleId:c,adds:[{rule:o,index:a}]}),wf(()=>n.apply(s,i))()})}),n.CSSStyleSheet.prototype.addRule=function(e,t,r=this.cssRules.length){const s=`${e} { ${t} }`;return n.CSSStyleSheet.prototype.insertRule.apply(this,[s,r])};const i=n.CSSStyleSheet.prototype.deleteRule;let o,a;n.CSSStyleSheet.prototype.deleteRule=new Proxy(i,{apply:bf((n,s,i)=>{const[o]=i,{id:a,styleId:l}=Rf(s,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:o}]}),wf(()=>n.apply(s,i))()})}),n.CSSStyleSheet.prototype.removeRule=function(e){return n.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},n.CSSStyleSheet.prototype.replace&&(o=n.CSSStyleSheet.prototype.replace,n.CSSStyleSheet.prototype.replace=new Proxy(o,{apply:bf((n,s,i)=>{const[o]=i,{id:a,styleId:l}=Rf(s,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,replace:o}),n.apply(s,i)})})),n.CSSStyleSheet.prototype.replaceSync&&(a=n.CSSStyleSheet.prototype.replaceSync,n.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:bf((n,s,i)=>{const[o]=i,{id:a,styleId:l}=Rf(s,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,replaceSync:o}),n.apply(s,i)})}));const l={};Nf("CSSGroupingRule")?l.CSSGroupingRule=n.CSSGroupingRule:(Nf("CSSMediaRule")&&(l.CSSMediaRule=n.CSSMediaRule),Nf("CSSConditionRule")&&(l.CSSConditionRule=n.CSSConditionRule),Nf("CSSSupportsRule")&&(l.CSSSupportsRule=n.CSSSupportsRule));const c={};return Object.entries(l).forEach(([n,s])=>{c[n]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=new Proxy(c[n].insertRule,{apply:bf((n,s,i)=>{const[o,a]=i,{id:l,styleId:c}=Rf(s.parentStyleSheet,t,r.styleMirror);return(l&&-1!==l||c&&-1!==c)&&e({id:l,styleId:c,adds:[{rule:o,index:[...Mf(s),a||0]}]}),n.apply(s,i)})}),s.prototype.deleteRule=new Proxy(c[n].deleteRule,{apply:bf((n,s,i)=>{const[o]=i,{id:a,styleId:l}=Rf(s.parentStyleSheet,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:[...Mf(s),o]}]}),n.apply(s,i)})})}),bf(()=>{n.CSSStyleSheet.prototype.insertRule=s,n.CSSStyleSheet.prototype.deleteRule=i,o&&(n.CSSStyleSheet.prototype.replace=o),a&&(n.CSSStyleSheet.prototype.replaceSync=a),Object.entries(l).forEach(([e,t])=>{t.prototype.insertRule=c[e].insertRule,t.prototype.deleteRule=c[e].deleteRule})})}(e,{win:r}),h=Pf(e,e.doc),d=function({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:r,stylesheetManager:n},{win:s}){const i=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(i,{apply:bf((s,o,a)=>{var l;const[c,u,h]=a;if(r.has(c))return i.apply(o,[c,u,h]);const{id:d,styleId:p}=Rf(null==(l=o.parentRule)?void 0:l.parentStyleSheet,t,n.styleMirror);return(d&&-1!==d||p&&-1!==p)&&e({id:d,styleId:p,set:{property:c,value:u,priority:h},index:Mf(o.parentRule)}),s.apply(o,a)})});const o=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:bf((s,i,a)=>{var l;const[c]=a;if(r.has(c))return o.apply(i,[c]);const{id:u,styleId:h}=Rf(null==(l=i.parentRule)?void 0:l.parentStyleSheet,t,n.styleMirror);return(u&&-1!==u||h&&-1!==h)&&e({id:u,styleId:h,remove:{property:c},index:Mf(i.parentRule)}),s.apply(i,a)})}),bf(()=>{s.CSSStyleDeclaration.prototype.setProperty=i,s.CSSStyleDeclaration.prototype.removeProperty=o})}(e,{win:r}),e.collectFonts&&(p=function({fontCb:e,doc:t}){const r=t.defaultView;if(!r)return()=>{};const n=[],s=new WeakMap,i=r.FontFace;r.FontFace=function(e,t,r){const n=new i(e,t,r);return s.set(n,{family:e,buffer:"string"!=typeof t,descriptors:r,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),n};const o=Up(t.fonts,"add",function(t){return function(r){return setTimeout(bf(()=>{const t=s.get(r);t&&(e(t),s.delete(r))}),0),t.apply(this,[r])}});return n.push(()=>{r.FontFace=i}),n.push(o),bf(()=>{n.forEach(e=>e())})}(e)));const f=function(e){const{doc:t,mirror:r,blockClass:n,blockSelector:s,selectionCb:i}=e;let o=!0;const a=bf(()=>{const e=t.getSelection();if(!e||o&&(null==e?void 0:e.isCollapsed))return;o=e.isCollapsed||!1;const a=[],l=e.rangeCount||0;for(let t=0;t<l;t++){const i=e.getRangeAt(t),{startContainer:o,startOffset:l,endContainer:c,endOffset:u}=i;Vp(o,n,s,!0)||Vp(c,n,s,!0)||a.push({start:r.getId(o),startOffset:l,end:r.getId(c),endOffset:u})}i({ranges:a})});return a(),Lp("selectionchange",a)}(e),m=function({doc:e,customElementCb:t}){const r=e.defaultView;return r&&r.customElements?Up(r.customElements,"define",function(e){return function(r,n,s){try{t({define:{name:r}})}catch(e){console.warn(`Custom element callback failed for ${r}`)}return e.apply(this,[r,n,s])}}):()=>{}}(e),g=[];for(const t of e.plugins)g.push(t.observer(t.callback,r,t.options));return bf(()=>{Sf.forEach(e=>e.reset()),null==n||n.disconnect(),s(),i(),o(),a(),l(),c(),u(),h(),d(),p(),f(),m(),g.forEach(e=>e())})}function Tf(e){return void 0!==window[e]}function Nf(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class Lf{constructor(e){uc(this,"iframeIdToRemoteIdMap",new WeakMap),uc(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,n){const s=r||this.getIdToRemoteIdMap(e),i=n||this.getRemoteIdToIdMap(e);let o=s.get(t);return o||(o=this.generateIdFn(),s.set(t,o),i.set(o,t)),o}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 s=n.get(t);return s||-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}}class _f{constructor(e){uc(this,"iframes",new WeakMap),uc(this,"crossOriginIframeMap",new WeakMap),uc(this,"crossOriginIframeMirror",new Lf($c)),uc(this,"crossOriginIframeStyleMirror"),uc(this,"crossOriginIframeRootIdMap",new WeakMap),uc(this,"mirror"),uc(this,"mutationCb"),uc(this,"wrappedEmit"),uc(this,"loadListener"),uc(this,"stylesheetManager"),uc(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Lf(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 rf.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:rf.IncrementalSnapshot,data:{source:nf.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case rf.Meta:case rf.Load:case rf.DomContentLoaded:return!1;case rf.Plugin:return t;case rf.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case rf.IncrementalSnapshot:switch(t.data.source){case nf.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 nf.Drag:case nf.TouchMove:case nf.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case nf.ViewportResize:return!1;case nf.MediaInteraction:case nf.MouseInteraction:case nf.Scroll:case nf.CanvasMutation:case nf.Input:return this.replaceIds(t.data,e,["id"]),t;case nf.StyleSheetRule:case nf.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case nf.Font:return t;case nf.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,["start","end"])}),t;case nf.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 s of n)(Array.isArray(t[s])||"number"==typeof t[s])&&(Array.isArray(t[s])?t[s]=e.getIds(r,t[s]):t[s]=e.getId(r,t[s]));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===cf.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(e=>{this.patchRootIdOnNode(e,t)})}}class Df{constructor(e){uc(this,"shadowDoms",new WeakSet),uc(this,"mutationCb"),uc(this,"scrollCb"),uc(this,"bypassOptions"),uc(this,"mirror"),uc(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(!Ic(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const r=xf({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(If({...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(Np.host(e))),this.restoreHandlers.push(Pf({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(Up(e.prototype,"attachShadow",function(e){return function(n){const s=e.call(this,n),i=Np.shadowRoot(this);return i&&tf(this)&&r.addShadowRoot(i,t),s}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch(e){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var Ff="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Bf="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Uf=0;Uf<64;Uf++)Bf[Ff.charCodeAt(Uf)]=Uf;const jf=new Map;const zf=(e,t,r)=>{if(!e||!$f(e,t)&&"object"!=typeof e)return;const n=function(e,t){let r=jf.get(e);return r||(r=new Map,jf.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}(r,e.constructor.name);let s=n.indexOf(e);return-1===s&&(s=n.length,n.push(e)),s};function Wf(e,t,r){if(e instanceof Array)return e.map(e=>Wf(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:function(e){var t,r=new Uint8Array(e),n=r.length,s="";for(t=0;t<n;t+=3)s+=Ff[r[t]>>2],s+=Ff[(3&r[t])<<4|r[t+1]>>4],s+=Ff[(15&r[t+1])<<2|r[t+2]>>6],s+=Ff[63&r[t+2]];return n%3==2?s=s.substring(0,s.length-1)+"=":n%3==1&&(s=s.substring(0,s.length-2)+"=="),s}(e)}}if(e instanceof DataView){return{rr_type:e.constructor.name,args:[Wf(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:[Wf(e.data,t,r),e.width,e.height]}}if($f(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:zf(e,t,r)}}return e}const qf=(e,t,r)=>e.map(e=>Wf(e,t,r)),$f=(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]))};function Vf(e,t,r,n){const s=[];try{const i=Up(e.HTMLCanvasElement.prototype,"getContext",function(e){return function(s,...i){if(!Vp(this,t,r,!0)){const e=function(e){return"experimental-webgl"===e?"webgl":e}(s);if("__context"in this||(this.__context=e),n&&["webgl","webgl2"].includes(e))if(i[0]&&"object"==typeof i[0]){const e=i[0];e.preserveDrawingBuffer||(e.preserveDrawingBuffer=!0)}else i.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[s,...i])}});s.push(i)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{s.forEach(e=>e())}}function Gf(e,t,r,n,s,i){const o=[],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=Up(e,l,function(e){return function(...o){const a=e.apply(this,o);if(zf(a,i,this),"tagName"in this.canvas&&!Vp(this.canvas,n,s,!0)){const e=qf(o,i,this),n={type:t,property:l,args:e};r(this.canvas,n)}return a}});o.push(a)}catch{const n=Bp(e,l,{set(e){r(this.canvas,{type:t,property:l,args:[e],setter:!0})}});o.push(n)}return o}const Hf='(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',Jf="undefined"!=typeof self&&self.Blob&&new Blob([Hf],{type:"text/javascript;charset=utf-8"});function Kf(e){let t;try{if(t=Jf&&(self.URL||self.webkitURL).createObjectURL(Jf),!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(Hf),{name:null==e?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}class Yf{constructor(e){uc(this,"pendingCanvasMutations",new Map),uc(this,"rafStamps",{latestId:0,invokeId:null}),uc(this,"mirror"),uc(this,"mutationCb"),uc(this,"resetObservers"),uc(this,"frozen",!1),uc(this,"locked",!1),uc(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:s,recordCanvas:i,dataURLOptions:o}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,i&&"all"===t&&this.initCanvasMutationObserver(r,n,s),i&&"number"==typeof t&&this.initCanvasFPSObserver(t,r,n,s,{dataURLOptions:o})}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,s){const i=Vf(t,r,n,!0),o=new Map,a=new Kf;a.onmessage=e=>{const{id:t}=e.data;if(o.set(t,!1),!("base64"in e.data))return;const{base64:r,type:n,width:s,height:i}=e.data;this.mutationCb({id:t,type:af["2D"],commands:[{property:"clearRect",args:[0,0,s,i]},{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 c,u=0;const h=e=>{u&&e-u<l||(u=e,(()=>{const e=[];return t.document.querySelectorAll("canvas").forEach(t=>{Vp(t,r,n,!0)||e.push(t)}),e})().forEach(async e=>{var t;const r=this.mirror.getId(e);if(o.get(r))return;if(0===e.width||0===e.height)return;if(o.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:s.dataURLOptions},[n])})),c=requestAnimationFrame(h)};c=requestAnimationFrame(h),this.resetObservers=()=>{i(),cancelAnimationFrame(c)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const n=Vf(e,t,r,!1),s=function(e,t,r,n){const s=[],i=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const o of i)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[o])continue;const i=Up(t.CanvasRenderingContext2D.prototype,o,function(s){return function(...i){return Vp(this.canvas,r,n,!0)||setTimeout(()=>{const r=qf(i,t,this);e(this.canvas,{type:af["2D"],property:o,args:r})},0),s.apply(this,i)}});s.push(i)}catch{const r=Bp(t.CanvasRenderingContext2D.prototype,o,{set(t){e(this.canvas,{type:af["2D"],property:o,args:[t],setter:!0})}});s.push(r)}return()=>{s.forEach(e=>e())}}(this.processMutation.bind(this),e,t,r),i=function(e,t,r,n){const s=[];return s.push(...Gf(t.WebGLRenderingContext.prototype,af.WebGL,e,r,n,t)),void 0!==t.WebGL2RenderingContext&&s.push(...Gf(t.WebGL2RenderingContext.prototype,af.WebGL2,e,r,n,t)),()=>{s.forEach(e=>e())}}(this.processMutation.bind(this),e,t,r);this.resetObservers=()=>{n(),s(),i()}}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:s}=r[0];this.mutationCb({id:t,type:s,commands:n}),this.pendingCanvasMutations.delete(e)}}class Xf{constructor(e){uc(this,"trackedLinkElements",new WeakSet),uc(this,"mutationCb"),uc(this,"adoptedStyleSheetCb"),uc(this,"styleMirror",new Qp),uc(this,"inlinedAdoptedStyleSheetRuleIds",new Set),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}getInlinedAdoptedStyleSheetRuleIds(){return this.inlinedAdoptedStyleSheetRuleIds}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:Oc(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,this.inlinedAdoptedStyleSheetRuleIds.clear()}trackStylesheetInLinkElement(e){}}class Qf{constructor(){uc(this,"nodeMap",new WeakMap),uc(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(){}}let Zf,em,tm,rm=!1;try{if(2!==Array.from([1],e=>2*e)[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(ac=e.contentWindow)?void 0:ac.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}const nm=new Mc;function sm(e={}){const{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:s="rr-block",blockSelector:i=null,ignoreClass:o="rr-ignore",ignoreSelector:a=null,maskTextClass:l="rr-mask",maskTextSelector:c=null,inlineStylesheet:u=!0,maskAllInputs:h,maskInputOptions:d,slimDOMOptions:p,maskInputFn:f,maskTextFn:m,maskAttributeFn:g,hooks:v,packFn:y,sampling:b={},dataURLOptions:w={},mousemoveWait:S,recordDOM:C=!0,recordCanvas:x=!1,recordCrossOriginIframes:k=!1,recordAfter:I=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:E=!1,collectFonts:O=!1,inlineImages:M=!1,captureAdoptedStyleSheets:R=!1,plugins:P,keepIframeSrcFn:A=()=>!1,ignoreCSSAttributes:T=new Set([]),errorHandler:N,applyBackgroundColorToBlockedElements:L=!1}=e;yf=N;const _=!k||window.parent===window;let D=!1;if(!_)try{window.parent.document&&(D=!1)}catch(e){D=!0}if(_&&!t)throw new Error("emit function is required");if(!_&&!D)return()=>{};void 0!==S&&void 0===b.mousemove&&(b.mousemove=S),nm.reset();const F=!0===h?{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!==d?d:{password:!0},B=!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 U;!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 j=0;const z=e=>{for(const t of P||[])t.eventProcessor&&(e=t.eventProcessor(e));return y&&!D&&(e=y(e)),e};Zf=(e,s)=>{var i;const o=e;if(o.timestamp=jp(),!(null==(i=Sf[0])?void 0:i.isFrozen())||o.type===rf.FullSnapshot||o.type===rf.IncrementalSnapshot&&o.data.source===nf.Mutation||Sf.forEach(e=>e.unfreeze()),_)null==t||t(z(o),s);else if(D){const e={type:"rrweb",event:z(o),origin:window.location.origin,isCheckout:s};window.parent.postMessage(e,"*")}if(o.type===rf.FullSnapshot)U=o,j=0;else if(o.type===rf.IncrementalSnapshot){if(o.data.source===nf.Mutation&&o.data.isAttachIframe)return;j++;const e=n&&j>=n,t=r&&o.timestamp-U.timestamp>r;(e||t)&&em(!0)}};const W=e=>{Zf({type:rf.IncrementalSnapshot,data:{source:nf.Mutation,...e}})},q=e=>Zf({type:rf.IncrementalSnapshot,data:{source:nf.Scroll,...e}}),$=e=>Zf({type:rf.IncrementalSnapshot,data:{source:nf.CanvasMutation,...e}}),V=new Xf({mutationCb:W,adoptedStyleSheetCb:e=>Zf({type:rf.IncrementalSnapshot,data:{source:nf.AdoptedStyleSheet,...e}})}),G=new _f({mirror:nm,mutationCb:W,stylesheetManager:V,recordCrossOriginIframes:k,wrappedEmit:Zf});for(const e of P||[])e.getMirror&&e.getMirror({nodeMirror:nm,crossOriginIframeMirror:G.crossOriginIframeMirror,crossOriginIframeStyleMirror:G.crossOriginIframeStyleMirror});const H=new Qf;tm=new Yf({recordCanvas:x,mutationCb:$,win:window,blockClass:s,blockSelector:i,mirror:nm,sampling:b.canvas,dataURLOptions:w});const J=new Df({mutationCb:W,scrollCb:q,bypassOptions:{blockClass:s,blockSelector:i,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskInputOptions:F,dataURLOptions:w,maskTextFn:m,maskInputFn:f,maskAttributeFn:g,recordCanvas:x,inlineImages:M,sampling:b,slimDOMOptions:B,iframeManager:G,stylesheetManager:V,canvasManager:tm,keepIframeSrcFn:A,processedNodeManager:H,captureAdoptedStyleSheets:R},mirror:nm});em=(e=!1)=>{if(!C)return;Zf({type:rf.Meta,data:{href:window.location.href,width:qp(),height:Wp()}},e),V.reset(),J.init(),Sf.forEach(e=>e.lock());const t=function(e,t){const{mirror:r=new Mc,blockClass:n="rr-block",blockSelector:s=null,maskTextClass:i="rr-mask",maskTextSelector:o=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:c=!1,maskAllInputs:u=!1,maskTextFn:h,maskInputFn:d,maskAttributeFn:p,slimDOM:f=!1,dataURLOptions:m,preserveWhiteSpace:g,onSerialize:v,onAdoptedStyleSheet:y,_emittedStyleIds:b,onIframeLoad:w,iframeLoadTimeout:S,onStylesheetLoad:C,stylesheetLoadTimeout:x,keepIframeSrcFn:k=()=>!1,applyBackgroundColorToBlockedElements:I=!1}=t||{};return ou(e,{doc:e,mirror:r,blockClass:n,blockSelector:s,maskTextClass:i,maskTextSelector:o,skipChild:!1,inlineStylesheet:a,maskInputOptions:!0===u?{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===u?{password:!0}:u,maskTextFn:h,maskInputFn:d,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:m,inlineImages:l,recordCanvas:c,preserveWhiteSpace:g,onSerialize:v,onAdoptedStyleSheet:y,_emittedStyleIds:b,onIframeLoad:w,iframeLoadTimeout:S,onStylesheetLoad:C,stylesheetLoadTimeout:x,keepIframeSrcFn:k,newlyAddedElement:!1,applyBackgroundColorToBlockedElements:I})}(document,{mirror:nm,blockClass:s,blockSelector:i,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskAllInputs:F,maskTextFn:m,maskInputFn:f,maskAttributeFn:g,slimDOM:B,dataURLOptions:w,recordCanvas:x,inlineImages:M,applyBackgroundColorToBlockedElements:L,onSerialize:e=>{Kp(e,nm)&&G.addIframe(e),Yp(e,nm)&&V.trackLinkElement(e),Xp(e)&&J.addShadowRoot(Np.shadowRoot(e),document)},onAdoptedStyleSheet:R?e=>V.styleMirror.add(e):void 0,_emittedStyleIds:R?V.getInlinedAdoptedStyleSheetRuleIds():void 0,onIframeLoad:(e,t)=>{G.attachIframe(e,t),J.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{V.attachLinkElement(e,t)},keepIframeSrcFn:A});if(!t)return console.warn("Failed to snapshot the document");Zf({type:rf.FullSnapshot,data:{node:t,initialOffset:zp(window)}},e),Sf.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&V.adoptStyleSheets(document.adoptedStyleSheets,nm.getId(document))};try{const e=[],t=e=>{var t;return bf(Af)({mutationCb:W,mousemoveCb:(e,t)=>Zf({type:rf.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>Zf({type:rf.IncrementalSnapshot,data:{source:nf.MouseInteraction,...e}}),scrollCb:q,viewportResizeCb:e=>Zf({type:rf.IncrementalSnapshot,data:{source:nf.ViewportResize,...e}}),inputCb:e=>Zf({type:rf.IncrementalSnapshot,data:{source:nf.Input,...e}}),mediaInteractionCb:e=>Zf({type:rf.IncrementalSnapshot,data:{source:nf.MediaInteraction,...e}}),styleSheetRuleCb:e=>Zf({type:rf.IncrementalSnapshot,data:{source:nf.StyleSheetRule,...e}}),styleDeclarationCb:e=>Zf({type:rf.IncrementalSnapshot,data:{source:nf.StyleDeclaration,...e}}),canvasMutationCb:$,fontCb:e=>Zf({type:rf.IncrementalSnapshot,data:{source:nf.Font,...e}}),selectionCb:e=>{Zf({type:rf.IncrementalSnapshot,data:{source:nf.Selection,...e}})},customElementCb:e=>{Zf({type:rf.IncrementalSnapshot,data:{source:nf.CustomElement,...e}})},blockClass:s,ignoreClass:o,ignoreSelector:a,maskTextClass:l,maskTextSelector:c,maskInputOptions:F,inlineStylesheet:u,sampling:b,recordDOM:C,recordCanvas:x,inlineImages:M,userTriggeredOnInput:E,collectFonts:O,doc:e,maskInputFn:f,maskTextFn:m,maskAttributeFn:g,keepIframeSrcFn:A,blockSelector:i,slimDOMOptions:B,dataURLOptions:w,mirror:nm,iframeManager:G,stylesheetManager:V,shadowDomManager:J,processedNodeManager:H,captureAdoptedStyleSheets:R,canvasManager:tm,ignoreCSSAttributes:T,plugins:(null==(t=null==P?void 0:P.filter(e=>e.observer))?void 0:t.map(e=>({observer:e.observer,options:e.options,callback:t=>Zf({type:rf.Plugin,data:{plugin:e.name,payload:t}})})))||[]},v)};G.addLoadListener(r=>{try{e.push(t(r.contentDocument))}catch(e){console.warn(e)}});const r=()=>{em(),e.push(t(document)),rm=!0};return"interactive"===document.readyState||"complete"===document.readyState?r():(e.push(Lp("DOMContentLoaded",()=>{Zf({type:rf.DomContentLoaded,data:{}}),"DOMContentLoaded"===I&&r()})),e.push(Lp("load",()=>{Zf({type:rf.Load,data:{}}),"load"===I&&r()},window))),()=>{e.forEach(e=>e()),H.destroy(),rm=!1,yf=void 0}}catch(e){console.warn(e)}}var im;sm.addCustomEvent=(e,t)=>{if(!rm)throw new Error("please add custom event after start recording");Zf({type:rf.Custom,data:{tag:e,payload:t}})},sm.freezePage=()=>{Sf.forEach(e=>e.freeze())},sm.takeFullSnapshot=e=>{if(!rm)throw new Error("please take full snapshot after start recording");em(e)},sm.mirror=nm,sm.supportsNativeMouseInteraction=!0,function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(im||(im={}));var om=Object.freeze({__proto__:null,record:sm}),am=function(e){return void 0!==e&&("boolean"==typeof e?e:!1!==e.enabled)},lm=function(e,t,r,n){var s=function(e){var t;return"object"==typeof e&&null!==e?{allowlist:null!==(t=e.allowlist)&&void 0!==t?t:[],excludelist:e.excludelist||e.blocklist||[]}:{allowlist:[],excludelist:[]}}(t),i=function(e,t,r){if(0===t.length&&0===r.length)return e;var n=t.length>0?t:["/**"];try{var s=JSON.parse(e);return ee(s,n,r),JSON.stringify(s)}catch(t){return e}}(e,s.allowlist,s.excludelist);return n(i,r)},cm=["image/","audio/","video/","application/octet-stream","font/"];function um(e,t){return function(e,t){t<0&&(t=0);for(var r=e.length,n=0,s=0;s<r;s++){var i=e.charCodeAt(s),o=1,a=1;if(i<=127)o=1;else if(i<=2047)o=2;else if(i>=55296&&i<=56319){var l=s+1<r?e.charCodeAt(s+1):NaN;l>=56320&&l<=57343?(o=4,a=2):o=3}else o=3;if(n+o>t)break;n+=o,2===a&&s++}return s>=r?{value:e,truncated:!1}:{value:e.slice(0,s),truncated:!0}}(e,t)}var hm=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=g();if(t){var r=t.fetch;r&&(t.fetch=function(t,n){return l(e,void 0,void 0,function(){var e,s,i,o,a,l,u,h,d,p,f,m,g=this;return c(this,function(c){switch(c.label){case 0:e=Date.now(),s={timestamp:e,type:"fetch",method:(null==n?void 0:n.method)||"GET",url:t.toString(),requestHeaders:null==n?void 0:n.headers},(i=null===(f=this.networkConfig)||void 0===f?void 0:f.body)&&am(i.request)&&void 0!==(o=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!==(m=i.maxBodySizeBytes)&&void 0!==m?m:10240,s.requestBody=lm(o,i.request,a,um).value),c.label=1;case 1:return c.trys.push([1,3,,4]),[4,r(t,n)];case 2:return l=c.sent(),d=Date.now(),s.status=l.status,s.duration=d-e,u={},l.headers.forEach(function(e,t){u[t]=e}),s.responseHeaders=u,i&&am(i.response)?!function(e){return!!e&&cm.some(function(t){return e.toLowerCase().startsWith(t)})}(u["content-type"]||null)?l.clone().text().then(function(e){var t,r=null!==(t=i.maxBodySizeBytes)&&void 0!==t?t:10240,n=lm(e,i.response,r,um),o=n.value,a=n.truncated;s.responseBody=o,s.responseBodyStatus=a?"truncated":"captured",g.notifyEvent(s)},function(){s.responseBodyStatus="error",g.notifyEvent(s)}):(s.responseBodyStatus="skipped_binary",this.notifyEvent(s)):this.notifyEvent(s),[2,l];case 3:throw h=c.sent(),d=Date.now(),s.duration=d-e,p=h,s.error={name:p.name||"UnknownError",message:p.message||"An unknown error occurred"},this.notifyEvent(s),h;case 4:return[2]}})})},this.fetchObserver=function(){t.fetch=r})}},e}(),dm=Object.freeze({__proto__:null,NetworkObservers:hm});return e.SessionReplayPlugin=ss,e.plugin=is,e.sessionReplayPlugin=is,Object.defineProperty(e,"__esModule",{value:!0}),e}({});
|
|
1
|
+
var sessionReplay=function(e){"use strict";function t(e,t){return t.forEach(function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach(function(r){if("default"!==r&&!(r in e)){var n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:function(){return t[r]}})}})}),Object.freeze(e)}var r=function(e,t){return r=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])},r(e,t)};function n(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var s,o,i=function(){return i=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},i.apply(this,arguments)};function a(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 s=0;for(n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]])}return r}function l(e,t,r,n){return new(r||(r=Promise))(function(s,o){function i(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?s(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(i,a)}l((n=n.apply(e,t||[])).next())})}function c(e,t){var r,n,s,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=a(0),i.throw=a(1),i.return=a(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(l){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(o=0)),o;)try{if(r=1,n&&(s=2&a[0]?n.return:a[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,a[1])).done)return s;switch(n=0,s&&(a=[2&a[0],s.value]),a[0]){case 0:case 1:s=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(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!s||a[1]>s[0]&&a[1]<s[3])){o.label=a[1];break}if(6===a[0]&&o.label<s[1]){o.label=s[1],s=a;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(a);break}s[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],n=0}finally{r=s=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}function u(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 h(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,s,o=r.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)i.push(n.value)}catch(e){s={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(s)throw s.error}}return i}function d(e,t,r){if(r||2===arguments.length)for(var n,s=0,o=t.length;s<o;s++)!n&&s in t||(n||(n=Array.prototype.slice.call(t,0,s)),n[s]=t[s]);return e.concat(n||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError,function(e){e.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"}(s||(s={})),function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"}(o||(o={}));var p,f="$default_instance",m="https://api2.amplitude.com/2/httpapi";!function(e){e.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"}(p||(p={}));var g=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},v=d([],h(Array(256).keys()),!1).map(function(e){return e.toString(16).padStart(2,"0")}),y=function(e){var t,r=g();if(!(null===(t=null==r?void 0:r.crypto)||void 0===t?void 0:t.getRandomValues))return 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,y)}(e);var n=r.crypto.getRandomValues(new Uint8Array(16));return n[6]=15&n[6]|64,n[8]=63&n[8]|128,d([],h(n.entries()),!1).map(function(e){var t=h(e,2),r=t[0],n=t[1];return[4,6,8,10].includes(r)?"-".concat(v[n]):v[n]}).join("")},w={},b={get exports(){return w},set exports(e){w=e}},S=Object.prototype.hasOwnProperty;function C(e){return"[Throws: "+(e?e.message:"?")+"]"}function x(e){var t=[];return function e(r){if(null===r||"object"!=typeof r)return r;if(-1!==t.indexOf(r))return"[Circular]";if(t.push(r),"function"==typeof r.toJSON)try{var n=e(r.toJSON());return t.pop(),n}catch(e){return C(e)}if(Array.isArray(r)){var s=r.map(e);return t.pop(),s}var o=Object.keys(r).reduce(function(t,n){return t[n]=e(function(e,t){if(S.call(e,t))try{return e[t]}catch(e){return C(e)}return e[t]}(r,n)),t},{});return t.pop(),o}(e)}b.exports=function(e,t,r){return JSON.stringify(x(e),t,r)};var k,I=w.ensureProperties=x,O=w||t({__proto__:null,ensureProperties:I,get default(){return w}},[w]),E=function(e){return{promise:e||Promise.resolve()}};!function(e){e[e.None=0]="None",e[e.Error=1]="Error",e[e.Warn=2]="Warn",e[e.Verbose=3]="Verbose",e[e.Debug=4]="Debug"}(k||(k={}));var M="Amplitude Logger ",R=function(){function e(){this.logLevel=k.None}return e.prototype.disable=function(){this.logLevel=k.None},e.prototype.enable=function(e){void 0===e&&(e=k.Warn),this.logLevel=e},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<k.Verbose||console.log("".concat(M,"[Log]: ").concat(e.join(" ")))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<k.Warn||console.warn("".concat(M,"[Warn]: ").concat(e.join(" ")))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<k.Error||console.error("".concat(M,"[Error]: ").concat(e.join(" ")))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<k.Debug||console.log("".concat(M,"[Debug]: ").concat(e.join(" ")))},e}(),P=function(e){return void 0===e||""===e?f:e},A=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,instanceName:f,logLevel:k.Warn,loggerProvider:new R,offline:!1,optOut:!1,serverUrl:m,serverZone:"US",useBatch:!1}},T=function(){function e(e){var t,r,n,s;this._optOut=!1;var o=A();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=P(e.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!==(s=e.useBatch)&&void 0!==s?s:o.useBatch,this.loggerProvider.enable(this.logLevel);var i=L(e.serverUrl,e.serverZone,e.useBatch);this.serverZone=i.serverZone,this.serverUrl=i.serverUrl}return Object.defineProperty(e.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut=e},enumerable:!1,configurable:!0}),e}(),N=function(e,t){return"EU"===e?t?"https://api.eu.amplitude.com/batch":"https://api.eu.amplitude.com/2/httpapi":t?"https://api2.amplitude.com/batch":m},L=function(e,t,r){if(void 0===e&&(e=""),void 0===t&&(t=A().serverZone),void 0===r&&(r=A().useBatch),e)return{serverUrl:e,serverZone:void 0};var n=["US","EU"].includes(t)?t:A().serverZone;return{serverZone:n,serverUrl:N(n,r)}};var F=function(e,t,r,n,s){return void 0===s&&(s=null),function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];var a=r(),l=a.logger,c=a.logLevel;if(c&&c<k.Debug||!c||!l)return e.apply(s,o);var u,h={type:"invoke public method",name:t,args:o,stacktrace:(u=1,void 0===u&&(u=0),((new Error).stack||"").split("\n").slice(2+u).map(function(e){return e.trim()})),time:{start:(new Date).toISOString()},states:{}};n&&h.states&&(h.states.before=n());var d=e.apply(s,o);return d&&d.promise?d.promise.then(function(){n&&h.states&&(h.states.after=n()),h.time&&(h.time.end=(new Date).toISOString()),l.debug(JSON.stringify(h,null,2))}):(n&&h.states&&(h.states.after=n()),h.time&&(h.time.end=(new Date).toISOString()),l.debug(JSON.stringify(h,null,2))),d}};class _{getApplicationContext(){return{versionName:this.versionName,language:D(),platform:"Web",os:void 0,deviceModel:void 0}}}const D=()=>"undefined"!=typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||"";class B{constructor(){this.queue=[]}logEvent(e){this.receiver?this.receiver(e):this.queue.length<512&&this.queue.push(e)}setEventReceiver(e){this.receiver=e,this.queue.length>0&&(this.queue.forEach(t=>{e(t)}),this.queue=[])}}const U=(e,t)=>{const r=["string","number","boolean","undefined"],n=typeof e;if(n!==typeof t)return!1;for(const s of r)if(s===n)return e===t;if(null==e&&null==t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;const s=Array.isArray(e),o=Array.isArray(t);if(s!==o)return!1;if(!s||!o){const r=Object.keys(e).sort(),n=Object.keys(t).sort();if(!U(r,n))return!1;let s=!0;return Object.keys(e).forEach(r=>{U(e[r],t[r])||(s=!1)}),s}for(let r=0;r<e.length;r++)if(!U(e[r],t[r]))return!1;return!0};Object.entries||(Object.entries=function(e){const t=Object.keys(e);let r=t.length;const n=new Array(r);for(;r--;)n[r]=[t[r],e[t[r]]];return n});class j{constructor(){this.identity={userProperties:{}},this.listeners=new Set}editIdentity(){const e=this,t=Object.assign({},this.identity.userProperties),r=Object.assign(Object.assign({},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(e){return r.optOut=e,this},updateUserProperties:function(e){let t=r.userProperties||{};for(const[r,n]of Object.entries(e))switch(r){case"$set":for(const[e,r]of Object.entries(n))t[e]=r;break;case"$unset":for(const e of Object.keys(n))delete t[e];break;case"$clearAll":t={}}return r.userProperties=t,this},commit:function(){return e.setIdentity(r),this}}}getIdentity(){return Object.assign({},this.identity)}setIdentity(e){const t=Object.assign({},this.identity);this.identity=Object.assign({},e),U(t,this.identity)||this.listeners.forEach(t=>{t(e)})}addIdentityListener(e){this.listeners.add(e)}removeIdentityListener(e){this.listeners.delete(e)}}const z="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:self;class W{constructor(){this.identityStore=new j,this.eventBridge=new B,this.applicationContextProvider=new _}static getInstance(e){return z.analyticsConnectorInstances||(z.analyticsConnectorInstances={}),z.analyticsConnectorInstances[e]||(z.analyticsConnectorInstances[e]=new W),z.analyticsConnectorInstances[e]}}var q=function(e){return W.getInstance(P(e))},$=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},V=function(){function e(){}return e.prototype.send=function(e,t,r){return Promise.resolve(null)},e.prototype.buildResponse=function(e){var t,r,n,s,o,i,a,l,c,u,h,d,f,m,g,v,y,w,b,S,C,x;if("object"!=typeof e)return null;var k=e.code||0,I=this.buildStatus(k);switch(I){case p.Success:return{status:I,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 p.Invalid:return{status:I,statusCode:k,body:{error:null!==(s=e.error)&&void 0!==s?s:"",missingField:null!==(o=e.missing_field)&&void 0!==o?o:"",eventsWithInvalidFields:null!==(i=e.events_with_invalid_fields)&&void 0!==i?i:{},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!==(c=e.eps_threshold)&&void 0!==c?c:0,exceededDailyQuotaDevices:null!==(u=e.exceeded_daily_quota_devices)&&void 0!==u?u:{},silencedDevices:null!==(h=e.silenced_devices)&&void 0!==h?h:[],silencedEvents:null!==(d=e.silenced_events)&&void 0!==d?d:[],throttledDevices:null!==(f=e.throttled_devices)&&void 0!==f?f:{},throttledEvents:null!==(m=e.throttled_events)&&void 0!==m?m:[]}};case p.PayloadTooLarge:return{status:I,statusCode:k,body:{error:null!==(g=e.error)&&void 0!==g?g:""}};case p.RateLimit:return{status:I,statusCode:k,body:{error:null!==(v=e.error)&&void 0!==v?v:"",epsThreshold:null!==(y=e.eps_threshold)&&void 0!==y?y:0,throttledDevices:null!==(w=e.throttled_devices)&&void 0!==w?w:{},throttledUsers:null!==(b=e.throttled_users)&&void 0!==b?b:{},exceededDailyQuotaDevices:null!==(S=e.exceeded_daily_quota_devices)&&void 0!==S?S:{},exceededDailyQuotaUsers:null!==(C=e.exceeded_daily_quota_users)&&void 0!==C?C:{},throttledEvents:null!==(x=e.throttled_events)&&void 0!==x?x:[]}};case p.Timeout:default:return{status:I,statusCode:k}}},e.prototype.buildStatus=function(e){return function(e){return e>=200&&e<300}(e)?p.Success:429===e?p.RateLimit:413===e?p.PayloadTooLarge:408===e?p.Timeout:e>=400&&e<500?p.Invalid:e>=500?p.Failed:p.Unknown},e}(),G=function(e){function t(t){void 0===t&&(t={});var r=e.call(this)||this;return r.customHeaders=t,r}return n(t,e),t.prototype.send=function(e,t){return l(this,void 0,void 0,function(){var r,n,s;return c(this,function(o){switch(o.label){case 0:if("undefined"==typeof fetch)throw new Error("FetchTransport is not supported");return r={headers:i({"Content-Type":"application/json",Accept:"*/*"},this.customHeaders),body:JSON.stringify(t),method:"POST"},[4,fetch(e,r)];case 1:return[4,(n=o.sent()).text()];case 2:s=o.sent();try{return[2,this.buildResponse(JSON.parse(s))]}catch(e){return[2,this.buildResponse({code:n.status})]}return[2]}})})},t}(V),H=function(){function e(e,t){this.key="AMP_remote_config_".concat(e.substring(0,10)),this.logger=t;try{this.isSupported="undefined"!=typeof localStorage}catch(e){this.logger.debug("Remote config localstorage failed to access: ",e),this.isSupported=!1}}return e.prototype.fetchConfig=function(){var e=null,t={remoteConfig:null,lastFetch:new Date};if(!this.isSupported)return Promise.resolve(t);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(O(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){if(!this.isSupported)return Promise.resolve(!1);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}();var J,K=401,Y=403,Q=429,X=function(){function e(t,r,n,s,o,i,a){void 0===n&&(n="US"),void 0===i&&(i=e.DEFAULT_CONFIG_GROUP),this.callbackInfos=[],this.lastSuccessfulFetch=null,this.fetchPromise=null,this.isLastFetchInvalidApiKey=!1,this.apiKey=t,this.configGroup=i,this.serverUrl=s||("US"===n?"https://sr-client-cfg.amplitude.com/config":"https://sr-client-cfg.eu.amplitude.com/config"),this.logger=r,this.storage=a||new H(t,r),this.customFetch=o}return e.prototype.subscribe=function(e,t,r){var n=y(),s={id:n,key:e,deliveryMode:t,callback:r};return this.callbackInfos.push(s),"all"===t?this.subscribeAll(s):this.subscribeWaitForRemote(s,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 l(this,void 0,void 0,function(){var e,t=this;return c(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 l(this,void 0,void 0,function(){var t,r,n,s=this;return c(this,function(o){switch(o.label){case 0:return t=this.getOrCreateFetchPromise().then(function(t){s.logger.debug("Remote config client subscription all mode fetched from remote: ".concat(JSON.stringify(t))),s.sendCallback(e,t,"remote"),s.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 l(this,void 0,void 0,function(){var r,n;return c(this,function(s){switch(s.label){case 0:r=new Promise(function(e,r){setTimeout(function(){r("Timeout exceeded")},t)}),s.label=1;case 1:return s.trys.push([1,3,,5]),[4,Promise.race([this.getOrCreateFetchPromise(),r])];case 2:return n=s.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 s.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=s.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),l(this,void 0,void 0,function(){var r,n,s,o,i,a,l=this;return c(this,function(u){switch(u.label){case 0:r=t/e,n={remoteConfig:null,lastFetch:new Date},s=function(n){var s,i,a,u,h,d,p,f,m;return c(this,function(c){switch(c.label){case 0:s=!0,i=new AbortController,a=setTimeout(function(){return i.abort()},t),c.label=1;case 1:return c.trys.push([1,10,11,12]),u=o.getUrlParams(),h={Accept:"*/*"},o.customFetch?[4,(g=o.customFetch({url:u,method:"GET",headers:h,signal:i.signal}),v=i.signal,new Promise(function(e,t){var r=function(){var e=new Error("Remote config custom fetch aborted by timeout");e.name="AbortError",t(e)};v.addEventListener("abort",r,{once:!0}),g.then(function(t){v.removeEventListener("abort",r),e(t)},function(e){v.removeEventListener("abort",r),t(e)})}))]:[3,3];case 2:return p=c.sent(),[3,5];case 3:return[4,fetch(u,{method:"GET",headers:h,signal:i.signal})];case 4:p=c.sent(),c.label=5;case 5:return(d=p).ok||d.status>=200&&d.status<300?[3,7]:[4,d.text()];case 6:return f=c.sent(),o.logger.debug("Remote config client fetch with retry time ".concat(e," failed with ").concat(d.status,": ").concat(f)),d.status===K||d.status===Y?(o.logger.error("Remote config client fetch failed with ".concat(d.status,". Invalid API key; future fetches will be skipped.")),o.isLastFetchInvalidApiKey=!0,s=!1):d.status>=400&&d.status<500&&d.status!==Q&&(s=!1),[3,9];case 7:return[4,d.json()];case 8:return[2,{value:{remoteConfig:c.sent(),lastFetch:new Date}}];case 9:return[3,12];case 10:return(m=c.sent())instanceof Error&&"AbortError"===m.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: "),m),[3,12];case 11:return clearTimeout(a),[7];case 12:return s?n<e-1?[4,new Promise(function(e){return setTimeout(e,l.getJitterDelay(r))})]:[3,14]:[2,"break"];case 13:c.sent(),c.label=14;case 14:return[2]}var g,v})},o=this,i=0,u.label=1;case 1:return i<e?[5,s(i)]:[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 i++,[3,1];case 4:return[2,n]}})})},e.prototype.getJitterDelay=function(e){return Math.floor(Math.random()*e)},e.prototype.getUrlParams=function(){var e=encodeURIComponent(this.apiKey),t=new URLSearchParams;return t.append("config_group",this.configGroup),"".concat(this.serverUrl,"/").concat(e,"?").concat(t.toString())},e.DEFAULT_CONFIG_GROUP="browser",e}();function Z(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e||null==e}function ee(e,t,r){e&&te({json:e,allowlist:t.map(re),excludelist:r.map(re),ancestors:[]})}function te(e){var t,r,n=e.json,s=e.targetObject,o=e.allowlist,i=e.excludelist,a=e.ancestors,l=e.parentObject,c=e.targetKey;s||(s=n);var p=Object.keys(s);try{for(var f=u(p),m=f.next();!m.done;m=f.next()){var g=m.value,v=d(d([],h(a),!1),[g],!1);Z(s[g])?se(v,o)&&!se(v,i)||delete s[g]:te({json:n,targetObject:s[g],allowlist:o,excludelist:i,ancestors:v,parentObject:s,targetKey:g})}}catch(e){t={error:e}}finally{try{m&&!m.done&&(r=f.return)&&r.call(f)}finally{if(t)throw t.error}}0===Object.keys(s).length&&l&&c&&delete l[c]}function re(e){return e.startsWith("/")&&(e=e.slice(1)),e.split("/").map(function(e){return e.replace(/~0/g,"~").replace(/~1/g,"/")})}function ne(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 s=t[n];if("**"===s){if(n+1===t.length)return!0;for(var o=r;o<=e.length;o++)if(ne(e,t,o,n+1))return!0;return!1}return("*"===s||s===e[r])&&ne(e,t,r+1,n+1)}function se(e,t){return t.some(function(t){return ne(e,t)})}!function(e){e.US="US",e.EU="EU",e.STAGING="STAGING"}(J||(J={}));var oe,ie="https://app.amplitude.com",ae={US:ie,EU:"https://app.eu.amplitude.com",STAGING:"https://apps.stag2.amplitude.com"};var le="__AMPLITUDE_MESSENGER_INSTANCE__",ce="__AMPLITUDE_MESSENGER__",ue=function(){function e(e){var t=(void 0===e?{}:e).origin,r=void 0===t?ie:t;this[oe]=!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,s;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===(s=null===(n=window.opener)||void 0===n?void 0:n.postMessage)||void 0===s||s.call(n,e,this.endpoint)},e.prototype.sendRequest=function(e,t,r){var n=this;void 0===r&&(r={timeout:15e3});var s="".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9)),o={id:s,action:e,args:t};return new Promise(function(t,i){n.requestCallbacks[s]={resolve:t,reject:i},n.notify(o),r.timeout>0&&setTimeout(function(){i(new Error("".concat(e," timed out (id: ").concat(s,")"))),delete n.requestCallbacks[s]},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,s,o;this.actionHandlers.has(e)&&(null===(o=null===(s=this.logger)||void 0===s?void 0:s.warn)||void 0===o||o.call(s,"Overwriting existing action handler for: ".concat(e))),this.actionHandlers.set(e,t);var i=this.pendingMessages.get(e);if(i){this.pendingMessages.delete(e);try{for(var a=u(i),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 l(this,void 0,void 0,function(){var t,r,n;return c(this,function(s){switch(s.label){case 0:if(t=this.scriptLoadPromises.get(e))return[2,t];r=function(e){return document.querySelector('script[src="'.concat(CSS.escape(e),'"]'))?Promise.resolve({status:!0}):new Promise(function(t,r){var n;try{var s=document.createElement("script");s.type="text/javascript",s.async=!0,s.src=e,s.addEventListener("load",function(){t({status:!0})},{once:!0}),s.addEventListener("error",function(){r({status:!1,message:"Failed to load the script ".concat(e)})}),null===(n=document.head)||void 0===n||n.appendChild(s)}catch(e){r(e)}})}(e).then(function(){}),this.scriptLoadPromises.set(e,r),s.label=1;case 1:return s.trys.push([1,3,,4]),[4,r];case 2:return s.sent(),[3,4];case 3:throw n=s.sent(),this.scriptLoadPromises.delete(e),n;case 4:return[2]}})})},e.prototype.setup=function(e){var t,r,n=this,s=void 0===e?{}:e,o=s.logger,i=s.endpoint;o&&(this.logger=o),i&&this.endpoint===ie&&(this.endpoint=i),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,s,o,i;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===(s=n.logger)||void 0===s?void 0:s.debug)||void 0===o||o.call(s,"Received Response to previous request: ",JSON.stringify(e)),n.handleResponse(a);else{if("ping"===l)return void n.notify({action:"pong"});var c=n.actionHandlers.get(l);if(c)c(a.data);else{var u=null!==(i=n.pendingMessages.get(l))&&void 0!==i?i:[];u.push(a.data),n.pendingMessages.set(l,u)}}}},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=g();(null==e?void 0:e[ce])===this&&delete e[ce]},e}();function he(e){var t,r=g(),n=null==r?void 0:r[ce];if("object"==typeof(t=n)&&null!==t&&le in t&&!0===t[le])return n;var s=new ue(e);return r&&(r[ce]=s),s}oe=le;var de=["desktop","tablet","mobile"],pe="__AMPLITUDE_BACKGROUND_CAPTURE__";function fe(e,t){var r,n=e;if(!0!==n[pe]){n[pe]=!0;var s=null!==(r=null==t?void 0:t.scriptUrl)&&void 0!==r?r:"https://cdn.amplitude.com/libs/background-capture-1.1.0.js.gz",o=null,a=function(t,r){var n,s;"background-capture-complete"===t&&(null===(s=null===(n=e.logger)||void 0===n?void 0:n.debug)||void 0===s||s.call(n,"Background capture complete"),e.notify({action:"background-capture-complete",data:r}))};e.registerActionHandler("initialize-background-capture",function(t){var r,n;null===(n=null===(r=e.logger)||void 0===r?void 0:r.debug)||void 0===n||n.call(r,"Initializing background capture (external script)");var l=new URL(s,e.endpoint).toString(),c=t&&"object"==typeof t?function(e){if("string"==typeof e)return de.includes(e)?e:void 0}(t.deviceMode):void 0;e.loadScriptOnce(l).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,i({messenger:e,onBackgroundCapture:a},void 0!==c?{initialDeviceMode:c}:{})),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 me,ge="[Amplitude]",ve="".concat(ge," Session Replay ID"),ye=J.US,we={enabled:!0},be=1e3,Se="".concat(ge," Session Replay Debug"),Ce="https://api-sr.amplitude.com/sessions/v2/track",xe="https://api-sr.eu.amplitude.com/sessions/v2/track",ke="https://api-sr.stag2.amplitude.com/sessions/v2/track",Ie=9e6,Oe=/payload.*exceed/i,Ee=500,Me=1e4,Re=1024,Pe="X-Session-Replay-Event-Skipped",Ae="amplitude-sr-iframe";!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"}(me||(me={}));var Te=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="medium";var Le=new Map,Fe=function(e){var t=Le.get(e);if(t)return t;var r="\0TRAIL\0",n="\0MID\0",s="\0DS\0",o="\0ST\0",i="\0QU\0",a=e;a=(a=(a=(a=(a=(a=(a=(a=(a=(a=(a=a.replace(/\/\*\*$/,r)).replace(/\/\*\*\//g,n)).replace(/\*\*/g,s)).replace(/\*/g,o)).replace(/\?/g,i)).replace(/[.+^${}()|[\]\\]/g,"\\$&")).split(r).join("(/.*)?")).split(n).join("/(.*\\/)?")).split(s).join(".*")).split(o).join(".*")).split(i).join(".");var l=new RegExp("^".concat(a,"$"));return Le.set(e,l),l},_e=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 _e(e,Ne,r)}},De=function(e,t){var r,n,s;if(e&&t.urlMaskLevels)try{for(var o=u(t.urlMaskLevels),i=o.next();!i.done;i=o.next()){var a=i.value;if(Fe(a.match).test(e))return a.maskLevel}}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return null!==(s=t.defaultMaskLevel)&&void 0!==s?s:Ne},Be=function(e,t,r,n){var s,o;if(void 0===t&&(t={defaultMaskLevel:Ne}),r){if(r.closest(".amp-mask, [data-amp-mask]"))return!0;var i=(null!==(s=t.maskSelector)&&void 0!==s?s:[]).some(function(e){return r.closest(e)});if(i)return!0;if(r.closest(".amp-unmask, [data-amp-unmask]"))return!1;var a=(null!==(o=t.unmaskSelector)&&void 0!==o?o:[]).some(function(e){return r.closest(e)});if(a)return!1}return _e(e,De(n,t),r)},Ue=function(e,t,r){return function(n,s){return Be(e,t,s,null==r?void 0:r())?n.replace(/[^\s]/g,"*"):n}},je=function(e,t){return function(r,n,s){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 i=["INPUT","SELECT","TEXTAREA"].includes(s.tagName)?"input":"text";return Be(i,e,s,null==t?void 0:t())?n.replace(/[^\s]/g,"*"):n}},ze=function(e){var t=null==e?void 0:e.blockSelector;return d(d([],h("string"==typeof t?t?[t]:[]:null!=t?t:[]),!1),["[data-amp-block]"],!1).join(",")},We=function(e,t){var r,n;return e&&("conservative"===De(t,e)||"conservative"===e.defaultMaskLevel||(null===(r=e.urlMaskLevels)||void 0===r?void 0:r.some(function(e){return"conservative"===e.maskLevel})))?"*":d(d([],h(null!==(n=null==e?void 0:e.maskSelector)&&void 0!==n?n:[]),!1),["[data-amp-mask]"],!1).join(",")};function qe(e,t){return t||("STAGING"===e?ke:"EU"===e?xe:Ce)}var $e=function(){var e=g();return(null==e?void 0:e.location)?e.location.href:""},Ve=function(e,t){var r,n;try{for(var s=u(t),o=s.next();!o.done;o=s.next()){var i=o.value,a=Fe(i.selector);if(a.test(e))return e.replace(a,i.replacement)}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return e},Ge=function(){return l(void 0,void 0,void 0,function(){var e,t,r,n,s,o,i;return c(this,function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),(e=g())?[4,e.navigator.storage.estimate()]:[3,2];case 1:return t=a.sent(),r=t.usage,n=t.quota,s=t.usageDetails,o=r?Math.round(r/Re):0,i=r&&n?Math.round(1e3*(r/n+Number.EPSILON))/1e3:0,[2,{totalStorageSize:o,percentOfQuota:i,usageDetails:JSON.stringify(s)}];case 2:return[3,4];case 3:return a.sent(),[3,4];case 4:return[2,{totalStorageSize:0,percentOfQuota:0,usageDetails:""}]}})})},He=function(e){e.loggerProvider;var t=a(e,["loggerProvider"]),r=i(i({},t),{apiKey:"****".concat(e.apiKey.substring(e.apiKey.length-4))});return JSON.parse(JSON.stringify(r))},Je=function(){return{flushMaxRetries:2,logLevel:k.Warn,loggerProvider:new R,transportProvider:new G}},Ke=function(e){function t(t,r){var n,s,o,a,l,c,u,p,f,m,g,v,y,w,b=this,S=Je();(b=e.call(this,i(i({transportProvider:S.transportProvider,loggerProvider:new Te(r.loggerProvider||S.loggerProvider)},r),{apiKey:t}))||this).flushMaxRetries=void 0!==r.flushMaxRetries&&r.flushMaxRetries<=S.flushMaxRetries?r.flushMaxRetries:S.flushMaxRetries,b.apiKey=t,b.sampleRate=r.sampleRate||0,b.semanticCapture=r.semanticCapture,b.semanticAnalyticsContext=r.semanticAnalyticsContext,b.serverZone=r.serverZone||ye,b.configServerUrl=r.configServerUrl,b.trackServerUrl=r.trackServerUrl,b.shouldInlineStylesheet=r.shouldInlineStylesheet,b.inlineImages=r.inlineImages,b.version=r.version,b.performanceConfig=r.performanceConfig||we,b.storeType=null!==(n=r.storeType)&&void 0!==n?n:"memory",b.applyBackgroundColorToBlockedElements=null!==(s=r.applyBackgroundColorToBlockedElements)&&void 0!==s&&s,b.enableUrlChangePolling=null!==(o=r.enableUrlChangePolling)&&void 0!==o&&o,b.urlChangePollingInterval=null!==(a=r.urlChangePollingInterval)&&void 0!==a?a:be,b.captureDocumentTitle=null!==(l=r.captureDocumentTitle)&&void 0!==l&&l,void 0!==r.fullSnapshotIntervalMs&&(b.fullSnapshotIntervalMs=r.fullSnapshotIntervalMs),void 0!==r.eagerFullSnapshotSend&&(b.eagerFullSnapshotSend=r.eagerFullSnapshotSend),b.captureFullSnapshotOnFocus=null!==(c=r.captureFullSnapshotOnFocus)&&void 0!==c&&c,void 0!==r.maxPersistedEventsSizeBytes&&(b.maxPersistedEventsSizeBytes=et(r.maxPersistedEventsSizeBytes,Qe,Xe,"maxPersistedEventsSizeBytes",b.loggerProvider)),void 0!==r.maxSingleEventSizeBytes&&(b.maxSingleEventSizeBytes=et(r.maxSingleEventSizeBytes,Qe,Ze,"maxSingleEventSizeBytes",b.loggerProvider)),b.privacyConfig=i(i({},null!==(u=r.privacyConfig)&&void 0!==u?u:{}),{unmaskSelector:Array.from(new Set(d([".".concat("amp-unmask")],h(null!==(f=null===(p=r.privacyConfig)||void 0===p?void 0:p.unmaskSelector)&&void 0!==f?f:[]),!1)))}),r.interactionConfig&&(b.interactionConfig=r.interactionConfig,b.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")}(b.interactionConfig.ugcFilterRules)),r.debugMode&&(b.debugMode=r.debugMode);var C=r;return b.useWebWorker=null===(v=null!==(m=r.useWebWorker)&&void 0!==m?m:null===(g=C.experimental)||void 0===g?void 0:g.useWebWorker)||void 0===v||v,b.enableTransportCompression=null===(y=r.enableTransportCompression)||void 0===y||y,b.sendTimeoutMs=r.sendTimeoutMs,b.captureAdoptedStyleSheets=null===(w=r.captureAdoptedStyleSheets)||void 0===w||w,r.crossOriginIframes&&(b.crossOriginIframes=r.crossOriginIframes),r.flushIntervalConfig?b.flushIntervalConfig=function(e,t){var r,n,s={};void 0!==e.minIntervalMs&&(!Number.isFinite(e.minIntervalMs)||e.minIntervalMs<Ye?(t.warn("flushIntervalConfig.minIntervalMs ".concat(e.minIntervalMs," is below floor ").concat(Ye,"ms; clamping.")),s.minIntervalMs=Ye):s.minIntervalMs=e.minIntervalMs);void 0!==e.maxIntervalMs&&(Number.isNaN(e.maxIntervalMs)||e.maxIntervalMs<Ye?(t.warn("flushIntervalConfig.maxIntervalMs ".concat(e.maxIntervalMs," is below floor ").concat(Ye,"ms; clamping.")),s.maxIntervalMs=Ye):s.maxIntervalMs=e.maxIntervalMs);if(void 0!==s.minIntervalMs||void 0!==s.maxIntervalMs){var o=null!==(r=s.minIntervalMs)&&void 0!==r?r:Ee,i=null!==(n=s.maxIntervalMs)&&void 0!==n?n:Me;i<o&&(void 0===s.maxIntervalMs?(t.warn("flushIntervalConfig.minIntervalMs (".concat(o,") exceeds the default maxIntervalMs (").concat(Me,"); raising max to match min.")),s.maxIntervalMs=o):void 0===s.minIntervalMs?(t.warn("flushIntervalConfig.maxIntervalMs (".concat(i,") is below the default minIntervalMs (").concat(Ee,"); lowering min to match max.")),s.minIntervalMs=i):(t.warn("flushIntervalConfig.maxIntervalMs (".concat(s.maxIntervalMs,") is less than minIntervalMs (").concat(s.minIntervalMs,"); raising max to match min.")),s.maxIntervalMs=s.minIntervalMs))}return s}(r.flushIntervalConfig,b.loggerProvider):b.flushIntervalConfig={minIntervalMs:1e3,maxIntervalMs:1e4},b.handleSendEvents=r.handleSendEvents,b.handleFetchConfig=r.handleFetchConfig,b}return n(t,e),t}(T),Ye=100,Qe=1e3,Xe=8e6,Ze=1e7;function et(e,t,r,n,s){if(Number.isFinite(e))return e<t?(s.warn("".concat(n," ").concat(e," is below floor ").concat(t,"; clamping.")),t):e>r?(s.warn("".concat(n," ").concat(e," exceeds ceiling ").concat(r,"; clamping.")),r):e;s.warn("".concat(n," value is not a finite number (got ").concat(String(e),"); ignoring."))}var tt=(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))(tt||{}),rt=(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))(rt||{}),nt=(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))(nt||{}),st=function(){function e(e,t){this.createCapture=e,this.ready=!1,this.pendingSnapshots=0,this.config={enabled:!1},this.capture=e(this.config,t)}return e.prototype.prepare=function(e,t){this.stop(),this.config=e,this.capture.updateConfig(e),this.sessionId!==t&&this.capture.resetSession(),this.sessionId=t},e.prototype.recordingReady=function(){if(this.config.enabled&&!this.ready){this.ready=!0,this.capture.start();var e=this.pendingSnapshots;this.pendingSnapshots=0;for(var t=0;t<e;t++)this.snapshot()}},e.prototype.event=function(e){e.type===tt.FullSnapshot&&this.snapshot()},e.prototype.snapshot=function(){this.config.enabled&&(this.ready?this.capture.isActive()&&this.capture.notify("snapshot",void 0):this.pendingSnapshots=Math.min(this.pendingSnapshots+1,200))},e.prototype.stop=function(){this.ready=!1,this.pendingSnapshots=0,this.capture.stop()},e}(),ot="AMP_semantic_tab_v1",it=new WeakMap,at=/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;var lt=function(e,t){var r=document.createDocumentFragment();return function(e,t,r){var n,s,o=i({},e);try{for(var a=u(["blockSelector","maskSelector","unmaskSelector"]),l=a.next();!l.done;l=a.next()){var c=l.value,h=e[c],d=("string"==typeof h?[h]:null!=h?h:[]).filter(function(e){try{return t(e),!0}catch(t){if(!r)throw new Error("Invalid privacy selector: ".concat(e));return r(e),!1}});o[c]=d.length?d:void 0}}catch(e){n={error:e}}finally{try{l&&!l.done&&(s=a.return)&&s.call(a)}finally{if(n)throw n.error}}return o}(e,function(e){r.querySelector(e)},function(e){t.warn('[session-replay-browser] omitting selector "'.concat(e,'" because it is invalid'))})},ct=function(){function e(e,t){this.localConfig=t,this.remoteConfigClient=e}return e.prototype.generateJoinedConfig=function(){var e,t,r,n,s,o,a,p;return l(this,void 0,void 0,function(){var l,f,m,g,v,y,w,b,S,C,x,k,I,O,E,M,R,P,A=this;return c(this,function(c){switch(c.label){case 0:(l=i({},this.localConfig)).optOut=this.localConfig.optOut,l.captureEnabled=!0,c.label=1;case 1:return c.trys.push([1,3,,4]),[4,new Promise(function(e,t){A.remoteConfigClient.subscribe("configs.sessionReplay",{timeout:1500},function(r,n){var s;if(A.localConfig.loggerProvider.debug("Session Replay remote configuration received from ".concat(n,":"),JSON.stringify(r,null,2)),r){var o=r,i=o.sr_sampling_config,a=o.sr_privacy_config,c=o.sr_targeting_config,u=o.sr_semantic_config,h=null===(s=l.interactionConfig)||void 0===s?void 0:s.ugcFilterRules;l.interactionConfig=o.sr_interaction_config,l.interactionConfig&&h&&(l.interactionConfig.ugcFilterRules=h),l.loggingConfig=o.sr_logging_config,(i||a||c||u)&&(f={},u&&(f.sr_semantic_config=u),i&&(f.sr_sampling_config=i),a&&(f.sr_privacy_config=a),c&&(f.sr_targeting_config=c)),e()}else t(new Error("No remote config received"))})})];case 2:return c.sent(),[3,4];case 3:return m=c.sent(),this.localConfig.loggerProvider.error("Failed to generate joined config: ",m),l.captureEnabled=!1,[2,{localConfig:this.localConfig,joinedConfig:l,remoteConfig:void 0}];case 4:if(!f)return[2,{localConfig:this.localConfig,joinedConfig:l,remoteConfig:f}];if(g=f.sr_sampling_config,v=f.sr_privacy_config,y=f.sr_targeting_config,(w=f.sr_semantic_config)&&(l.semanticCapture=i(i(i(i({enabled:!1},l.semanticCapture),void 0!==w.enabled?{enabled:w.enabled}:{}),void 0!==w.sampleRate?{sampleRate:this.sanitizeSemanticSampleRate(w.sampleRate)}:{}),{families:i(i({},null===(e=l.semanticCapture)||void 0===e?void 0:e.families),w.families)})),g&&Object.keys(g).length>0?(Object.prototype.hasOwnProperty.call(g,"capture_enabled")?l.captureEnabled=g.capture_enabled:l.captureEnabled=!1,Object.prototype.hasOwnProperty.call(g,"sample_rate")&&(l.sampleRate=g.sample_rate),Object.prototype.hasOwnProperty.call(g,"min_session_duration_ms")&&(l.minSessionDurationMs=this.sanitizeMinSessionDurationMs(g.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.")),v){b=null!==(t=l.privacyConfig)&&void 0!==t?t:{},S={defaultMaskLevel:null!==(n=null!==(r=v.defaultMaskLevel)&&void 0!==r?r:b.defaultMaskLevel)&&void 0!==n?n:"medium",blockSelector:[],maskSelector:[],unmaskSelector:[],maskAttributes:d([],h(new Set(d(d([],h(null!==(s=b.maskAttributes)&&void 0!==s?s:[]),!1),h(null!==(o=v.maskAttributes)&&void 0!==o?o:[]),!1))),!1),urlMaskLevels:d(d([],h(null!==(a=v.urlMaskLevels)&&void 0!==a?a:[]),!1),h(null!==(p=b.urlMaskLevels)&&void 0!==p?p:[]),!1)},C=function(e){var t,r,n,s,o,i,a,l,c,h={};"string"==typeof e.blockSelector&&(e.blockSelector=[e.blockSelector]);try{for(var d=u(null!==(a=e.blockSelector)&&void 0!==a?a:[]),p=d.next();!p.done;p=d.next()){h[p.value]="block"}}catch(e){t={error:e}}finally{try{p&&!p.done&&(r=d.return)&&r.call(d)}finally{if(t)throw t.error}}try{for(var f=u(null!==(l=e.maskSelector)&&void 0!==l?l:[]),m=f.next();!m.done;m=f.next()){h[m.value]="mask"}}catch(e){n={error:e}}finally{try{m&&!m.done&&(s=f.return)&&s.call(f)}finally{if(n)throw n.error}}try{for(var g=u(null!==(c=e.unmaskSelector)&&void 0!==c?c:[]),v=g.next();!v.done;v=g.next()){h[v.value]="unmask"}}catch(e){o={error:e}}finally{try{v&&!v.done&&(i=g.return)&&i.call(g)}finally{if(o)throw o.error}}return h},x=i(i({},C(b)),C(v));try{for(k=u(Object.entries(x)),I=k.next();!I.done;I=k.next())O=h(I.value,2),E=O[0],"mask"===(M=O[1])?S.maskSelector.push(E):"block"===M?S.blockSelector.push(E):"unmask"===M&&S.unmaskSelector.push(E)}catch(e){R={error:e}}finally{try{I&&!I.done&&(P=k.return)&&P.call(k)}finally{if(R)throw R.error}}l.privacyConfig=lt(S,this.localConfig.loggerProvider)}return y&&Object.keys(y).length>0&&(l.targetingConfig=y),this.localConfig.loggerProvider.debug(JSON.stringify({name:"session replay joined config",config:He(l)},null,2)),[2,{localConfig:this.localConfig,joinedConfig:l,remoteConfig:f}]}})})},e.prototype.sanitizeSemanticSampleRate=function(e){return"number"==typeof e&&Number.isFinite(e)&&e>=0&&e<=1?e:(this.localConfig.loggerProvider.warn("Invalid semantic sampleRate remote value (".concat(String(e),"); disabling capture.")),0)},e.prototype.sanitizeMinSessionDurationMs=function(e){if("number"==typeof e&&Number.isFinite(e)){if(!(e<0))return e>ut?(this.localConfig.loggerProvider.warn("min_session_duration_ms remote value ".concat(e," exceeds ").concat(ut,"ms ceiling; clamping.")),ut):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}(),ut=6e4,ht=function(e,t){return l(void 0,void 0,void 0,function(){var r,n;return c(this,function(s){return r=new Ke(e,t),n=new X(e,r.loggerProvider,r.serverZone,t.configServerUrl,t.handleFetchConfig),[2,new ct(n,r)]})})};function dt(e){for(var t=e.length,r=0;r<t&&!(e.charCodeAt(r)>127);r++);if(r===t)return t;for(var n=r;r<t;r++){var s=e.charCodeAt(r);if(s<=127)n++;else if(s<=2047)n+=2;else if(s>=55296&&s<=56319){var o=r+1<t?e.charCodeAt(r+1):NaN;o>=56320&&o<=57343?(n+=4,r++):n+=3}else n+=3}return n}function pt(e){for(var t=0,r=0;r<e.length;r++)t+=dt(e[r]);return t}function ft(e,t){if(!(3*e.length<=t)){var r=dt(e);return r>t?r:void 0}}function mt(e){if(e.type!==tt.IncrementalSnapshot)return!1;var t=e.data;return t.source===rt.Mutation&&!t.isAttachIframe}function gt(e){var t,r,n=new Map;if(e.forEach(function(e,t){if(e.attributes&&"style"in e.attributes){var r=n.get(e.id);r?r.push(t):n.set(e.id,[t])}}),0===n.size)return e;var s=function(t){return e[t].attributes.style},o=new Set,a=new Map,l=function(e){if(1===e.length)return"continue";var t=-1;e.forEach(function(e,r){var n;("object"!=typeof(n=s(e))||null===n)&&(t=r)});var r=[];if(e.forEach(function(e,n){n!==t&&(o.add(e),n>t&&r.push(e))}),r.length>0){var n=r[r.length-1],i=function(e){var t,r,n,s,o={};try{for(var i=u(e),a=i.next();!a.done;a=i.next()){var l=a.value;try{for(var c=(n=void 0,u(Object.keys(l))),h=c.next();!h.done;h=c.next()){var d=h.value;o[d]=l[d]}}catch(e){n={error:e}}finally{try{h&&!h.done&&(s=c.return)&&s.call(c)}finally{if(n)throw n.error}}}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return o}(r.map(function(e){return s(e)}));o.delete(n),a.set(n,i)}};try{for(var c=u(n.values()),h=c.next();!h.done;h=c.next()){l(h.value)}}catch(e){t={error:e}}finally{try{h&&!h.done&&(r=c.return)&&r.call(c)}finally{if(t)throw t.error}}if(0===o.size&&0===a.size)return e;var d=[];return e.forEach(function(e,t){var r=a.get(t);if(void 0===r)if(o.has(t)){var n=i({},e.attributes);delete n.style,Object.keys(n).length>0&&d.push(i(i({},e),{attributes:n}))}else d.push(e);else d.push(i(i({},e),{attributes:i(i({},e.attributes),{style:r})}))}),d}function vt(e){var t,r,n,s,o=e[0],a=new Map,l=new Map,c=new Map,d=new Map,p=new Map;e.forEach(function(e,t){var r,n,s,o,i=e.data;try{for(var h=u(i.adds),f=h.next();!f.done;f=h.next()){var m=f.value;a.has(m.node.id)||a.set(m.node.id,t),l.set(m.node.id,t),p.set(m.node.id,m.parentId)}}catch(e){r={error:e}}finally{try{f&&!f.done&&(n=h.return)&&n.call(h)}finally{if(r)throw r.error}}try{for(var g=u(i.removes),v=g.next();!v.done;v=g.next()){var y=v.value;c.has(y.id)||c.set(y.id,t),d.set(y.id,t)}}catch(e){s={error:e}}finally{try{v&&!v.done&&(o=g.return)&&o.call(g)}finally{if(s)throw s.error}}});var f=new Set,m=new Set;try{for(var g=u(a),v=g.next();!v.done;v=g.next()){var y=h(v.value,2),w=y[0],b=y[1],S=c.get(w);if(void 0!==S)l.get(w)>=d.get(w)||(b<S?f.add(w):S<b&&m.add(w))}}catch(e){t={error:e}}finally{try{v&&!v.done&&(r=g.return)&&r.call(g)}finally{if(t)throw t.error}}var C=new Set;if(f.size>0||m.size>0)for(var x=!0;x;){x=!1;try{for(var k=(n=void 0,u(p)),I=k.next();!I.done;I=k.next()){var O=h(I.value,2),E=O[0],M=O[1];if(!f.has(E)&&!m.has(E)&&!C.has(E)&&(f.has(M)||m.has(M)||C.has(M))){var R=c.get(E),P=a.get(E);void 0!==R&&void 0!==P&&R<P?m.add(E):void 0!==R&&void 0!==P&&R===P?C.add(E):f.add(E),x=!0}}}catch(e){n={error:e}}finally{try{I&&!I.done&&(s=k.return)&&s.call(k)}finally{if(n)throw n.error}}}var A=f.size>0||m.size>0||C.size>0,T=[];e.forEach(function(e,t){var r,n;try{for(var s=u(e.data.removes),o=s.next();!o.done;o=s.next()){var i=o.value;f.has(i.id)||(m.has(i.id)&&t>=a.get(i.id)||C.has(i.id)&&(f.has(i.parentId)||m.has(i.parentId)||C.has(i.parentId))||T.push(i))}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}});var N=e.flatMap(function(e){return e.data.adds}),L=e.flatMap(function(e){return e.data.texts}),F=e.flatMap(function(e){return e.data.attributes}),_=A?F.filter(function(e){return!f.has(e.id)&&!m.has(e.id)&&!C.has(e.id)}):F,D={source:rt.Mutation,removes:T,adds:A?N.filter(function(e){return!f.has(e.node.id)&&!m.has(e.node.id)&&!C.has(e.node.id)}):N,texts:A?L.filter(function(e){return!f.has(e.id)&&!m.has(e.id)&&!C.has(e.id)}):L,attributes:gt(_)};return i(i({},o),{data:D})}function yt(e){if(e.length<=1)return e;for(var t=[],r=0;r<e.length;)if(mt(e[r])){for(var n=r+1;n<e.length&&mt(e[n]);)n++;t.push(n>r+1?vt(e.slice(r,n)):e[r]),r=n}else t.push(e[r]),r++;return t}var wt=function(){function e(e,t,r,n,s){var o,i=this;this.taskQueue=[],this.pendingQueue=[],this.isProcessing=!1,this.compressEvent=function(e){var t=e,r=t.type,n=t.timestamp,s=t.delay,o=t.data;return null!=s?JSON.stringify({type:r,timestamp:n,delay:s,data:o}):JSON.stringify({type:r,timestamp:n,data:o})},this.addCompressedEventToManager=function(e,t){var r,n=ft(e,null!==(r=i.config.maxSingleEventSizeBytes)&&void 0!==r?r:Ie);void 0===n?i.eventsManager&&i.deviceId&&i.eventsManager.addEvent({event:{type:"replay",data:e},sessionId:t,deviceId:i.deviceId}):i.config.loggerProvider.warn("Session replay event dropped: serialized size ".concat(Math.round(n/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."))},this.addCompressedEvent=function(e,t){if(i.worker)try{i.worker.postMessage({event:e,sessionId:t})}catch(r){"DataCloneError"===r.name?i.worker.postMessage(JSON.stringify({event:e,sessionId:t})):i.config.loggerProvider.warn("Unexpected error while posting message to worker:",r)}else{var r=i.compressEvent(e);i.addCompressedEventToManager(r,t)}},this.flushQueue=function(){var e;for(i.pendingQueue.length>0&&(e=i.taskQueue).push.apply(e,d([],h(i.mergeMutationTasks(i.pendingQueue.splice(0))),!1));i.taskQueue.length>0;){var t=i.taskQueue.shift();if(t){var r=t.event,n=t.sessionId,s=i.compressEvent(r);i.addCompressedEventToManager(s,n)}}i.isProcessing=!1},this.terminate=function(){var e;null===(e=i.worker)||void 0===e||e.terminate()};var a=g();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=s,n){t.loggerProvider.log("Enabling web worker for compression");try{var l=new Blob([n],{type:"application/javascript"}),c=URL.createObjectURL(l),u=new Worker(c);u.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,")")),u.terminate(),i.worker=void 0},u.onmessage=function(e){var t=e.data,r=t.compressedEvent,n=t.sessionId;i.addCompressedEventToManager(r,n)},this.worker=u}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,s,o;if(e.type===tt.FullSnapshot){if(this.config.loggerProvider.debug("Processing full snapshot immediately."),this.taskQueue.length>0||this.pendingQueue.length>0){var i=d(d([],h(this.taskQueue.splice(0)),!1),h(this.mergeMutationTasks(this.pendingQueue.splice(0))),!1);try{for(var a=u(i),l=a.next();!l.done;l=a.next()){var c=l.value,p=this.compressEvent(c.event);this.addCompressedEventToManager(p,c.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 f=this.compressEvent(e);return this.addCompressedEventToManager(f,t),void(null===(s=this.onFullSnapshotProcessed)||void 0===s||s.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,d([],h(this.mergeMutationTasks(this.pendingQueue.splice(0))),!1));this.taskQueue.length>0&&(e.timeRemaining()>0||e.didTimeout);){var n=this.taskQueue.shift();if(n){var s=n.event,o=n.sessionId;this.addCompressedEvent(s,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(!1===(null===(n=this.config.performanceConfig)||void 0===n?void 0:n.mergeMutations))return e;if(e.length<=1)return e;for(var s=[],o=0;o<e.length;){for(var i=e[o].sessionId,a=o+1;a<e.length&&e[a].sessionId===i;)a++;var l=yt(e.slice(o,a).map(function(e){return e.event}));try{for(var c=(t=void 0,u(l)),h=c.next();!h.done;h=c.next()){var d=h.value;s.push({event:d,sessionId:i})}}catch(e){t={error:e}}finally{try{h&&!h.done&&(r=c.return)&&r.call(c)}finally{if(t)throw t.error}}o=a}return s},e}(),bt="Session replay event batch rejected due to exceeded retry count",St="Failed to store session replay events in IndexedDB",Ct="Session replay event batch dropped: server signalled capture disabled or session out of valid range for this session",xt="1.52.0";function kt(e,t){return l(this,void 0,void 0,function(){var r,n,s,o,i,a,h,d,p,f,m,g,v,y,w=this;return c(this,function(b){switch(b.label){case 0:return b.trys.push([0,4,,5]),r=t.CompressionStream,n=new r("gzip"),s=n.writable.getWriter(),o=n.readable.getReader(),i=[],a=l(w,void 0,void 0,function(){var e,t,r;return c(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];i.push(r),n.label=2;case 2:return[3,0];case 3:return[2]}})}),[4,s.write((new TextEncoder).encode(e))];case 1:return b.sent(),[4,s.close()];case 2:return b.sent(),[4,a];case 3:b.sent(),h=i.reduce(function(e,t){return e+t.length},0),d=new Uint8Array(h),p=0;try{for(f=u(i),m=f.next();!m.done;m=f.next())g=m.value,d.set(g,p),p+=g.length}catch(e){v={error:e}}finally{try{m&&!m.done&&(y=f.return)&&y.call(f)}finally{if(v)throw v.error}}return[2,d];case 4:return b.sent(),[2,null];case 5:return[2]}})})}var It=function(){function e(e){var t=e.trackServerUrl,r=e.loggerProvider,n=e.payloadBatcher,s=e.workerScript,o=e.enableTransportCompression,i=e.sendTimeoutMs,a=e.handleSendEvents,l=this;if(this.storageKey="",this.retryTimeout=1e3,this.scheduled=null,this.queue=[],this.sendIdCounter=0,this.pendingWorkerRequests=new Map,this.timedOutWorkerRequests=new Map,this.flushPauseUntilMs=0,this.mergeOnNextFlush=!1,this.coalesceNextFlush=!1,this.mergeLogFiredThisPause=!1,this.killedSessions=new Set,this.loggerProvider=r,this.payloadBatcher=n||function(e){return e},this.trackServerUrl=t,this.enableTransportCompression=null==o||o,this.sendTimeoutMs=null!=i?i:1e4,this.handleSendEvents=a,s)try{var c=new Blob([s],{type:"application/javascript"}),d=URL.createObjectURL(c),p=new Worker(d);p.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,")")),p.terminate(),l.worker=void 0;try{for(var s=u(l.pendingWorkerRequests),o=s.next();!o.done;o=s.next()){var i=h(o.value,2)[1];i.timeout&&clearTimeout(i.timeout),r.warn("Session replay event send failed due to worker crash: ".concat(e.message)),i.resolve()}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}l.pendingWorkerRequests.clear(),l.timedOutWorkerRequests.clear()},p.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=l.pendingWorkerRequests.get(t.id);if(n)n.timeout&&clearTimeout(n.timeout),l.handlePayloadTooLargeResponse(n.context,t.isWaf),n.resolve(),l.pendingWorkerRequests.delete(t.id);else(s=l.timedOutWorkerRequests.get(t.id))&&(l.timedOutWorkerRequests.delete(t.id),l.handlePayloadTooLargeResponse(s,t.isWaf))}else if("complete"===t.type){var s,o=l.pendingWorkerRequests.get(t.id);if(o)o.timeout&&clearTimeout(o.timeout),void 0!==t.skipCode&&l.applyServerDirective(o.context.sessionId,t.skipCode),l.completeRequest({context:o.context}),o.resolve(),l.pendingWorkerRequests.delete(t.id);else(s=l.timedOutWorkerRequests.get(t.id))&&(l.timedOutWorkerRequests.delete(t.id),void 0!==t.skipCode&&l.applyServerDirective(s.sessionId,t.skipCode),l.completeRequest({context:s}))}else"fetch-request"===t.type&&l.handleDelegatedFetch(p,t).catch(function(e){r.warn("Failed to handle delegated session replay fetch:",e)})},this.worker=p}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(i(i({},e),{attempts:0,timeout:0}))},e.prototype.markCoalesceNextFlush=function(){this.coalesceNextFlush=!0,this.schedule(0)},e.prototype.sendBeacon=function(e){var t,r,n=this,s=e.events,o=e.sessionId,i=e.deviceId,a=e.apiKey,l=e.serverZone,c=function(e){return dt(e)},u=s,h=JSON.stringify({version:2,events:u});if(c(h)>65536){for(var d=0,p=u.length;d<p;){var f=Math.floor((d+p+1)/2);c(JSON.stringify({version:2,events:u.slice(0,f)}))<=65536?d=f:p=f-1}u=u.slice(0,d),h=JSON.stringify({version:2,events:u}),this.loggerProvider.warn("sendBeacon payload exceeded 64 KB limit, trimmed from ".concat(s.length," to ").concat(u.length," events"))}if(0!==u.length)if(this.handleSendEvents){var m=new URLSearchParams({device_id:i,session_id:String(o),type:"replay"}),v="".concat(qe(l,this.trackServerUrl),"?").concat(m.toString()),y={"Content-Type":"application/json",Accept:"*/*",Authorization:"Bearer ".concat(a)};this.loggerProvider.debug("Routing session replay exit batch (".concat(u.length," events) through custom transport for session id ").concat(o,"."));try{this.handleSendEvents({url:v,method:"POST",headers:y,body:h,keepalive:!0}).catch(function(e){n.loggerProvider.warn("Custom transport failed to send session replay exit batch:",e)})}catch(e){this.loggerProvider.warn("Custom transport threw while sending session replay exit batch:",e)}}else{var w=new URLSearchParams({device_id:i,session_id:String(o),type:"replay",api_key:a}),b="".concat(qe(l,this.trackServerUrl),"?").concat(w.toString()),S=g();try{var C=new Blob([h],{type:"application/json"});!1===(null===(r=null===(t=null==S?void 0:S.navigator)||void 0===t?void 0:t.sendBeacon)||void 0===r?void 0:r.call(t,b,C))&&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:Ct}),!1):t.attempts<(t.flushMaxRetries||0)?(t.attempts+=1,!0):(e.completeRequest({context:t,err:bt}),!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),l(this,void 0,void 0,function(){var t,r,n,s,o,i,a;return c(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,this.coalesceNextFlush=!1,t=this.mergeQueueAfterThrottle(t)):this.coalesceNextFlush&&(this.coalesceNextFlush=!1,t=this.mergeDrainBacklog(t)),l.label=1;case 1:l.trys.push([1,6,7,8]),r=u(t),n=r.next(),l.label=2;case 2:return n.done?[3,5]:(s=n.value,[4,this.send(s,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(),i={error:o},[3,8];case 7:try{n&&!n.done&&(a=r.return)&&a.call(r)}finally{if(i)throw i.error}return[7];case 8:return[2]}})})},e.prototype.mergeQueueAfterThrottle=function(e){var t=this.coalesceByIdentity(e);return t.length<e.length&&!this.mergeLogFiredThisPause&&(this.mergeLogFiredThisPause=!0,this.loggerProvider.log("Session replay throttle pause ended; merged ".concat(e.length," queued batches into ").concat(t.length," request(s)"))),t},e.prototype.mergeDrainBacklog=function(e){var t=this.coalesceByIdentity(e);return t.length<e.length&&this.loggerProvider.log("Session replay coalesced ".concat(e.length," persisted page-load backlog batches into ").concat(t.length," request(s)")),t},e.prototype.coalesceByIdentity=function(e){var t,r,n,s,o,a,p,f,m,g,v,y=this;if(e.length<=1)return e;var w=new Map;try{for(var b=u(e),S=b.next();!S.done;S=b.next()){var C=S.value,x=[C.sessionId,null!==(o=C.deviceId)&&void 0!==o?o:"",null!==(a=C.apiKey)&&void 0!==a?a:"",C.type,null!==(p=C.serverZone)&&void 0!==p?p:"",C.sampleRate,null!==(m=null===(f=C.version)||void 0===f?void 0:f.type)&&void 0!==m?m:"",null!==(v=null===(g=C.version)||void 0===g?void 0:g.version)&&void 0!==v?v:""].join("|"),k=w.get(x);k?k.push(C):w.set(x,[C])}}catch(e){t={error:e}}finally{try{S&&!S.done&&(r=b.return)&&r.call(b)}finally{if(t)throw t.error}}var I=[],O=function(e){var t,r;if(1===e.length)return I.push(e[0]),"continue";var n=null,s=0,o=function(){n&&I.push(n),n=null,s=0},a=function(e){var t=pt(e.events);if(null===n)return n=i(i({},e),{events:d([],h(e.events),!1),attempts:0}),s=t,"continue";if(s+t>4e6)return o(),n=i(i({},e),{events:d([],h(e.events),!1),attempts:0}),s=t,"continue";var r=n.onComplete,a=e.onComplete;n.events=n.events.concat(e.events),s+=t,n.onComplete=function(){return l(y,void 0,void 0,function(){return c(this,function(e){switch(e.label){case 0:return[4,Promise.allSettled([r(),a()])];case 1:return e.sent(),[2]}})})}};try{for(var p=(t=void 0,u(e)),f=p.next();!f.done;f=p.next()){a(f.value)}}catch(e){t={error:e}}finally{try{f&&!f.done&&(r=p.return)&&r.call(p)}finally{if(t)throw t.error}}o()};try{for(var E=u(w.values()),M=E.next();!M.done;M=E.next()){O(M.value)}}catch(e){n={error:e}}finally{try{M&&!M.done&&(s=E.return)&&s.call(E)}finally{if(n)throw n.error}}return I},e.prototype.send=function(e,t){return void 0===t&&(t=!0),l(this,void 0,void 0,function(){var r,n,s,o;return c(this,function(i){return this.killedSessions.has(e.sessionId)?[2,this.completeRequest({context:e,err:Ct})]:(r=e.apiKey)?(n=e.deviceId)?0===(s=this.payloadBatcher({version:1,events:e.events})).events.length?(this.completeRequest({context:e}),[2]):(o=this.worker)?[2,this.sendViaWorker(o,e,s,t)]:[2,this.sendOnMainThread(r,n,e,s,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 l(this,void 0,void 0,function(){var s,o=this;return c(this,function(i){return s="".concat(++this.sendIdCounter),[2,new Promise(function(i){var a,l=o.sendTimeoutMs>0?setTimeout(function(){var e=o.pendingWorkerRequests.get(s);e&&(o.pendingWorkerRequests.delete(s),o.rememberTimedOutRequest(s,e.context),o.loggerProvider.warn("Session replay worker send timed out after ".concat(o.sendTimeoutMs,"ms; leaving events for retry")),e.resolve())},o.sendTimeoutMs):void 0;o.pendingWorkerRequests.set(s,{context:t,resolve:i,timeout:l}),e.postMessage({type:"send",id:s,payload:r,useRetry:n,useCustomTransport:!!o.handleSendEvents,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:$e(),sdkVersion:xt,enableTransportCompression:o.enableTransportCompression,sendTimeoutMs:o.sendTimeoutMs}})})]})})},e.prototype.rememberTimedOutRequest=function(e,t){var r,n;if(this.timedOutWorkerRequests.set(e,t),this.timedOutWorkerRequests.size>256)try{for(var s=u(this.timedOutWorkerRequests.keys()),o=s.next();!o.done;o=s.next()){var i=o.value;this.timedOutWorkerRequests.delete(i);break}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}},e.prototype.handleDelegatedFetch=function(e,t){var r,n,s;return l(this,void 0,void 0,function(){var o,i,a,l,u,h,d,p,f,m,g;return c(this,function(c){switch(c.label){case 0:o=t.requestId,i=t.url,a=t.method,l=t.headers,u=t.body,h=t.keepalive,c.label=1;case 1:return c.trys.push([1,10,,11]),d=void 0,this.handleSendEvents?[4,this.handleSendEvents({url:i,method:a,headers:l,body:u,keepalive:h})]:[3,3];case 2:return d=c.sent(),[3,5];case 3:return this.loggerProvider.warn("Delegated session replay fetch received without a custom transport configured; falling back to built-in fetch."),[4,fetch(i,{method:a,headers:l,body:u,keepalive:h})];case 4:d=c.sent(),c.label=5;case 5:if(p=d.status,f=null,m="",p>=200&&p<300&&(f=null!==(s=null===(n=null===(r=d.headers)||void 0===r?void 0:r.get)||void 0===n?void 0:n.call(r,Pe))&&void 0!==s?s:null),413!==p)return[3,9];c.label=6;case 6:return c.trys.push([6,8,,9]),[4,d.text()];case 7:return m=c.sent(),[3,9];case 8:return c.sent(),[3,9];case 9:return this.loggerProvider.debug("Delegated session replay fetch (request ".concat(o,") returned status ").concat(p,".")),e.postMessage({type:"fetch-response",requestId:o,status:p,skipHeader:f,body:m}),[3,11];case 10:return g=c.sent(),this.loggerProvider.debug("Delegated session replay fetch (request ".concat(o,") failed:"),g),e.postMessage({type:"fetch-response",requestId:o,status:0,skipHeader:null,body:String(g),error:!0}),[3,11];case 11:return[2]}})})},e.prototype.sendOnMainThread=function(e,t,r,n,s){var o,a,u,h,d,p,f;return l(this,void 0,void 0,function(){var l,m,v,y,w,b,S,C,x,k,I,O,E,M,R,P,A,T,N,L,F,_;return c(this,function(c){switch(c.label){case 0:l=$e(),m=xt,v=r.sampleRate,y=new URLSearchParams({device_id:t,session_id:"".concat(r.sessionId),type:"".concat(r.type)}),w="".concat(null!==(a=null===(o=r.version)||void 0===o?void 0:o.type)&&void 0!==a?a:"standalone","/").concat(null!==(h=null===(u=r.version)||void 0===u?void 0:u.version)&&void 0!==h?h:m),c.label=1;case 1:return c.trys.push([1,19,,23]),b=JSON.stringify(n),S=g(),this.enableTransportCompression&&S&&"CompressionStream"in S?[4,kt(b,S)]:[3,3];case 2:return x=c.sent(),[3,4];case 3:x=null,c.label=4;case 4:if(k=(C=x)?C.byteLength:dt(b),I=new AbortController,O=i({"Content-Type":"application/json",Accept:"*/*",Authorization:"Bearer ".concat(e),"X-Client-Version":m,"X-Client-Library":w,"X-Client-Url":l.substring(0,1e3),"X-Client-Sample-Rate":"".concat(v),"X-Sampling-Hash-Alg":"xxhash32"},C?{"Content-Encoding":"gzip"}:{}),R={headers:O,body:E=null!=C?C:b,method:"POST",keepalive:M=k<=65536,signal:I.signal},P="".concat(qe(r.serverZone,this.trackServerUrl),"?").concat(y.toString()),0===n.events.length)return this.completeRequest({context:r}),[2];A=this.sendTimeoutMs>0?setTimeout(function(){I.abort()},this.sendTimeoutMs):void 0,T=void 0,c.label=5;case 5:return c.trys.push([5,,10,11]),this.handleSendEvents?[4,(D=this.handleSendEvents({url:P,method:"POST",headers:O,body:E,keepalive:M}),B=I.signal,new Promise(function(e,t){var r=function(){var e=new Error("Custom session replay transport aborted by send timeout");e.name="AbortError",t(e)};B.addEventListener("abort",r,{once:!0}),D.then(function(t){B.removeEventListener("abort",r),e(t)},function(e){B.removeEventListener("abort",r),t(e)})}))]:[3,7];case 6:return N=c.sent(),[3,9];case 7:return[4,fetch(P,R)];case 8:N=c.sent(),c.label=9;case 9:return T=N,[3,11];case 10:return A&&clearTimeout(A),[7];case 11:if(null===T)return this.completeRequest({context:r,err:"Unexpected error occurred"}),[2];if(T.status>=200&&T.status<300&&(L=null!==(f=null===(p=null===(d=T.headers)||void 0===d?void 0:d.get)||void 0===p?void 0:p.call(d,Pe))&&void 0!==f?f:null,this.applyServerDirective(r.sessionId,L)),s)return[3,12];F="";try{F=JSON.stringify(T.body,null,2)}catch(e){}return this.completeRequest({context:r,success:"".concat(T.status,": ").concat(F)}),[3,18];case 12:if(F="",413!==T.status)return[3,16];c.label=13;case 13:return c.trys.push([13,15,,16]),[4,T.text()];case 14:return F=c.sent(),[3,16];case 15:return c.sent(),[3,16];case 16:return[4,this.handleReponse(T.status,r,F)];case 17:c.sent(),c.label=18;case 18:return[3,23];case 19:return _=c.sent(),!!_&&"object"==typeof _&&"AbortError"===_.name&&s?[4,this.handleOtherResponse(r)]:[3,21];case 20:return c.sent(),[3,22];case 21:this.completeRequest({context:r,err:_}),c.label=22;case 22:return[3,23];case 23:return[2]}var D,B})})},e.prototype.handleReponse=function(e,t,r){return void 0===r&&(r=""),l(this,void 0,void 0,function(){var n;return c(this,function(s){switch(s.label){case 0:switch(n=(new V).buildStatus(e),n){case p.Success:return[3,1];case p.Failed:case p.Timeout:case p.RateLimit:return[3,2];case p.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 s.sent(),[3,8];case 4:return this.handlePayloadTooLargeResponse(t,Oe.test(r)),[3,8];case 5:return 499!==e?[3,7]:[4,this.handleOtherResponse(t)];case 6:return s.sent(),[3,8];case 7:this.completeRequest({context:t,err:"Network error occurred, event batch rejected"}),s.label=8;case 8:return[2]}})})},e.prototype.handlePayloadTooLargeResponse=function(e,t){var r=t?"WAF (compressed payload too large)":"server (event too large)",n=Math.round(e.events.reduce(function(e,t){return e+t.length},0)/Re);if(t)if(1!==e.events.length){this.loggerProvider.warn("Session replay event batch rejected by ".concat(r," (").concat(e.events.length," events, ").concat(n," KB total) — splitting and retrying")),e.onComplete();var s=function(){return Promise.resolve()},o=Math.floor(e.events.length/2);this.sendEventsList(i(i({},e),{events:e.events.slice(0,o),onComplete:s})),this.sendEventsList(i(i({},e),{events:e.events.slice(o),onComplete:s}))}else this.completeRequest({context:e,err:"Session replay event dropped: single event (".concat(n," KB, 1 event) rejected by ").concat(r," — cannot split further")});else this.completeRequest({context:e,err:"Session replay event batch dropped: ".concat(r," rejected payload (").concat(e.events.length," events, ").concat(n," KB) — not retrying non-WAF 413")})},e.prototype.handleSuccessResponse=function(e){var t=Math.round(pt(e.events)/Re);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 l(this,void 0,void 0,function(){var t;return c(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:bt}),[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,s,o;if(!this.killedSessions.has(e)){if(this.killedSessions.add(e),this.killedSessions.size>256)try{for(var i=u(this.killedSessions),a=i.next();!a.done;a=i.next()){var l=a.value;this.killedSessions.delete(l);break}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}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 c=[];try{for(var h=u(this.queue),d=h.next();!d.done;d=h.next()){var p=d.value;p.sessionId===e?this.completeRequest({context:p,err:Ct}):c.push(p)}}catch(e){s={error:e}}finally{try{d&&!d.done&&(o=h.return)&&o.call(h)}finally{if(s)throw s.error}}this.queue=c}},e}();const Ot=(e,t)=>t.some(t=>e instanceof t);let Et,Mt;const Rt=new WeakMap,Pt=new WeakMap,At=new WeakMap;let Tt={get(e,t,r){if(e instanceof IDBTransaction){if("done"===t)return Rt.get(e);if("store"===t)return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return _t(e[t])},set:(e,t,r)=>(e[t]=r,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function Nt(e){Tt=e(Tt)}function Lt(e){return(Mt||(Mt=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(Dt(this),t),_t(this.request)}:function(...t){return _t(e.apply(Dt(this),t))}}function Ft(e){return"function"==typeof e?Lt(e):(e instanceof IDBTransaction&&function(e){if(Rt.has(e))return;const t=new Promise((t,r)=>{const n=()=>{e.removeEventListener("complete",s),e.removeEventListener("error",o),e.removeEventListener("abort",o)},s=()=>{t(),n()},o=()=>{r(e.error||new DOMException("AbortError","AbortError")),n()};e.addEventListener("complete",s),e.addEventListener("error",o),e.addEventListener("abort",o)});Rt.set(e,t)}(e),Ot(e,Et||(Et=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,Tt):e)}function _t(e){if(e instanceof IDBRequest)return function(e){const t=new Promise((t,r)=>{const n=()=>{e.removeEventListener("success",s),e.removeEventListener("error",o)},s=()=>{t(_t(e.result)),n()},o=()=>{r(e.error),n()};e.addEventListener("success",s),e.addEventListener("error",o)});return At.set(t,e),t}(e);if(Pt.has(e))return Pt.get(e);const t=Ft(e);return t!==e&&(Pt.set(e,t),At.set(t,e)),t}const Dt=e=>At.get(e);function Bt(e,t,{blocked:r,upgrade:n,blocking:s,terminated:o}={}){const i=indexedDB.open(e,t),a=_t(i);return n&&i.addEventListener("upgradeneeded",e=>{n(_t(i.result),e.oldVersion,e.newVersion,_t(i.transaction),e)}),r&&i.addEventListener("blocked",e=>r(e.oldVersion,e.newVersion,e)),a.then(e=>{o&&e.addEventListener("close",()=>o()),s&&e.addEventListener("versionchange",e=>s(e.oldVersion,e.newVersion,e))}).catch(()=>{}),a}const Ut=["get","getKey","getAll","getAllKeys","count"],jt=["put","add","delete","clear"],zt=new Map;function Wt(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(zt.get(t))return zt.get(t);const r=t.replace(/FromIndex$/,""),n=t!==r,s=jt.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!s&&!Ut.includes(r))return;const o=async function(e,...t){const o=this.transaction(e,s?"readwrite":"readonly");let i=o.store;return n&&(i=i.index(t.shift())),(await Promise.all([i[r](...t),s&&o.done]))[0]};return zt.set(t,o),o}Nt(e=>({...e,get:(t,r,n)=>Wt(t,r)||e.get(t,r,n),has:(t,r)=>!!Wt(t,r)||e.has(t,r)}));const qt=["continue","continuePrimaryKey","advance"],$t={},Vt=new WeakMap,Gt=new WeakMap,Ht={get(e,t){if(!qt.includes(t))return e[t];let r=$t[t];return r||(r=$t[t]=function(...e){Vt.set(this,Gt.get(this)[t](...e))}),r}};async function*Jt(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;const r=new Proxy(t,Ht);for(Gt.set(r,t),At.set(r,Dt(t));t;)yield r,t=await(Vt.get(r)||t.continue()),Vt.delete(r)}function Kt(e,t){return t===Symbol.asyncIterator&&Ot(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===t&&Ot(e,[IDBIndex,IDBObjectStore])}Nt(e=>({...e,get:(t,r,n)=>Kt(t,r)?Jt:e.get(t,r,n),has:(t,r)=>Kt(t,r)||e.has(t,r)}));var Yt=function(){function e(e){var t,r,n,s=this;this.minInterval=Ee,this.maxInterval=Me,this.maxPersistedEventsSize=6e6,this._timeAtLastSplit=Date.now(),this.eventsContentBytes=new WeakMap,this.sequenceContentBytes=new Map,this.shouldSplitEventsList=function(e,t){var r=s.getEventsArraySize(e),n=s.maxPersistedEventsSize-r,o=t.length>=n;return!o&&3*t.length>=n&&(o=dt(t)>=n),!!o||!!(Date.now()-s.timeAtLastSplit>s.interval&&e.length)&&(s.interval=Math.min(s.maxInterval,s.interval+s.minInterval),s._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.isPrefixOf=function(e,t){return!(t.length<e.length)&&(0===e.length||t[e.length-1]===e.tail)},e.prototype.measureContentBytes=function(e,t){if(e&&e.length===t.length&&this.isPrefixOf(e,t))return e;var r=0,n=0;e&&this.isPrefixOf(e,t)&&(r=e.contentBytes,n=e.length);for(var s=n;s<t.length;s++)r+=dt(t[s]);return{length:t.length,contentBytes:r,tail:t.length>0?t[t.length-1]:void 0}},e.prototype.getEventsContentBytes=function(e){var t=this.measureContentBytes(this.eventsContentBytes.get(e),e);return this.eventsContentBytes.set(e,t),t.contentBytes},e.prototype.getEventsArraySize=function(e){return this.getEventsContentBytes(e)+(2+Math.max(0,e.length-1)+2*e.length)},e.prototype.recallSequenceContentBytes=function(e,t){var r=this.sequenceContentBytes.get(e);r&&r.length===t.length&&this.isPrefixOf(r,t)&&this.eventsContentBytes.set(t,r)},e.prototype.rememberSequenceContentBytes=function(e,t){var r=this.measureContentBytes(this.sequenceContentBytes.get(e),t);this.sequenceContentBytes.set(e,r),this.eventsContentBytes.set(t,r)},e.prototype.forgetSequenceContentBytes=function(e){this.sequenceContentBytes.delete(e)},e}(),Qt=function(e,t,r){var n;"object"==typeof(n=r)&&null!==n&&"AbortError"===n.name?e.debug(t):e.warn(t)};var Xt="sessionCurrentSequence",Zt="sequencesToSend",er=5e3;function tr(e,t,r){var n=setTimeout(r,t);return e.then(function(){return clearTimeout(n)},function(){return clearTimeout(n)}),function(){return clearTimeout(n)}}var rr,nr,sr,or=function(e){var t,r;return e.objectStoreNames.contains(Xt)||(r=e.createObjectStore(Xt,{keyPath:"sessionId"})),e.objectStoreNames.contains(Zt)||(t=e.createObjectStore(Zt,{keyPath:"sequenceId",autoIncrement:!0})).createIndex("sessionId","sessionId"),{sequencesStore:t,currentSequenceStore:r}},ir=function(e){return l(void 0,void 0,void 0,function(){return c(this,function(t){switch(t.label){case 0:return[4,(r=Bt(e,1,{upgrade:or}),n=2e3,s="IDB openDB timed out",void 0===s&&(s="IDB operation timed out"),new Promise(function(e,t){var o=setTimeout(function(){return t(new Error("".concat(s," 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,s})})},ar=function(e){function t(t){var r,n=this;return(n=e.call(this,t)||this).consecutiveFailures=0,n.hasTriggeredFallback=!1,n.emptyFilteredCount=0,n.getSequencesToSend=function(){return l(n,void 0,void 0,function(){var e,t,r,n,s,o,i,a,l,u,h=this;return c(this,function(c){switch(c.label){case 0:e=!1,t=!1,c.label=1;case 1:return c.trys.push([1,9,,10]),r=[],(n=this.db.transaction("sequencesToSend","readwrite")).done.catch(function(r){e||t||(Qt(h.loggerProvider,"".concat(St,": ").concat(r),r),h.recordFailure())}),s=tr(n.done,er,function(){e||t||(t=!0,Qt(h.loggerProvider,"".concat(St,": transaction timed out")),h.recordFailure())}),[4,n.store.openCursor()];case 2:o=c.sent(),c.label=3;case 3:return o?(i=o.value,a=i.sessionId,0!==(l=i.events).length?[3,5]:(this.maybeLogEmptyFiltered("getSequencesToSend"),[4,o.delete()])):[3,8];case 4:return c.sent(),[3,6];case 5:r.push({events:l,sequenceId:o.key,sessionId:a}),c.label=6;case 6:return[4,o.continue()];case 7:return o=c.sent(),[3,3];case 8:return this.recordSuccess(),s(),[2,r];case 9:return u=c.sent(),t||(e=!0,Qt(this.loggerProvider,"".concat(St,": ").concat(u),u),this.recordFailure()),[3,10];case 10:return[2,void 0]}})})},n.storeCurrentSequence=function(e){return l(n,void 0,void 0,function(){var t,r,n,s,o,l,u,h,d=this;return c(this,function(c){switch(c.label){case 0:t=!1,r=!1,c.label=1;case 1:return c.trys.push([1,5,,6]),(n=this.db.transaction([Xt,Zt],"readwrite")).done.catch(function(e){t||r||(Qt(d.loggerProvider,"".concat(St,": ").concat(e),e),d.recordFailure())}),s=tr(n.done,er,function(){t||r||(r=!0,Qt(d.loggerProvider,"".concat(St,": transaction timed out")),d.recordFailure())}),[4,n.objectStore(Xt).get(e)];case 2:return!(o=c.sent())||o.tabId&&o.tabId!==this.tabId?(s(),[2,void 0]):0===o.events.length?(this.maybeLogEmptyFiltered("storeCurrentSequence"),s(),[2,void 0]):[4,n.objectStore(Zt).put({sessionId:e,events:o.events,tabId:this.tabId})];case 3:return l=c.sent(),[4,n.objectStore(Xt).put({sessionId:e,events:[],tabId:this.tabId})];case 4:return c.sent(),this.rememberSequenceContentBytes(e,[]),this.recordSuccess(),s(),o.tabId,u=a(o,["tabId"]),[2,i(i({},u),{sessionId:e,sequenceId:l})];case 5:return h=c.sent(),this.forgetSequenceContentBytes(e),r||(t=!0,Qt(this.loggerProvider,"".concat(St,": ").concat(h),h),this.recordFailure()),[3,6];case 6:return[2,void 0]}})})},n.addEventToCurrentSequence=function(e,t){return l(n,void 0,void 0,function(){var r,n,s,o,i,a,l,u,h,d,p,f,m,g,v=this;return c(this,function(c){switch(c.label){case 0:r=!1,n=!1,c.label=1;case 1:return c.trys.push([1,15,,16]),(s=this.db.transaction([Xt,Zt],"readwrite")).done.catch(function(e){r||n||(Qt(v.loggerProvider,"".concat(St,": ").concat(e),e),v.recordFailure())}),o=tr(s.done,er,function(){r||n||(n=!0,Qt(v.loggerProvider,"".concat(St,": transaction timed out")),v.recordFailure())}),[4,s.objectStore(Xt).get(e)];case 2:return(null==(i=c.sent())?void 0:i.tabId)&&i.tabId!==this.tabId?i.events.length>0?[4,s.objectStore(Zt).put({sessionId:e,events:i.events,tabId:i.tabId})]:[3,4]:[3,6];case 3:c.sent(),c.label=4;case 4:return a=[t],[4,s.objectStore(Xt).put({sessionId:e,events:a,tabId:this.tabId})];case 5:return c.sent(),this.rememberSequenceContentBytes(e,a),this.recordSuccess(),o(),[2,void 0];case 6:return(l=i)?[3,8]:(u=[t],[4,s.objectStore(Xt).put({sessionId:e,events:u,tabId:this.tabId})]);case 7:return c.sent(),this.rememberSequenceContentBytes(e,u),this.recordSuccess(),o(),[2,void 0];case 8:return this.recallSequenceContentBytes(e,l.events),this.shouldSplitEventsList(l.events,t)?[3,10]:(h=l.events.concat(t),[4,s.objectStore(Xt).put({sessionId:e,events:h,tabId:this.tabId})]);case 9:return c.sent(),this.rememberSequenceContentBytes(e,h),this.recordSuccess(),o(),[2,void 0];case 10:return 0!==(d=l.events).length?[3,12]:(this.maybeLogEmptyFiltered("addEventToCurrentSequence"),p=[t],[4,s.objectStore(Xt).put({sessionId:e,events:p,tabId:this.tabId})]);case 11:return c.sent(),this.rememberSequenceContentBytes(e,p),this.recordSuccess(),o(),[2,void 0];case 12:return f=[t],[4,s.objectStore(Xt).put({sessionId:e,events:f,tabId:this.tabId})];case 13:return c.sent(),this.rememberSequenceContentBytes(e,f),[4,s.objectStore(Zt).put({sessionId:e,events:d,tabId:this.tabId})];case 14:return m=c.sent(),this.recordSuccess(),o(),[2,{events:d,sessionId:e,sequenceId:m}];case 15:return g=c.sent(),this.forgetSequenceContentBytes(e),n||(r=!0,Qt(this.loggerProvider,"".concat(St,": ").concat(g),g),this.recordFailure()),[3,16];case 16:return[2,void 0]}})})},n.storeSendingEvents=function(e,t){return l(n,void 0,void 0,function(){var r,n;return c(this,function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),[4,this.db.put(Zt,{sessionId:e,events:t,tabId:this.tabId})];case 1:return r=s.sent(),this.recordSuccess(),[2,r];case 2:return n=s.sent(),Qt(this.loggerProvider,"".concat(St,": ").concat(n),n),this.recordFailure(),[3,3];case 3:return[2,void 0]}})})},n.cleanUpSessionEventsStore=function(e,t){return l(n,void 0,void 0,function(){var e;return c(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(Zt,t)];case 2:return r.sent(),this.recordSuccess(),[3,4];case 3:return e=r.sent(),Qt(this.loggerProvider,"".concat(St,": ").concat(e),e),this.recordFailure(),[3,4];case 4:return[2]}})})},n.db=t.db,n.tabId=t.tabId,n.onPersistentFailure=t.onPersistentFailure,n.consecutiveFailureThreshold=null!==(r=t.consecutiveFailureThreshold)&&void 0!==r?r:1,n}return n(t,e),t.prototype.maybeLogEmptyFiltered=function(e){this.emptyFilteredCount++%100==0&&this.loggerProvider.debug("Filtered empty session replay sequence at ".concat(e," (idb store)"))},t.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))},t.prototype.recordSuccess=function(){this.consecutiveFailures=0},t.new=function(e,r){var n;return l(this,void 0,void 0,function(){var s,o,a,l,u;return c(this,function(c){switch(c.label){case 0:return c.trys.push([0,2,,3]),s="replay"===e?"":"_".concat(e),o="".concat(r.apiKey.substring(0,10),"_amp_session_replay_events").concat(s),[4,ir(o)];case 1:return a=c.sent(),l=null!==(n=r.tabId)&&void 0!==n?n: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 t(i(i({},r),{db:a,tabId:l}))];case 2:return u=c.sent(),Qt(r.loggerProvider,"".concat(St,": ").concat(u),u),[3,3];case 3:return[2]}})})},t.prototype.getCurrentSequenceEvents=function(e){return l(this,void 0,void 0,function(){var t,r,n,s,o,i,l,h;return c(this,function(c){switch(c.label){case 0:return e?[4,this.db.get("sessionCurrentSequence",e)]:[3,2];case 1:return(s=c.sent())?s.tabId&&s.tabId!==this.tabId?[2,void 0]:(s.tabId,[2,[o=a(s,["tabId"])]]):[2,void 0];case 2:t=[],c.label=3;case 3:return c.trys.push([3,8,9,10]),[4,this.db.getAll("sessionCurrentSequence")];case 4:r=u.apply(void 0,[c.sent()]),n=r.next(),c.label=5;case 5:if(n.done)return[3,7];if((s=n.value).tabId&&s.tabId!==this.tabId)return[3,6];s.tabId,o=a(s,["tabId"]),t.push(o),c.label=6;case 6:return n=r.next(),[3,5];case 7:return[3,10];case 8:return i=c.sent(),l={error:i},[3,10];case 9:try{n&&!n.done&&(h=r.return)&&h.call(r)}finally{if(l)throw l.error}return[7];case 10:return[2,t]}})})},t}(Yt),lr=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 n(t,e),t.prototype.resetCurrentSequence=function(e){this.sequences[e]=[]},t.prototype.addSequence=function(e){var t=this.sequenceId++,r=d([],h(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 l(this,void 0,void 0,function(){var e,t,r,n,s,o,i,a,l,d;return c(this,function(c){e=[];try{for(t=u(Object.entries(this.finalizedSequences)),r=t.next();!r.done;r=t.next())n=h(r.value,2),s=n[0],o=n[1],i=o.sessionId,0!==(a=o.events).length?e.push({sequenceId:Number(s),sessionId:i,events:a}):(this.maybeLogEmptyFiltered("getSequencesToSend"),delete this.finalizedSequences[Number(s)])}catch(e){l={error:e}}finally{try{r&&!r.done&&(d=t.return)&&d.call(t)}finally{if(l)throw l.error}}return[2,e]})})},t.prototype.storeCurrentSequence=function(e){return l(this,void 0,void 0,function(){var t;return c(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 l(this,void 0,void 0,function(){var r;return c(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 l(this,void 0,void 0,function(){return c(this,function(r){return this.finalizedSequences[this.sequenceId]={sessionId:e,events:t},[2,this.sequenceId++]})})},t.prototype.cleanUpSessionEventsStore=function(e,t){return l(this,void 0,void 0,function(){return c(this,function(e){return void 0!==t&&delete this.finalizedSequences[t],[2]})})},t}(Yt),cr=function(e){var t=e.config,r=e.minInterval,n=e.maxInterval,s=e.maxPersistedEventsSize,o=e.type,a=e.payloadBatcher,u=e.storeType,p=e.trackDestinationWorkerScript,f=e.shouldSend;return l(void 0,void 0,void 0,function(){function e(e){return void 0===e&&(e=!1),l(this,void 0,void 0,function(){return c(this,function(t){return[2,g.flush(e)]})})}var m,g,v,y,w,b,S,C,x,k,I,O,E,M,R,P,A;return c(this,function(T){switch(T.label){case 0:return m=null!==(A=t.maxSingleEventSizeBytes)&&void 0!==A?A:Ie,g=new It(i(i({},t),{loggerProvider:t.loggerProvider,payloadBatcher:a,workerScript:p})),v=function(){return new lr({loggerProvider:t.loggerProvider,maxInterval:n,minInterval:r,maxPersistedEventsSize:s})},w=!1,S=function(){return l(void 0,void 0,void 0,function(){var e,r,n;return c(this,function(s){switch(s.label){case 0:return w?(w=!1,t.loggerProvider.warn("IDB store is experiencing repeated failures; falling back to in-memory event store."),y?[4,b.getSequencesToSend()]:[3,2]):[2];case 1:return r=s.sent(),[3,3];case 2:r=void 0,s.label=3;case 3:return e=r,b=v(),e&&y&&(n=y,e.forEach(function(e){E({sequenceId:e.sequenceId,events:e.events,sessionId:e.sessionId,deviceId:n})})),[2]}})})},C=function(){return l(void 0,void 0,void 0,function(){var e;return c(this,function(i){switch(i.label){case 0:return[4,ar.new(o,{loggerProvider:t.loggerProvider,minInterval:r,maxInterval:n,maxPersistedEventsSize:s,apiKey:t.apiKey,onPersistentFailure:function(){S()}})];case 1:return(e=i.sent())?(w=!0,[2,e]):(t.loggerProvider.log("Failed to initialize idb store, falling back to memory store."),[2,v()])}})})},"idb"!==u?[3,2]:[4,C()];case 1:return x=T.sent(),[3,3];case 2:x=v(),T.label=3;case 3:return b=x,k=[],I=0,O=function(e){if(!(e<=I)){var t=Math.min(e-I,k.length);t>0&&(k.splice(0,t),I=e)}},E=function(e){for(var r=e.events,n=e.sessionId,s=e.deviceId,i=e.sequenceId,a=r,u=[],h=0;h<r.length;h++){var d=ft(r[h],m);void 0!==d?(0===u.length&&(a=r.slice(0,h)),u.push(d)):a!==r&&a.push(r[h])}u.length>0&&t.loggerProvider.warn("Dropping ".concat(u.length," oversized event(s) from session replay sequence before send. Sizes: ").concat(u.map(function(e){return"".concat(Math.round(e/1024)," KB")}).join(", "),". If this recurs, please open a GitHub issue at https://github.com/amplitude/Amplitude-TypeScript/issues or contact Amplitude support.")),0!==a.length?(t.debugMode&&Ge().then(function(e){var r=e.totalStorageSize,n=e.percentOfQuota,s=e.usageDetails;t.loggerProvider.debug("Total storage size: ".concat(r," KB, percentage of quota: ").concat(n,"%, usage details: ").concat(s))}).catch(function(){}),g.sendEventsList({events:a,sessionId:n,flushMaxRetries:t.flushMaxRetries,apiKey:t.apiKey,deviceId:s,sampleRate:t.sampleRate,serverZone:t.serverZone,version:t.version,type:o,onComplete:function(){return l(void 0,void 0,void 0,function(){return c(this,function(e){switch(e.label){case 0:return[4,b.cleanUpSessionEventsStore(n,i)];case 1:return e.sent(),[2]}})})}})):b.cleanUpSessionEventsStore(n,i).catch(function(e){t.loggerProvider.warn("Failed to clean up session replay events store:",e)})},M=function(e){var r=e.sessionId,n=e.deviceId;if(y=n,!f||f()){var s=I+k.length;b.storeCurrentSequence(r).then(function(e){e&&(O(s),E({sequenceId:e.sequenceId,events:e.events,sessionId:e.sessionId,deviceId:n}))}).catch(function(e){t.loggerProvider.warn("Failed to get current sequence of session replay events for session:",e)})}},R=function(e){var r=e.deviceId;return l(void 0,void 0,void 0,function(){var e;return c(this,function(n){switch(n.label){case 0:return y=r,[4,b.getSequencesToSend()];case 1:return(null==(e=n.sent())?void 0:e.length)?(t.loggerProvider.log("Draining ".concat(e.length," stored sequence(s) from previous session.")),e.length>1&&g.markCoalesceNextFlush(),e.forEach(function(e){E({sequenceId:e.sequenceId,events:e.events,sessionId:e.sessionId,deviceId:r})}),[2]):[2]}})})},P=function(e){var r=e.event,n=e.sessionId,s=e.deviceId;y=s;var o=!f||f(),i=I+k.length;k.push(r.data),b.addEventToCurrentSequence(n,r.data).then(function(e){if(e){if(!o)return b.cleanUpSessionEventsStore(e.sessionId,e.sequenceId).catch(function(e){t.loggerProvider.warn("Failed to clean up dropped session replay sequence:",e)}),void O(i);O(i),E({sequenceId:e.sequenceId,events:e.events,sessionId:e.sessionId,deviceId:s})}}).catch(function(e){t.loggerProvider.warn("Failed to add event to session replay capture:",e)})},[2,{sendCurrentSequenceEvents:M,addEvent:P,sendStoredEvents:R,flush:e,getBeaconEvents:function(){return d([],h(k),!1)},dropPendingBeaconEvents:function(){O(I+k.length)},trackDestination:g}]}})})},ur=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 l(this,void 0,void 0,function(){var t;return c(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,s=e.deviceId;null===(t=this.managers.get(n.type))||void 0===t||t.addEvent({sessionId:r,event:n,deviceId:s})},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 l(this,void 0,void 0,function(){var t;return c(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 hr(e,t){if(sr=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 r={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};rr=i(i({},r),t),nr=function(e,t){if(e.nodeType===Node.DOCUMENT_NODE)return e;if(e===t.root)return e.ownerDocument;return e}(rr.root,r);var n=dr(e,"all",function(){return dr(e,"two",function(){return dr(e,"one",function(){return dr(e,"none")})})});if(n){var s=Cr(xr(n,e));return s.length>0&&(n=s[0]),fr(n)}throw new Error("Selector was not found.")}function dr(e,t,r){for(var n=null,s=[],o=e,i=0,a=function(){var e,a,l=(new Date).getTime()-sr.getTime();if(void 0!==rr.timeoutMs&&l>rr.timeoutMs)throw new Error("Timeout: Can't find a unique selector after ".concat(l,"ms"));var c=wr(function(e){var t=e.getAttribute("id");if(t&&rr.idName(t))return{name:"#"+CSS.escape(t),penalty:0};return null}(o))||wr.apply(void 0,d([],h(function(e){var t=Array.from(e.attributes).filter(function(e){return rr.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))||wr.apply(void 0,d([],h(function(e){var t=Array.from(e.classList).filter(rr.className);return t.map(function(e){return{name:"."+CSS.escape(e),penalty:1}})}(o)),!1))||wr(function(e){var t=e.tagName.toLowerCase();if(rr.tagName(t))return{name:t,penalty:2};return null}(o))||[{name:"*",penalty:3}],p=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)p&&(c=c.concat(c.filter(yr).map(function(e){return vr(e,p)})));else if("two"==t)c=c.slice(0,1),p&&(c=c.concat(c.filter(yr).map(function(e){return vr(e,p)})));else if("one"==t){var f=h(c=c.slice(0,1),1)[0];p&&yr(f)&&(c=[vr(f,p)])}else"none"==t&&(c=[{name:"*",penalty:3}],p&&(c=[vr(c[0],p)]));try{for(var m=(e=void 0,u(c)),g=m.next();!g.done;g=m.next()){(f=g.value).level=i}}catch(t){e={error:t}}finally{try{g&&!g.done&&(a=m.return)&&a.call(m)}finally{if(e)throw e.error}}if(s.push(c),s.length>=rr.seedMinLength&&(n=pr(s,r)))return"break";o=o.parentElement,i++};o;){if("break"===a())break}return n||(n=pr(s,r)),!n&&r?r():n}function pr(e,t){var r,n,s=Cr(Sr(e));if(s.length>rr.threshold)return t?t():null;try{for(var o=u(s),i=o.next();!i.done;i=o.next()){var a=i.value;if(gr(a))return a}}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return null}function fr(e){for(var t=e[0],r=t.name,n=1;n<e.length;n++){var s=e[n].level||0;r=t.level===s-1?"".concat(e[n].name," > ").concat(r):"".concat(e[n].name," ").concat(r),t=e[n]}return r}function mr(e){return e.map(function(e){return e.penalty}).reduce(function(e,t){return e+t},0)}function gr(e){var t=fr(e);switch(nr.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 vr(e,t){return{name:e.name+":nth-child(".concat(t,")"),penalty:e.penalty+1}}function yr(e){return"html"!==e.name&&!e.name.startsWith("#")}function wr(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e.filter(br);return r.length>0?r:null}function br(e){return null!=e}function Sr(e,t){var r,n,s,o,i,a;return void 0===t&&(t=[]),c(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=u(e[0]),n=r.next(),l.label=2;case 2:return n.done?[3,5]:(s=n.value,[5,u(Sr(e.slice(1,e.length),t.concat(s)))]);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(),i={error:o},[3,8];case 7:try{n&&!n.done&&(a=r.return)&&a.call(r)}finally{if(i)throw i.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 Cr(e){return d([],h(e),!1).sort(function(e,t){return mr(e)-mr(t)})}function xr(e,t,r){var n,s,o;return void 0===r&&(r={counter:0,visited:new Map}),c(this,function(i){switch(i.label){case 0:if(!(e.length>2&&e.length>rr.optimizedMinLength))return[3,5];n=1,i.label=1;case 1:return n<e.length-1?r.counter>rr.maxNumberOfTries?[2]:(r.counter+=1,(s=d([],h(e),!1)).splice(n,1),o=fr(s),r.visited.has(o)?[2]:gr(s)&&function(e,t){return nr.querySelector(fr(e))===t}(s,t)?[4,s]:[3,4]):[3,5];case 2:return i.sent(),r.visited.set(o,!0),[5,u(xr(s,t,r))];case 3:i.sent(),i.label=4;case 4:return n++,[3,1];case 5:return[2]}})}var kr=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}},Ir=function(e){var t=e.version,r=e.events,n=[];r.forEach(function(e){var t=JSON.parse(e);"click"===t.type&&n.push(t)});var s=n.reduce(function(e,t){var r=t.x,n=t.y,s=t.selector,o=t.timestamp,a=o-o%36e5,l="".concat(r,":").concat(n,":").concat(null!=s?s:"",":").concat(a);return e[l]?e[l].count+=1:e[l]=i(i({},t),{timestamp:a,count:1}),e},{});return{version:t,events:Object.values(s)}},Or=function(e,t){var r=this;this.createHook=function(e){var t=e.eventsManager,n=e.sessionId,s=e.deviceIdFn,o=e.mirror,i=e.ugcFilterRules,a=e.performanceOptions;return function(e){if(e.type===nt.Click){var l=g();if(l){var c=l.location,u=l.innerHeight,h=l.innerWidth;if(c){var d=e.x,p=e.y;if(void 0!==d&&void 0!==p){var f,m=o.getNode(e.id);if(m)try{f=hr(m,a)}catch(e){r.logger.debug("error resolving selector from finder")}var v=Ve(c.href,i),y={x:d+r.scrollWatcher.currentScrollX,y:p+r.scrollWatcher.currentScrollY,selector:f,viewportHeight:u,viewportWidth:h,pageUrl:v,timestamp:Date.now(),type:"click"},w=s();w&&t.addEvent({sessionId:n,event:{type:"interaction",data:JSON.stringify(y)},deviceId:w})}}}}}},this.logger=e,this.scrollWatcher=t};function Er(){var e=g();return(null==e?void 0:e.innerHeight)||document.documentElement&&document.documentElement.clientHeight||0}function Mr(){var e=g();return(null==e?void 0:e.innerWidth)||document.documentElement&&document.documentElement.clientWidth||0}var Rr=function(){function e(e,t){var r=g();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=qe(t.serverZone,t.trackServerUrl),this.apiKey=t.apiKey,this.context=e,this.handleSendEvents=t.handleSendEvents,this.loggerProvider=t.loggerProvider}return e.prototype.send=function(e,t){var r,n=this,s=this.context,o=s.sessionId,i=s.type;if(this.handleSendEvents){var a=new URLSearchParams({device_id:e,session_id:String(o),type:String(i)}),l="".concat(this.basePageUrl,"?").concat(a.toString()),c={"Content-Type":"application/json",Accept:"*/*",Authorization:"Bearer ".concat(this.apiKey)};try{this.handleSendEvents({url:l,method:"POST",headers:c,body:JSON.stringify(t),keepalive:!0}).catch(function(e){var t;null===(t=n.loggerProvider)||void 0===t||t.warn("Custom transport failed to send session replay interaction beacon:",e)})}catch(e){null===(r=this.loggerProvider)||void 0===r||r.warn("Custom transport threw while sending session replay interaction beacon:",e)}}else{var u=new URLSearchParams({device_id:e,session_id:String(o),type:String(i),api_key:this.apiKey}),h="".concat(this.basePageUrl,"?").concat(u.toString());this.sendBeacon(h,t)||this.sendXhr(h,t)}},e}(),Pr=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,s,o,i,a=e(),l=g();if(l&&a){var c=null!==(n=l.scrollX)&&void 0!==n?n:0,u=null!==(s=l.scrollY)&&void 0!==s?s:0;(c>0||u>0)&&r.update({id:1,x:c,y:u}),r.transport.send(a,{version:1,events:[{maxScrollX:r._maxScrollX,maxScrollY:r._maxScrollY,maxScrollWidth:r._maxScrollWidth,maxScrollHeight:r._maxScrollHeight,viewportHeight:Er(),viewportWidth:Mr(),pageUrl:Ve(l.location.href,null!==(i=null===(o=r.config.interactionConfig)||void 0===o?void 0:o.ugcFilterRules)&&void 0!==i?i:[]),timestamp:r.timestamp,type:"scroll"}]})}}},this._maxScrollX=0,this._maxScrollY=0,this._currentScrollX=0,this._currentScrollY=0,this._maxScrollWidth=Mr(),this._maxScrollHeight=Er(),this.config=t,this.transport=e}return e.default=function(t,r){return new e(new Rr(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=Mr();this._maxScrollX=e.x;var n=e.x+r;n>this._maxScrollWidth&&(this._maxScrollWidth=n),this.timestamp=t}if(e.y>this._maxScrollY){var s=Er();this._maxScrollY=e.y;var o=e.y+s;o>this._maxScrollHeight&&(this._maxScrollHeight=o),this.timestamp=t}},e}(),Ar=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))},Tr=864e5,Nr=function(e){return"".concat("AMP_SR_START_").concat(e.substring(0,10),"_")},Lr=function(e,t){return"".concat(Nr(e)).concat(t)},Fr=function(){try{var e=g();return null==e?void 0:e.localStorage}catch(e){return}},_r=function(){var e=this;this.dbs={},this.createStore=function(t){return l(e,void 0,void 0,function(){return c(this,function(e){switch(e.label){case 0:return[4,Bt(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 l(e,void 0,void 0,function(){var e,r;return c(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,s=t.sessionId;return l(e,void 0,void 0,function(){var e,t,o,i;return c(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(s),[4,e.get("sessionTargetingMatch",t)];case 2:return[2,null==(o=a.sent())?void 0:o.targetingMatch];case 3:return i=a.sent(),Qt(r,"Failed to get targeting match for session id ".concat(s,": ").concat(i),i),[3,4];case 4:return[2,void 0]}})})},this.storeTargetingMatchForSession=function(t){var r=t.loggerProvider,n=t.apiKey,s=t.sessionId,o=t.targetingMatch;return l(e,void 0,void 0,function(){var e,t,i;return c(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(s),[4,e.put("sessionTargetingMatch",{targetingMatch:o,sessionId:t,lastUpdated:Date.now()})];case 2:return[2,a.sent()];case 3:return i=a.sent(),Qt(r,"Failed to store targeting match for session id ".concat(s,": ").concat(i),i),[3,4];case 4:return[2,void 0]}})})},this.clearStoreOfOldSessions=function(t){var r=t.loggerProvider,n=t.apiKey,s=t.currentSessionId;return l(e,void 0,void 0,function(){var e,t,o,i,a,l,u,h;return c(this,function(c){switch(c.label){case 0:return c.trys.push([0,8,,9]),[4,this.openOrCreateDB(n)];case 1:return e=c.sent(),t=String(s),[4,(o=e.transaction("sessionTargetingMatch","readwrite")).store.getAll()];case 2:i=c.sent(),a=0,c.label=3;case 3:return a<i.length?(l=i[a],u=Date.now()-l.lastUpdated,l.sessionId!==t&&u>1728e5?[4,o.store.delete(l.sessionId)]:[3,5]):[3,6];case 4:c.sent(),c.label=5;case 5:return a++,[3,3];case 6:return[4,o.done];case 7:return c.sent(),[3,9];case 8:return h=c.sent(),Qt(r,"Failed to clear old targeting matches for sessions: ".concat(h),h),[3,9];case 9:return[2]}})})}},Dr=new _r,Br=function(e){var t=e.sessionId,r=e.targetingConfig,n=e.loggerProvider,s=e.apiKey,o=e.targetingParams,a=e.urlChange,u=void 0!==a&&a;return l(void 0,void 0,void 0,function(){var e,a,l,h,d,p;return c(this,function(c){switch(c.label){case 0:return[4,Dr.clearStoreOfOldSessions({loggerProvider:n,apiKey:s,currentSessionId:t})];case 1:return c.sent(),[4,Dr.getTargetingMatchForSession({loggerProvider:n,apiKey:s,sessionId:t})];case 2:if(!0===c.sent()&&!u)return[2,!0];e=!0,c.label=3;case 3:return c.trys.push([3,6,,7]),[4,Promise.resolve().then(function(){return ls})];case 4:return a=c.sent().evaluateTargeting,l=i(i({},o),{flag:r,sessionId:"string"==typeof t?parseInt(t,10):t,apiKey:s,loggerProvider:n}),[4,a(l)];case 5:return(h=c.sent())&&h.sr_targeting_config&&(e="on"===h.sr_targeting_config.key),Dr.storeTargetingMatchForSession({loggerProvider:n,apiKey:s,sessionId:t,targetingMatch:e}),[3,7];case 6:return d=c.sent(),p=d,n.warn(p.message),[3,7];case 7:return[2,e]}})})},Ur=2654435761,jr=2246822519,zr=3266489917,Wr=374761393;function qr(e,t){return(e<<t|e>>>32-t)>>>0}function $r(e,t){return e=qr(e=e+Math.imul(t,jr)>>>0,13),e=Math.imul(e,Ur)>>>0}function Vr(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function Gr(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 s=e.charCodeAt(r+1);s>=56320&&s<=57343&&(n=s-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),s=n.length,o=0;if(s>=16){for(var i=t+Ur+jr>>>0,a=t+jr>>>0,l=t>>>0,c=t-Ur>>>0;o<=s-16;)i=$r(i,Vr(n,o)),a=$r(a,Vr(n,o+=4)),l=$r(l,Vr(n,o+=4)),c=$r(c,Vr(n,o+=4)),o+=4;r=qr(i,1)+qr(a,7)+qr(l,12)+qr(c,18)>>>0}else r=t+Wr>>>0;for(r=r+s>>>0;o<=s-4;)r=r+Math.imul(Vr(n,o),zr)>>>0,r=Math.imul(qr(r,17),668265263)>>>0,o+=4;for(;o<s;)r=r+Math.imul(n[o],Wr)>>>0,r=Math.imul(qr(r,11),Ur)>>>0,o++;return r^=r>>>15,r=Math.imul(r,jr)>>>0,r^=r>>>13,r=Math.imul(r,zr)>>>0,(r^=r>>>16)>>>0}var Hr="__amplitude_url_tracking_patched__",Jr=new WeakMap;function Kr(e,t,r){if(void 0===r&&(r={}),!(null==e?void 0:e.location))return function(){};var n=r.enablePolling,s=void 0!==n&&n,o=r.pollingInterval,i=void 0===o?be:o;if(s){var a=function(){var t;return null!==(t=e.location.href)&&void 0!==t?t:""},l=a(),c=e.setInterval(function(){var e=a();e!==l&&(l=e,t(e))},i);return function(){null!=c&&e.clearInterval(c)}}var u=Jr.get(e);if(!u){var h=void 0,d=new Set,p=function(){var t=function(){var t;return null!==(t=e.location.href)&&void 0!==t?t:""}();void 0!==h&&t===h||(h=t,d.forEach(function(e){return e(t)}))},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[Hr]=!0,t},m=e.history;if(null==m?void 0:m.pushState){var g=Reflect.get(m,"pushState");g[Hr]||(m.pushState=f(g))}if(null==m?void 0:m.replaceState){var v=Reflect.get(m,"replaceState");v[Hr]||(m.replaceState=f(v))}u={callbacks:d,notify:p,onPopStateOrHashChange:function(){return p()},listenersAttached:!1},Jr.set(e,u)}var y=u;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 Yr(e){return void 0===e&&(e={}),{name:"amplitude/url-tracking@1",observer:function(t,r,n){var s,o,a,l=i(i({},e),n),c=l.ugcFilterRules||[],u=null!==(s=l.enablePolling)&&void 0!==s&&s,h=null!==(o=l.pollingInterval)&&void 0!==o?o:be,d=null!==(a=l.captureDocumentTitle)&&void 0!==a&&a;if(!r)return function(){};var p=void 0,f=function(){return r.location&&r.location.href||""},m=function(){var e=f();if(void 0===p||e!==p){p=e;var n=function(){var e=r.innerHeight,t=r.innerWidth,n=r.document,s=f(),o="";return d&&(o=(null==n?void 0:n.title)||""),{href:c.length>0?Ve(s,c):s,title:o,viewportHeight:e,viewportWidth:t,type:"url-change-event"}}();t(n)}},g=Kr(r,function(){return m()},u?{enablePolling:!0,pollingInterval:h}:{});return m(),function(){return g()}},options:e}}Yr();var Qr=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(),g()&&(this.sendToAllIframes({type:Ae,action:"start"}),this.mutationObserver=new MutationObserver(function(e){var r,n,s,o,i,a;try{for(var l=u(e),c=l.next();!c.done;c=l.next()){var h=c.value;try{for(var d=(s=void 0,u(Array.from(h.addedNodes))),p=d.next();!p.done;p=d.next()){(g=p.value)instanceof HTMLIFrameElement?t.sendToIframeAfterLoad(g):g instanceof Element&&g.querySelectorAll("iframe").forEach(function(e){t.sendToIframeAfterLoad(e)})}}catch(e){s={error:e}}finally{try{p&&!p.done&&(o=d.return)&&o.call(d)}finally{if(s)throw s.error}}try{for(var f=(i=void 0,u(Array.from(h.removedNodes))),m=f.next();!m.done;m=f.next()){var g;if((g=m.value)instanceof HTMLIFrameElement){var v=t.pendingLoadListeners.get(g);v&&(g.removeEventListener("load",v),t.pendingLoadListeners.delete(g))}}}catch(e){i={error:e}}finally{try{m&&!m.done&&(a=f.return)&&a.call(f)}finally{if(i)throw i.error}}}}catch(e){r={error:e}}finally{try{c&&!c.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:Ae,action:"stop"})},e.prototype.sendToIframeAfterLoad=function(e){var t=this,r=function(){t.pendingLoadListeners.delete(e),t.sendToIframe(e,{type:Ae,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 Xr,Zr,en,tn=function(){function e(){this.focusLeftWindow=!1}return e.prototype.noteBlur=function(){var e=this;this.focusLeftWindow=!1,this.cancelFocusDestinationCheck();var t=g();this.scheduleFocusInspect(t,function(){var r,n=null===(r=null==t?void 0:t.document)||void 0===r?void 0:r.activeElement;"IFRAME"!==(null==n?void 0:n.tagName)?(e.releaseFocusedFrame(),e.focusLeftWindow=!0):e.watchFocusedFrame(n)})},e.prototype.onDocumentHidden=function(){this.releaseFocusedFrame()},e.prototype.onDocumentVisible=function(){this.focusLeftWindow=!1,this.cancelFocusDestinationCheck(),this.releaseFocusedFrame()},e.prototype.consumeArrivedFromOutside=function(){var e,t,r=this.focusLeftWindow&&"visible"===(null===(t=null===(e=g())||void 0===e?void 0:e.document)||void 0===t?void 0:t.visibilityState);return this.focusLeftWindow=!1,this.releaseFocusedFrame(),r},e.prototype.stop=function(){this.focusLeftWindow=!1,this.cancelFocusDestinationCheck(),this.releaseFocusedFrame()},e.prototype.noteFrameBlur=function(){var e=this;this.cancelFocusDestinationCheck();var t=g();this.scheduleFocusInspect(t,function(){var r,n=null===(r=null==t?void 0:t.document)||void 0===r?void 0:r.activeElement,s=null==t?void 0:t.document;if("function"==typeof(null==s?void 0:s.hasFocus)&&s.hasFocus()||"IFRAME"!==(null==n?void 0:n.tagName))e.releaseFocusedFrame();else{var o=e.focusHolder(n);o?e.watchFocusedFrame(o):e.focusLeftWindow=!0}})},e.prototype.focusHolder=function(e,t){if(null==t?void 0:t.has(e))return e;var r,n=null!=t?t:new Set;n.add(e);try{r=e.contentDocument}catch(t){return e}if(null==r)return e;if("function"==typeof r.hasFocus&&r.hasFocus())return e;var s=r.activeElement;return"IFRAME"===(null==s?void 0:s.tagName)?this.focusHolder(s,n):void 0},e.prototype.watchFocusedFrame=function(e){var t,r=this;this.releaseFocusedFrame();var n=function(){r.noteFrameBlur()};try{if(null==(t=e.contentWindow)||"function"!=typeof t.addEventListener)return;t.addEventListener("blur",n)}catch(e){return}this.focusedFrameWindow=t,this.focusedFrameBlur=n},e.prototype.releaseFocusedFrame=function(){var e=this.focusedFrameWindow,t=this.focusedFrameBlur;if(this.focusedFrameWindow=void 0,this.focusedFrameBlur=void 0,void 0!==e)try{e.removeEventListener("blur",t)}catch(e){}},e.prototype.scheduleFocusInspect=function(e,t){var r=this,n=function(){r.focusDestinationFrame=void 0;try{t()}catch(e){r.releaseFocusedFrame()}};"function"!=typeof(null==e?void 0:e.requestAnimationFrame)?n():this.focusDestinationFrame=e.requestAnimationFrame(n)},e.prototype.cancelFocusDestinationCheck=function(){if(void 0!==this.focusDestinationFrame){var e=g();"function"==typeof(null==e?void 0:e.cancelAnimationFrame)&&e.cancelAnimationFrame(this.focusDestinationFrame),this.focusDestinationFrame=void 0}},e}(),rn=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.recordingEnabled=!0,this.recordingGeneration=0,this.startChildRecordingOnSetup=!1,this.pendingEmitEvents=[],this.windowFocus=new tn,this.currentPageUrl="",this.recordEventsPendingShouldLogMetadata=null,this.urlChangeCleanup=null,this.crossOriginIframeCoordinator=null,this.crossOriginParentSignalCleanup=null,this.latestUrlChangeTargetingEvaluationId=0,this.teardownEventListeners=function(t){var r=g();if(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));var n=r.document;(null==n?void 0:n.addEventListener)&&n.removeEventListener&&(n.removeEventListener("visibilitychange",e.visibilityListener),!t&&n.addEventListener("visibilitychange",e.visibilityListener))}},this.blurListener=function(){e.scheduleHiddenSend(),e.windowFocus.noteBlur()},this.visibilityListener=function(){var t,r,n=null===(r=null===(t=g())||void 0===t?void 0:t.document)||void 0===r?void 0:r.visibilityState;if("hidden"===n)return e.windowFocus.onDocumentHidden(),void e.scheduleHiddenSend();"visible"===n&&(e.windowFocus.onDocumentVisible(),e.cancelHiddenSend(),e.captureVisibleTab())},this.focusListener=function(){var t;if(e.recordingEnabled)if(e.windowFocus.consumeArrivedFromOutside())e.captureVisibleTab();else if(e.recordCancelCallback&&e.recordFunction){if(!1===(null===(t=e.config)||void 0===t?void 0:t.captureFullSnapshotOnFocus))return;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){e.cancelHiddenSend(),e.flushPendingReplayEvents(),e.pageLeaveFns.forEach(function(e){e(t)})},this.evaluateTargetingAndCapture=function(t,r,n,s){return void 0===r&&(r=!1),void 0===n&&(n=!1),void 0===s&&(s=!1),l(e,void 0,void 0,function(){var e,i,a,l,u,h,d,p,f,m,v,y;return c(this,function(c){switch(c.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?(i=s?this.latestUrlChangeTargetingEvaluationId:void 0,(a=t.event)&&Object.values(o).includes(a.event_type)&&(a=void 0),l=null!==(v=null!==(p=null===(d=t.page)||void 0===d?void 0:d.url)&&void 0!==p?p:null===(m=null===(f=g())||void 0===f?void 0:f.location)||void 0===m?void 0:m.href)&&void 0!==v?v:"",u=null!==(y=t.page)&&void 0!==y?y:""!==l?{url:l}:void 0,[4,Br({sessionId:this.identifiers.sessionId,targetingConfig:e,loggerProvider:this.loggerProvider,apiKey:this.config.apiKey,targetingParams:{userProperties:t.userProperties,event:a,page:u},urlChange:s})]):[3,2];case 1:if(h=c.sent(),s&&void 0!==i&&i!==this.latestUrlChangeTargetingEvaluationId)return this.loggerProvider.debug("Ignoring stale URL-change targeting result #".concat(i,"; latest is #").concat(this.latestUrlChangeTargetingEvaluationId,".")),[2];this.sessionTargetingMatch=this.sessionTargetingMatch||h,this.loggerProvider.debug(JSON.stringify({name:"targeted replay capture config",sessionTargetingMatch:this.sessionTargetingMatch,event:a,targetingParams:t},null,2)),c.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:c.sent(),c.label=5;case 5:return[2]}})})},this.addCustomRRWebEvent=function(t,r,n){return void 0===r&&(r={}),void 0===n&&(n=!0),l(e,void 0,void 0,function(){var e,s,o,a;return c(this,function(l){switch(l.label){case 0:return l.trys.push([0,3,,4]),e=void 0,(s=this.config)&&t!==me.METADATA?(e={config:He(s),version:xt},n?[4,Ge()]:[3,2]):[3,2];case 1:o=l.sent(),e=i(i({},o),e),l.label=2;case 2:return this.recordCancelCallback&&this.recordFunction?this.recordFunction.addCustomEvent(t,i(i({},r),e)):this.loggerProvider.debug("Not able to add custom replay capture event ".concat(t," 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.useSemanticAdapter(function(e){return e.stop()}),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 s=t;e.loggerProvider.warn("Error occurred while stopping replay capture: ".concat(s.toString()))}},this.loggerProvider=new Te(new R)}return e.prototype.init=function(e,t){return E(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=g();if(null==n?void 0:n.location){var s=!!(null===(t=this.config)||void 0===t?void 0:t.targetingConfig),o=Kr(n,function(e){if(r.currentPageUrl=e,s){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=g())||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,t){var r,n,s,o,a,p,f,m,v,y,w,b,S,C;return l(this,void 0,void 0,function(){var l,x,k,I,O,E,M,P,A,T,N,L,F,_,D,B,U,j,z,W,q,$,V,G,H,J,K,Y,Q,X,Z,ee=this;return c(this,function(c){switch(c.label){case 0:return null===(r=this.urlChangeCleanup)||void 0===r||r.call(this),this.useSemanticAdapter(function(e){return e.stop()}),this.semanticAdapter=void 0,this.recordingEnabled=!0,this.startChildRecordingOnSetup=!1,this.loggerProvider=new Te(t.loggerProvider||new R),Object.prototype.hasOwnProperty.call(t,"logLevel")&&this.loggerProvider.enable(t.logLevel),this.currentPageUrl=$e(),this.identifiers=new Ar({sessionId:t.sessionId,deviceId:t.deviceId}),l=Date.now(),function(e,t,r){var n,s,o=Fr();if(o){var i=Nr(e);try{for(var a=[],l=0;l<o.length;l++)if((f=o.key(l))&&f.startsWith(i)){var c=o.getItem(f);if(null!==c){var h=Number(c);(!Number.isFinite(h)||h<=0||t-h>=Tr)&&a.push(f)}}try{for(var d=u(a),p=d.next();!p.done;p=d.next()){var f=p.value;o.removeItem(f)}}catch(e){n={error:e}}finally{try{p&&!p.done&&(s=d.return)&&s.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,l,this.loggerProvider),this.sessionStartTime=void 0!==t.sessionId&&null!==(n=function(e,t,r,n){var s=Fr();if(s){var o=Lr(e,t);try{var i=s.getItem(o);if(null!==i){var a=Number(i);if(Number.isFinite(a)&&a>0&&a<=r&&r-a<Tr)return a}return s.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,t.sessionId,l,this.loggerProvider))&&void 0!==n?n:l,x=this,[4,ht(e,t)];case 1:return x.joinedConfigGenerator=c.sent(),[4,this.joinedConfigGenerator.generateJoinedConfig()];case 2:return k=c.sent(),I=k.joinedConfig,O=k.localConfig,E=k.remoteConfig,this.config=I,this.setMetadata(t.sessionId,I,O,E,null===(s=t.version)||void 0===s?void 0:s.version,xt,null===(o=t.version)||void 0===o?void 0:o.type),this.pageLeaveFns=[],t.sessionId&&(null===(a=this.config.interactionConfig)||void 0===a?void 0:a.enabled)&&(M=Pr.default({sessionId:t.sessionId,type:"interaction"},this.config),this.pageLeaveFns=[M.send(this.getDeviceId.bind(this)).bind(M)],this.scrollHook=M.hook.bind(M),this.clickHandler=new Or(this.loggerProvider,M)),P=[],"idb"!==(A=this.config.storeType)||(null===(p=g())||void 0===p?void 0:p.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.")),L=g(),this.config.useWebWorker&&L&&L.Worker?[4,Promise.resolve().then(function(){return cs})]:[3,4];case 3:F=c.sent(),_=F.compressionScript,D=F.trackDestinationScript,T=_,N=D,c.label=4;case 4:return c.trys.push([4,6,,7]),[4,cr({config:this.config,type:"replay",minInterval:null===(f=this.config.flushIntervalConfig)||void 0===f?void 0:f.minIntervalMs,maxInterval:null===(m=this.config.flushIntervalConfig)||void 0===m?void 0:m.maxIntervalMs,maxPersistedEventsSize:this.config.maxPersistedEventsSizeBytes,storeType:A,trackDestinationWorkerScript:N,shouldSend:function(){return!ee.isBelowMinSessionDuration()}})];case 5:return B=c.sent(),this.rrwebEventManager=B,P.push({name:"replay",manager:B}),[3,7];case 6:return U=c.sent(),q=U,this.loggerProvider.warn("Error occurred while creating replay events manager: ".concat(q.toString())),[3,7];case 7:if(!(null===(v=this.config.interactionConfig)||void 0===v?void 0:v.enabled))return[3,11];j=this.config.interactionConfig.batch?Ir:kr,c.label=8;case 8:return c.trys.push([8,10,,11]),[4,cr({config:this.config,type:"interaction",minInterval:null!==(y=this.config.interactionConfig.trackEveryNms)&&void 0!==y?y:3e4,maxInterval:6e4,maxPersistedEventsSize:this.config.maxPersistedEventsSizeBytes,payloadBatcher:j,storeType:A,trackDestinationWorkerScript:N})];case 9:return z=c.sent(),P.push({name:"interaction",manager:z}),[3,11];case 10:return W=c.sent(),q=W,this.loggerProvider.warn("Error occurred while creating interaction events manager: ".concat(q.toString())),[3,11];case 11:if(this.eventsManager=new(ur.bind.apply(ur,d([void 0],h(P),!1))),this.eventCompressor&&this.eventCompressor.terminate(),$=!0===this.config.eagerFullSnapshotSend?function(){return ee.sendEvents()}:void 0,this.eventCompressor=new wt(this.eventsManager,this.config,this.getDeviceId(),T,$),this.pendingEmitEvents.length>0){V=this.pendingEmitEvents.splice(0);try{for(G=u(V),H=G.next();!H.done;H=G.next())J=H.value,K=J.event,Y=J.sessionId,this.eventCompressor.enqueueEvent(K,Y)}catch(e){X={error:e}}finally{try{H&&!H.done&&(Z=G.return)&&Z.call(G)}finally{if(X)throw X.error}}}return this.pageLeaveFns=d(d([],h(this.pageLeaveFns),!1),[function(){var e;if(ee.config&&(null===(e=ee.identifiers)||void 0===e?void 0:e.sessionId)&&B){var t=B.getBeaconEvents();if(t.length){var r=ee.getDeviceId();r&&(ee.isBelowMinSessionDuration()||B.trackDestination.sendBeacon({events:t,sessionId:ee.identifiers.sessionId,deviceId:r,apiKey:ee.config.apiKey,serverZone:ee.config.serverZone}))}}}],!1),[4,this.initializeNetworkObservers()];case 12:return c.sent(),(null===(w=g())||void 0===w?void 0:w.opener)&&(fe(Q=he()),Q.setup(i({logger:this.loggerProvider},this.config.serverZone&&{endpoint:ae[this.config.serverZone]}))),this.loggerProvider.log("Installing @amplitude/session-replay-browser."),this.teardownEventListeners(!1),[4,this.evaluateTargetingAndCapture({userProperties:t.userProperties,page:this.getCurrentPageForTargeting()},!0)];case 13:return c.sent(),(this.config.targetingConfig||(null!==(C=null===(S=null===(b=this.config.privacyConfig)||void 0===b?void 0:b.urlMaskLevels)||void 0===S?void 0:S.length)&&void 0!==C?C:0)>0)&&this.setupUrlChangeListener(),[2]}})})},e.prototype.setSessionId=function(e,t){return E(this.asyncSetSessionId(e,t))},e.prototype.asyncSetSessionId=function(e,t,r){var n,s,o,i,a,u;return l(this,void 0,void 0,function(){var l,h,d,p,f;return c(this,function(c){switch(c.label){case 0:return l=null===(n=this.identifiers)||void 0===n?void 0:n.sessionId,h=this.getDeviceId(),void 0===l||l!==e||void 0!==t&&t!==h||void 0!==(null==r?void 0:r.userProperties)&&0!==Object.keys(r.userProperties).length?(this.latestUrlChangeTargetingEvaluationId++,this.sessionTargetingMatch=!1,this.lastShouldRecordDecision=void 0,l&&this.sendEvents(l),(d=l!==e)&&(null===(o=null===(s=this.config)||void 0===s?void 0:s.semanticCapture)||void 0===o?void 0:o.enabled)&&this.semanticAdapter&&this.useSemanticAdapter(function(e){return e.stop()}),d&&(null===(i=this.rrwebEventManager)||void 0===i||i.dropPendingBeaconEvents()),p=t||this.getDeviceId(),this.identifiers=new Ar({sessionId:e,deviceId:p}),d&&(this.sessionStartTime=Date.now(),this.suppressedSendCount=0,this.hasEmittedGateDecision=!1,(null===(a=this.config)||void 0===a?void 0:a.apiKey)&&(function(e,t,r,n){var s=Fr();if(s)try{s.setItem(Lr(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!==l&&function(e,t,r){var n=Fr();if(n)try{n.removeItem(Lr(e,t))}catch(e){null==r||r.debug("Failed to remove replay start time from storage: ".concat(String(e)))}}(this.config.apiKey,l,this.loggerProvider))),this.joinedConfigGenerator&&l?[4,this.joinedConfigGenerator.generateJoinedConfig()]:[3,2]):[2];case 1:f=c.sent().joinedConfig,this.config=f,c.label=2;case 2:return(null===(u=this.config)||void 0===u?void 0:u.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(),s={};return n&&((e={})[ve]=r.sessionReplayId?r.sessionReplayId:null,s=e,t.debugMode&&(s[Se]=JSON.stringify({appHash:$(t.apiKey).toString()}))),this.addCustomRRWebEvent(me.GET_SR_PROPS,{shouldRecord:n,eventProperties:s},10===this.eventCount),10===this.eventCount&&(this.eventCount=0),this.eventCount++,s},e.prototype.flushPendingReplayEvents=function(){var e;null===(e=this.eventCompressor)||void 0===e||e.flushQueue(),this.sendEvents()},e.prototype.scheduleHiddenSend=function(){var e,t=this;if(null===(e=this.eventCompressor)||void 0===e||e.flushQueue(),void 0===this.hiddenFlushTimer){var r=this.hostSetTimeout();this.hiddenFlushTimer=r(function(){t.hiddenFlushTimer=void 0,t.sendEvents()},0)}},e.prototype.cancelHiddenSend=function(){void 0!==this.hiddenFlushTimer&&(this.hostClearTimeout()(this.hiddenFlushTimer),this.hiddenFlushTimer=void 0)},e.prototype.hostSetTimeout=function(){var e=g();return"function"==typeof(null==e?void 0:e.setTimeout)?e.setTimeout.bind(e):setTimeout},e.prototype.hostClearTimeout=function(){var e=g();return"function"==typeof(null==e?void 0:e.clearTimeout)?e.clearTimeout.bind(e):clearTimeout},e.prototype.captureVisibleTab=function(){var e;if(this.recordingEnabled)if(null===(e=this.eventCompressor)||void 0===e||e.flushQueue(),this.recordCancelCallback&&this.recordFunction){try{this.recordFunction.takeFullSnapshot(!0)}catch(e){this.loggerProvider.warn("Failed to take full snapshot when the tab became visible:",e)}this.sendEvents()}else this.recordEventsInFlight||this.recordEvents(!1)},e.prototype.sendEvents=function(e){var t,r,n=e||(null===(t=this.identifiers)||void 0===t?void 0:t.sessionId),s=this.getDeviceId();if(this.eventsManager&&n&&s){if(this.isBelowMinSessionDuration()){var o=this.sessionStartTime,i=this.config.minSessionDurationMs;return this.loggerProvider.log("Session ".concat(n," not sent: duration ").concat(Date.now()-o,"ms is below minimum ").concat(i,"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(me.REPLAY_GATE_DECISION,{sessionId:n,suppressedSendCount:this.suppressedSendCount,elapsedMs:a,minSessionDurationMs:this.config.minSessionDurationMs},!1)}this.eventsManager.sendCurrentSequenceEvents({sessionId:n,deviceId:s})}},e.prototype.initialize=function(e){var t;return void 0===e&&(e=!1),l(this,void 0,void 0,function(){var r;return c(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=q(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.recordingEnabled)return this.loggerProvider.log("Session ".concat(this.identifiers.sessionId," not being captured because recording was stopped.")),!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="",s=!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,s=!0):(n="Not capturing replays for session ".concat(this.identifiers.sessionId," due to not matching targeting conditions."),this.loggerProvider.log(n),r=!1,s=!1):(e=this.identifiers.sessionId,t=this.config.sampleRate,Gr(e.toString())%1e6/1e6<t)?(r=!0,s=!0):(n="Opting session ".concat(this.identifiers.sessionId," out of recording due to sample rate."),this.loggerProvider.log(n),r=!1,s=!1);return this.lastShouldRecordDecision!==r&&this.config.targetingConfig&&(this.addCustomRRWebEvent(me.TARGETING_DECISION,{message:n,sessionId:this.identifiers.sessionId,matched:s,targetingParams:this.lastTargetingParams}),this.lastShouldRecordDecision=r),r},e.prototype.getBlockSelectors=function(){var e;return ze(null===(e=this.config)||void 0===e?void 0:e.privacyConfig)},e.prototype.getMaskTextSelectors=function(){var e;return We(null===(e=this.config)||void 0===e?void 0:e.privacyConfig,this.currentPageUrl)},e.prototype.getRecordingPlugins=function(e){var t,r,n,s,o,i;return l(this,void 0,void 0,function(){var a,l,u,h;return c(this,function(c){switch(c.label){case 0:a=[];try{l=Yr({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===(s=this.config)||void 0===s?void 0:s.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===(i=null==e?void 0:e.console)||void 0===i?void 0:i.enabled))return[3,4];c.label=1;case 1:return c.trys.push([1,3,,4]),[4,Promise.resolve().then(function(){return kl})];case 2:return u=c.sent().getRecordConsolePlugin,a.push(u({level:e.console.levels})),[3,4];case 3:return h=c.sent(),this.loggerProvider.warn("Failed to load console plugin:",h),[3,4];case 4:return[2,a.length>0?a:void 0]}})})},e.prototype.getRecordFunction=function(){return l(this,void 0,void 0,function(){var e,t;return c(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(function(){return Cf})];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),l(this,void 0,void 0,function(){var t;return c(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.shouldAbandonRecordStart=function(e){return!this.recordingEnabled||e!==this.recordingGeneration},e.prototype._recordEvents=function(e){var t,r,n,s,o,a,u,h;return void 0===e&&(e=!0),l(this,void 0,void 0,function(){var l,d,p,f,m,v,y,w,b,S,C,x,k,I,O,E,M,R=this;return c(this,function(c){switch(c.label){case 0:return l=this.config,d=this.getShouldRecord(),p=null===(t=this.identifiers)||void 0===t?void 0:t.sessionId,d&&p&&l?(this.stopRecordingEvents(),f=this.recordingGeneration,[4,this.getRecordFunction()]):(this.semanticAdapter&&this.recordCancelCallback&&this.stopRecordingEvents(),[2]);case 1:return!(m=c.sent())||this.shouldAbandonRecordStart(f)?[2]:[4,this.initializeNetworkObservers()];case 2:if(c.sent(),this.shouldAbandonRecordStart(f))return[2];v=null===(r=l.loggingConfig)||void 0===r?void 0:r.network,y=qe(l.serverZone,l.trackServerUrl),w=[Ce,xe,ke,y],null===(n=this.networkObservers)||void 0===n||n.start(function(e){w.some(function(t){return e.url.startsWith(t)})||R.addCustomRRWebEvent(me.FETCH_REQUEST,e)},v),b=l.interactionConfig,S=l.loggingConfig,C=(null==b?void 0:b.enabled)?{mouseInteraction:this.eventsManager&&(null===(s=this.clickHandler)||void 0===s?void 0:s.createHook({eventsManager:this.eventsManager,sessionId:p,deviceIdFn:this.getDeviceId.bind(this),mirror:m.mirror,ugcFilterRules:null!==(o=b.ugcFilterRules)&&void 0!==o?o:[],performanceOptions:null===(a=l.performanceConfig)||void 0===a?void 0:a.interaction})),scroll:this.scrollHook}:{},x=(null==b?void 0:b.enabled)&&b.ugcFilterRules?b.ugcFilterRules:[],this.loggerProvider.log("Session Replay capture beginning for ".concat(p,".")),c.label=3;case 3:return c.trys.push([3,5,,6]),k=!!(null===(u=l.crossOriginIframes)||void 0===u?void 0:u.enabled),I=!1!==(null===(h=l.crossOriginIframes)||void 0===h?void 0:h.coordinateChildren),(O=k&&function(){try{var e=g();return!!e&&e.parent!==e}catch(e){return!0}}())&&I?(this.crossOriginParentSignalCleanup=function(e){var t=g();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)===Ae&&("start"===n.action?e.onStart():"stop"===n.action&&e.onStop())}}return t.addEventListener("message",n),function(){return t.removeEventListener("message",n)}}({onStart:function(){R.recordingEnabled&&R._recordEventsInChildMode(m,p,l,C)},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()))}}}),this.startChildRecordingOnSetup&&(this.startChildRecordingOnSetup=!1,this._recordEventsInChildMode(m,p,l,C)),[2]):(this.startChildRecordingOnSetup=!1,[4,this.getRecordingPlugins(S)]);case 4:return E=c.sent(),this.shouldAbandonRecordStart(f)?[2]:(this.prepareSemanticCapture(l,p),this.recordCancelCallback=m(i(i({},this.buildRRWebRecordOptions(l,C,function(e){if(R.shouldOptOut()||!R.recordingEnabled)return R.loggerProvider.log(R.shouldOptOut()?"Opting session ".concat(p," out of recording due to optOut config."):"Session Replay capture stopping for ".concat(p,".")),R.stopRecordingEvents(),void R.sendEvents();e.type===tt.Meta&&(e.data.href=Ve(e.data.href,x)),R.eventCompressor?R.eventCompressor.enqueueEvent(e,p):R.pendingEmitEvents.push({event:e,sessionId:p}),R.useSemanticAdapter(function(t){return t.event(e)})},"Error while capturing replay: ")),{plugins:E,recordCrossOriginIframes:k})),this.recordCancelCallback&&this.useSemanticAdapter(function(e){return e.recordingReady()}),k&&!O&&I&&(this.crossOriginIframeCoordinator||(this.crossOriginIframeCoordinator=new Qr),this.crossOriginIframeCoordinator.start()),this.addCustomRRWebEvent(me.DEBUG_INFO),e&&this.addCustomRRWebEvent(me.METADATA,this.metadata),[3,6]);case 5:return M=c.sent(),this.useSemanticAdapter(function(e){return e.stop()}),this.loggerProvider.warn("Failed to initialize session replay:",M),[3,6];case 6:return[2]}})})},e.prototype.useSemanticAdapter=function(e){var t=this.semanticAdapter;if(t)try{e(t)}catch(e){this.semanticAdapter=void 0,this.loggerProvider.debug("Semantic capture failed:",e);try{t.stop()}catch(e){this.loggerProvider.debug("Semantic capture stop failed:",e)}}},e.prototype.prepareSemanticCapture=function(e,t){var r,n=this,s=g();if(null==s?void 0:s.document){var o=e.semanticCapture,a=null==o?void 0:o.createCapture;if(!(null==o?void 0:o.enabled)||"function"!=typeof a)return this.useSemanticAdapter(function(e){return e.stop()}),void this.useSemanticAdapter(function(e){return e.prepare({enabled:!1},t)});if((null===(r=this.semanticAdapter)||void 0===r?void 0:r.createCapture)!==a){this.useSemanticAdapter(function(e){return e.stop()}),this.semanticAdapter=void 0;try{this.semanticAdapter=new st(a,{document:s.document,window:s,sdk:"@amplitude/session-replay-browser@".concat(xt),getPrivacy:function(){var e,t;return null!==(t=null===(e=n.config)||void 0===e?void 0:e.privacyConfig)&&void 0!==t?t:{}},getIdentity:function(){return function(e){var t=e.document,r=it.get(t);if(r)return r;var n=Object.freeze({tab_id:y(),document_id:y()}),s=n;if(e.top===e)try{var o=e.sessionStorage,a=function(){var e;try{var t=JSON.parse(null!==(e=o.getItem(ot))&&void 0!==e?e:"null");if(t&&at.test(t.tab_id)&&(null===t.owner||"string"==typeof t.owner))return t}catch(e){}},l=a();null===(null==l?void 0:l.owner)&&(s=Object.freeze(i(i({},s),{tab_id:l.tab_id})));var c=function(e){try{o.setItem(ot,JSON.stringify({tab_id:s.tab_id,owner:e}))}catch(e){}};o.setItem(ot,JSON.stringify({tab_id:s.tab_id,owner:s.document_id})),e.addEventListener("pagehide",function(){var e;(null===(e=a())||void 0===e?void 0:e.owner)===s.document_id&&c(null)}),e.addEventListener("pageshow",function(e){e.persisted&&c(s.document_id)})}catch(e){s=n}return it.set(t,s),s}(s)},getAnalyticsContext:function(){var e,t;return null!==(t=null===(e=n.config)||void 0===e?void 0:e.semanticAnalyticsContext)&&void 0!==t?t:{present:!1,autocapture:[]}},inlineStylesheet:e.shouldInlineStylesheet,emit:function(e){if(n.recordCancelCallback&&n.recordFunction)try{n.recordFunction.addCustomEvent("amp-semantic/".concat(e.name),e.payload)}catch(e){n.loggerProvider.debug("Error while adding semantic replay capture event:",e)}},onError:function(e){return n.loggerProvider.debug("Semantic capture error:",e)}})}catch(e){return void this.loggerProvider.debug("Semantic capture initialization failed:",e)}}this.useSemanticAdapter(function(e){return e.prepare(o,t)})}},e.prototype.buildRRWebRecordOptions=function(e,t,r,n){var s=this,o=e.privacyConfig;return i(i(i(i({emit:r,inlineStylesheet:e.shouldInlineStylesheet,inlineImages:e.inlineImages,hooks:t},function(e,t){return void 0===t&&(t=function(){return""}),{maskAllInputs:!0,maskTextClass:"amp-mask",blockClass:"amp-block",blockSelector:ze(e),maskTextSelector:We(e,t()),maskInputFn:Ue("input",e,t),maskTextFn:Ue("text",e,t),maskAttributeFn:je(e,t)}}(o,function(){return s.currentPageUrl})),{applyBackgroundColorToBlockedElements:e.applyBackgroundColorToBlockedElements}),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 s.loggerProvider.warn(n,t.toString()),!0}})},e.prototype._recordEventsInChildMode=function(e,t,r,n){try{this.recordCancelCallback&&this.recordCancelCallback(),this.recordCancelCallback=null,this.recordCancelCallback=e(i(i({},this.buildRRWebRecordOptions(r,n,function(){},"Error while capturing replay (child iframe): ")),{recordCrossOriginIframes:!0})),this.loggerProvider.log("Session Replay child iframe capture beginning for session ".concat(t,"."))}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.start=function(){return E(this._start())},e.prototype._start=function(){return l(this,void 0,void 0,function(){return c(this,function(e){switch(e.label){case 0:return this.recordingEnabled=!0,this.startChildRecordingOnSetup=!0,[4,this.recordEvents()];case 1:return e.sent(),[2]}})})},e.prototype.stop=function(){this.recordingEnabled=!1,this.startChildRecordingOnSetup=!1,this.recordingGeneration++,this.cancelHiddenSend(),this.windowFocus.stop(),this.stopRecordingEvents(),this.sendEvents()},e.prototype.flush=function(e){var t;return void 0===e&&(e=!1),l(this,void 0,void 0,function(){return c(this,function(r){return[2,null===(t=this.eventsManager)||void 0===t?void 0:t.flush(e)]})})},e.prototype.shutdown=function(){var e,t;this.recordingEnabled=!1,this.startChildRecordingOnSetup=!1,this.recordingGeneration++,this.cancelHiddenSend(),this.windowFocus.stop(),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,s,o,i){var a=(null==e?void 0:e.toString())?$(e.toString()):void 0;this.metadata={joinedConfig:t,localConfig:r,remoteConfig:n,sessionId:e,hashValue:a,sampleRate:t.sampleRate,replaySDKType:this.mapSDKType(i),replaySDKVersion:s,standaloneSDKType:"@amplitude/session-replay-browser",standaloneSDKVersion:o}},e.prototype.initializeNetworkObservers=function(){var e,t,r;return l(this,void 0,void 0,function(){var n,s;return c(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(function(){return Mf})];case 2:return n=o.sent().NetworkObservers,this.networkObservers=new n,[3,4];case 3:return s=o.sent(),this.loggerProvider.warn("Failed to import or instantiate NetworkObservers:",s),[3,4];case 4:return[2]}})})},e}(),nn=function(e){return function(){var t=e.config||Je();return{logger:t.loggerProvider,logLevel:t.logLevel}}},sn=function(){var e=new rn;return{init:F(e.init.bind(e),"init",nn(e)),evaluateTargetingAndCapture:F(e.evaluateTargetingAndCapture.bind(e),"evaluateTargetingAndRecord",nn(e)),setSessionId:F(e.setSessionId.bind(e),"setSessionId",nn(e)),getSessionId:F(e.getSessionId.bind(e),"getSessionId",nn(e)),getSessionReplayProperties:F(e.getSessionReplayProperties.bind(e),"getSessionReplayProperties",nn(e)),flush:F(e.flush.bind(e),"flush",nn(e)),start:F(e.start.bind(e),"start",nn(e)),stop:F(e.stop.bind(e),"stop",nn(e)),shutdown:F(e.shutdown.bind(e),"shutdown",nn(e))}}(),on=sn.init,an=sn.setSessionId,ln=sn.getSessionId,cn=sn.getSessionReplayProperties,un=sn.flush,hn=sn.start,dn=sn.stop,pn=sn.shutdown,fn=sn.evaluateTargetingAndCapture;!function(e){e.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"}(Xr||(Xr={})),function(e){e.REVENUE_PRODUCT_ID="$productId",e.REVENUE_QUANTITY="$quantity",e.REVENUE_PRICE="$price",e.REVENUE_TYPE="$revenueType",e.REVENUE_CURRENCY="$currency",e.REVENUE="$revenue"}(Zr||(Zr={})),function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"}(en||(en={}));const mn=[Xr.SET,Xr.SET_ONCE,Xr.ADD,Xr.APPEND,Xr.PREPEND,Xr.POSTINSERT];function gn(e,t){if("boolean"==typeof e)return e;const r=e&&"object"==typeof e?e[t]:void 0;return!1!==r&&(!function(){var e,t,r=g();return"string"==typeof(null===(t=null===(e=null==r?void 0:r.chrome)||void 0===e?void 0:e.runtime)||void 0===t?void 0:t.id)}()||Boolean(r))}function vn(e){return!0===e||"object"==typeof e&&null!==e}function yn(e,t=e){const r=[],n=["attribution","fileDownloads","formInteractions","pageViews","sessions"];for(const e of n)gn(t,e)&&r.push(e);if(gn(e,"pageUrlEnrichment")&&r.push("pageUrlEnrichment"),!0===e)r.push("networkTracking","elementInteractions","webVitals","frustrationInteractions");else if(e&&"object"==typeof e){vn(e.networkTracking)&&r.push("networkTracking"),vn(e.elementInteractions)&&r.push("elementInteractions"),vn(e.webVitals)&&r.push("webVitals"),vn(e.performanceTracking)&&r.push("performanceTracking");const t=e.frustrationInteractions;(!0===t||t&&"object"==typeof t&&(!1!==t.deadClicks&&null!==t.deadClicks||Boolean(t.errorClicks)))&&r.push("frustrationInteractions")}return r}const wn="1.37.0";class bn{constructor(e){this.name=bn.pluginName,this.type="enrichment",this.config=null,this.sessionReplay={flush:un,getSessionId:ln,getSessionReplayProperties:cn,init:on,setSessionId:an,start:hn,stop:dn,shutdown:pn,evaluateTargetingAndCapture:fn},this.options=Object.assign({forceSessionTracking:!1},e),this.srInitOptions=this.options}setup(e,t){var r,n,s,o,i,a,c,u,h;return l(this,void 0,void 0,function*(){try{null==e||e.loggerProvider.log(`Installing @amplitude/plugin-session-replay, version ${wn}.`),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=Object.assign(Object.assign({},e.defaultTracking),{sessions:!0}));const t=q(this.config.instanceName).identityStore.getIdentity().userProperties;this.srInitOptions={instanceName:this.config.instanceName,deviceId:null!==(r=this.options.deviceId)&&void 0!==r?r: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===(n=this.config.remoteConfig)||void 0===n?void 0:n.serverUrl),trackServerUrl:this.options.trackServerUrl,sampleRate:this.options.sampleRate,semanticCapture:this.options.semanticCapture,semanticAnalyticsContext:{present:!0,autocapture:yn(this.config.autocapture,this.config.defaultTracking)},privacyConfig:{blockSelector:null===(s=this.options.privacyConfig)||void 0===s?void 0:s.blockSelector,maskAttributes:null===(o=this.options.privacyConfig)||void 0===o?void 0:o.maskAttributes,maskSelector:null===(i=this.options.privacyConfig)||void 0===i?void 0:i.maskSelector,unmaskSelector:null===(a=this.options.privacyConfig)||void 0===a?void 0:a.unmaskSelector,defaultMaskLevel:null===(c=this.options.privacyConfig)||void 0===c?void 0:c.defaultMaskLevel},debugMode:this.options.debugMode,shouldInlineStylesheet:this.options.shouldInlineStylesheet,inlineImages:this.options.inlineImages,version:{type:"plugin",version:wn},performanceConfig:this.options.performanceConfig,storeType:this.options.storeType,useWebWorker:null!==(u=this.options.useWebWorker)&&void 0!==u?u:null===(h=this.options.experimental)||void 0===h?void 0:h.useWebWorker,userProperties:t,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,eagerFullSnapshotSend:this.options.eagerFullSnapshotSend,captureFullSnapshotOnFocus:this.options.captureFullSnapshotOnFocus,maxPersistedEventsSizeBytes:this.options.maxPersistedEventsSizeBytes,maxSingleEventSizeBytes:this.options.maxSingleEventSizeBytes,sendTimeoutMs:this.options.sendTimeoutMs,handleSendEvents:this.options.handleSendEvents,handleFetchConfig:this.options.handleFetchConfig},yield this.sessionReplay.init(e.apiKey,this.srInitOptions).promise}catch(t){null==e||e.loggerProvider.error(`Session Replay: Failed to initialize due to ${t.message}`)}})}onSessionIdChanged(e){var t;return l(this,void 0,void 0,function*(){null===(t=this.config)||void 0===t||t.loggerProvider.debug(`Analytics session id is changed to ${e}, SR session id is ${String(this.sessionReplay.getSessionId())}.`),yield this.sessionReplay.setSessionId(e).promise})}onOptOutChanged(e){var t;return l(this,void 0,void 0,function*(){null===(t=this.config)||void 0===t||t.loggerProvider.debug(`optOut is changed to ${String(e)}, calling ${e?"sessionReplay.shutdown()":"sessionReplay.init()"}.`),e?this.sessionReplay.shutdown():null!=this.config&&(yield this.sessionReplay.init(this.config.apiKey,this.srInitOptions).promise)})}execute(e){var t,r,n;return l(this,void 0,void 0,function*(){try{if(this.options.customSessionId){const t=this.options.customSessionId(e);if(t){t!==this.sessionReplay.getSessionId()&&(yield this.sessionReplay.setSessionId(t).promise);const r=this.sessionReplay.getSessionReplayProperties();e.event_properties=Object.assign(Object.assign({},e.event_properties),r)}}else{const n=null===(t=this.config)||void 0===t?void 0:t.sessionId;if(n&&n!==this.sessionReplay.getSessionId()&&(yield this.sessionReplay.setSessionId(n).promise),n&&n===e.session_id){let t;e.event_type===o.IDENTIFY&&(t=(e=>{if(!e.user_properties)return;let t={};return Object.keys(e.user_properties).forEach(r=>{if(mn.includes(r)){const n=e.user_properties&&e.user_properties[r];t=Object.assign(Object.assign({},t),n)}}),t})(e));const n=g();yield this.sessionReplay.evaluateTargetingAndCapture({event:e,userProperties:t,page:null!=(null===(r=null==n?void 0:n.location)||void 0===r?void 0:r.href)?{url:n.location.href}:void 0});const s=this.sessionReplay.getSessionReplayProperties();e.event_properties=Object.assign(Object.assign({},e.event_properties),s)}}return e.event_type===o.IDENTIFY&&e.event_properties&&delete e.event_properties["[Amplitude] Session Replay ID"],Promise.resolve(e)}catch(t){return null===(n=this.config)||void 0===n||n.loggerProvider.error(`Session Replay: Failed to enrich event due to ${t.message}`),Promise.resolve(e)}})}teardown(){var e;return l(this,void 0,void 0,function*(){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 ${t.message}`)}})}getSessionReplayProperties(){return this.sessionReplay.getSessionReplayProperties()}start(){return l(this,void 0,void 0,function*(){yield this.sessionReplay.start().promise})}stop(){this.sessionReplay.stop()}}bn.pluginName="@amplitude/plugin-session-replay-browser";const Sn=e=>new bn(e);var Cn=function(e,t){return Cn=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])},Cn(e,t)};var xn=function(){return xn=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},xn.apply(this,arguments)};function kn(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"==typeof SuppressedError&&SuppressedError;var In="is",On="is not",En="contains",Mn="does not contain",Rn="less",Pn="less or equal",An="greater",Tn="greater or equal",Nn="version less",Ln="version less or equal",Fn="version greater",_n="version greater or equal",Dn="set is",Bn="set is not",Un="set contains",jn="set does not contain",zn="set contains any",Wn="set does not contain any",qn="regex match",$n="regex does not match",Vn=-862048943,Gn=461845907,Hn=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 s=e.charCodeAt(n);s<128?t[r++]=s:s<2048?(t[r++]=s>>6|192,t[r++]=63&s|128):55296==(64512&s)&&n+1<e.length&&56320==(64512&e.charCodeAt(n+1))?(s=65536+((1023&s)<<10)+(1023&e.charCodeAt(++n)),t[r++]=s>>18|240,t[r++]=s>>12&63|128,t[r++]=s>>6&63|128,t[r++]=63&s|128):(t[r++]=s>>12|224,t[r++]=s>>6&63|128,t[r++]=63&s|128)}return Uint8Array.from(t)}(e),n=r.length,s=n>>2,o=t,i=0;i<s;i++){var a=Qn(r,i<<2);o=Jn(a,o)}var l=s<<2,c=0;switch(n-l){case 3:c^=r[l+2]<<16,c^=r[l+1]<<8,c^=r[l],c=Math.imul(c,Vn),c=Yn(c,15),o^=c=Math.imul(c,Gn);break;case 2:c^=r[l+1]<<8,c^=r[l],c=Math.imul(c,Vn),c=Yn(c,15),o^=c=Math.imul(c,Gn);break;case 1:c^=r[l],c=Math.imul(c,Vn),c=Yn(c,15),o^=c=Math.imul(c,Gn)}return Kn(o^=n)>>>0},Jn=function(e,t){var r=e,n=t;return r=Math.imul(r,Vn),r=Yn(r,15),r=Math.imul(r,Gn),n=Yn(n^=r,13),(n=Math.imul(n,5))+-430675100|0},Kn=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},Yn=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},Qn=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 Xn(r)},Xn=function(e){return(-16777216&e)>>>24|(16711680&e)>>>8|(65280&e)<<8|(255&e)<<24},Zn=function(e,t){var r,n;if(t&&0!==t.length){try{for(var s=kn(t),o=s.next();!o.done;o=s.next()){var i=o.value;if(!i||!e||"object"!=typeof e)return;e=e[i]}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return e||void 0}},es="^".concat("(\\d+)\\.(\\d+)","(\\.").concat("(\\d+)").concat("(-(([-\\w]+\\.?)*))?",")?$"),ts=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(es).exec(t);if(r){var n=Number(r[1]),s=Number(r[2]);if(!isNaN(n)&&!isNaN(s))return new e(n,s,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}(),rs=function(){function e(){}return e.prototype.evaluate=function(e,t){var r,n,s={},o={context:e,result:s};try{for(var i=kn(t),a=i.next();!a.done;a=i.next()){var l=a.value,c=this.evaluateFlag(o,l);c&&(s[l.key]=c)}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return s},e.prototype.evaluateFlag=function(e,t){var r,n,s;try{for(var o=kn(t.segments),i=o.next();!i.done;i=o.next()){var a=i.value;if(s=this.evaluateSegment(e,t,a)){var l=xn(xn(xn({},t.metadata),a.metadata),s.metadata);s=xn(xn({},s),{metadata:l});break}}}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return s},e.prototype.evaluateSegment=function(e,t,r){var n,s,o,i;if(!r.conditions)return void 0!==(c=this.bucket(e,r))?t.variants[c]:void 0;try{for(var a=kn(r.conditions),l=a.next();!l.done;l=a.next()){var c,u=l.value,h=!0;try{for(var d=(o=void 0,kn(u)),p=d.next();!p.done;p=d.next()){var f=p.value;if(!(h=this.matchCondition(e,f)))break}}catch(e){o={error:e}}finally{try{p&&!p.done&&(i=d.return)&&i.call(d)}finally{if(o)throw o.error}}if(h)return void 0!==(c=this.bucket(e,r))?t.variants[c]:void 0}}catch(e){n={error:e}}finally{try{l&&!l.done&&(s=a.return)&&s.call(a)}finally{if(n)throw n.error}}},e.prototype.matchCondition=function(e,t){var r=Zn(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 s=this.coerceString(r);return void 0!==s&&this.matchString(s,t.op,t.values)}return this.matchNull(t.op,t.values)},e.prototype.getHash=function(e){return Hn(e)},e.prototype.bucket=function(e,t){var r,n,s,o;if(!t.bucket)return t.variant;var i=this.coerceString(Zn(e,t.bucket.selector));if(!i||0===i.length)return t.variant;var a="".concat(t.bucket.salt,"/").concat(i),l=this.getHash(a),c=l%100,u=Math.floor(l/100);try{for(var h=kn(t.bucket.allocations),d=h.next();!d.done;d=h.next()){var p=d.value,f=p.range[0],m=p.range[1];if(c>=f&&c<m)try{for(var g=(s=void 0,kn(p.distributions)),v=g.next();!v.done;v=g.next()){var y=v.value,w=y.range[0],b=y.range[1];if(u>=w&&u<b)return y.variant}}catch(e){s={error:e}}finally{try{v&&!v.done&&(o=g.return)&&o.call(g)}finally{if(s)throw s.error}}}}catch(e){r={error:e}}finally{try{d&&!d.done&&(n=h.return)&&n.call(h)}finally{if(r)throw r.error}}return t.variant},e.prototype.matchNull=function(e,t){var r=this.containsNone(t);switch(e){case In:case En:case Rn:case Pn:case An:case Tn:case Nn:case Ln:case Fn:case _n:case Dn:case Un:case zn:return r;case On:case Mn:case jn:case Wn:return!r;default:return!1}},e.prototype.matchSet=function(e,t,r){switch(t){case Dn:return this.setEquals(e,r);case Bn:return!this.setEquals(e,r);case Un:return this.matchesSetContainsAll(e,r);case jn:return!this.matchesSetContainsAll(e,r);case zn:return this.matchesSetContainsAny(e,r);case Wn:return!this.matchesSetContainsAny(e,r);default:return!1}},e.prototype.matchString=function(e,t,r){var n=this;switch(t){case In:return this.matchesIs(e,r);case On:return!this.matchesIs(e,r);case En:return this.matchesContains(e,r);case Mn:return!this.matchesContains(e,r);case Rn:case Pn:case An:case Tn:return this.matchesComparable(e,t,r,function(e){return n.parseNumber(e)},this.comparator);case Nn:case Ln:case Fn:case _n:return this.matchesComparable(e,t,r,function(e){return ts.parse(e)},this.versionComparator);case qn:return this.matchesRegex(e,r);case $n: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 s=kn(t),o=s.next();!o.done;o=s.next()){var i=o.value;if(e.toLowerCase().includes(i.toLowerCase()))return!0}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return!1},e.prototype.matchesComparable=function(e,t,r,n,s){var o=this,i=n(e),a=r.map(function(e){return n(e)}).filter(function(e){return void 0!==e});return void 0===i||0===a.length?r.some(function(r){return o.comparator(e,t,r)}):a.some(function(e){return s(i,t,e)})},e.prototype.comparator=function(e,t,r){switch(t){case Rn:case Nn:return e<r;case Pn:case Ln:return e<=r;case An:case Fn:return e>r;case Tn:case _n:return e>=r;default:return!1}},e.prototype.versionComparator=function(e,t,r){var n=e.compareTo(r);switch(t){case Rn:case Nn:return n<0;case Pn:case Ln:return n<=0;case An:case Fn:return n>0;case Tn:case _n: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 Dn:case Bn:case Un:case jn:case zn:case Wn: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,s=0,o=t.length;s<o;s++)!n&&s in t||(n||(n=Array.prototype.slice.call(t,0,s)),n[s]=t[s]);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,s,o=r.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)i.push(n.value)}catch(e){s={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(s)throw s.error}}return i}(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 s=kn(t),o=s.next();!o.done;o=s.next()){var i=o.value;if(!this.matchesIs(i,e))return!1}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return!0},e.prototype.matchesSetContainsAny=function(e,t){var r,n;try{for(var s=kn(t),o=s.next();!o.done;o=s.next()){var i=o.value;if(this.matchesIs(i,e))return!0}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return!1},e}();"function"==typeof TextDecoder&&new TextDecoder,"function"==typeof TextEncoder&&new TextEncoder;(e=>{let t={};e.forEach((e,r)=>t[e]=r)})(Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=")),String.fromCharCode.bind(String),"function"==typeof Uint8Array.from&&Uint8Array.from.bind(Uint8Array),function(e){function t(r,n){var s=e.call(this,n)||this;return s.statusCode=r,Object.setPrototypeOf(s,t.prototype),s}(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}Cn(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})(t,e)}(Error);var ns,ss=function(){var e=this;this.dbs={},this.createStore=function(t){return l(e,void 0,void 0,function(){return c(this,function(e){switch(e.label){case 0:return[4,Bt(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 l(e,void 0,void 0,function(){var e,r;return c(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(t){var r=t.sessionId,n=t.eventType,s=t.eventTime,o=t.loggerProvider,a=t.tx;return l(e,void 0,void 0,function(){var e,t,l,u,h,d,p,f,m;return c(this,function(c){switch(c.label){case 0:return c.trys.push([0,3,,4]),e=String(r),[4,a.store.get(e)];case 1:return t=c.sent(),l=t?t.eventTypes:{},u=l[n]||{},h=i(i({},l),((f={})[n]=i(i({},u),((m={})[s]={event_type:n},m)),f)),d={sessionId:e,eventTypes:h,lastUpdated:Date.now()},[4,a.store.put(d)];case 2:return c.sent(),[2,h];case 3:return p=c.sent(),o.warn("Failed to store events for targeting ".concat(r,": ").concat(p)),[3,4];case 4:return[2,void 0]}})})},this.deleteOldSessionEventTypes=function(t){var r=t.currentSessionId,n=t.loggerProvider,s=t.tx;return l(e,void 0,void 0,function(){var e,t,o,i,a,l;return c(this,function(c){switch(c.label){case 0:return c.trys.push([0,6,,7]),e=String(r),[4,s.store.getAll()];case 1:t=c.sent(),o=0,c.label=2;case 2:return o<t.length?(i=t[o],a=Date.now()-i.lastUpdated,i.sessionId!==e&&a>1728e5?[4,s.store.delete(i.sessionId)]:[3,4]):[3,5];case 3:c.sent(),c.label=4;case 4:return o++,[3,2];case 5:return[3,7];case 6:return l=c.sent(),n.warn("Failed to clear old session event types for targeting: ".concat(l)),[3,7];case 7:return[2]}})})},this.storeEventTypeForSession=function(t){var r=t.loggerProvider,n=t.sessionId,s=t.eventType,o=t.eventTime,i=t.apiKey;return l(e,void 0,void 0,function(){var e,t,a,l;return c(this,function(c){switch(c.label){case 0:return c.trys.push([0,5,,6]),[4,this.openOrCreateDB(i)];case 1:return e=c.sent(),(t=e.transaction("eventTypesForSession","readwrite"))?[4,this.updateEventListForSession({sessionId:n,tx:t,loggerProvider:r,eventType:s,eventTime:o})]:[2];case 2:return a=c.sent(),[4,this.deleteOldSessionEventTypes({currentSessionId:n,tx:t,loggerProvider:r})];case 3:return c.sent(),[4,t.done];case 4:return c.sent(),[2,a];case 5:return l=c.sent(),r.warn("Failed to store events for targeting ".concat(n,": ").concat(l)),[3,6];case 6:return[2,void 0]}})})}},os=new ss,is=function(){var e=this;this.evaluateTargeting=function(t){var r=t.apiKey,n=t.loggerProvider,s=t.event,o=t.sessionId,a=t.userProperties,u=t.deviceId,h=t.page,d=t.flag;return l(e,void 0,void 0,function(){var e,t,l,p;return c(this,function(c){switch(c.label){case 0:return s&&s.time?[4,os.storeEventTypeForSession({loggerProvider:n,apiKey:r,sessionId:o,eventType:s.event_type,eventTime:s.time})]:[3,2];case 1:return t=c.sent(),[3,3];case 2:t=void 0,c.label=3;case 3:return l=(e=t)&&new Set(Object.keys(e)),p={session_id:o,event:s,event_types:l&&Array.from(l),user:i(i({},a),{device_id:u,user_properties:a}),page:h},[2,this.evaluationEngine.evaluate(p,[d])]}})})},this.evaluationEngine=new rs},as=function(){var e=new is;return{evaluateTargeting:e.evaluateTargeting.bind(e)}}().evaluateTargeting,ls=Object.freeze({__proto__:null,evaluateTargeting:as}),cs=Object.freeze({__proto__:null,compressionScript:'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',trackDestinationScript:'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,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function i(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(a,i)}u((n=n.apply(e,t||[])).next())})}function s(e,t){var r,n,s,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=i(0),a.throw=i(1),a.return=i(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function i(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,i[0]&&(o=0)),o;)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 o.label++,{value:i[1],done:!1};case 5:o.label++,n=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==i[0]&&2!==i[0])){o=0;continue}if(3===i[0]&&(!s||i[1]>s[0]&&i[1]<s[3])){o.label=i[1];break}if(6===i[0]&&o.label<s[1]){o.label=s[1],s=i;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(i);break}s[2]&&o.ops.pop(),o.trys.pop();continue}i=t.call(e,o)}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,u])}}}"function"==typeof SuppressedError&&SuppressedError,function(e){e.US="US",e.EU="EU",e.STAGING="STAGING"}(t||(t={})),t.US;var o,a=/payload.*exceed/i,i="X-Session-Replay-Event-Skipped";!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"}(o||(o={}));var u="Network error occurred, event batch rejected";function c(e,t){return n(this,void 0,void 0,function(){var r,o,a,i,u,c,l,d,p,f,v,h,y,b,g=this;return s(this,function(m){switch(m.label){case 0:return m.trys.push([0,4,,5]),r=t.CompressionStream,o=new r("gzip"),a=o.writable.getWriter(),i=o.readable.getReader(),u=[],c=n(g,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];u.push(r),n.label=2;case 2:return[3,0];case 3:return[2]}})}),[4,a.write((new TextEncoder).encode(e))];case 1:return m.sent(),[4,a.close()];case 2:return m.sent(),[4,c];case 3:m.sent(),l=u.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.")}(u),v=f.next();!v.done;v=f.next())h=v.value,d.set(h,p),p+=h.length}catch(e){y={error:e}}finally{try{v&&!v.done&&(b=f.return)&&b.call(f)}finally{if(y)throw y.error}}return[2,d];case 4:return m.sent(),[2,null];case 5:return[2]}})})}function l(e){for(var t=e.length,r=0;r<t&&!(e.charCodeAt(r)>127);r++);if(r===t)return t;for(var n=r;r<t;r++){var s=e.charCodeAt(r);if(s<=127)n++;else if(s<=2047)n+=2;else if(s>=55296&&s<=56319){var o=r+1<t?e.charCodeAt(r+1):NaN;o>=56320&&o<=57343?(n+=4,r++):n+=3}else n+=3}return n}var d=0,p=new Map,f=function(e,t){return fetch(e,t)},v=function(e,t){var r="".concat(++d);return new Promise(function(n,s){var o=t.signal,a=function(){p.delete(r);var e=new Error("Delegated session replay fetch aborted by send timeout");e.name="AbortError",s(e)};o.addEventListener("abort",a,{once:!0}),p.set(r,function(e){o.removeEventListener("abort",a),e.error?s(new Error(e.body)):n({status:e.status,headers:{get:function(t){return t===i?e.skipHeader:null}},text:function(){return Promise.resolve(e.body)}})}),postMessage({type:"fetch-request",requestId:r,url:e,method:"POST",headers:t.headers,body:t.body,keepalive:t.keepalive})})};function h(e,t,o){var d,p,f,v,h,y,b,g;return n(this,void 0,void 0,function(){var n,m,w,S,T,E,k,R,C,x,A,I,M,O,U;return s(this,function(s){switch(s.label){case 0:n=null!==(d=t.sendTimeoutMs)&&void 0!==d?d:1e4,s.label=1;case 1:return s.trys.push([1,14,,15]),!1!==t.enableTransportCompression&&"CompressionStream"in self?[4,c(e,self)]:[3,3];case 2:return w=s.sent(),[3,4];case 3:w=null,s.label=4;case 4:m=w,S="".concat(null!==(f=null===(p=t.version)||void 0===p?void 0:p.type)&&void 0!==f?f:"standalone","/").concat(null!==(h=null===(v=t.version)||void 0===v?void 0:v.version)&&void 0!==h?h:t.sdkVersion),T=new URLSearchParams({device_id:t.deviceId,session_id:"".concat(t.sessionId),type:t.eventType}),E="".concat((P=t.serverZone,_=t.trackServerUrl,_||("STAGING"===P?"https://api-sr.stag2.amplitude.com/sessions/v2/track":"EU"===P?"https://api-sr.eu.amplitude.com/sessions/v2/track":"https://api-sr.amplitude.com/sessions/v2/track")),"?").concat(T.toString()),k=r({"Content-Type":"application/json",Accept:"*/*",Authorization:"Bearer ".concat(t.apiKey),"X-Client-Version":t.sdkVersion,"X-Client-Library":S,"X-Client-Url":t.currentUrl.substring(0,1e3),"X-Client-Sample-Rate":"".concat(t.sampleRate),"X-Sampling-Hash-Alg":"xxhash32"},m?{"Content-Encoding":"gzip"}:{}),R=m?m.byteLength:l(e),C=new AbortController,x=n>0?setTimeout(function(){C.abort()},n):void 0,A=void 0,s.label=5;case 5:return s.trys.push([5,,7,8]),[4,o(E,{method:"POST",headers:k,body:null!=m?m:e,keepalive:R<=65536,signal:C.signal})];case 6:return A=s.sent(),[3,8];case 7:return x&&clearTimeout(x),[7];case 8:if(null===A)return[2,{shouldRetry:!1,success:!1,message:"Unexpected error occurred"}];if(A.status>=200&&A.status<300)return I=Math.round(function(e){for(var t=0,r=0;r<e.length;r++)t+=l(e[r]);return t}(t.events)/1024),M=null!==(g=null===(b=null===(y=A.headers)||void 0===y?void 0:y.get)||void 0===b?void 0:b.call(y,i))&&void 0!==g?g:null,[2,{shouldRetry:!1,success:!0,message:"Session replay event batch tracked successfully for session id ".concat(t.sessionId,", size of events: ").concat(I," KB"),skipCode:M}];if(413!==A.status)return[3,13];O="",s.label=9;case 9:return s.trys.push([9,11,,12]),[4,A.text()];case 10:return O=s.sent(),[3,12];case 11:return s.sent(),[3,12];case 12:return[2,{shouldRetry:!1,success:!1,message:u,payloadTooLarge:!0,isWaf:a.test(O)}];case 13:return A.status>=500||408===A.status||429===A.status||499===A.status?[2,{shouldRetry:!0,success:!1,message:"HTTP ".concat(A.status)}]:[2,{shouldRetry:!1,success:!1,message:u}];case 14:return(U=s.sent())&&"object"==typeof U&&"AbortError"===U.name?[2,{shouldRetry:!0,success:!1,message:"Session replay worker request timed out after ".concat(n,"ms")}]:[2,{shouldRetry:!1,success:!1,message:String(U)}];case 15:return[2]}var P,_})})}function y(e,t,r,o,a){var i;return n(this,void 0,void 0,function(){var n,u,c;return s(this,function(s){switch(s.label){case 0:n=1,s.label=1;case 1:return[4,h(t,r,a)];case 2:return(u=s.sent()).success?(postMessage({type:"log",id:e,message:u.message}),postMessage({type:"complete",id:e,skipCode:null!==(i=u.skipCode)&&void 0!==i?i:null}),[2]):u.payloadTooLarge&&o?(postMessage({type:"payload_too_large",id:e,isWaf:!0===u.isWaf}),[2]):o&&u.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":u.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,o,a,i,u,c;return s(this,function(s){switch(s.label){case 0:return"fetch-response"===(t=e.data).type?((r=p.get(t.requestId))&&(p.delete(t.requestId),r(t)),[2]):"send"!==t.type?[3,2]:(n=t.id,o=t.payload,a=t.context,i=t.useRetry,u=t.useCustomTransport,c=JSON.stringify(o),[4,y(n,c,a,i,u?v:f)]);case 1:s.sent(),s.label=2;case 2:return[2]}})})};var b=onmessage;return e.trackDestinationOnMessage=b,Object.defineProperty(e,"__esModule",{value:!0}),e}({});\n'}),us=Object.defineProperty,hs=(e,t,r)=>((e,t,r)=>t in e?us(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),ds=Object.defineProperty,ps=(e,t,r)=>((e,t,r)=>t in e?ds(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),fs=Object.defineProperty,ms=(e,t,r)=>((e,t,r)=>t in e?fs(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);const gs={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},vs={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},ys={};function ws(e){if(ys[e])return ys[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 gs?gs[e]:void 0,s=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 vs?vs[e]:void 0,i=Boolean(o&&o.every(e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))}));if(s&&i)return ys[e]=t.prototype,t.prototype;try{const n=document.createElement("iframe");document.body.appendChild(n);const s=n.contentWindow;if(!s)return t.prototype;const o=s[e].prototype;return document.body.removeChild(n),o?ys[e]=o:r}catch{return r}}const bs={};function Ss(e,t,r){var n;const s=`${e}.${String(r)}`;if(bs[s])return bs[s].call(t);const o=ws(e),i=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return i?(bs[s]=i,i.call(t)):t[r]}const Cs={};function xs(e,t,r){const n=`${e}.${String(r)}`;if(Cs[n])return Cs[n].bind(t);const s=ws(e)[r];return"function"!=typeof s?t[r]:(Cs[n]=s,s.bind(t))}const ks={childNodes:function(e){return Ss("Node",e,"childNodes")},parentNode:function(e){return Ss("Node",e,"parentNode")},parentElement:function(e){return Ss("Node",e,"parentElement")},textContent:function(e){return Ss("Node",e,"textContent")},contains:function(e,t){return xs("Node",e,"contains")(t)},getRootNode:function(e){return xs("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Ss("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Ss("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Ss("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Ss("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return ws("MutationObserver").constructor}};class Is{constructor(){ms(this,"idNodeMap",new Map),ms(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;return(null==(t=this.getMeta(e))?void 0:t.id)??-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}}function Os(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&Os(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&&Os(ks.parentNode(e),t,r)}function Es(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Ms(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}var Rs,Ps={exports:{}};function As(){if(Rs)return Ps.exports;Rs=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,blackBright:e,redBright:e,greenBright:e,yellowBright:e,blueBright:e,magentaBright:e,cyanBright:e,whiteBright:e,bgBlackBright:e,bgRedBright:e,bgGreenBright:e,bgYellowBright:e,bgBlueBright:e,bgMagentaBright:e,bgCyanBright:e,bgWhiteBright:e}};return Ps.exports=t(),Ps.exports.createColors=t,Ps.exports}const Ts=Ms(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Ns,Ls,Fs,_s,Ds,Bs;function Us(){if(Ls)return Ns;Ls=1;let e=As(),t=Ts;class r extends Error{constructor(e,t,n,s,o,i){super(e),this.name="CssSyntaxError",this.reason=e,o&&(this.file=o),s&&(this.source=s),i&&(this.plugin=i),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);let s=e=>e,o=e=>e,i=e=>e;if(r){let{bold:r,gray:n,red:a}=e.createColors(!0);o=e=>r(a(e)),s=e=>n(e),t&&(i=e=>t(e))}let a=n.split(/\r?\n/),l=Math.max(this.line-3,0),c=Math.min(this.line+2,a.length),u=String(c).length;return a.slice(l,c).map((e,t)=>{let r=l+1+t,n=" "+(" "+r).slice(-u)+" | ";if(r===this.line){if(e.length>160){let t=20,r=Math.max(0,this.column-t),a=Math.max(this.column+t,this.endColumn+t),l=e.slice(r,a),c=s(n.replace(/\d/g," "))+e.slice(0,Math.min(this.column-1,t-1)).replace(/[^\t]/g," ");return o(">")+s(n)+i(l)+"\n "+c+o("^")}let t=s(n.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return o(">")+s(n)+i(e)+"\n "+t+o("^")}return" "+s(n)+i(e)}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}return Ns=r,r.default=r,Ns}function js(){if(_s)return Fs;_s=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 s=(e.raws.between||"")+(t?";":"");this.builder(r+n+s,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,s=0;for(;n&&"root"!==n.type;)s+=1,n=n.parent;if(r.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<s;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 s=e.nodes[n],o=this.raw(s,"before");o&&this.builder(o),this.stringify(s,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 s;if(n||(n=r),r&&(s=t.raws[r],void 0!==s))return s;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 i=t.root();if(i.rawCache||(i.rawCache={}),void 0!==i.rawCache[n])return i.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(t,n);{let e="raw"+((a=n)[0].toUpperCase()+a.slice(1));this[e]?s=this[e](i,t):i.walk(e=>{if(s=e.raws[r],void 0!==s)return!1})}var a;return void 0===s&&(s=e[n]),i.rawCache[n]=s,s}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 Fs=t,t.default=t,Fs}function zs(){if(Bs)return Ds;Bs=1;let e=js();function t(t,r){new e(r).stringify(t)}return Ds=t,t.default=t,Ds}var Ws,qs,$s,Vs,Gs,Hs,Js,Ks,Ys,Qs,Xs,Zs,eo,to,ro,no,so,oo,io,ao,lo,co,uo,ho,po,fo,mo,go,vo,yo,wo,bo,So,Co,xo,ko,Io,Oo,Eo,Mo,Ro,Po,Ao,To,No,Lo,Fo,_o,Do,Bo={};function Uo(){return Ws||(Ws=1,Bo.isClean=Symbol("isClean"),Bo.my=Symbol("my")),Bo}function jo(){if($s)return qs;$s=1;let e=Us(),t=js(),r=zs(),{isClean:n,my:s}=Uo();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 s=e[n],i=typeof s;"parent"===n&&"object"===i?t&&(r[n]=t):"source"===n?r[n]=s:Array.isArray(s)?r[n]=s.map(e=>o(e,r)):("object"===i&&null!==s&&(s=o(s)),r[n]=s)}return r}function i(e,t){if(t&&void 0!==t.offset)return t.offset;let r=1,n=1,s=0;for(let o=0;o<e.length;o++){if(n===t.line&&r===t.column){s=o;break}"\n"===e[o]?(r=1,n+=1):r+=1}return s}class a{get proxyOf(){return this}constructor(e={}){this.raws={},this[n]=!1,this[s]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let r of e[t])"function"==typeof r.clone?this.append(r.clone()):this.append(r)}else this[t]=e[t]}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(t,r={}){if(this.source){let{end:e,start:n}=this.rangeBy(r);return this.source.input.error(t,{column:n.column,line:n.line},{column:e.column,line:e.line},r)}return new e(t)}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)}}markClean(){this[n]=!0}markDirty(){if(this[n]){this[n]=!1;let e=this;for(;e=e.parent;)e[n]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e={}){let t=this.source.start;if(e.index)t=this.positionInside(e.index);else if(e.word){let r="document"in this.source.input?this.source.input.document:this.source.input.css,n=r.slice(i(r,this.source.start),i(r,this.source.end)).indexOf(e.word);-1!==n&&(t=this.positionInside(n))}return t}positionInside(e){let t=this.source.start.column,r=this.source.start.line,n="document"in this.source.input?this.source.input.document:this.source.input.css,s=i(n,this.source.start),o=s+e;for(let e=s;e<o;e++)"\n"===n[e]?(t=1,r+=1):t+=1;return{column:t,line:r,offset:o}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e={}){let t="document"in this.source.input?this.source.input.document:this.source.input.css,r={column:this.source.start.column,line:this.source.start.line,offset:i(t,this.source.start)},n=this.source.end?{column:this.source.end.column+1,line:this.source.end.line,offset:"number"==typeof this.source.end.offset?this.source.end.offset:i(t,this.source.end)+1}:{column:r.column+1,line:r.line,offset:r.offset+1};if(e.word){let s=t.slice(i(t,this.source.start),i(t,this.source.end)).indexOf(e.word);-1!==s&&(r=this.positionInside(s),n=this.positionInside(s+e.word.length))}else e.start?r={column:e.start.column,line:e.start.line,offset:i(t,e.start)}:e.index&&(r=this.positionInside(e.index)),e.end?n={column:e.end.column,line:e.end.line,offset:i(t,e.end)}:"number"==typeof e.endIndex?n=this.positionInside(e.endIndex):e.index&&(n=this.positionInside(e.index+1));return(n.line<r.line||n.line===r.line&&n.column<=r.column)&&(n={column:r.column+1,line:r.line,offset:r.offset+1}),{end:n,start:r}}raw(e,r){return(new t).raw(this,e,r)}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 s=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){if(null==n)continue;let o=t.get(n.input);null==o&&(o=s,t.set(n.input,s),s++),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=r){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)}}return qs=a,a.default=a,qs}function zo(){if(Gs)return Vs;Gs=1;let e=jo();class t extends e{constructor(e){super(e),this.type="comment"}}return Vs=t,t.default=t,Vs}function Wo(){if(Js)return Hs;Js=1;let e=jo();class t extends e{get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}}return Hs=t,t.default=t,Hs}function qo(){if(Ys)return Ks;Ys=1;let e,t,r,n,s=zo(),o=Wo(),i=jo(),{isClean:a,my:l}=Uo();function c(e){return e.map(e=>(e.nodes&&(e.nodes=c(e.nodes)),delete e.source,e))}function u(e){if(e[a]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)u(t)}class h extends i{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]}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),s=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let e of s)this.proxyOf.nodes.splice(n+1,0,e);for(let e in this.indexes)r=this.indexes[e],n<r&&(this.indexes[e]=r+s.length);return this.markDirty(),this}insertBefore(e,t){let r,n=this.index(e),s=0===n&&"prepend",o=this.normalize(t,this.proxyOf.nodes[n],s).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(r,i){if("string"==typeof r)r=c(t(r).nodes);else if(void 0===r)r=[];else if(Array.isArray(r)){r=r.slice(0);for(let e of r)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===r.type&&"document"!==this.type){r=r.nodes.slice(0);for(let e of r)e.parent&&e.parent.removeChild(e,"ignore")}else if(r.type)r=[r];else if(r.prop){if(void 0===r.value)throw new Error("Value field is missed in node creation");"string"!=typeof r.value&&(r.value=String(r.value)),r=[new o(r)]}else if(r.selector||r.selectors)r=[new n(r)];else if(r.name)r=[new e(r)];else{if(!r.text)throw new Error("Unknown node type in node creation");r=[new s(r)]}return r.map(e=>(e[l]||h.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[a]&&u(e),e.raws||(e.raws={}),void 0===e.raws.before&&i&&void 0!==i.raws.before&&(e.raws.before=i.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)}))}}return h.registerParse=e=>{t=e},h.registerRule=e=>{n=e},h.registerAtRule=t=>{e=t},h.registerRoot=e=>{r=e},Ks=h,h.default=h,h.rebuild=t=>{"atrule"===t.type?Object.setPrototypeOf(t,e.prototype):"rule"===t.type?Object.setPrototypeOf(t,n.prototype):"decl"===t.type?Object.setPrototypeOf(t,o.prototype):"comment"===t.type?Object.setPrototypeOf(t,s.prototype):"root"===t.type&&Object.setPrototypeOf(t,r.prototype),t[l]=!0,t.nodes&&t.nodes.forEach(e=>{h.rebuild(e)})},Ks}function $o(){if(Xs)return Qs;Xs=1;let e=qo();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 Qs=t,t.default=t,e.registerAtRule(t),Qs}function Vo(){if(eo)return Zs;eo=1;let e,t,r=qo();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},Zs=n,n.default=n,Zs}function Go(){if(ro)return to;ro=1;return to={nanoid:(e=21)=>{let t="",r=0|e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(r=t)=>{let n="",s=0|r;for(;s--;)n+=e[Math.random()*e.length|0];return n}},to}function Ho(){if(so)return no;so=1;let{existsSync:e,readFileSync:t}=Ts,{dirname:r,join:n}=Ts,{SourceMapConsumer:s,SourceMapGenerator:o}=Ts;class i{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let n=t.map?t.map.prev:void 0,s=this.loadMap(t.from,n);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=r(this.mapFile)),s&&(this.text=s)}consumer(){return this.consumerCache||(this.consumerCache=new s(this.text)),this.consumerCache}decodeInline(e){let t=e.match(/^data:application\/json;charset=utf-?8,/)||e.match(/^data:application\/json,/);if(t)return decodeURIComponent(e.substr(t[0].length));let r=e.match(/^data:application\/json;charset=utf-?8;base64,/)||e.match(/^data:application\/json;base64,/);if(r)return n=e.substr(r[0].length),Buffer?Buffer.from(n,"base64").toString():window.atob(n);var n;let s=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+s)}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=/g);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(n){if(this.root=r(n),e(n))return this.mapFile=n,t(n,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof s)return o.fromSourceMap(t).toString();if(t instanceof o)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let r=t(e);if(r){let e=this.loadFile(r);if(!e)throw new Error("Unable to load previous source map: "+r.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=n(r(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return no=i,i.default=i,no}function Jo(){if(io)return oo;io=1;let{nanoid:e}=Go(),{isAbsolute:t,resolve:r}=Ts,{SourceMapConsumer:n,SourceMapGenerator:s}=Ts,{fileURLToPath:o,pathToFileURL:i}=Ts,a=Us(),l=Ho(),c=Ts,u=Symbol("lineToIndexCache"),h=Boolean(n&&s),d=Boolean(r&&t);function p(e){if(e[u])return e[u];let t=e.css.split("\n"),r=new Array(t.length),n=0;for(let e=0,s=t.length;e<s;e++)r[e]=n,n+=t[e].length+1;return e[u]=r,r}class f{get from(){return this.file||this.id}constructor(n,s={}){if(null==n||"object"==typeof n&&!n.toString)throw new Error(`PostCSS received ${n} instead of CSS string`);if(this.css=n.toString(),"\ufeff"===this.css[0]||""===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,this.document=this.css,s.document&&(this.document=s.document.toString()),s.from&&(!d||/^\w+:\/\//.test(s.from)||t(s.from)?this.file=s.from:this.file=r(s.from)),d&&h){let e=new l(this.css,s);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 "+e(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let s,o,l,c,u;if(t&&"object"==typeof t){let e=t,n=r;if("number"==typeof e.offset){c=e.offset;let n=this.fromOffset(c);t=n.line,r=n.col}else t=e.line,r=e.column,c=this.fromLineAndColumn(t,r);if("number"==typeof n.offset){l=n.offset;let e=this.fromOffset(l);o=e.line,s=e.col}else o=n.line,s=n.column,l=this.fromLineAndColumn(n.line,n.column)}else if(r)c=this.fromLineAndColumn(t,r);else{c=t;let e=this.fromOffset(c);t=e.line,r=e.col}let h=this.origin(t,r,o,s);return u=h?new a(e,void 0===h.endLine?h.line:{column:h.column,line:h.line},void 0===h.endLine?h.column:{column:h.endColumn,line:h.endLine},h.source,h.file,n.plugin):new a(e,void 0===o?t:{column:r,line:t},void 0===o?r:{column:s,line:o},this.css,this.file,n.plugin),u.input={column:r,endColumn:s,endLine:o,endOffset:l,line:t,offset:c,source:this.css},this.file&&(i&&(u.input.url=i(this.file).toString()),u.input.file=this.file),u}fromLineAndColumn(e,t){return p(this)[e-1]+t-1}fromOffset(e){let t=p(this),r=0;if(e>=t[t.length-1])r=t.length-1;else{let n,s=t.length-2;for(;r<s;)if(n=r+(s-r>>1),e<t[n])s=n-1;else{if(!(e>=t[n+1])){r=n;break}r=n+1}}return{col:e-t[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:r(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,r,n,s){if(!this.map)return!1;let a,l,c=this.map.consumer(),u=c.originalPositionFor({column:r,line:e});if(!u.source)return!1;"number"==typeof n&&(a=c.originalPositionFor({column:s,line:n})),l=t(u.source)?i(u.source):new URL(u.source,this.map.consumer().sourceRoot||i(this.map.mapFile));let h={column:u.column,endColumn:a&&a.column,endLine:a&&a.line,line:u.line,url:l.toString()};if("file:"===l.protocol){if(!o)throw new Error("file: protocol is not available in this PostCSS build");h.file=o(l)}let d=c.sourceContentFor(u.source);return d&&(h.source=d),h}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}}return oo=f,f.default=f,c&&c.registerInput&&c.registerInput(f),oo}function Ko(){if(lo)return ao;lo=1;let e,t,r=qo();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},ao=n,n.default=n,r.registerRoot(n),ao}function Yo(){if(uo)return co;uo=1;let e={comma:t=>e.split(t,[","],!0),space:t=>e.split(t,[" ","\n","\t"]),split(e,t,r){let n=[],s="",o=!1,i=0,a=!1,l="",c=!1;for(let r of e)c?c=!1:"\\"===r?c=!0:a?r===l&&(a=!1):'"'===r||"'"===r?(a=!0,l=r):"("===r?i+=1:")"===r?i>0&&(i-=1):0===i&&t.includes(r)&&(o=!0),o?(""!==s&&n.push(s.trim()),s="",o=!1):s+=r;return(r||""!==s)&&n.push(s.trim()),n}};return co=e,e.default=e,co}function Qo(){if(po)return ho;po=1;let e=qo(),t=Yo();class r extends e{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)}constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}}return ho=r,r.default=r,e.registerRule(r),ho}function Xo(){if(vo)return go;vo=1;let{dirname:e,relative:t,resolve:r,sep:n}=Ts,{SourceMapConsumer:s,SourceMapGenerator:o}=Ts,{pathToFileURL:i}=Ts,a=Jo(),l=Boolean(s&&o),c=Boolean(e&&r&&t&&n);return go=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 r,n=this.toUrl(this.path(t.file)),o=t.root||e(t.file);!1===this.mapOpts.sourcesContent?(r=new s(t.text),r.sourcesContent&&(r.sourcesContent=null)):r=t.consumer(),this.map.applySourceMap(r,n,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&&e.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),c&&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=o.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new o({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 o({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,r=1,n=1,s="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(o,a,l)=>{if(this.css+=o,a&&"end"!==l&&(i.generated.line=r,i.generated.column=n-1,a.source&&a.source.start?(i.source=this.sourcePath(a),i.original.line=a.source.start.line,i.original.column=a.source.start.column-1,this.map.addMapping(i)):(i.source=s,i.original.line=1,i.original.column=0,this.map.addMapping(i))),t=o.match(/\n/g),t?(r+=t.length,e=o.lastIndexOf("\n"),n=o.length-e):n+=o.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?(i.source=this.sourcePath(a),i.original.line=a.source.end.line,i.original.column=a.source.end.column-1,i.generated.line=r,i.generated.column=n-2,this.map.addMapping(i)):(i.source=s,i.original.line=1,i.original.column=0,i.generated.line=r,i.generated.column=n-1,this.map.addMapping(i)))}})}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(n){if(this.mapOpts.absolute)return n;if(60===n.charCodeAt(0))return n;if(/^\w+:\/\//.test(n))return n;let s=this.memoizedPaths.get(n);if(s)return s;let o=this.opts.to?e(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(o=e(r(o,this.mapOpts.annotation)));let i=t(o,n);return this.memoizedPaths.set(n,i),i}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(i){let t=i(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;"\\"===n&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}}}function Zo(){if(So)return bo;So=1;let e=$o(),t=zo(),r=Wo(),n=Ko(),s=Qo(),o=function(){if(wo)return yo;wo=1;const e="'".charCodeAt(0),t='"'.charCodeAt(0),r="\\".charCodeAt(0),n="/".charCodeAt(0),s="\n".charCodeAt(0),o=" ".charCodeAt(0),i="\f".charCodeAt(0),a="\t".charCodeAt(0),l="\r".charCodeAt(0),c="[".charCodeAt(0),u="]".charCodeAt(0),h="(".charCodeAt(0),d=")".charCodeAt(0),p="{".charCodeAt(0),f="}".charCodeAt(0),m=";".charCodeAt(0),g="*".charCodeAt(0),v=":".charCodeAt(0),y="@".charCodeAt(0),w=/[\t\n\f\r "#'()/;[\\\]{}]/g,b=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,S=/.[\r\n"'(/\\]/,C=/[\da-f]/i;return yo=function(x,k={}){let I,O,E,M,R,P,A,T,N,L,F=x.css.valueOf(),_=k.ignoreErrors,D=F.length,B=0,U=[],j=[];function z(e){throw x.error("Unclosed "+e,B)}return{back:function(e){j.push(e)},endOfFile:function(){return 0===j.length&&B>=D},nextToken:function(x){if(j.length)return j.pop();if(B>=D)return;let k=!!x&&x.ignoreUnclosed;switch(I=F.charCodeAt(B),I){case s:case o:case a:case l:case i:M=B;do{M+=1,I=F.charCodeAt(M)}while(I===o||I===s||I===a||I===l||I===i);P=["space",F.slice(B,M)],B=M-1;break;case c:case u:case p:case f:case v:case m:case d:{let e=String.fromCharCode(I);P=[e,e,B];break}case h:if(L=U.length?U.pop()[1]:"",N=F.charCodeAt(B+1),"url"===L&&N!==e&&N!==t&&N!==o&&N!==s&&N!==a&&N!==i&&N!==l){M=B;do{if(A=!1,M=F.indexOf(")",M+1),-1===M){if(_||k){M=B;break}z("bracket")}for(T=M;F.charCodeAt(T-1)===r;)T-=1,A=!A}while(A);P=["brackets",F.slice(B,M+1),B,M],B=M}else M=F.indexOf(")",B+1),O=F.slice(B,M+1),-1===M||S.test(O)?P=["(","(",B]:(P=["brackets",O,B,M],B=M);break;case e:case t:R=I===e?"'":'"',M=B;do{if(A=!1,M=F.indexOf(R,M+1),-1===M){if(_||k){M=B+1;break}z("string")}for(T=M;F.charCodeAt(T-1)===r;)T-=1,A=!A}while(A);P=["string",F.slice(B,M+1),B,M],B=M;break;case y:w.lastIndex=B+1,w.test(F),M=0===w.lastIndex?F.length-1:w.lastIndex-2,P=["at-word",F.slice(B,M+1),B,M],B=M;break;case r:for(M=B,E=!0;F.charCodeAt(M+1)===r;)M+=1,E=!E;if(I=F.charCodeAt(M+1),E&&I!==n&&I!==o&&I!==s&&I!==a&&I!==l&&I!==i&&(M+=1,C.test(F.charAt(M)))){for(;C.test(F.charAt(M+1));)M+=1;F.charCodeAt(M+1)===o&&(M+=1)}P=["word",F.slice(B,M+1),B,M],B=M;break;default:I===n&&F.charCodeAt(B+1)===g?(M=F.indexOf("*/",B+2)+1,0===M&&(_||k?M=F.length:z("comment")),P=["comment",F.slice(B,M+1),B,M],B=M):(b.lastIndex=B+1,b.test(F),M=0===b.lastIndex?F.length-1:b.lastIndex-2,P=["word",F.slice(B,M+1),B,M],U.push(P),B=M)}return B++,P},position:function(){return B}}}}();const i={empty:!0,space:!0};return bo=class{constructor(e){this.input=e,this.root=new n,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(t){let r,n,s,o=new e;o.name=t[1].slice(1),""===o.name&&this.unnamedAtrule(o,t),this.init(o,t[2]);let i=!1,a=!1,l=[],c=[];for(;!this.tokenizer.endOfFile();){if(r=(t=this.tokenizer.nextToken())[0],"("===r||"["===r?c.push("("===r?")":"]"):"{"===r&&c.length>0?c.push("}"):r===c[c.length-1]&&c.pop(),0===c.length){if(";"===r){o.source.end=this.getPosition(t[2]),o.source.end.offset++,this.semicolon=!0;break}if("{"===r){a=!0;break}if("}"===r){if(l.length>0){for(s=l.length-1,n=l[s];n&&"space"===n[0];)n=l[--s];n&&(o.source.end=this.getPosition(n[3]||n[2]),o.source.end.offset++)}this.end(t);break}l.push(t)}else l.push(t);if(this.tokenizer.endOfFile()){i=!0;break}}o.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(o.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(o,"params",l),i&&(t=l[l.length-1],o.source.end=this.getPosition(t[3]||t[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 s=t-1;s>=0&&(r=e[s],"space"===r[0]||(n+=1,2!==n));s--);throw this.input.error("Missed semicolon","word"===r[0]?r[3]+1:r[2])}colon(e){let t,r,n,s=0;for(let[o,i]of e.entries()){if(r=i,n=r[0],"("===n&&(s+=1),")"===n&&(s-=1),0===s&&":"===n){if(t){if("word"===t[0]&&"progid"===t[1])continue;return o}this.doubleColon(r)}t=r}return!1}comment(e){let r=new t;this.init(r,e[2]),r.source.end=this.getPosition(e[3]||e[2]),r.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))r.text="",r.raws.left=n,r.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);r.text=e[2],r.raws.left=e[1],r.raws.right=e[3]}}createTokenizer(){this.tokenizer=o(this.input)}decl(e,t){let n=new r;this.init(n,e[0][2]);let s,o=e[e.length-1];for(";"===o[0]&&(this.semicolon=!0,e.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}}(e)),n.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),n.raws.before+=e.shift()[1];for(n.source.start=this.getPosition(e[0][2]),n.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;n.prop+=e.shift()[1]}for(n.raws.between="";e.length;){if(s=e.shift(),":"===s[0]){n.raws.between+=s[1];break}"word"===s[0]&&/\w/.test(s[1])&&this.unknownWord([s]),n.raws.between+=s[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let i,a=[];for(;e.length&&(i=e[0][0],"space"===i||"comment"===i);)a.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(s=e[t],"!important"===s[1].toLowerCase()){n.important=!0;let r=this.stringFrom(e,t);r=this.spacesFromEnd(e)+r," !important"!==r&&(n.raws.important=r);break}if("important"===s[1].toLowerCase()){let r=e.slice(0),s="";for(let e=t;e>0;e--){let t=r[e][0];if(s.trim().startsWith("!")&&"space"!==t)break;s=r.pop()[1]+s}s.trim().startsWith("!")&&(n.important=!0,n.raws.important=s,e=r)}if("space"!==s[0]&&"comment"!==s[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(n,"value",a.concat(e),t),n.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new s;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 t=this.current.nodes[this.current.nodes.length-1];t&&"rule"===t.type&&!t.raws.ownSemicolon&&(t.raws.ownSemicolon=this.spaces,this.spaces="",t.source.end=this.getPosition(e[2]),t.source.end.offset+=t.raws.ownSemicolon.length)}}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,s=null,o=[],i=e[1].startsWith("--"),a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)s||(s=l),o.push("("===r?")":"]");else if(i&&n&&"{"===r)s||(s=l),o.push("}");else if(0===o.length){if(";"===r){if(n)return void this.decl(a,i);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&&(s=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(s),t&&n){if(!i)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,i)}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 s,o,a,l,c=r.length,u="",h=!0;for(let e=0;e<c;e+=1)s=r[e],o=s[0],"space"!==o||e!==c-1||n?"comment"===o?(l=r[e-1]?r[e-1][0]:"empty",a=r[e+1]?r[e+1][0]:"empty",i[l]||i[a]||","===u.slice(-1)?h=!1:u+=s[1]):u+=s[1]:h=!1;if(!h){let n=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:n,value:u}}e[t]=u}rule(e){e.pop();let t=new s;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 "+e[0][1],{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})}},bo}function ei(){if(xo)return Co;xo=1;let e=qo(),t=Jo(),r=Zo();function n(e,n){let s=new t(e,n),o=new r(s);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 Co=n,n.default=n,e.registerParse(n),Co}function ti(){if(Io)return ko;Io=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 ko=e,e.default=e,ko}function ri(){if(Eo)return Oo;Eo=1;let e=ti();class t{get content(){return this.css}constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css="",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)}}return Oo=t,t.default=t,Oo}function ni(){if(Ro)return Mo;Ro=1;let e={};return Mo=function(t){e[t]||(e[t]=!0,"undefined"!=typeof console&&console.warn&&console.warn(t))}}function si(){if(Ao)return Po;Ao=1;let e=qo(),t=Vo(),r=Xo(),n=ei(),s=ri(),o=Ko(),i=zs(),{isClean:a,my:l}=Uo(),c=ni();const u={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},h={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},d={Once:!0,postcssPlugin:!0,prepare:!0};function p(e){return"object"==typeof e&&"function"==typeof e.then}function f(e){let t=!1,r=u[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 m(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 g(e){return e[a]=!1,e.nodes&&e.nodes.forEach(e=>g(e)),e}let v={};class y{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"}constructor(t,r,o){let i;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof y||r instanceof s)i=g(r.root),r.map&&(void 0===o.map&&(o.map={}),o.map.inline||(o.map.inline=!1),o.map.prev=r.map);else{let t=n;o.syntax&&(t=o.syntax.parse),o.parser&&(t=o.parser),t.parse&&(t=t.parse);try{i=t(r,o)}catch(e){this.processed=!0,this.error=e}i&&!i[l]&&e.rebuild(i)}else i=g(r);this.result=new s(t,i,o),this.helpers={...v,postcss:v,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,s=t.split("."),o=n.split(".");(s[0]!==o[0]||parseInt(s[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(!h[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!d[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 e=this.result.root;for(;!e[a];){e[a]=!0;let t=[m(e)];for(;t.length>0;){let e=this.visitTick(t);if(p(e))try{await e}catch(e){let r=t[t.length-1].node;throw this.handleError(e,r)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map(e=>r(e,this.helpers));await Promise.all(t)}else await r(e,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=i;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let n=new r(t,this.result.root,this.result.opts).generate();return this.result.css=n[0],this.result.map=n[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 e=this.result.root;for(;!e[a];)e[a]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||c("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(e){let t=e[e.length-1],{node:r,visitors:n}=t;if("root"!==r.type&&"document"!==r.type&&!r.parent)return void e.pop();if(n.length>0&&t.visitorIndex<n.length){let[e,s]=n[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===n.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return s(r.toProxy(),this.helpers)}catch(e){throw this.handleError(e,r)}}if(0!==t.iterator){let n,s=t.iterator;for(;n=r.nodes[r.indexes[s]];)if(r.indexes[s]+=1,!n[a])return n[a]=!0,void e.push(m(n));t.iterator=0,delete r.indexes[s]}let s=t.events;for(;t.eventIndex<s.length;){let e=s[t.eventIndex];if(t.eventIndex+=1,0===e)return void(r.nodes&&r.nodes.length&&(r[a]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[a]=!0;let t=f(e);for(let r of t)if(0===r)e.nodes&&e.each(e=>{e[a]||this.walkSync(e)});else{let t=this.listeners[r];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}}return y.registerPostcss=e=>{v=e},Po=y,y.default=y,o.registerLazyResult(y),t.registerLazyResult(y),Po}function oi(){if(Fo)return Lo;Fo=1;let e=Vo(),t=si(),r=function(){if(No)return To;No=1;let e=Xo(),t=ei();const r=ri();let n=zs(),s=ni();class o{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,r=t;try{e=r(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"}constructor(t,s,o){let i;s=s.toString(),this.stringified=!1,this._processor=t,this._css=s,this._opts=o,this._map=void 0;let a=n;this.result=new r(this._processor,i,this._opts),this.result.css=s;let l=this;Object.defineProperty(this.result,"root",{get:()=>l.root});let c=new e(a,i,this._opts,s);if(c.isMap()){let[e,t]=c.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else c.clearAnnotation(),this.result.css=c.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||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}warnings(){return[]}}return To=o,o.default=o,To}(),n=Ko();class s{constructor(e=[]){this.version="8.5.6",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(e,n={}){return this.plugins.length||n.parser||n.stringifier||n.syntax?new t(this,e,n):new r(this,e,n)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}return Lo=s,s.default=s,n.registerProcessor(s),e.registerProcessor(s),Lo}const ii=Es(function(){if(Do)return _o;Do=1;let e=$o(),t=zo(),r=qo(),n=Us(),s=Wo(),o=Vo(),i=function(){if(mo)return fo;mo=1;let e=$o(),t=zo(),r=Wo(),n=Jo(),s=Ho(),o=Ko(),i=Qo();function a(l,c){if(Array.isArray(l))return l.map(e=>a(e));let{inputs:u,...h}=l;if(u){c=[];for(let e of u){let t={...e,__proto__:n.prototype};t.map&&(t.map={...t.map,__proto__:s.prototype}),c.push(t)}}if(h.nodes&&(h.nodes=l.nodes.map(e=>a(e,c))),h.source){let{inputId:e,...t}=h.source;h.source=t,null!=e&&(h.source.input=c[e])}if("root"===h.type)return new o(h);if("decl"===h.type)return new r(h);if("rule"===h.type)return new i(h);if("comment"===h.type)return new t(h);if("atrule"===h.type)return new e(h);throw new Error("Unknown node type: "+l.type)}return fo=a,a.default=a,fo}(),a=Jo(),l=si(),c=Yo(),u=jo(),h=ei(),d=oi(),p=ri(),f=Ko(),m=Qo(),g=zs(),v=ti();function y(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new d(e)}return y.plugin=function(e,t){let r,n=!1;function s(...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 s=t(...r);return s.postcssPlugin=e,s.postcssVersion=(new d).version,s}return Object.defineProperty(s,"postcss",{get:()=>(r||(r=s()),r)}),s.process=function(e,t,r){return y([s(r)]).process(e,t)},s},y.stringify=g,y.parse=h,y.fromJSON=i,y.list=c,y.comment=e=>new t(e),y.atRule=t=>new e(t),y.decl=e=>new s(e),y.rule=e=>new m(e),y.root=e=>new f(e),y.document=e=>new o(e),y.CssSyntaxError=n,y.Declaration=s,y.Container=r,y.Processor=d,y.Document=o,y.Comment=t,y.Warning=v,y.AtRule=e,y.Result=p,y.Input=a,y.Rule=m,y.Root=f,y.Node=u,l.registerPostcss(y),_o=y,y.default=y,_o}());ii.stringify,ii.fromJSON,ii.plugin,ii.parse,ii.list,ii.document,ii.comment,ii.atRule,ii.rule,ii.decl,ii.root,ii.CssSyntaxError,ii.Declaration,ii.Container,ii.Processor,ii.Document,ii.Comment,ii.Warning,ii.AtRule,ii.Result,ii.Input,ii.Rule,ii.Root,ii.Node;var ai=Object.defineProperty,li=(e,t,r)=>((e,t,r)=>t in e?ai(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);function ci(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ui(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}var hi,di={exports:{}};function pi(){if(hi)return di.exports;hi=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,blackBright:e,redBright:e,greenBright:e,yellowBright:e,blueBright:e,magentaBright:e,cyanBright:e,whiteBright:e,bgBlackBright:e,bgRedBright:e,bgGreenBright:e,bgYellowBright:e,bgBlueBright:e,bgMagentaBright:e,bgCyanBright:e,bgWhiteBright:e}};return di.exports=t(),di.exports.createColors=t,di.exports}const fi=ui(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var mi,gi,vi,yi,wi,bi;function Si(){if(gi)return mi;gi=1;let e=pi(),t=fi;class r extends Error{constructor(e,t,n,s,o,i){super(e),this.name="CssSyntaxError",this.reason=e,o&&(this.file=o),s&&(this.source=s),i&&(this.plugin=i),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);let s=e=>e,o=e=>e,i=e=>e;if(r){let{bold:r,gray:n,red:a}=e.createColors(!0);o=e=>r(a(e)),s=e=>n(e),t&&(i=e=>t(e))}let a=n.split(/\r?\n/),l=Math.max(this.line-3,0),c=Math.min(this.line+2,a.length),u=String(c).length;return a.slice(l,c).map((e,t)=>{let r=l+1+t,n=" "+(" "+r).slice(-u)+" | ";if(r===this.line){if(e.length>160){let t=20,r=Math.max(0,this.column-t),a=Math.max(this.column+t,this.endColumn+t),l=e.slice(r,a),c=s(n.replace(/\d/g," "))+e.slice(0,Math.min(this.column-1,t-1)).replace(/[^\t]/g," ");return o(">")+s(n)+i(l)+"\n "+c+o("^")}let t=s(n.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return o(">")+s(n)+i(e)+"\n "+t+o("^")}return" "+s(n)+i(e)}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}return mi=r,r.default=r,mi}function Ci(){if(yi)return vi;yi=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 s=(e.raws.between||"")+(t?";":"");this.builder(r+n+s,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,s=0;for(;n&&"root"!==n.type;)s+=1,n=n.parent;if(r.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<s;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 s=e.nodes[n],o=this.raw(s,"before");o&&this.builder(o),this.stringify(s,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 s;if(n||(n=r),r&&(s=t.raws[r],void 0!==s))return s;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 i=t.root();if(i.rawCache||(i.rawCache={}),void 0!==i.rawCache[n])return i.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(t,n);{let e="raw"+((a=n)[0].toUpperCase()+a.slice(1));this[e]?s=this[e](i,t):i.walk(e=>{if(s=e.raws[r],void 0!==s)return!1})}var a;return void 0===s&&(s=e[n]),i.rawCache[n]=s,s}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 vi=t,t.default=t,vi}function xi(){if(bi)return wi;bi=1;let e=Ci();function t(t,r){new e(r).stringify(t)}return wi=t,t.default=t,wi}var ki,Ii,Oi,Ei,Mi,Ri,Pi,Ai,Ti,Ni,Li,Fi,_i,Di,Bi,Ui,ji,zi,Wi,qi,$i,Vi,Gi,Hi,Ji,Ki,Yi,Qi,Xi,Zi,ea,ta,ra,na,sa,oa,ia,aa,la,ca,ua,ha,da,pa,fa,ma,ga,va,ya,wa={};function ba(){return ki||(ki=1,wa.isClean=Symbol("isClean"),wa.my=Symbol("my")),wa}function Sa(){if(Oi)return Ii;Oi=1;let e=Si(),t=Ci(),r=xi(),{isClean:n,my:s}=ba();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 s=e[n],i=typeof s;"parent"===n&&"object"===i?t&&(r[n]=t):"source"===n?r[n]=s:Array.isArray(s)?r[n]=s.map(e=>o(e,r)):("object"===i&&null!==s&&(s=o(s)),r[n]=s)}return r}function i(e,t){if(t&&void 0!==t.offset)return t.offset;let r=1,n=1,s=0;for(let o=0;o<e.length;o++){if(n===t.line&&r===t.column){s=o;break}"\n"===e[o]?(r=1,n+=1):r+=1}return s}class a{get proxyOf(){return this}constructor(e={}){this.raws={},this[n]=!1,this[s]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let r of e[t])"function"==typeof r.clone?this.append(r.clone()):this.append(r)}else this[t]=e[t]}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(t,r={}){if(this.source){let{end:e,start:n}=this.rangeBy(r);return this.source.input.error(t,{column:n.column,line:n.line},{column:e.column,line:e.line},r)}return new e(t)}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)}}markClean(){this[n]=!0}markDirty(){if(this[n]){this[n]=!1;let e=this;for(;e=e.parent;)e[n]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e={}){let t=this.source.start;if(e.index)t=this.positionInside(e.index);else if(e.word){let r="document"in this.source.input?this.source.input.document:this.source.input.css,n=r.slice(i(r,this.source.start),i(r,this.source.end)).indexOf(e.word);-1!==n&&(t=this.positionInside(n))}return t}positionInside(e){let t=this.source.start.column,r=this.source.start.line,n="document"in this.source.input?this.source.input.document:this.source.input.css,s=i(n,this.source.start),o=s+e;for(let e=s;e<o;e++)"\n"===n[e]?(t=1,r+=1):t+=1;return{column:t,line:r,offset:o}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e={}){let t="document"in this.source.input?this.source.input.document:this.source.input.css,r={column:this.source.start.column,line:this.source.start.line,offset:i(t,this.source.start)},n=this.source.end?{column:this.source.end.column+1,line:this.source.end.line,offset:"number"==typeof this.source.end.offset?this.source.end.offset:i(t,this.source.end)+1}:{column:r.column+1,line:r.line,offset:r.offset+1};if(e.word){let s=t.slice(i(t,this.source.start),i(t,this.source.end)).indexOf(e.word);-1!==s&&(r=this.positionInside(s),n=this.positionInside(s+e.word.length))}else e.start?r={column:e.start.column,line:e.start.line,offset:i(t,e.start)}:e.index&&(r=this.positionInside(e.index)),e.end?n={column:e.end.column,line:e.end.line,offset:i(t,e.end)}:"number"==typeof e.endIndex?n=this.positionInside(e.endIndex):e.index&&(n=this.positionInside(e.index+1));return(n.line<r.line||n.line===r.line&&n.column<=r.column)&&(n={column:r.column+1,line:r.line,offset:r.offset+1}),{end:n,start:r}}raw(e,r){return(new t).raw(this,e,r)}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 s=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){if(null==n)continue;let o=t.get(n.input);null==o&&(o=s,t.set(n.input,s),s++),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=r){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)}}return Ii=a,a.default=a,Ii}function Ca(){if(Mi)return Ei;Mi=1;let e=Sa();class t extends e{constructor(e){super(e),this.type="comment"}}return Ei=t,t.default=t,Ei}function xa(){if(Pi)return Ri;Pi=1;let e=Sa();class t extends e{get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}}return Ri=t,t.default=t,Ri}function ka(){if(Ti)return Ai;Ti=1;let e,t,r,n,s=Ca(),o=xa(),i=Sa(),{isClean:a,my:l}=ba();function c(e){return e.map(e=>(e.nodes&&(e.nodes=c(e.nodes)),delete e.source,e))}function u(e){if(e[a]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)u(t)}class h extends i{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]}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),s=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let e of s)this.proxyOf.nodes.splice(n+1,0,e);for(let e in this.indexes)r=this.indexes[e],n<r&&(this.indexes[e]=r+s.length);return this.markDirty(),this}insertBefore(e,t){let r,n=this.index(e),s=0===n&&"prepend",o=this.normalize(t,this.proxyOf.nodes[n],s).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(r,i){if("string"==typeof r)r=c(t(r).nodes);else if(void 0===r)r=[];else if(Array.isArray(r)){r=r.slice(0);for(let e of r)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===r.type&&"document"!==this.type){r=r.nodes.slice(0);for(let e of r)e.parent&&e.parent.removeChild(e,"ignore")}else if(r.type)r=[r];else if(r.prop){if(void 0===r.value)throw new Error("Value field is missed in node creation");"string"!=typeof r.value&&(r.value=String(r.value)),r=[new o(r)]}else if(r.selector||r.selectors)r=[new n(r)];else if(r.name)r=[new e(r)];else{if(!r.text)throw new Error("Unknown node type in node creation");r=[new s(r)]}return r.map(e=>(e[l]||h.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[a]&&u(e),e.raws||(e.raws={}),void 0===e.raws.before&&i&&void 0!==i.raws.before&&(e.raws.before=i.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)}))}}return h.registerParse=e=>{t=e},h.registerRule=e=>{n=e},h.registerAtRule=t=>{e=t},h.registerRoot=e=>{r=e},Ai=h,h.default=h,h.rebuild=t=>{"atrule"===t.type?Object.setPrototypeOf(t,e.prototype):"rule"===t.type?Object.setPrototypeOf(t,n.prototype):"decl"===t.type?Object.setPrototypeOf(t,o.prototype):"comment"===t.type?Object.setPrototypeOf(t,s.prototype):"root"===t.type&&Object.setPrototypeOf(t,r.prototype),t[l]=!0,t.nodes&&t.nodes.forEach(e=>{h.rebuild(e)})},Ai}function Ia(){if(Li)return Ni;Li=1;let e=ka();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 Ni=t,t.default=t,e.registerAtRule(t),Ni}function Oa(){if(_i)return Fi;_i=1;let e,t,r=ka();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},Fi=n,n.default=n,Fi}function Ea(){if(Bi)return Di;Bi=1;return Di={nanoid:(e=21)=>{let t="",r=0|e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(r=t)=>{let n="",s=0|r;for(;s--;)n+=e[Math.random()*e.length|0];return n}},Di}function Ma(){if(ji)return Ui;ji=1;let{existsSync:e,readFileSync:t}=fi,{dirname:r,join:n}=fi,{SourceMapConsumer:s,SourceMapGenerator:o}=fi;class i{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let n=t.map?t.map.prev:void 0,s=this.loadMap(t.from,n);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=r(this.mapFile)),s&&(this.text=s)}consumer(){return this.consumerCache||(this.consumerCache=new s(this.text)),this.consumerCache}decodeInline(e){let t=e.match(/^data:application\/json;charset=utf-?8,/)||e.match(/^data:application\/json,/);if(t)return decodeURIComponent(e.substr(t[0].length));let r=e.match(/^data:application\/json;charset=utf-?8;base64,/)||e.match(/^data:application\/json;base64,/);if(r)return n=e.substr(r[0].length),Buffer?Buffer.from(n,"base64").toString():window.atob(n);var n;let s=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+s)}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=/g);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(n){if(this.root=r(n),e(n))return this.mapFile=n,t(n,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof s)return o.fromSourceMap(t).toString();if(t instanceof o)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let r=t(e);if(r){let e=this.loadFile(r);if(!e)throw new Error("Unable to load previous source map: "+r.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=n(r(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return Ui=i,i.default=i,Ui}function Ra(){if(Wi)return zi;Wi=1;let{nanoid:e}=Ea(),{isAbsolute:t,resolve:r}=fi,{SourceMapConsumer:n,SourceMapGenerator:s}=fi,{fileURLToPath:o,pathToFileURL:i}=fi,a=Si(),l=Ma(),c=fi,u=Symbol("lineToIndexCache"),h=Boolean(n&&s),d=Boolean(r&&t);function p(e){if(e[u])return e[u];let t=e.css.split("\n"),r=new Array(t.length),n=0;for(let e=0,s=t.length;e<s;e++)r[e]=n,n+=t[e].length+1;return e[u]=r,r}class f{get from(){return this.file||this.id}constructor(n,s={}){if(null==n||"object"==typeof n&&!n.toString)throw new Error(`PostCSS received ${n} instead of CSS string`);if(this.css=n.toString(),"\ufeff"===this.css[0]||""===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,this.document=this.css,s.document&&(this.document=s.document.toString()),s.from&&(!d||/^\w+:\/\//.test(s.from)||t(s.from)?this.file=s.from:this.file=r(s.from)),d&&h){let e=new l(this.css,s);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 "+e(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let s,o,l,c,u;if(t&&"object"==typeof t){let e=t,n=r;if("number"==typeof e.offset){c=e.offset;let n=this.fromOffset(c);t=n.line,r=n.col}else t=e.line,r=e.column,c=this.fromLineAndColumn(t,r);if("number"==typeof n.offset){l=n.offset;let e=this.fromOffset(l);o=e.line,s=e.col}else o=n.line,s=n.column,l=this.fromLineAndColumn(n.line,n.column)}else if(r)c=this.fromLineAndColumn(t,r);else{c=t;let e=this.fromOffset(c);t=e.line,r=e.col}let h=this.origin(t,r,o,s);return u=h?new a(e,void 0===h.endLine?h.line:{column:h.column,line:h.line},void 0===h.endLine?h.column:{column:h.endColumn,line:h.endLine},h.source,h.file,n.plugin):new a(e,void 0===o?t:{column:r,line:t},void 0===o?r:{column:s,line:o},this.css,this.file,n.plugin),u.input={column:r,endColumn:s,endLine:o,endOffset:l,line:t,offset:c,source:this.css},this.file&&(i&&(u.input.url=i(this.file).toString()),u.input.file=this.file),u}fromLineAndColumn(e,t){return p(this)[e-1]+t-1}fromOffset(e){let t=p(this),r=0;if(e>=t[t.length-1])r=t.length-1;else{let n,s=t.length-2;for(;r<s;)if(n=r+(s-r>>1),e<t[n])s=n-1;else{if(!(e>=t[n+1])){r=n;break}r=n+1}}return{col:e-t[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:r(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,r,n,s){if(!this.map)return!1;let a,l,c=this.map.consumer(),u=c.originalPositionFor({column:r,line:e});if(!u.source)return!1;"number"==typeof n&&(a=c.originalPositionFor({column:s,line:n})),l=t(u.source)?i(u.source):new URL(u.source,this.map.consumer().sourceRoot||i(this.map.mapFile));let h={column:u.column,endColumn:a&&a.column,endLine:a&&a.line,line:u.line,url:l.toString()};if("file:"===l.protocol){if(!o)throw new Error("file: protocol is not available in this PostCSS build");h.file=o(l)}let d=c.sourceContentFor(u.source);return d&&(h.source=d),h}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}}return zi=f,f.default=f,c&&c.registerInput&&c.registerInput(f),zi}function Pa(){if($i)return qi;$i=1;let e,t,r=ka();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},qi=n,n.default=n,r.registerRoot(n),qi}function Aa(){if(Gi)return Vi;Gi=1;let e={comma:t=>e.split(t,[","],!0),space:t=>e.split(t,[" ","\n","\t"]),split(e,t,r){let n=[],s="",o=!1,i=0,a=!1,l="",c=!1;for(let r of e)c?c=!1:"\\"===r?c=!0:a?r===l&&(a=!1):'"'===r||"'"===r?(a=!0,l=r):"("===r?i+=1:")"===r?i>0&&(i-=1):0===i&&t.includes(r)&&(o=!0),o?(""!==s&&n.push(s.trim()),s="",o=!1):s+=r;return(r||""!==s)&&n.push(s.trim()),n}};return Vi=e,e.default=e,Vi}function Ta(){if(Ji)return Hi;Ji=1;let e=ka(),t=Aa();class r extends e{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)}constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}}return Hi=r,r.default=r,e.registerRule(r),Hi}function Na(){if(Xi)return Qi;Xi=1;let{dirname:e,relative:t,resolve:r,sep:n}=fi,{SourceMapConsumer:s,SourceMapGenerator:o}=fi,{pathToFileURL:i}=fi,a=Ra(),l=Boolean(s&&o),c=Boolean(e&&r&&t&&n);return Qi=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 r,n=this.toUrl(this.path(t.file)),o=t.root||e(t.file);!1===this.mapOpts.sourcesContent?(r=new s(t.text),r.sourcesContent&&(r.sourcesContent=null)):r=t.consumer(),this.map.applySourceMap(r,n,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&&e.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),c&&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=o.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new o({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 o({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,r=1,n=1,s="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(o,a,l)=>{if(this.css+=o,a&&"end"!==l&&(i.generated.line=r,i.generated.column=n-1,a.source&&a.source.start?(i.source=this.sourcePath(a),i.original.line=a.source.start.line,i.original.column=a.source.start.column-1,this.map.addMapping(i)):(i.source=s,i.original.line=1,i.original.column=0,this.map.addMapping(i))),t=o.match(/\n/g),t?(r+=t.length,e=o.lastIndexOf("\n"),n=o.length-e):n+=o.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?(i.source=this.sourcePath(a),i.original.line=a.source.end.line,i.original.column=a.source.end.column-1,i.generated.line=r,i.generated.column=n-2,this.map.addMapping(i)):(i.source=s,i.original.line=1,i.original.column=0,i.generated.line=r,i.generated.column=n-1,this.map.addMapping(i)))}})}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(n){if(this.mapOpts.absolute)return n;if(60===n.charCodeAt(0))return n;if(/^\w+:\/\//.test(n))return n;let s=this.memoizedPaths.get(n);if(s)return s;let o=this.opts.to?e(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(o=e(r(o,this.mapOpts.annotation)));let i=t(o,n);return this.memoizedPaths.set(n,i),i}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(i){let t=i(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;"\\"===n&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}}}function La(){if(ra)return ta;ra=1;let e=Ia(),t=Ca(),r=xa(),n=Pa(),s=Ta(),o=function(){if(ea)return Zi;ea=1;const e="'".charCodeAt(0),t='"'.charCodeAt(0),r="\\".charCodeAt(0),n="/".charCodeAt(0),s="\n".charCodeAt(0),o=" ".charCodeAt(0),i="\f".charCodeAt(0),a="\t".charCodeAt(0),l="\r".charCodeAt(0),c="[".charCodeAt(0),u="]".charCodeAt(0),h="(".charCodeAt(0),d=")".charCodeAt(0),p="{".charCodeAt(0),f="}".charCodeAt(0),m=";".charCodeAt(0),g="*".charCodeAt(0),v=":".charCodeAt(0),y="@".charCodeAt(0),w=/[\t\n\f\r "#'()/;[\\\]{}]/g,b=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,S=/.[\r\n"'(/\\]/,C=/[\da-f]/i;return Zi=function(x,k={}){let I,O,E,M,R,P,A,T,N,L,F=x.css.valueOf(),_=k.ignoreErrors,D=F.length,B=0,U=[],j=[];function z(e){throw x.error("Unclosed "+e,B)}return{back:function(e){j.push(e)},endOfFile:function(){return 0===j.length&&B>=D},nextToken:function(x){if(j.length)return j.pop();if(B>=D)return;let k=!!x&&x.ignoreUnclosed;switch(I=F.charCodeAt(B),I){case s:case o:case a:case l:case i:M=B;do{M+=1,I=F.charCodeAt(M)}while(I===o||I===s||I===a||I===l||I===i);P=["space",F.slice(B,M)],B=M-1;break;case c:case u:case p:case f:case v:case m:case d:{let e=String.fromCharCode(I);P=[e,e,B];break}case h:if(L=U.length?U.pop()[1]:"",N=F.charCodeAt(B+1),"url"===L&&N!==e&&N!==t&&N!==o&&N!==s&&N!==a&&N!==i&&N!==l){M=B;do{if(A=!1,M=F.indexOf(")",M+1),-1===M){if(_||k){M=B;break}z("bracket")}for(T=M;F.charCodeAt(T-1)===r;)T-=1,A=!A}while(A);P=["brackets",F.slice(B,M+1),B,M],B=M}else M=F.indexOf(")",B+1),O=F.slice(B,M+1),-1===M||S.test(O)?P=["(","(",B]:(P=["brackets",O,B,M],B=M);break;case e:case t:R=I===e?"'":'"',M=B;do{if(A=!1,M=F.indexOf(R,M+1),-1===M){if(_||k){M=B+1;break}z("string")}for(T=M;F.charCodeAt(T-1)===r;)T-=1,A=!A}while(A);P=["string",F.slice(B,M+1),B,M],B=M;break;case y:w.lastIndex=B+1,w.test(F),M=0===w.lastIndex?F.length-1:w.lastIndex-2,P=["at-word",F.slice(B,M+1),B,M],B=M;break;case r:for(M=B,E=!0;F.charCodeAt(M+1)===r;)M+=1,E=!E;if(I=F.charCodeAt(M+1),E&&I!==n&&I!==o&&I!==s&&I!==a&&I!==l&&I!==i&&(M+=1,C.test(F.charAt(M)))){for(;C.test(F.charAt(M+1));)M+=1;F.charCodeAt(M+1)===o&&(M+=1)}P=["word",F.slice(B,M+1),B,M],B=M;break;default:I===n&&F.charCodeAt(B+1)===g?(M=F.indexOf("*/",B+2)+1,0===M&&(_||k?M=F.length:z("comment")),P=["comment",F.slice(B,M+1),B,M],B=M):(b.lastIndex=B+1,b.test(F),M=0===b.lastIndex?F.length-1:b.lastIndex-2,P=["word",F.slice(B,M+1),B,M],U.push(P),B=M)}return B++,P},position:function(){return B}}}}();const i={empty:!0,space:!0};return ta=class{constructor(e){this.input=e,this.root=new n,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(t){let r,n,s,o=new e;o.name=t[1].slice(1),""===o.name&&this.unnamedAtrule(o,t),this.init(o,t[2]);let i=!1,a=!1,l=[],c=[];for(;!this.tokenizer.endOfFile();){if(r=(t=this.tokenizer.nextToken())[0],"("===r||"["===r?c.push("("===r?")":"]"):"{"===r&&c.length>0?c.push("}"):r===c[c.length-1]&&c.pop(),0===c.length){if(";"===r){o.source.end=this.getPosition(t[2]),o.source.end.offset++,this.semicolon=!0;break}if("{"===r){a=!0;break}if("}"===r){if(l.length>0){for(s=l.length-1,n=l[s];n&&"space"===n[0];)n=l[--s];n&&(o.source.end=this.getPosition(n[3]||n[2]),o.source.end.offset++)}this.end(t);break}l.push(t)}else l.push(t);if(this.tokenizer.endOfFile()){i=!0;break}}o.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(o.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(o,"params",l),i&&(t=l[l.length-1],o.source.end=this.getPosition(t[3]||t[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 s=t-1;s>=0&&(r=e[s],"space"===r[0]||(n+=1,2!==n));s--);throw this.input.error("Missed semicolon","word"===r[0]?r[3]+1:r[2])}colon(e){let t,r,n,s=0;for(let[o,i]of e.entries()){if(r=i,n=r[0],"("===n&&(s+=1),")"===n&&(s-=1),0===s&&":"===n){if(t){if("word"===t[0]&&"progid"===t[1])continue;return o}this.doubleColon(r)}t=r}return!1}comment(e){let r=new t;this.init(r,e[2]),r.source.end=this.getPosition(e[3]||e[2]),r.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))r.text="",r.raws.left=n,r.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);r.text=e[2],r.raws.left=e[1],r.raws.right=e[3]}}createTokenizer(){this.tokenizer=o(this.input)}decl(e,t){let n=new r;this.init(n,e[0][2]);let s,o=e[e.length-1];for(";"===o[0]&&(this.semicolon=!0,e.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}}(e)),n.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),n.raws.before+=e.shift()[1];for(n.source.start=this.getPosition(e[0][2]),n.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;n.prop+=e.shift()[1]}for(n.raws.between="";e.length;){if(s=e.shift(),":"===s[0]){n.raws.between+=s[1];break}"word"===s[0]&&/\w/.test(s[1])&&this.unknownWord([s]),n.raws.between+=s[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let i,a=[];for(;e.length&&(i=e[0][0],"space"===i||"comment"===i);)a.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(s=e[t],"!important"===s[1].toLowerCase()){n.important=!0;let r=this.stringFrom(e,t);r=this.spacesFromEnd(e)+r," !important"!==r&&(n.raws.important=r);break}if("important"===s[1].toLowerCase()){let r=e.slice(0),s="";for(let e=t;e>0;e--){let t=r[e][0];if(s.trim().startsWith("!")&&"space"!==t)break;s=r.pop()[1]+s}s.trim().startsWith("!")&&(n.important=!0,n.raws.important=s,e=r)}if("space"!==s[0]&&"comment"!==s[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(n,"value",a.concat(e),t),n.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new s;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 t=this.current.nodes[this.current.nodes.length-1];t&&"rule"===t.type&&!t.raws.ownSemicolon&&(t.raws.ownSemicolon=this.spaces,this.spaces="",t.source.end=this.getPosition(e[2]),t.source.end.offset+=t.raws.ownSemicolon.length)}}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,s=null,o=[],i=e[1].startsWith("--"),a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)s||(s=l),o.push("("===r?")":"]");else if(i&&n&&"{"===r)s||(s=l),o.push("}");else if(0===o.length){if(";"===r){if(n)return void this.decl(a,i);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&&(s=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(s),t&&n){if(!i)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,i)}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 s,o,a,l,c=r.length,u="",h=!0;for(let e=0;e<c;e+=1)s=r[e],o=s[0],"space"!==o||e!==c-1||n?"comment"===o?(l=r[e-1]?r[e-1][0]:"empty",a=r[e+1]?r[e+1][0]:"empty",i[l]||i[a]||","===u.slice(-1)?h=!1:u+=s[1]):u+=s[1]:h=!1;if(!h){let n=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:n,value:u}}e[t]=u}rule(e){e.pop();let t=new s;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 "+e[0][1],{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})}},ta}function Fa(){if(sa)return na;sa=1;let e=ka(),t=Ra(),r=La();function n(e,n){let s=new t(e,n),o=new r(s);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 na=n,n.default=n,e.registerParse(n),na}function _a(){if(ia)return oa;ia=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 oa=e,e.default=e,oa}function Da(){if(la)return aa;la=1;let e=_a();class t{get content(){return this.css}constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css="",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)}}return aa=t,t.default=t,aa}function Ba(){if(ua)return ca;ua=1;let e={};return ca=function(t){e[t]||(e[t]=!0,"undefined"!=typeof console&&console.warn&&console.warn(t))}}function Ua(){if(da)return ha;da=1;let e=ka(),t=Oa(),r=Na(),n=Fa(),s=Da(),o=Pa(),i=xi(),{isClean:a,my:l}=ba(),c=Ba();const u={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},h={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},d={Once:!0,postcssPlugin:!0,prepare:!0};function p(e){return"object"==typeof e&&"function"==typeof e.then}function f(e){let t=!1,r=u[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 m(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 g(e){return e[a]=!1,e.nodes&&e.nodes.forEach(e=>g(e)),e}let v={};class y{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"}constructor(t,r,o){let i;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof y||r instanceof s)i=g(r.root),r.map&&(void 0===o.map&&(o.map={}),o.map.inline||(o.map.inline=!1),o.map.prev=r.map);else{let t=n;o.syntax&&(t=o.syntax.parse),o.parser&&(t=o.parser),t.parse&&(t=t.parse);try{i=t(r,o)}catch(e){this.processed=!0,this.error=e}i&&!i[l]&&e.rebuild(i)}else i=g(r);this.result=new s(t,i,o),this.helpers={...v,postcss:v,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,s=t.split("."),o=n.split(".");(s[0]!==o[0]||parseInt(s[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(!h[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!d[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 e=this.result.root;for(;!e[a];){e[a]=!0;let t=[m(e)];for(;t.length>0;){let e=this.visitTick(t);if(p(e))try{await e}catch(e){let r=t[t.length-1].node;throw this.handleError(e,r)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map(e=>r(e,this.helpers));await Promise.all(t)}else await r(e,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=i;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let n=new r(t,this.result.root,this.result.opts).generate();return this.result.css=n[0],this.result.map=n[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 e=this.result.root;for(;!e[a];)e[a]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||c("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(e){let t=e[e.length-1],{node:r,visitors:n}=t;if("root"!==r.type&&"document"!==r.type&&!r.parent)return void e.pop();if(n.length>0&&t.visitorIndex<n.length){let[e,s]=n[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===n.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return s(r.toProxy(),this.helpers)}catch(e){throw this.handleError(e,r)}}if(0!==t.iterator){let n,s=t.iterator;for(;n=r.nodes[r.indexes[s]];)if(r.indexes[s]+=1,!n[a])return n[a]=!0,void e.push(m(n));t.iterator=0,delete r.indexes[s]}let s=t.events;for(;t.eventIndex<s.length;){let e=s[t.eventIndex];if(t.eventIndex+=1,0===e)return void(r.nodes&&r.nodes.length&&(r[a]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[a]=!0;let t=f(e);for(let r of t)if(0===r)e.nodes&&e.each(e=>{e[a]||this.walkSync(e)});else{let t=this.listeners[r];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}}return y.registerPostcss=e=>{v=e},ha=y,y.default=y,o.registerLazyResult(y),t.registerLazyResult(y),ha}function ja(){if(ga)return ma;ga=1;let e=Oa(),t=Ua(),r=function(){if(fa)return pa;fa=1;let e=Na(),t=Fa();const r=Da();let n=xi(),s=Ba();class o{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,r=t;try{e=r(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"}constructor(t,s,o){let i;s=s.toString(),this.stringified=!1,this._processor=t,this._css=s,this._opts=o,this._map=void 0;let a=n;this.result=new r(this._processor,i,this._opts),this.result.css=s;let l=this;Object.defineProperty(this.result,"root",{get:()=>l.root});let c=new e(a,i,this._opts,s);if(c.isMap()){let[e,t]=c.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else c.clearAnnotation(),this.result.css=c.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||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}warnings(){return[]}}return pa=o,o.default=o,pa}(),n=Pa();class s{constructor(e=[]){this.version="8.5.6",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(e,n={}){return this.plugins.length||n.parser||n.stringifier||n.syntax?new t(this,e,n):new r(this,e,n)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}return ma=s,s.default=s,n.registerProcessor(s),e.registerProcessor(s),ma}const za=ci(function(){if(ya)return va;ya=1;let e=Ia(),t=Ca(),r=ka(),n=Si(),s=xa(),o=Oa(),i=function(){if(Yi)return Ki;Yi=1;let e=Ia(),t=Ca(),r=xa(),n=Ra(),s=Ma(),o=Pa(),i=Ta();function a(l,c){if(Array.isArray(l))return l.map(e=>a(e));let{inputs:u,...h}=l;if(u){c=[];for(let e of u){let t={...e,__proto__:n.prototype};t.map&&(t.map={...t.map,__proto__:s.prototype}),c.push(t)}}if(h.nodes&&(h.nodes=l.nodes.map(e=>a(e,c))),h.source){let{inputId:e,...t}=h.source;h.source=t,null!=e&&(h.source.input=c[e])}if("root"===h.type)return new o(h);if("decl"===h.type)return new r(h);if("rule"===h.type)return new i(h);if("comment"===h.type)return new t(h);if("atrule"===h.type)return new e(h);throw new Error("Unknown node type: "+l.type)}return Ki=a,a.default=a,Ki}(),a=Ra(),l=Ua(),c=Aa(),u=Sa(),h=Fa(),d=ja(),p=Da(),f=Pa(),m=Ta(),g=xi(),v=_a();function y(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new d(e)}return y.plugin=function(e,t){let r,n=!1;function s(...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 s=t(...r);return s.postcssPlugin=e,s.postcssVersion=(new d).version,s}return Object.defineProperty(s,"postcss",{get:()=>(r||(r=s()),r)}),s.process=function(e,t,r){return y([s(r)]).process(e,t)},s},y.stringify=g,y.parse=h,y.fromJSON=i,y.list=c,y.comment=e=>new t(e),y.atRule=t=>new e(t),y.decl=e=>new s(e),y.rule=e=>new m(e),y.root=e=>new f(e),y.document=e=>new o(e),y.CssSyntaxError=n,y.Declaration=s,y.Container=r,y.Processor=d,y.Document=o,y.Comment=t,y.Warning=v,y.AtRule=e,y.Result=p,y.Input=a,y.Rule=m,y.Root=f,y.Node=u,l.registerPostcss(y),va=y,y.default=y,va}());za.stringify,za.fromJSON,za.plugin,za.parse,za.list,za.document,za.comment,za.atRule,za.rule,za.decl,za.root,za.CssSyntaxError,za.Declaration,za.Container,za.Processor,za.Document,za.Comment,za.Warning,za.AtRule,za.Result,za.Input,za.Rule,za.Root,za.Node;class Wa{constructor(...e){li(this,"parentElement",null),li(this,"parentNode",null),li(this,"ownerDocument"),li(this,"firstChild",null),li(this,"lastChild",null),li(this,"previousSibling",null),li(this,"nextSibling",null),li(this,"ELEMENT_NODE",1),li(this,"TEXT_NODE",3),li(this,"nodeType"),li(this,"nodeName"),li(this,"RRNodeType")}get childNodes(){const e=[];let t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(!(e instanceof Wa))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.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"}}const qa={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},$a={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Va={};function Ga(e){if(Va[e])return Va[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 qa?qa[e]:void 0,s=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 $a?$a[e]:void 0,i=Boolean(o&&o.every(e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))}));if(s&&i)return Va[e]=t.prototype,t.prototype;try{const n=document.createElement("iframe");document.body.appendChild(n);const s=n.contentWindow;if(!s)return t.prototype;const o=s[e].prototype;return document.body.removeChild(n),o?Va[e]=o:r}catch{return r}}const Ha={};function Ja(e,t,r){var n;const s=`${e}.${String(r)}`;if(Ha[s])return Ha[s].call(t);const o=Ga(e),i=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return i?(Ha[s]=i,i.call(t)):t[r]}const Ka={};function Ya(e,t,r){const n=`${e}.${String(r)}`;if(Ka[n])return Ka[n].bind(t);const s=Ga(e)[r];return"function"!=typeof s?t[r]:(Ka[n]=s,s.bind(t))}const Qa={childNodes:function(e){return Ja("Node",e,"childNodes")},parentNode:function(e){return Ja("Node",e,"parentNode")},parentElement:function(e){return Ja("Node",e,"parentElement")},textContent:function(e){return Ja("Node",e,"textContent")},contains:function(e,t){return Ya("Node",e,"contains")(t)},getRootNode:function(e){return Ya("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Ja("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Ja("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Ja("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Ja("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return Ga("MutationObserver").constructor}};const Xa="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.";let Za={map:{},getId:()=>(console.error(Xa),-1),getNode:()=>(console.error(Xa),null),removeNodeFromMap(){console.error(Xa)},has:()=>(console.error(Xa),!1),reset(){console.error(Xa)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Za=new Proxy(Za,{get:(e,t,r)=>("map"===t&&console.error(Xa),Reflect.get(e,t,r))}));let el=Date.now;function tl(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:Qa.parentElement(e)}/[1-9][0-9]{12}/.test(Date.now().toString())||(el=()=>(new Date).getTime());function rl(e){var t;let r=null;return"getRootNode"in e&&(null==(t=Qa.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&Qa.host(Qa.getRootNode(e))&&(r=Qa.host(Qa.getRootNode(e))),r}function nl(e){let t,r=e;for(;t=rl(r);)r=t;return r}function sl(e){const t=e.ownerDocument;if(!t)return!1;const r=nl(e);return Qa.contains(t,r)}const ol=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){ps(this,"id",1),ps(this,"styleIDMap",new WeakMap),ps(this,"idStyleMap",new Map)}getId(e){return this.styleIDMap.get(e)??-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++}},get _mirror(){return Za},closestElementOfNode:tl,getBaseDimension:function e(t,r){var n,s;const o=null==(s=null==(n=t.ownerDocument)?void 0:n.defaultView)?void 0:s.frameElement;if(!o||o===r)return{x:0,y:0,relativeScale:1,absoluteScale:1};const i=o.getBoundingClientRect(),a=e(o,r),l=i.height/o.clientHeight;return{x:i.x*a.relativeScale+a.x,y:i.y*a.relativeScale+a.y,relativeScale:l,absoluteScale:a.absoluteScale*l}},getNestedRule:function e(t,r){const n=t[r[0]];return 1===r.length?n:e(n.cssRules[r[1]].cssRules,r.slice(2))},getPositionsAndIndex:function(e){const t=[...e],r=t.pop();return{positions:t,index:r}},getRootShadowHost:nl,getShadowHost:rl,getWindowHeight:function(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight},getWindowScroll:function(e){var t,r,n,s;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=Qa.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=Qa.parentElement(o.body))?void 0:n.scrollTop)||(null==(s=null==o?void 0:o.body)?void 0:s.scrollTop)||0}},getWindowWidth:function(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth},hasShadowRoot:function(e){return!!e&&(e instanceof Wa&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(Qa.shadowRoot(e)))},hookSetter:function e(t,r,n,s,o=window){const i=o.Object.getOwnPropertyDescriptor(t,r);return o.Object.defineProperty(t,r,s?n:{set(e){setTimeout(()=>{n.set.call(this,e)},0),i&&i.set&&i.set.call(this,e)}}),()=>e(t,r,i||{},!0)},inDom:function(e){const t=e.ownerDocument;return!!t&&(Qa.contains(t,e)||sl(e))},isAncestorRemoved:function e(t,r){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)}(t))return!1;const n=r.getId(t);if(!r.has(n))return!0;const s=Qa.parentNode(t);return(!s||s.nodeType!==t.DOCUMENT_NODE)&&(!s||e(s,r))},isBlocked:function(e,t,r,n){if(!e)return!1;const s=tl(e);if(!s)return!1;try{if("string"==typeof t){if(s.classList.contains(t))return!0;if(n&&null!==s.closest("."+t))return!0}else if(Os(s,t,n))return!0}catch(e){}if(r){if(s.matches(r))return!0;if(n&&null!==s.closest(r))return!0}return!1},isIgnored:function(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||-2===t.getId(e)},isSerialized:function(e,t){return-1!==t.getId(e)},isSerializedIframe:function(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))},isSerializedStylesheet:function(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))},iterateResolveTree:function e(t,r){r(t.value);for(let n=t.children.length-1;n>=0;n--)e(t.children[n],r)},legacy_isTouchEvent:function(e){return Boolean(e.changedTouches)},get nowTimestamp(){return el},on:function(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)},patch:function(e,t,r){try{if(!(t in e))return()=>{};const n=e[t],s=r(n);return"function"==typeof s&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=s,()=>{e[t]=n}}catch{return()=>{}}},polyfill: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)},queueToResolveTrees:function(e){const t={},r=(e,r)=>{const n={value:e,parent:r,children:[]};return t[e.node.id]=n,n},n=[];for(const s of e){const{nextId:e,parentId:o}=s;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(s,o.parent))}else{const e=n.indexOf(o);n.splice(e,0,r(s,null))}continue}if(o in t){const e=t[o];e.children.push(r(s,e));continue}n.push(r(s,null))}return n},shadowHostInDom:sl,throttle:function(e,t,r={}){let n=null,s=0;return function(...o){const i=Date.now();s||!1!==r.leading||(s=i);const a=t-(i-s),l=this;a<=0||a>t?(n&&(clearTimeout(n),n=null),s=i,e.apply(l,o)):n||!1===r.trailing||(n=setTimeout(()=>{s=!1===r.leading?0:Date.now(),n=null,e.apply(l,o)},a))}},uniqueTextMutations:function(e){const t=new Set,r=[];for(let n=e.length;n--;){const s=e[n];t.has(s.id)||(r.push(s),t.add(s.id))}return r}},Symbol.toStringTag,{value:"Module"}));for(var il="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",al="undefined"==typeof Uint8Array?[]:new Uint8Array(256),ll=0;ll<64;ll++)al[il.charCodeAt(ll)]=ll;"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==(ns=e.contentWindow)?void 0:ns.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}var cl,ul;new Is,(ul=cl||(cl={}))[ul.NotStarted=0]="NotStarted",ul[ul.Running=1]="Running",ul[ul.Stopped=2]="Stopped";class hl{constructor(e){hs(this,"fileName"),hs(this,"functionName"),hs(this,"lineNumber"),hs(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}`}}const dl=/(^|@)\S+:\d+/,pl=/^\s*at .*(\S+:\d+|\(native\))/m,fl=/^(eval@)?(\[native code])?$/,ml={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(pl)?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(pl)},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),s=this.extractLocation(r?r[1]:n.pop()),o=n.join(" ")||void 0,i=["eval","<anonymous>"].indexOf(s[0])>-1?void 0:s[0];return new hl({functionName:o,fileName:i,lineNumber:s[1],columnNumber:s[2]})},this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter(function(e){return!e.match(fl)},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 hl({functionName:e});{const t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),n=r&&r[1]?r[1]:void 0,s=this.extractLocation(e.replace(t,""));return new hl({functionName:n,fileName:s[0],lineNumber:s[1],columnNumber:s[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,s=r.length;e<s;e+=2){const s=t.exec(r[e]);s&&n.push(new hl({fileName:s[2],lineNumber:parseFloat(s[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,s=r.length;e<s;e+=2){const s=t.exec(r[e]);s&&n.push(new hl({functionName:s[3]||void 0,fileName:s[2],lineNumber:parseFloat(s[1])}))}return n},parseOpera11:function(e){return e.stack.split("\n").filter(function(e){return!!e.match(dl)&&!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 hl({functionName:n,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})},this)}};function gl(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,s=[];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&&s.push(t)}s.length>1&&(r+=`:eq(${s.indexOf(e)})`),t=r+(t?">"+t:""),e=n}return t}function vl(e){return"[object Object]"===Object.prototype.toString.call(e)}function yl(e,t){if(0===t)return!0;const r=Object.keys(e);for(const n of r)if(vl(e[n])&&yl(e[n],t-1))return!0;return!1}function wl(e,t){const r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,t);const n=[],s=[];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?s.splice(r,1/0,e):s.push(e),~n.indexOf(t)&&(t=n[0]===t?"[Circular ~]":"[Circular ~."+s.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(vl(e)&&Object.keys(e).length>r.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(vl(e)&&yl(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]=gl(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})}const bl={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};function Sl(e,t,r){const n=r?Object.assign({},bl,r):bl,s=n.logger;if(!s)return()=>{};let o;o="string"==typeof s?t[s]:s;let i=0,a=!1;const l=[];if(n.level.includes("error")){const r=t=>{const r=t.message,s=t.error,o=ml.parse(s).map(e=>e.toString()),i=[wl(r,n.stringifyOptions)];e({level:"error",trace:o,payload:i})};t.addEventListener("error",r),l.push(()=>{t.removeEventListener("error",r)});const s=t=>{let r,s;t.reason instanceof Error?(r=t.reason,s=[wl(`Uncaught (in promise) ${r.name}: ${r.message}`,n.stringifyOptions)]):(r=new Error,s=[wl("Uncaught (in promise)",n.stringifyOptions),wl(t.reason,n.stringifyOptions)]);const o=ml.parse(r).map(e=>e.toString());e({level:"error",trace:o,payload:s})};t.addEventListener("unhandledrejection",s),l.push(()=>{t.removeEventListener("unhandledrejection",s)})}for(const e of n.level)l.push(c(o,e));return()=>{l.forEach(e=>e())};function c(t,r){return t[r]?ol.patch(t,r,t=>(...s)=>{if(t.apply(this,s),!("assert"===r&&s[0]||a)){a=!0;try{const t=ml.parse(new Error).map(e=>e.toString()).splice(1),o=("assert"===r?s.slice(1):s).map(e=>wl(e,n.stringifyOptions));i++,i<n.lengthThreshold?e({level:r,trace:t,payload:o}):i===n.lengthThreshold&&e({level:"warn",trace:[],payload:[wl("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...s)}finally{a=!1}}}):()=>{}}}const Cl="rrweb/console@1";var xl,kl=Object.freeze({__proto__:null,PLUGIN_NAME:Cl,getRecordConsolePlugin:e=>({name:Cl,observer:Sl,options:e})}),Il=Object.defineProperty,Ol=(e,t,r)=>((e,t,r)=>t in e?Il(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),El=Object.defineProperty,Ml=(e,t,r)=>((e,t,r)=>t in e?El(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Rl=(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))(Rl||{});const Pl={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Al={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Tl={};function Nl(e){if(Tl[e])return Tl[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 Pl?Pl[e]:void 0,s=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 Al?Al[e]:void 0,i=Boolean(o&&o.every(e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))}));if(s&&i)return Tl[e]=t.prototype,t.prototype;try{const n=document.createElement("iframe");document.body.appendChild(n);const s=n.contentWindow;if(!s)return t.prototype;const o=s[e].prototype;return document.body.removeChild(n),o?Tl[e]=o:r}catch{return r}}const Ll={};function Fl(e,t,r){var n;const s=`${e}.${String(r)}`;if(Ll[s])return Ll[s].call(t);const o=Nl(e),i=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return i?(Ll[s]=i,i.call(t)):t[r]}const _l={};function Dl(e,t,r){const n=`${e}.${String(r)}`;if(_l[n])return _l[n].bind(t);const s=Nl(e)[r];return"function"!=typeof s?t[r]:(_l[n]=s,s.bind(t))}const Bl={childNodes:function(e){return Fl("Node",e,"childNodes")},parentNode:function(e){return Fl("Node",e,"parentNode")},parentElement:function(e){return Fl("Node",e,"parentElement")},textContent:function(e){return Fl("Node",e,"textContent")},contains:function(e,t){return Dl("Node",e,"contains")(t)},getRootNode:function(e){return Dl("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Fl("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Fl("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Fl("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Fl("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return Nl("MutationObserver").constructor}};function Ul(e){return e.nodeType===e.ELEMENT_NODE}function jl(e){const t=e&&"host"in e&&"mode"in e&&Bl.host(e)||null;return Boolean(t&&"shadowRoot"in t&&Bl.shadowRoot(t)===e)}function zl(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function Wl(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 s=Array.from(r,e=>ql(e,n)).join("");return(t=s).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 ql(e,t){if(function(e){return"styleSheet"in e}(e)){let t;try{t=Wl(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?ec(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?ec(r,t):r}}class $l{constructor(){Ml(this,"idNodeMap",new Map),Ml(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;return(null==(t=this.getMeta(e))?void 0:t.id)??-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}}function Vl({element:e,maskInputOptions:t,tagName:r,type:n,value:s,maskInputFn:o}){let i=s||"";const a=n&&Gl(n);return(t[r.toLowerCase()]||a&&t[a])&&(i=o?o(i,e):"*".repeat(i.length)),i}function Gl(e){return e.toLowerCase()}const Hl="__rrweb_original__";function Jl(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Gl(t):null}function Kl(e,t){let r;try{r=new URL(e,t??window.location.href)}catch(e){return null}const n=r.pathname.match(/\.([0-9a-z]+)(?:$)/i);return(null==n?void 0:n[1])??null}const Yl=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Ql=/^(?:[a-z+]+:)?\/\//i,Xl=/^www\..*/i,Zl=/^(data:)([^,]*),(.*)/i;function ec(e,t){return(e||"").replace(Yl,(e,r,n,s,o,i)=>{const a=n||o||i,l=r||s||"";if(!a)return e;if(Ql.test(a)||Xl.test(a))return`url(${l}${a}${l})`;if(Zl.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 c=t.split("/"),u=a.split("/");c.pop();for(const e of u)"."!==e&&(".."===e?c.pop():c.push(e));return`url(${l}${c.join("/")}${l})`})}function tc(e,t=!1){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function rc(e,t){return function(e,t,r=!1){const n=Array.from(t.childNodes),s=[];let o=0;if(n.length>1&&e&&"string"==typeof e){let t=tc(e,r);const i=t.length/e.length;for(let a=1;a<n.length;a++)if(n[a].textContent&&"string"==typeof n[a].textContent){const l=tc(n[a].textContent,r),c=100;let u=3;for(;u<l.length&&(l[u].match(/[a-zA-Z0-9]/)||-1!==l.indexOf(l.substring(0,u),1));u++);for(;u<l.length;u++){let h=l.substring(0,u),d=t.split(h),p=-1;if(2===d.length)p=d[0].length;else if(d.length>2&&""===d[0]&&""!==n[a-1].textContent)p=t.indexOf(h,1);else if(1===d.length){if(h=h.substring(0,h.length-1),d=t.split(h),d.length<=1)return s.push(e),s;u=c+1}else u===l.length-1&&(p=t.indexOf(h));if(d.length>=2&&u>c){const e=n[a-1].textContent;if(e&&"string"==typeof e){const r=tc(e).length;p=t.indexOf(h,r)}-1===p&&(p=d[0].length)}if(-1!==p){let a=Math.floor(p/i);for(;a>0&&a<e.length;){if(o+=1,o>50*n.length)return s.push(e),s;const l=tc(e.substring(0,a),r);if(l.length===p){s.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)/i)):a-=Math.max(1,Math.floor((l.length-p)*i))}break}}}}return s.push(e),s}(e,t).join("/* rr_split */")}const nc="lightgrey";let sc=1;const oc=new RegExp("[^a-z0-9-_:]");function ic(){return sc++}let ac,lc;const cc=/^[^ \t\n\r\u000c]+/,uc=/^[, \t\n\r\u000c]+/;const hc=new WeakMap;function dc(e,t){return t&&""!==t.trim()?fc(e,t):t}function pc(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function fc(e,t){let r=hc.get(e);if(r||(r=e.createElement("a"),hc.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function mc(e,t,r,n){return n?"src"===r||"href"===r&&("use"!==t||"#"!==n[0])||"xlink:href"===r&&"#"!==n[0]?dc(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 s=e.exec(t.substring(r));return s?(n=s[0],r+=n.length,n):""}const s=[];for(;n(uc),!(r>=t.length);){let o=n(cc);if(","===o.slice(-1))o=dc(e,o.substring(0,o.length-1)),s.push(o);else{let n="";o=dc(e,o);let i=!1;for(;;){const e=t.charAt(r);if(""===e){s.push((o+n).trim());break}if(i)")"===e&&(i=!1);else{if(","===e){r+=1,s.push((o+n).trim());break}"("===e&&(i=!0)}n+=e,r+=1}}}return s.join(", ")}(e,n):"style"===r?ec(n,fc(e)):"object"===t&&"data"===r?dc(e,n):n:dc(e,n):n}function gc(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function vc(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&vc(Bl.parentNode(e),t,r);for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!!r&&vc(Bl.parentNode(e),t,r)}function yc(e,t,r,n){let s;if(Ul(e)){if(s=e,!Bl.childNodes(s).length)return!1}else{if(null===Bl.parentElement(e))return!1;s=Bl.parentElement(e)}try{if("string"==typeof t){if(n){if(s.closest(`.${t}`))return!0}else if(s.classList.contains(t))return!0}else if(vc(s,t,n))return!0;if(r)if(n){if(s.closest(r))return!0}else if(s.matches(r))return!0}catch(e){}return!1}function wc(e,t){const{doc:r,mirror:n,blockClass:s,blockSelector:o,needsMask:i,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:c,maskInputFn:u,maskAttributeFn:h,dataURLOptions:d={},inlineImages:p,recordCanvas:f,keepIframeSrcFn:m,newlyAddedElement:g=!1,cssCaptured:v=!1,applyBackgroundColorToBlockedElements:y=!1}=t,w=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:Rl.Document,childNodes:[],compatMode:e.compatMode}:{type:Rl.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:Rl.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:w};case e.ELEMENT_NODE:return function(e,t){const{doc:r,blockClass:n,blockSelector:s,inlineStylesheet:o,maskInputOptions:i={},maskInputFn:a,maskAttributeFn:l,dataURLOptions:c={},inlineImages:u,recordCanvas:h,keepIframeSrcFn:d,newlyAddedElement:p=!1,rootId:f,applyBackgroundColorToBlockedElements:m=!1}=t,g=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,s),v=function(e){if(e instanceof HTMLFormElement)return"form";const t=Gl(e.tagName);return oc.test(t)?"div":t}(e);let y={};const w=e.attributes.length;for(let t=0;t<w;t++){const n=e.attributes[t];if(!gc(v,n.name,n.value)){const t=mc(r,v,Gl(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"===v&&o){const t=Array.from(r.styleSheets).find(t=>t.href===e.href);let n=null;t&&(n=Wl(t)),n&&(delete y.rel,delete y.href,y._cssText=n)}if("style"===v&&e.sheet){let t=Wl(e.sheet);t&&(e.childNodes.length>1&&(t=rc(t,e)),y._cssText=t)}if("input"===v||"textarea"===v||"select"===v){const t=e.value,r=e.checked;"radio"!==y.type&&"checkbox"!==y.type&&"submit"!==y.type&&"button"!==y.type&&t?y.value=Vl({element:e,type:Jl(e),tagName:v,value:t,maskInputOptions:i,maskInputFn:a}):r&&(y.checked=r)}"option"===v&&(e.selected&&!i.select?y.selected=!0:delete y.selected);"dialog"===v&&e.open&&(y.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal");if("canvas"===v&&h)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 s=t.getImageData,o=Hl in s?s[Hl]:s;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(c.type,c.quality));else if(!("__context"in e)){const t=e.toDataURL(c.type,c.quality),n=r.createElement("canvas");n.width=e.width,n.height=e.height;t!==n.toDataURL(c.type,c.quality)&&(y.rr_dataURL=t)}if("img"===v&&u){ac||(ac=r.createElement("canvas"),lc=ac.getContext("2d"));const t=e,n=t.currentSrc||t.getAttribute("src")||"<unknown-src>",s=t.crossOrigin,o=()=>{t.removeEventListener("load",o);try{ac.width=t.naturalWidth,ac.height=t.naturalHeight,lc.drawImage(t,0,0),y.rr_dataURL=ac.toDataURL(c.type,c.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&&(s?y.crossOrigin=s:t.removeAttribute("crossorigin"))};t.complete&&0!==t.naturalWidth?o():t.addEventListener("load",o)}if("audio"===v||"video"===v){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(g){const{width:t,height:r}=e.getBoundingClientRect();y={class:y.class,rr_width:`${t}px`,rr_height:`${r}px`,...m?{rr_background_color:nc}:{}}}"iframe"!==v||d(y.src)||(e.contentDocument||(y.rr_src=y.src),delete y.src);let b;try{customElements.get(v)&&(b=!0)}catch(e){}return{type:Rl.Element,tagName:v,attributes:y,childNodes:[],isSVG:pc(e)||void 0,needBlock:g,rootId:f,isCustom:b}}(e,{doc:r,blockClass:s,blockSelector:o,inlineStylesheet:a,maskInputOptions:l,maskInputFn:u,maskAttributeFn:h,dataURLOptions:d,inlineImages:p,recordCanvas:f,keepIframeSrcFn:m,newlyAddedElement:g,rootId:w,applyBackgroundColorToBlockedElements:y});case e.TEXT_NODE:return function(e,t){const{needsMask:r,maskTextFn:n,rootId:s,cssCaptured:o}=t,i=Bl.parentNode(e),a=i&&i.tagName;let l="";const c="STYLE"===a||void 0,u="SCRIPT"===a||void 0;u?l="SCRIPT_PLACEHOLDER":o||(l=Bl.textContent(e),c&&l&&(l=ec(l,fc(t.doc))));!c&&!u&&l&&r&&(l=n?n(l,Bl.parentElement(e)):l.replace(/[\S]/g,"*"));return{type:Rl.Text,textContent:l||"",rootId:s}}(e,{doc:r,needsMask:i,maskTextFn:c,rootId:w,cssCaptured:v});case e.CDATA_SECTION_NODE:return{type:Rl.CDATA,textContent:"",rootId:w};case e.COMMENT_NODE:return{type:Rl.Comment,textContent:Bl.textContent(e)||"",rootId:w};default:return!1}}function bc(e){return null==e?"":e.toLowerCase()}function Sc(e,t,r){return Array.from(e).map(e=>{const n=t(e);let s=[];if(!r.has(n)){r.add(n);try{s=Array.from(e.cssRules,(t,r)=>({rule:ql(t,e.href),index:r}))}catch(e){if(!(e instanceof DOMException&&"SecurityError"===e.name))throw e}}return{styleId:n,rules:s}})}function Cc(e,t){var r,n;const{doc:s,mirror:o,blockClass:i,blockSelector:a,maskTextClass:l,maskTextSelector:c,skipChild:u=!1,inlineStylesheet:h=!0,maskInputOptions:d={},maskTextFn:p,maskInputFn:f,maskAttributeFn:m,slimDOMOptions:g,dataURLOptions:v={},inlineImages:y=!1,recordCanvas:w=!1,onSerialize:b,onAdoptedStyleSheet:S,onIframeLoad:C,iframeLoadTimeout:x=5e3,onStylesheetLoad:k,stylesheetLoadTimeout:I=5e3,keepIframeSrcFn:O=()=>!1,newlyAddedElement:E=!1,cssCaptured:M=!1,applyBackgroundColorToBlockedElements:R=!1}=t,P=t._emittedStyleIds??new Set;let{needsMask:A}=t,{preserveWhiteSpace:T=!0}=t;if(!A){A=yc(e,l,c,void 0===A)}const N=wc(e,{doc:s,mirror:o,blockClass:i,blockSelector:a,needsMask:A,inlineStylesheet:h,maskInputOptions:d,maskTextFn:p,maskInputFn:f,maskAttributeFn:m,dataURLOptions:v,inlineImages:y,recordCanvas:w,keepIframeSrcFn:O,newlyAddedElement:E,cssCaptured:M,applyBackgroundColorToBlockedElements:R});if(!N)return console.warn(e,"not serialized"),null;let L;L=o.hasNode(e)?o.getId(e):function(e,t){if(t.comment&&e.type===Rl.Comment)return!0;if(e.type===Rl.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"===Kl(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(bc(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===bc(e.attributes.name)||"icon"===bc(e.attributes.rel)||"apple-touch-icon"===bc(e.attributes.rel)||"shortcut icon"===bc(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&bc(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(bc(e.attributes.property).match(/^(og|twitter|fb):/)||bc(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===bc(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===bc(e.attributes.name)||"googlebot"===bc(e.attributes.name)||"bingbot"===bc(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===bc(e.attributes.name)||"generator"===bc(e.attributes.name)||"framework"===bc(e.attributes.name)||"publisher"===bc(e.attributes.name)||"progid"===bc(e.attributes.name)||bc(e.attributes.property).match(/^article:/)||bc(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===bc(e.attributes.name)||"yandex-verification"===bc(e.attributes.name)||"csrf-token"===bc(e.attributes.name)||"p:domain_verify"===bc(e.attributes.name)||"verify-v1"===bc(e.attributes.name)||"verification"===bc(e.attributes.name)||"shopify-checkout-api-token"===bc(e.attributes.name)))return!0}}return!1}(N,g)||!T&&N.type===Rl.Text&&!N.textContent.replace(/^\s+|\s+$/gm,"").length?-2:ic();const F=Object.assign(N,{id:L});if(o.add(e,F),-2===L)return null;b&&b(e);let _=!u;if(F.type===Rl.Element){_=_&&!F.needBlock,delete F.needBlock;const t=Bl.shadowRoot(e);t&&zl(t)&&(F.isShadowHost=!0,S&&(null==(r=t.adoptedStyleSheets)?void 0:r.length)&&(F.adoptedStyleSheets=Sc(t.adoptedStyleSheets,S,P)))}if(F.type===Rl.Document&&S){const t=e;(null==(n=t.adoptedStyleSheets)?void 0:n.length)&&(F.adoptedStyleSheets=Sc(t.adoptedStyleSheets,S,P))}if((F.type===Rl.Document||F.type===Rl.Element)&&_){g.headWhitespace&&F.type===Rl.Element&&"head"===F.tagName&&(T=!1);const t={doc:s,mirror:o,blockClass:i,blockSelector:a,needsMask:A,maskTextClass:l,maskTextSelector:c,skipChild:u,inlineStylesheet:h,maskInputOptions:d,maskTextFn:p,maskInputFn:f,maskAttributeFn:m,slimDOMOptions:g,dataURLOptions:v,inlineImages:y,recordCanvas:w,preserveWhiteSpace:T,onSerialize:b,onAdoptedStyleSheet:S,_emittedStyleIds:P,onIframeLoad:C,iframeLoadTimeout:x,onStylesheetLoad:k,stylesheetLoadTimeout:I,keepIframeSrcFn:O,cssCaptured:!1,applyBackgroundColorToBlockedElements:R};if(F.type===Rl.Element&&"textarea"===F.tagName&&void 0!==F.attributes.value);else{F.type===Rl.Element&&void 0!==F.attributes._cssText&&"string"==typeof F.attributes._cssText&&(t.cssCaptured=!0);for(const r of Array.from(Bl.childNodes(e))){const e=Cc(r,t);e&&F.childNodes.push(e)}}let r=null;if(Ul(e)&&(r=Bl.shadowRoot(e)))for(const e of Array.from(Bl.childNodes(r))){const n=Cc(e,t);n&&(zl(r)&&(n.isShadow=!0),F.childNodes.push(n))}}const D=Bl.parentNode(e);return D&&jl(D)&&zl(D)&&(F.isShadow=!0),F.type===Rl.Element&&"iframe"===F.tagName&&function(e,t,r){const n=e.contentWindow;if(!n)return;let s,o=!1;try{s=n.document.readyState}catch(e){return}if("complete"!==s){const n=setTimeout(()=>{o||(t(),o=!0)},r);return void e.addEventListener("load",()=>{clearTimeout(n),o=!0,t()})}const i="about:blank";if(n.location.href!==i||e.src===i||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}(e,()=>{const t=e.contentDocument;if(t&&C){const r=Cc(t,{doc:t,mirror:o,blockClass:i,blockSelector:a,needsMask:A,maskTextClass:l,maskTextSelector:c,skipChild:!1,inlineStylesheet:h,maskInputOptions:d,maskTextFn:p,maskInputFn:f,maskAttributeFn:m,slimDOMOptions:g,dataURLOptions:v,inlineImages:y,recordCanvas:w,preserveWhiteSpace:T,onSerialize:b,onAdoptedStyleSheet:S,_emittedStyleIds:P,onIframeLoad:C,iframeLoadTimeout:x,onStylesheetLoad:k,stylesheetLoadTimeout:I,keepIframeSrcFn:O});r&&C(e,r)}},x),F.type===Rl.Element&&"link"===F.tagName&&"string"==typeof F.attributes.rel&&("stylesheet"===F.attributes.rel||"preload"===F.attributes.rel&&"string"==typeof F.attributes.href&&"css"===Kl(F.attributes.href))&&function(e,t,r){let n,s=!1;try{n=e.sheet}catch(e){return}if(n)return;const o=setTimeout(()=>{s||(t(),s=!0)},r);e.addEventListener("load",()=>{clearTimeout(o),s=!0,t()})}(e,()=>{if(k){const t=Cc(e,{doc:s,mirror:o,blockClass:i,blockSelector:a,needsMask:A,maskTextClass:l,maskTextSelector:c,skipChild:!1,inlineStylesheet:h,maskInputOptions:d,maskTextFn:p,maskInputFn:f,maskAttributeFn:m,slimDOMOptions:g,dataURLOptions:v,inlineImages:y,recordCanvas:w,preserveWhiteSpace:T,onSerialize:b,onIframeLoad:C,iframeLoadTimeout:x,onStylesheetLoad:k,stylesheetLoadTimeout:I,keepIframeSrcFn:O});t&&k(e,t)}},I),F}function xc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function kc(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}var Ic,Oc={exports:{}};function Ec(){if(Ic)return Oc.exports;Ic=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,blackBright:e,redBright:e,greenBright:e,yellowBright:e,blueBright:e,magentaBright:e,cyanBright:e,whiteBright:e,bgBlackBright:e,bgRedBright:e,bgGreenBright:e,bgYellowBright:e,bgBlueBright:e,bgMagentaBright:e,bgCyanBright:e,bgWhiteBright:e}};return Oc.exports=t(),Oc.exports.createColors=t,Oc.exports}const Mc=kc(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Rc,Pc,Ac,Tc,Nc,Lc;function Fc(){if(Pc)return Rc;Pc=1;let e=Ec(),t=Mc;class r extends Error{constructor(e,t,n,s,o,i){super(e),this.name="CssSyntaxError",this.reason=e,o&&(this.file=o),s&&(this.source=s),i&&(this.plugin=i),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);let s=e=>e,o=e=>e,i=e=>e;if(r){let{bold:r,gray:n,red:a}=e.createColors(!0);o=e=>r(a(e)),s=e=>n(e),t&&(i=e=>t(e))}let a=n.split(/\r?\n/),l=Math.max(this.line-3,0),c=Math.min(this.line+2,a.length),u=String(c).length;return a.slice(l,c).map((e,t)=>{let r=l+1+t,n=" "+(" "+r).slice(-u)+" | ";if(r===this.line){if(e.length>160){let t=20,r=Math.max(0,this.column-t),a=Math.max(this.column+t,this.endColumn+t),l=e.slice(r,a),c=s(n.replace(/\d/g," "))+e.slice(0,Math.min(this.column-1,t-1)).replace(/[^\t]/g," ");return o(">")+s(n)+i(l)+"\n "+c+o("^")}let t=s(n.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return o(">")+s(n)+i(e)+"\n "+t+o("^")}return" "+s(n)+i(e)}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}return Rc=r,r.default=r,Rc}function _c(){if(Tc)return Ac;Tc=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 s=(e.raws.between||"")+(t?";":"");this.builder(r+n+s,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,s=0;for(;n&&"root"!==n.type;)s+=1,n=n.parent;if(r.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<s;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 s=e.nodes[n],o=this.raw(s,"before");o&&this.builder(o),this.stringify(s,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 s;if(n||(n=r),r&&(s=t.raws[r],void 0!==s))return s;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 i=t.root();if(i.rawCache||(i.rawCache={}),void 0!==i.rawCache[n])return i.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(t,n);{let e="raw"+((a=n)[0].toUpperCase()+a.slice(1));this[e]?s=this[e](i,t):i.walk(e=>{if(s=e.raws[r],void 0!==s)return!1})}var a;return void 0===s&&(s=e[n]),i.rawCache[n]=s,s}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 Ac=t,t.default=t,Ac}function Dc(){if(Lc)return Nc;Lc=1;let e=_c();function t(t,r){new e(r).stringify(t)}return Nc=t,t.default=t,Nc}var Bc,Uc,jc,zc,Wc,qc,$c,Vc,Gc,Hc,Jc,Kc,Yc,Qc,Xc,Zc,eu,tu,ru,nu,su,ou,iu,au,lu,cu,uu,hu,du,pu,fu,mu,gu,vu,yu,wu,bu,Su,Cu,xu,ku,Iu,Ou,Eu,Mu,Ru,Pu,Au,Tu,Nu={};function Lu(){return Bc||(Bc=1,Nu.isClean=Symbol("isClean"),Nu.my=Symbol("my")),Nu}function Fu(){if(jc)return Uc;jc=1;let e=Fc(),t=_c(),r=Dc(),{isClean:n,my:s}=Lu();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 s=e[n],i=typeof s;"parent"===n&&"object"===i?t&&(r[n]=t):"source"===n?r[n]=s:Array.isArray(s)?r[n]=s.map(e=>o(e,r)):("object"===i&&null!==s&&(s=o(s)),r[n]=s)}return r}function i(e,t){if(t&&void 0!==t.offset)return t.offset;let r=1,n=1,s=0;for(let o=0;o<e.length;o++){if(n===t.line&&r===t.column){s=o;break}"\n"===e[o]?(r=1,n+=1):r+=1}return s}class a{get proxyOf(){return this}constructor(e={}){this.raws={},this[n]=!1,this[s]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let r of e[t])"function"==typeof r.clone?this.append(r.clone()):this.append(r)}else this[t]=e[t]}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(t,r={}){if(this.source){let{end:e,start:n}=this.rangeBy(r);return this.source.input.error(t,{column:n.column,line:n.line},{column:e.column,line:e.line},r)}return new e(t)}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)}}markClean(){this[n]=!0}markDirty(){if(this[n]){this[n]=!1;let e=this;for(;e=e.parent;)e[n]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e={}){let t=this.source.start;if(e.index)t=this.positionInside(e.index);else if(e.word){let r="document"in this.source.input?this.source.input.document:this.source.input.css,n=r.slice(i(r,this.source.start),i(r,this.source.end)).indexOf(e.word);-1!==n&&(t=this.positionInside(n))}return t}positionInside(e){let t=this.source.start.column,r=this.source.start.line,n="document"in this.source.input?this.source.input.document:this.source.input.css,s=i(n,this.source.start),o=s+e;for(let e=s;e<o;e++)"\n"===n[e]?(t=1,r+=1):t+=1;return{column:t,line:r,offset:o}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e={}){let t="document"in this.source.input?this.source.input.document:this.source.input.css,r={column:this.source.start.column,line:this.source.start.line,offset:i(t,this.source.start)},n=this.source.end?{column:this.source.end.column+1,line:this.source.end.line,offset:"number"==typeof this.source.end.offset?this.source.end.offset:i(t,this.source.end)+1}:{column:r.column+1,line:r.line,offset:r.offset+1};if(e.word){let s=t.slice(i(t,this.source.start),i(t,this.source.end)).indexOf(e.word);-1!==s&&(r=this.positionInside(s),n=this.positionInside(s+e.word.length))}else e.start?r={column:e.start.column,line:e.start.line,offset:i(t,e.start)}:e.index&&(r=this.positionInside(e.index)),e.end?n={column:e.end.column,line:e.end.line,offset:i(t,e.end)}:"number"==typeof e.endIndex?n=this.positionInside(e.endIndex):e.index&&(n=this.positionInside(e.index+1));return(n.line<r.line||n.line===r.line&&n.column<=r.column)&&(n={column:r.column+1,line:r.line,offset:r.offset+1}),{end:n,start:r}}raw(e,r){return(new t).raw(this,e,r)}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 s=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){if(null==n)continue;let o=t.get(n.input);null==o&&(o=s,t.set(n.input,s),s++),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=r){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)}}return Uc=a,a.default=a,Uc}function _u(){if(Wc)return zc;Wc=1;let e=Fu();class t extends e{constructor(e){super(e),this.type="comment"}}return zc=t,t.default=t,zc}function Du(){if($c)return qc;$c=1;let e=Fu();class t extends e{get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}}return qc=t,t.default=t,qc}function Bu(){if(Gc)return Vc;Gc=1;let e,t,r,n,s=_u(),o=Du(),i=Fu(),{isClean:a,my:l}=Lu();function c(e){return e.map(e=>(e.nodes&&(e.nodes=c(e.nodes)),delete e.source,e))}function u(e){if(e[a]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)u(t)}class h extends i{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]}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),s=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let e of s)this.proxyOf.nodes.splice(n+1,0,e);for(let e in this.indexes)r=this.indexes[e],n<r&&(this.indexes[e]=r+s.length);return this.markDirty(),this}insertBefore(e,t){let r,n=this.index(e),s=0===n&&"prepend",o=this.normalize(t,this.proxyOf.nodes[n],s).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(r,i){if("string"==typeof r)r=c(t(r).nodes);else if(void 0===r)r=[];else if(Array.isArray(r)){r=r.slice(0);for(let e of r)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===r.type&&"document"!==this.type){r=r.nodes.slice(0);for(let e of r)e.parent&&e.parent.removeChild(e,"ignore")}else if(r.type)r=[r];else if(r.prop){if(void 0===r.value)throw new Error("Value field is missed in node creation");"string"!=typeof r.value&&(r.value=String(r.value)),r=[new o(r)]}else if(r.selector||r.selectors)r=[new n(r)];else if(r.name)r=[new e(r)];else{if(!r.text)throw new Error("Unknown node type in node creation");r=[new s(r)]}return r.map(e=>(e[l]||h.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[a]&&u(e),e.raws||(e.raws={}),void 0===e.raws.before&&i&&void 0!==i.raws.before&&(e.raws.before=i.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)}))}}return h.registerParse=e=>{t=e},h.registerRule=e=>{n=e},h.registerAtRule=t=>{e=t},h.registerRoot=e=>{r=e},Vc=h,h.default=h,h.rebuild=t=>{"atrule"===t.type?Object.setPrototypeOf(t,e.prototype):"rule"===t.type?Object.setPrototypeOf(t,n.prototype):"decl"===t.type?Object.setPrototypeOf(t,o.prototype):"comment"===t.type?Object.setPrototypeOf(t,s.prototype):"root"===t.type&&Object.setPrototypeOf(t,r.prototype),t[l]=!0,t.nodes&&t.nodes.forEach(e=>{h.rebuild(e)})},Vc}function Uu(){if(Jc)return Hc;Jc=1;let e=Bu();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 Hc=t,t.default=t,e.registerAtRule(t),Hc}function ju(){if(Yc)return Kc;Yc=1;let e,t,r=Bu();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},Kc=n,n.default=n,Kc}function zu(){if(Xc)return Qc;Xc=1;return Qc={nanoid:(e=21)=>{let t="",r=0|e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(r=t)=>{let n="",s=0|r;for(;s--;)n+=e[Math.random()*e.length|0];return n}},Qc}function Wu(){if(eu)return Zc;eu=1;let{existsSync:e,readFileSync:t}=Mc,{dirname:r,join:n}=Mc,{SourceMapConsumer:s,SourceMapGenerator:o}=Mc;class i{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let n=t.map?t.map.prev:void 0,s=this.loadMap(t.from,n);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=r(this.mapFile)),s&&(this.text=s)}consumer(){return this.consumerCache||(this.consumerCache=new s(this.text)),this.consumerCache}decodeInline(e){let t=e.match(/^data:application\/json;charset=utf-?8,/)||e.match(/^data:application\/json,/);if(t)return decodeURIComponent(e.substr(t[0].length));let r=e.match(/^data:application\/json;charset=utf-?8;base64,/)||e.match(/^data:application\/json;base64,/);if(r)return n=e.substr(r[0].length),Buffer?Buffer.from(n,"base64").toString():window.atob(n);var n;let s=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+s)}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=/g);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(n){if(this.root=r(n),e(n))return this.mapFile=n,t(n,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof s)return o.fromSourceMap(t).toString();if(t instanceof o)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let r=t(e);if(r){let e=this.loadFile(r);if(!e)throw new Error("Unable to load previous source map: "+r.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=n(r(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return Zc=i,i.default=i,Zc}function qu(){if(ru)return tu;ru=1;let{nanoid:e}=zu(),{isAbsolute:t,resolve:r}=Mc,{SourceMapConsumer:n,SourceMapGenerator:s}=Mc,{fileURLToPath:o,pathToFileURL:i}=Mc,a=Fc(),l=Wu(),c=Mc,u=Symbol("lineToIndexCache"),h=Boolean(n&&s),d=Boolean(r&&t);function p(e){if(e[u])return e[u];let t=e.css.split("\n"),r=new Array(t.length),n=0;for(let e=0,s=t.length;e<s;e++)r[e]=n,n+=t[e].length+1;return e[u]=r,r}class f{get from(){return this.file||this.id}constructor(n,s={}){if(null==n||"object"==typeof n&&!n.toString)throw new Error(`PostCSS received ${n} instead of CSS string`);if(this.css=n.toString(),"\ufeff"===this.css[0]||""===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,this.document=this.css,s.document&&(this.document=s.document.toString()),s.from&&(!d||/^\w+:\/\//.test(s.from)||t(s.from)?this.file=s.from:this.file=r(s.from)),d&&h){let e=new l(this.css,s);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 "+e(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let s,o,l,c,u;if(t&&"object"==typeof t){let e=t,n=r;if("number"==typeof e.offset){c=e.offset;let n=this.fromOffset(c);t=n.line,r=n.col}else t=e.line,r=e.column,c=this.fromLineAndColumn(t,r);if("number"==typeof n.offset){l=n.offset;let e=this.fromOffset(l);o=e.line,s=e.col}else o=n.line,s=n.column,l=this.fromLineAndColumn(n.line,n.column)}else if(r)c=this.fromLineAndColumn(t,r);else{c=t;let e=this.fromOffset(c);t=e.line,r=e.col}let h=this.origin(t,r,o,s);return u=h?new a(e,void 0===h.endLine?h.line:{column:h.column,line:h.line},void 0===h.endLine?h.column:{column:h.endColumn,line:h.endLine},h.source,h.file,n.plugin):new a(e,void 0===o?t:{column:r,line:t},void 0===o?r:{column:s,line:o},this.css,this.file,n.plugin),u.input={column:r,endColumn:s,endLine:o,endOffset:l,line:t,offset:c,source:this.css},this.file&&(i&&(u.input.url=i(this.file).toString()),u.input.file=this.file),u}fromLineAndColumn(e,t){return p(this)[e-1]+t-1}fromOffset(e){let t=p(this),r=0;if(e>=t[t.length-1])r=t.length-1;else{let n,s=t.length-2;for(;r<s;)if(n=r+(s-r>>1),e<t[n])s=n-1;else{if(!(e>=t[n+1])){r=n;break}r=n+1}}return{col:e-t[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:r(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,r,n,s){if(!this.map)return!1;let a,l,c=this.map.consumer(),u=c.originalPositionFor({column:r,line:e});if(!u.source)return!1;"number"==typeof n&&(a=c.originalPositionFor({column:s,line:n})),l=t(u.source)?i(u.source):new URL(u.source,this.map.consumer().sourceRoot||i(this.map.mapFile));let h={column:u.column,endColumn:a&&a.column,endLine:a&&a.line,line:u.line,url:l.toString()};if("file:"===l.protocol){if(!o)throw new Error("file: protocol is not available in this PostCSS build");h.file=o(l)}let d=c.sourceContentFor(u.source);return d&&(h.source=d),h}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}}return tu=f,f.default=f,c&&c.registerInput&&c.registerInput(f),tu}function $u(){if(su)return nu;su=1;let e,t,r=Bu();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},nu=n,n.default=n,r.registerRoot(n),nu}function Vu(){if(iu)return ou;iu=1;let e={comma:t=>e.split(t,[","],!0),space:t=>e.split(t,[" ","\n","\t"]),split(e,t,r){let n=[],s="",o=!1,i=0,a=!1,l="",c=!1;for(let r of e)c?c=!1:"\\"===r?c=!0:a?r===l&&(a=!1):'"'===r||"'"===r?(a=!0,l=r):"("===r?i+=1:")"===r?i>0&&(i-=1):0===i&&t.includes(r)&&(o=!0),o?(""!==s&&n.push(s.trim()),s="",o=!1):s+=r;return(r||""!==s)&&n.push(s.trim()),n}};return ou=e,e.default=e,ou}function Gu(){if(lu)return au;lu=1;let e=Bu(),t=Vu();class r extends e{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)}constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}}return au=r,r.default=r,e.registerRule(r),au}function Hu(){if(du)return hu;du=1;let{dirname:e,relative:t,resolve:r,sep:n}=Mc,{SourceMapConsumer:s,SourceMapGenerator:o}=Mc,{pathToFileURL:i}=Mc,a=qu(),l=Boolean(s&&o),c=Boolean(e&&r&&t&&n);return hu=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 r,n=this.toUrl(this.path(t.file)),o=t.root||e(t.file);!1===this.mapOpts.sourcesContent?(r=new s(t.text),r.sourcesContent&&(r.sourcesContent=null)):r=t.consumer(),this.map.applySourceMap(r,n,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&&e.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),c&&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=o.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new o({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 o({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,r=1,n=1,s="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(o,a,l)=>{if(this.css+=o,a&&"end"!==l&&(i.generated.line=r,i.generated.column=n-1,a.source&&a.source.start?(i.source=this.sourcePath(a),i.original.line=a.source.start.line,i.original.column=a.source.start.column-1,this.map.addMapping(i)):(i.source=s,i.original.line=1,i.original.column=0,this.map.addMapping(i))),t=o.match(/\n/g),t?(r+=t.length,e=o.lastIndexOf("\n"),n=o.length-e):n+=o.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?(i.source=this.sourcePath(a),i.original.line=a.source.end.line,i.original.column=a.source.end.column-1,i.generated.line=r,i.generated.column=n-2,this.map.addMapping(i)):(i.source=s,i.original.line=1,i.original.column=0,i.generated.line=r,i.generated.column=n-1,this.map.addMapping(i)))}})}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(n){if(this.mapOpts.absolute)return n;if(60===n.charCodeAt(0))return n;if(/^\w+:\/\//.test(n))return n;let s=this.memoizedPaths.get(n);if(s)return s;let o=this.opts.to?e(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(o=e(r(o,this.mapOpts.annotation)));let i=t(o,n);return this.memoizedPaths.set(n,i),i}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(i){let t=i(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;"\\"===n&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}},hu}function Ju(){if(gu)return mu;gu=1;let e=Uu(),t=_u(),r=Du(),n=$u(),s=Gu(),o=function(){if(fu)return pu;fu=1;const e="'".charCodeAt(0),t='"'.charCodeAt(0),r="\\".charCodeAt(0),n="/".charCodeAt(0),s="\n".charCodeAt(0),o=" ".charCodeAt(0),i="\f".charCodeAt(0),a="\t".charCodeAt(0),l="\r".charCodeAt(0),c="[".charCodeAt(0),u="]".charCodeAt(0),h="(".charCodeAt(0),d=")".charCodeAt(0),p="{".charCodeAt(0),f="}".charCodeAt(0),m=";".charCodeAt(0),g="*".charCodeAt(0),v=":".charCodeAt(0),y="@".charCodeAt(0),w=/[\t\n\f\r "#'()/;[\\\]{}]/g,b=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,S=/.[\r\n"'(/\\]/,C=/[\da-f]/i;return pu=function(x,k={}){let I,O,E,M,R,P,A,T,N,L,F=x.css.valueOf(),_=k.ignoreErrors,D=F.length,B=0,U=[],j=[];function z(e){throw x.error("Unclosed "+e,B)}return{back:function(e){j.push(e)},endOfFile:function(){return 0===j.length&&B>=D},nextToken:function(x){if(j.length)return j.pop();if(B>=D)return;let k=!!x&&x.ignoreUnclosed;switch(I=F.charCodeAt(B),I){case s:case o:case a:case l:case i:M=B;do{M+=1,I=F.charCodeAt(M)}while(I===o||I===s||I===a||I===l||I===i);P=["space",F.slice(B,M)],B=M-1;break;case c:case u:case p:case f:case v:case m:case d:{let e=String.fromCharCode(I);P=[e,e,B];break}case h:if(L=U.length?U.pop()[1]:"",N=F.charCodeAt(B+1),"url"===L&&N!==e&&N!==t&&N!==o&&N!==s&&N!==a&&N!==i&&N!==l){M=B;do{if(A=!1,M=F.indexOf(")",M+1),-1===M){if(_||k){M=B;break}z("bracket")}for(T=M;F.charCodeAt(T-1)===r;)T-=1,A=!A}while(A);P=["brackets",F.slice(B,M+1),B,M],B=M}else M=F.indexOf(")",B+1),O=F.slice(B,M+1),-1===M||S.test(O)?P=["(","(",B]:(P=["brackets",O,B,M],B=M);break;case e:case t:R=I===e?"'":'"',M=B;do{if(A=!1,M=F.indexOf(R,M+1),-1===M){if(_||k){M=B+1;break}z("string")}for(T=M;F.charCodeAt(T-1)===r;)T-=1,A=!A}while(A);P=["string",F.slice(B,M+1),B,M],B=M;break;case y:w.lastIndex=B+1,w.test(F),M=0===w.lastIndex?F.length-1:w.lastIndex-2,P=["at-word",F.slice(B,M+1),B,M],B=M;break;case r:for(M=B,E=!0;F.charCodeAt(M+1)===r;)M+=1,E=!E;if(I=F.charCodeAt(M+1),E&&I!==n&&I!==o&&I!==s&&I!==a&&I!==l&&I!==i&&(M+=1,C.test(F.charAt(M)))){for(;C.test(F.charAt(M+1));)M+=1;F.charCodeAt(M+1)===o&&(M+=1)}P=["word",F.slice(B,M+1),B,M],B=M;break;default:I===n&&F.charCodeAt(B+1)===g?(M=F.indexOf("*/",B+2)+1,0===M&&(_||k?M=F.length:z("comment")),P=["comment",F.slice(B,M+1),B,M],B=M):(b.lastIndex=B+1,b.test(F),M=0===b.lastIndex?F.length-1:b.lastIndex-2,P=["word",F.slice(B,M+1),B,M],U.push(P),B=M)}return B++,P},position:function(){return B}}}}();const i={empty:!0,space:!0};return mu=class{constructor(e){this.input=e,this.root=new n,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(t){let r,n,s,o=new e;o.name=t[1].slice(1),""===o.name&&this.unnamedAtrule(o,t),this.init(o,t[2]);let i=!1,a=!1,l=[],c=[];for(;!this.tokenizer.endOfFile();){if(r=(t=this.tokenizer.nextToken())[0],"("===r||"["===r?c.push("("===r?")":"]"):"{"===r&&c.length>0?c.push("}"):r===c[c.length-1]&&c.pop(),0===c.length){if(";"===r){o.source.end=this.getPosition(t[2]),o.source.end.offset++,this.semicolon=!0;break}if("{"===r){a=!0;break}if("}"===r){if(l.length>0){for(s=l.length-1,n=l[s];n&&"space"===n[0];)n=l[--s];n&&(o.source.end=this.getPosition(n[3]||n[2]),o.source.end.offset++)}this.end(t);break}l.push(t)}else l.push(t);if(this.tokenizer.endOfFile()){i=!0;break}}o.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(o.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(o,"params",l),i&&(t=l[l.length-1],o.source.end=this.getPosition(t[3]||t[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 s=t-1;s>=0&&(r=e[s],"space"===r[0]||(n+=1,2!==n));s--);throw this.input.error("Missed semicolon","word"===r[0]?r[3]+1:r[2])}colon(e){let t,r,n,s=0;for(let[o,i]of e.entries()){if(r=i,n=r[0],"("===n&&(s+=1),")"===n&&(s-=1),0===s&&":"===n){if(t){if("word"===t[0]&&"progid"===t[1])continue;return o}this.doubleColon(r)}t=r}return!1}comment(e){let r=new t;this.init(r,e[2]),r.source.end=this.getPosition(e[3]||e[2]),r.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))r.text="",r.raws.left=n,r.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);r.text=e[2],r.raws.left=e[1],r.raws.right=e[3]}}createTokenizer(){this.tokenizer=o(this.input)}decl(e,t){let n=new r;this.init(n,e[0][2]);let s,o=e[e.length-1];for(";"===o[0]&&(this.semicolon=!0,e.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}}(e)),n.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),n.raws.before+=e.shift()[1];for(n.source.start=this.getPosition(e[0][2]),n.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;n.prop+=e.shift()[1]}for(n.raws.between="";e.length;){if(s=e.shift(),":"===s[0]){n.raws.between+=s[1];break}"word"===s[0]&&/\w/.test(s[1])&&this.unknownWord([s]),n.raws.between+=s[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let i,a=[];for(;e.length&&(i=e[0][0],"space"===i||"comment"===i);)a.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(s=e[t],"!important"===s[1].toLowerCase()){n.important=!0;let r=this.stringFrom(e,t);r=this.spacesFromEnd(e)+r," !important"!==r&&(n.raws.important=r);break}if("important"===s[1].toLowerCase()){let r=e.slice(0),s="";for(let e=t;e>0;e--){let t=r[e][0];if(s.trim().startsWith("!")&&"space"!==t)break;s=r.pop()[1]+s}s.trim().startsWith("!")&&(n.important=!0,n.raws.important=s,e=r)}if("space"!==s[0]&&"comment"!==s[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(n,"value",a.concat(e),t),n.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new s;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 t=this.current.nodes[this.current.nodes.length-1];t&&"rule"===t.type&&!t.raws.ownSemicolon&&(t.raws.ownSemicolon=this.spaces,this.spaces="",t.source.end=this.getPosition(e[2]),t.source.end.offset+=t.raws.ownSemicolon.length)}}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,s=null,o=[],i=e[1].startsWith("--"),a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)s||(s=l),o.push("("===r?")":"]");else if(i&&n&&"{"===r)s||(s=l),o.push("}");else if(0===o.length){if(";"===r){if(n)return void this.decl(a,i);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&&(s=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(s),t&&n){if(!i)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,i)}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 s,o,a,l,c=r.length,u="",h=!0;for(let e=0;e<c;e+=1)s=r[e],o=s[0],"space"!==o||e!==c-1||n?"comment"===o?(l=r[e-1]?r[e-1][0]:"empty",a=r[e+1]?r[e+1][0]:"empty",i[l]||i[a]||","===u.slice(-1)?h=!1:u+=s[1]):u+=s[1]:h=!1;if(!h){let n=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:n,value:u}}e[t]=u}rule(e){e.pop();let t=new s;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 "+e[0][1],{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})}},mu}function Ku(){if(yu)return vu;yu=1;let e=Bu(),t=qu(),r=Ju();function n(e,n){let s=new t(e,n),o=new r(s);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 vu=n,n.default=n,e.registerParse(n),vu}function Yu(){if(bu)return wu;bu=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 wu=e,e.default=e,wu}function Qu(){if(Cu)return Su;Cu=1;let e=Yu();class t{get content(){return this.css}constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css="",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)}}return Su=t,t.default=t,Su}function Xu(){if(ku)return xu;ku=1;let e={};return xu=function(t){e[t]||(e[t]=!0,"undefined"!=typeof console&&console.warn&&console.warn(t))}}function Zu(){if(Ou)return Iu;Ou=1;let e=Bu(),t=ju(),r=Hu(),n=Ku(),s=Qu(),o=$u(),i=Dc(),{isClean:a,my:l}=Lu(),c=Xu();const u={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},h={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},d={Once:!0,postcssPlugin:!0,prepare:!0};function p(e){return"object"==typeof e&&"function"==typeof e.then}function f(e){let t=!1,r=u[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 m(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 g(e){return e[a]=!1,e.nodes&&e.nodes.forEach(e=>g(e)),e}let v={};class y{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"}constructor(t,r,o){let i;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof y||r instanceof s)i=g(r.root),r.map&&(void 0===o.map&&(o.map={}),o.map.inline||(o.map.inline=!1),o.map.prev=r.map);else{let t=n;o.syntax&&(t=o.syntax.parse),o.parser&&(t=o.parser),t.parse&&(t=t.parse);try{i=t(r,o)}catch(e){this.processed=!0,this.error=e}i&&!i[l]&&e.rebuild(i)}else i=g(r);this.result=new s(t,i,o),this.helpers={...v,postcss:v,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,s=t.split("."),o=n.split(".");(s[0]!==o[0]||parseInt(s[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(!h[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!d[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 e=this.result.root;for(;!e[a];){e[a]=!0;let t=[m(e)];for(;t.length>0;){let e=this.visitTick(t);if(p(e))try{await e}catch(e){let r=t[t.length-1].node;throw this.handleError(e,r)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map(e=>r(e,this.helpers));await Promise.all(t)}else await r(e,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=i;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let n=new r(t,this.result.root,this.result.opts).generate();return this.result.css=n[0],this.result.map=n[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 e=this.result.root;for(;!e[a];)e[a]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||c("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(e){let t=e[e.length-1],{node:r,visitors:n}=t;if("root"!==r.type&&"document"!==r.type&&!r.parent)return void e.pop();if(n.length>0&&t.visitorIndex<n.length){let[e,s]=n[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===n.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return s(r.toProxy(),this.helpers)}catch(e){throw this.handleError(e,r)}}if(0!==t.iterator){let n,s=t.iterator;for(;n=r.nodes[r.indexes[s]];)if(r.indexes[s]+=1,!n[a])return n[a]=!0,void e.push(m(n));t.iterator=0,delete r.indexes[s]}let s=t.events;for(;t.eventIndex<s.length;){let e=s[t.eventIndex];if(t.eventIndex+=1,0===e)return void(r.nodes&&r.nodes.length&&(r[a]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[a]=!0;let t=f(e);for(let r of t)if(0===r)e.nodes&&e.each(e=>{e[a]||this.walkSync(e)});else{let t=this.listeners[r];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}}return y.registerPostcss=e=>{v=e},Iu=y,y.default=y,o.registerLazyResult(y),t.registerLazyResult(y),Iu}function eh(){if(Pu)return Ru;Pu=1;let e=ju(),t=Zu(),r=function(){if(Mu)return Eu;Mu=1;let e=Hu(),t=Ku();const r=Qu();let n=Dc(),s=Xu();class o{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,r=t;try{e=r(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"}constructor(t,s,o){let i;s=s.toString(),this.stringified=!1,this._processor=t,this._css=s,this._opts=o,this._map=void 0;let a=n;this.result=new r(this._processor,i,this._opts),this.result.css=s;let l=this;Object.defineProperty(this.result,"root",{get:()=>l.root});let c=new e(a,i,this._opts,s);if(c.isMap()){let[e,t]=c.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else c.clearAnnotation(),this.result.css=c.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||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}warnings(){return[]}}return Eu=o,o.default=o,Eu}(),n=$u();class s{constructor(e=[]){this.version="8.5.6",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(e,n={}){return this.plugins.length||n.parser||n.stringifier||n.syntax?new t(this,e,n):new r(this,e,n)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}return Ru=s,s.default=s,n.registerProcessor(s),e.registerProcessor(s),Ru}var th=function(){if(Tu)return Au;Tu=1;let e=Uu(),t=_u(),r=Bu(),n=Fc(),s=Du(),o=ju(),i=function(){if(uu)return cu;uu=1;let e=Uu(),t=_u(),r=Du(),n=qu(),s=Wu(),o=$u(),i=Gu();function a(l,c){if(Array.isArray(l))return l.map(e=>a(e));let{inputs:u,...h}=l;if(u){c=[];for(let e of u){let t={...e,__proto__:n.prototype};t.map&&(t.map={...t.map,__proto__:s.prototype}),c.push(t)}}if(h.nodes&&(h.nodes=l.nodes.map(e=>a(e,c))),h.source){let{inputId:e,...t}=h.source;h.source=t,null!=e&&(h.source.input=c[e])}if("root"===h.type)return new o(h);if("decl"===h.type)return new r(h);if("rule"===h.type)return new i(h);if("comment"===h.type)return new t(h);if("atrule"===h.type)return new e(h);throw new Error("Unknown node type: "+l.type)}return cu=a,a.default=a,cu}(),a=qu(),l=Zu(),c=Vu(),u=Fu(),h=Ku(),d=eh(),p=Qu(),f=$u(),m=Gu(),g=Dc(),v=Yu();function y(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new d(e)}return y.plugin=function(e,t){let r,n=!1;function s(...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 s=t(...r);return s.postcssPlugin=e,s.postcssVersion=(new d).version,s}return Object.defineProperty(s,"postcss",{get:()=>(r||(r=s()),r)}),s.process=function(e,t,r){return y([s(r)]).process(e,t)},s},y.stringify=g,y.parse=h,y.fromJSON=i,y.list=c,y.comment=e=>new t(e),y.atRule=t=>new e(t),y.decl=e=>new s(e),y.rule=e=>new m(e),y.root=e=>new f(e),y.document=e=>new o(e),y.CssSyntaxError=n,y.Declaration=s,y.Container=r,y.Processor=d,y.Document=o,y.Comment=t,y.Warning=v,y.AtRule=e,y.Result=p,y.Input=a,y.Rule=m,y.Root=f,y.Node=u,l.registerPostcss(y),Au=y,y.default=y,Au}();const rh=xc(th);rh.stringify,rh.fromJSON,rh.plugin,rh.parse,rh.list,rh.document,rh.comment,rh.atRule,rh.rule,rh.decl,rh.root,rh.CssSyntaxError,rh.Declaration,rh.Container,rh.Processor,rh.Document,rh.Comment,rh.Warning,rh.AtRule,rh.Result,rh.Input,rh.Rule,rh.Root,rh.Node;var nh=Object.defineProperty,sh=(e,t,r)=>((e,t,r)=>t in e?nh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);function oh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ih(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}var ah,lh={exports:{}};function ch(){if(ah)return lh.exports;ah=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,blackBright:e,redBright:e,greenBright:e,yellowBright:e,blueBright:e,magentaBright:e,cyanBright:e,whiteBright:e,bgBlackBright:e,bgRedBright:e,bgGreenBright:e,bgYellowBright:e,bgBlueBright:e,bgMagentaBright:e,bgCyanBright:e,bgWhiteBright:e}};return lh.exports=t(),lh.exports.createColors=t,lh.exports}const uh=ih(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var hh,dh,ph,fh,mh,gh;function vh(){if(dh)return hh;dh=1;let e=ch(),t=uh;class r extends Error{constructor(e,t,n,s,o,i){super(e),this.name="CssSyntaxError",this.reason=e,o&&(this.file=o),s&&(this.source=s),i&&(this.plugin=i),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);let s=e=>e,o=e=>e,i=e=>e;if(r){let{bold:r,gray:n,red:a}=e.createColors(!0);o=e=>r(a(e)),s=e=>n(e),t&&(i=e=>t(e))}let a=n.split(/\r?\n/),l=Math.max(this.line-3,0),c=Math.min(this.line+2,a.length),u=String(c).length;return a.slice(l,c).map((e,t)=>{let r=l+1+t,n=" "+(" "+r).slice(-u)+" | ";if(r===this.line){if(e.length>160){let t=20,r=Math.max(0,this.column-t),a=Math.max(this.column+t,this.endColumn+t),l=e.slice(r,a),c=s(n.replace(/\d/g," "))+e.slice(0,Math.min(this.column-1,t-1)).replace(/[^\t]/g," ");return o(">")+s(n)+i(l)+"\n "+c+o("^")}let t=s(n.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return o(">")+s(n)+i(e)+"\n "+t+o("^")}return" "+s(n)+i(e)}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}return hh=r,r.default=r,hh}function yh(){if(fh)return ph;fh=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 s=(e.raws.between||"")+(t?";":"");this.builder(r+n+s,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,s=0;for(;n&&"root"!==n.type;)s+=1,n=n.parent;if(r.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<s;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 s=e.nodes[n],o=this.raw(s,"before");o&&this.builder(o),this.stringify(s,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 s;if(n||(n=r),r&&(s=t.raws[r],void 0!==s))return s;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 i=t.root();if(i.rawCache||(i.rawCache={}),void 0!==i.rawCache[n])return i.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(t,n);{let e="raw"+((a=n)[0].toUpperCase()+a.slice(1));this[e]?s=this[e](i,t):i.walk(e=>{if(s=e.raws[r],void 0!==s)return!1})}var a;return void 0===s&&(s=e[n]),i.rawCache[n]=s,s}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 ph=t,t.default=t,ph}function wh(){if(gh)return mh;gh=1;let e=yh();function t(t,r){new e(r).stringify(t)}return mh=t,t.default=t,mh}var bh,Sh,Ch,xh,kh,Ih,Oh,Eh,Mh,Rh,Ph,Ah,Th,Nh,Lh,Fh,_h,Dh,Bh,Uh,jh,zh,Wh,qh,$h,Vh,Gh,Hh,Jh,Kh,Yh,Qh,Xh,Zh,ed,td,rd,nd,sd,od,id,ad,ld,cd,ud,hd,dd,pd,fd,md={};function gd(){return bh||(bh=1,md.isClean=Symbol("isClean"),md.my=Symbol("my")),md}function vd(){if(Ch)return Sh;Ch=1;let e=vh(),t=yh(),r=wh(),{isClean:n,my:s}=gd();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 s=e[n],i=typeof s;"parent"===n&&"object"===i?t&&(r[n]=t):"source"===n?r[n]=s:Array.isArray(s)?r[n]=s.map(e=>o(e,r)):("object"===i&&null!==s&&(s=o(s)),r[n]=s)}return r}function i(e,t){if(t&&void 0!==t.offset)return t.offset;let r=1,n=1,s=0;for(let o=0;o<e.length;o++){if(n===t.line&&r===t.column){s=o;break}"\n"===e[o]?(r=1,n+=1):r+=1}return s}class a{get proxyOf(){return this}constructor(e={}){this.raws={},this[n]=!1,this[s]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let r of e[t])"function"==typeof r.clone?this.append(r.clone()):this.append(r)}else this[t]=e[t]}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(t,r={}){if(this.source){let{end:e,start:n}=this.rangeBy(r);return this.source.input.error(t,{column:n.column,line:n.line},{column:e.column,line:e.line},r)}return new e(t)}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)}}markClean(){this[n]=!0}markDirty(){if(this[n]){this[n]=!1;let e=this;for(;e=e.parent;)e[n]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e={}){let t=this.source.start;if(e.index)t=this.positionInside(e.index);else if(e.word){let r="document"in this.source.input?this.source.input.document:this.source.input.css,n=r.slice(i(r,this.source.start),i(r,this.source.end)).indexOf(e.word);-1!==n&&(t=this.positionInside(n))}return t}positionInside(e){let t=this.source.start.column,r=this.source.start.line,n="document"in this.source.input?this.source.input.document:this.source.input.css,s=i(n,this.source.start),o=s+e;for(let e=s;e<o;e++)"\n"===n[e]?(t=1,r+=1):t+=1;return{column:t,line:r,offset:o}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e={}){let t="document"in this.source.input?this.source.input.document:this.source.input.css,r={column:this.source.start.column,line:this.source.start.line,offset:i(t,this.source.start)},n=this.source.end?{column:this.source.end.column+1,line:this.source.end.line,offset:"number"==typeof this.source.end.offset?this.source.end.offset:i(t,this.source.end)+1}:{column:r.column+1,line:r.line,offset:r.offset+1};if(e.word){let s=t.slice(i(t,this.source.start),i(t,this.source.end)).indexOf(e.word);-1!==s&&(r=this.positionInside(s),n=this.positionInside(s+e.word.length))}else e.start?r={column:e.start.column,line:e.start.line,offset:i(t,e.start)}:e.index&&(r=this.positionInside(e.index)),e.end?n={column:e.end.column,line:e.end.line,offset:i(t,e.end)}:"number"==typeof e.endIndex?n=this.positionInside(e.endIndex):e.index&&(n=this.positionInside(e.index+1));return(n.line<r.line||n.line===r.line&&n.column<=r.column)&&(n={column:r.column+1,line:r.line,offset:r.offset+1}),{end:n,start:r}}raw(e,r){return(new t).raw(this,e,r)}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 s=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){if(null==n)continue;let o=t.get(n.input);null==o&&(o=s,t.set(n.input,s),s++),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=r){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)}}return Sh=a,a.default=a,Sh}function yd(){if(kh)return xh;kh=1;let e=vd();class t extends e{constructor(e){super(e),this.type="comment"}}return xh=t,t.default=t,xh}function wd(){if(Oh)return Ih;Oh=1;let e=vd();class t extends e{get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}}return Ih=t,t.default=t,Ih}function bd(){if(Mh)return Eh;Mh=1;let e,t,r,n,s=yd(),o=wd(),i=vd(),{isClean:a,my:l}=gd();function c(e){return e.map(e=>(e.nodes&&(e.nodes=c(e.nodes)),delete e.source,e))}function u(e){if(e[a]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)u(t)}class h extends i{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]}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),s=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let e of s)this.proxyOf.nodes.splice(n+1,0,e);for(let e in this.indexes)r=this.indexes[e],n<r&&(this.indexes[e]=r+s.length);return this.markDirty(),this}insertBefore(e,t){let r,n=this.index(e),s=0===n&&"prepend",o=this.normalize(t,this.proxyOf.nodes[n],s).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(r,i){if("string"==typeof r)r=c(t(r).nodes);else if(void 0===r)r=[];else if(Array.isArray(r)){r=r.slice(0);for(let e of r)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===r.type&&"document"!==this.type){r=r.nodes.slice(0);for(let e of r)e.parent&&e.parent.removeChild(e,"ignore")}else if(r.type)r=[r];else if(r.prop){if(void 0===r.value)throw new Error("Value field is missed in node creation");"string"!=typeof r.value&&(r.value=String(r.value)),r=[new o(r)]}else if(r.selector||r.selectors)r=[new n(r)];else if(r.name)r=[new e(r)];else{if(!r.text)throw new Error("Unknown node type in node creation");r=[new s(r)]}return r.map(e=>(e[l]||h.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[a]&&u(e),e.raws||(e.raws={}),void 0===e.raws.before&&i&&void 0!==i.raws.before&&(e.raws.before=i.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)}))}}return h.registerParse=e=>{t=e},h.registerRule=e=>{n=e},h.registerAtRule=t=>{e=t},h.registerRoot=e=>{r=e},Eh=h,h.default=h,h.rebuild=t=>{"atrule"===t.type?Object.setPrototypeOf(t,e.prototype):"rule"===t.type?Object.setPrototypeOf(t,n.prototype):"decl"===t.type?Object.setPrototypeOf(t,o.prototype):"comment"===t.type?Object.setPrototypeOf(t,s.prototype):"root"===t.type&&Object.setPrototypeOf(t,r.prototype),t[l]=!0,t.nodes&&t.nodes.forEach(e=>{h.rebuild(e)})},Eh}function Sd(){if(Ph)return Rh;Ph=1;let e=bd();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 Rh=t,t.default=t,e.registerAtRule(t),Rh}function Cd(){if(Th)return Ah;Th=1;let e,t,r=bd();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},Ah=n,n.default=n,Ah}function xd(){if(Lh)return Nh;Lh=1;return Nh={nanoid:(e=21)=>{let t="",r=0|e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(r=t)=>{let n="",s=0|r;for(;s--;)n+=e[Math.random()*e.length|0];return n}},Nh}function kd(){if(_h)return Fh;_h=1;let{existsSync:e,readFileSync:t}=uh,{dirname:r,join:n}=uh,{SourceMapConsumer:s,SourceMapGenerator:o}=uh;class i{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let n=t.map?t.map.prev:void 0,s=this.loadMap(t.from,n);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=r(this.mapFile)),s&&(this.text=s)}consumer(){return this.consumerCache||(this.consumerCache=new s(this.text)),this.consumerCache}decodeInline(e){let t=e.match(/^data:application\/json;charset=utf-?8,/)||e.match(/^data:application\/json,/);if(t)return decodeURIComponent(e.substr(t[0].length));let r=e.match(/^data:application\/json;charset=utf-?8;base64,/)||e.match(/^data:application\/json;base64,/);if(r)return n=e.substr(r[0].length),Buffer?Buffer.from(n,"base64").toString():window.atob(n);var n;let s=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+s)}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=/g);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(n){if(this.root=r(n),e(n))return this.mapFile=n,t(n,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof s)return o.fromSourceMap(t).toString();if(t instanceof o)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let r=t(e);if(r){let e=this.loadFile(r);if(!e)throw new Error("Unable to load previous source map: "+r.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=n(r(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return Fh=i,i.default=i,Fh}function Id(){if(Bh)return Dh;Bh=1;let{nanoid:e}=xd(),{isAbsolute:t,resolve:r}=uh,{SourceMapConsumer:n,SourceMapGenerator:s}=uh,{fileURLToPath:o,pathToFileURL:i}=uh,a=vh(),l=kd(),c=uh,u=Symbol("lineToIndexCache"),h=Boolean(n&&s),d=Boolean(r&&t);function p(e){if(e[u])return e[u];let t=e.css.split("\n"),r=new Array(t.length),n=0;for(let e=0,s=t.length;e<s;e++)r[e]=n,n+=t[e].length+1;return e[u]=r,r}class f{get from(){return this.file||this.id}constructor(n,s={}){if(null==n||"object"==typeof n&&!n.toString)throw new Error(`PostCSS received ${n} instead of CSS string`);if(this.css=n.toString(),"\ufeff"===this.css[0]||""===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,this.document=this.css,s.document&&(this.document=s.document.toString()),s.from&&(!d||/^\w+:\/\//.test(s.from)||t(s.from)?this.file=s.from:this.file=r(s.from)),d&&h){let e=new l(this.css,s);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 "+e(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let s,o,l,c,u;if(t&&"object"==typeof t){let e=t,n=r;if("number"==typeof e.offset){c=e.offset;let n=this.fromOffset(c);t=n.line,r=n.col}else t=e.line,r=e.column,c=this.fromLineAndColumn(t,r);if("number"==typeof n.offset){l=n.offset;let e=this.fromOffset(l);o=e.line,s=e.col}else o=n.line,s=n.column,l=this.fromLineAndColumn(n.line,n.column)}else if(r)c=this.fromLineAndColumn(t,r);else{c=t;let e=this.fromOffset(c);t=e.line,r=e.col}let h=this.origin(t,r,o,s);return u=h?new a(e,void 0===h.endLine?h.line:{column:h.column,line:h.line},void 0===h.endLine?h.column:{column:h.endColumn,line:h.endLine},h.source,h.file,n.plugin):new a(e,void 0===o?t:{column:r,line:t},void 0===o?r:{column:s,line:o},this.css,this.file,n.plugin),u.input={column:r,endColumn:s,endLine:o,endOffset:l,line:t,offset:c,source:this.css},this.file&&(i&&(u.input.url=i(this.file).toString()),u.input.file=this.file),u}fromLineAndColumn(e,t){return p(this)[e-1]+t-1}fromOffset(e){let t=p(this),r=0;if(e>=t[t.length-1])r=t.length-1;else{let n,s=t.length-2;for(;r<s;)if(n=r+(s-r>>1),e<t[n])s=n-1;else{if(!(e>=t[n+1])){r=n;break}r=n+1}}return{col:e-t[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:r(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,r,n,s){if(!this.map)return!1;let a,l,c=this.map.consumer(),u=c.originalPositionFor({column:r,line:e});if(!u.source)return!1;"number"==typeof n&&(a=c.originalPositionFor({column:s,line:n})),l=t(u.source)?i(u.source):new URL(u.source,this.map.consumer().sourceRoot||i(this.map.mapFile));let h={column:u.column,endColumn:a&&a.column,endLine:a&&a.line,line:u.line,url:l.toString()};if("file:"===l.protocol){if(!o)throw new Error("file: protocol is not available in this PostCSS build");h.file=o(l)}let d=c.sourceContentFor(u.source);return d&&(h.source=d),h}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}}return Dh=f,f.default=f,c&&c.registerInput&&c.registerInput(f),Dh}function Od(){if(jh)return Uh;jh=1;let e,t,r=bd();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},Uh=n,n.default=n,r.registerRoot(n),Uh}function Ed(){if(Wh)return zh;Wh=1;let e={comma:t=>e.split(t,[","],!0),space:t=>e.split(t,[" ","\n","\t"]),split(e,t,r){let n=[],s="",o=!1,i=0,a=!1,l="",c=!1;for(let r of e)c?c=!1:"\\"===r?c=!0:a?r===l&&(a=!1):'"'===r||"'"===r?(a=!0,l=r):"("===r?i+=1:")"===r?i>0&&(i-=1):0===i&&t.includes(r)&&(o=!0),o?(""!==s&&n.push(s.trim()),s="",o=!1):s+=r;return(r||""!==s)&&n.push(s.trim()),n}};return zh=e,e.default=e,zh}function Md(){if($h)return qh;$h=1;let e=bd(),t=Ed();class r extends e{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)}constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}}return qh=r,r.default=r,e.registerRule(r),qh}function Rd(){if(Jh)return Hh;Jh=1;let{dirname:e,relative:t,resolve:r,sep:n}=uh,{SourceMapConsumer:s,SourceMapGenerator:o}=uh,{pathToFileURL:i}=uh,a=Id(),l=Boolean(s&&o),c=Boolean(e&&r&&t&&n);return Hh=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 r,n=this.toUrl(this.path(t.file)),o=t.root||e(t.file);!1===this.mapOpts.sourcesContent?(r=new s(t.text),r.sourcesContent&&(r.sourcesContent=null)):r=t.consumer(),this.map.applySourceMap(r,n,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&&e.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),c&&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=o.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new o({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 o({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,r=1,n=1,s="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(o,a,l)=>{if(this.css+=o,a&&"end"!==l&&(i.generated.line=r,i.generated.column=n-1,a.source&&a.source.start?(i.source=this.sourcePath(a),i.original.line=a.source.start.line,i.original.column=a.source.start.column-1,this.map.addMapping(i)):(i.source=s,i.original.line=1,i.original.column=0,this.map.addMapping(i))),t=o.match(/\n/g),t?(r+=t.length,e=o.lastIndexOf("\n"),n=o.length-e):n+=o.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?(i.source=this.sourcePath(a),i.original.line=a.source.end.line,i.original.column=a.source.end.column-1,i.generated.line=r,i.generated.column=n-2,this.map.addMapping(i)):(i.source=s,i.original.line=1,i.original.column=0,i.generated.line=r,i.generated.column=n-1,this.map.addMapping(i)))}})}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(n){if(this.mapOpts.absolute)return n;if(60===n.charCodeAt(0))return n;if(/^\w+:\/\//.test(n))return n;let s=this.memoizedPaths.get(n);if(s)return s;let o=this.opts.to?e(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(o=e(r(o,this.mapOpts.annotation)));let i=t(o,n);return this.memoizedPaths.set(n,i),i}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(i){let t=i(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;"\\"===n&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}},Hh}function Pd(){if(Xh)return Qh;Xh=1;let e=Sd(),t=yd(),r=wd(),n=Od(),s=Md(),o=function(){if(Yh)return Kh;Yh=1;const e="'".charCodeAt(0),t='"'.charCodeAt(0),r="\\".charCodeAt(0),n="/".charCodeAt(0),s="\n".charCodeAt(0),o=" ".charCodeAt(0),i="\f".charCodeAt(0),a="\t".charCodeAt(0),l="\r".charCodeAt(0),c="[".charCodeAt(0),u="]".charCodeAt(0),h="(".charCodeAt(0),d=")".charCodeAt(0),p="{".charCodeAt(0),f="}".charCodeAt(0),m=";".charCodeAt(0),g="*".charCodeAt(0),v=":".charCodeAt(0),y="@".charCodeAt(0),w=/[\t\n\f\r "#'()/;[\\\]{}]/g,b=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,S=/.[\r\n"'(/\\]/,C=/[\da-f]/i;return Kh=function(x,k={}){let I,O,E,M,R,P,A,T,N,L,F=x.css.valueOf(),_=k.ignoreErrors,D=F.length,B=0,U=[],j=[];function z(e){throw x.error("Unclosed "+e,B)}return{back:function(e){j.push(e)},endOfFile:function(){return 0===j.length&&B>=D},nextToken:function(x){if(j.length)return j.pop();if(B>=D)return;let k=!!x&&x.ignoreUnclosed;switch(I=F.charCodeAt(B),I){case s:case o:case a:case l:case i:M=B;do{M+=1,I=F.charCodeAt(M)}while(I===o||I===s||I===a||I===l||I===i);P=["space",F.slice(B,M)],B=M-1;break;case c:case u:case p:case f:case v:case m:case d:{let e=String.fromCharCode(I);P=[e,e,B];break}case h:if(L=U.length?U.pop()[1]:"",N=F.charCodeAt(B+1),"url"===L&&N!==e&&N!==t&&N!==o&&N!==s&&N!==a&&N!==i&&N!==l){M=B;do{if(A=!1,M=F.indexOf(")",M+1),-1===M){if(_||k){M=B;break}z("bracket")}for(T=M;F.charCodeAt(T-1)===r;)T-=1,A=!A}while(A);P=["brackets",F.slice(B,M+1),B,M],B=M}else M=F.indexOf(")",B+1),O=F.slice(B,M+1),-1===M||S.test(O)?P=["(","(",B]:(P=["brackets",O,B,M],B=M);break;case e:case t:R=I===e?"'":'"',M=B;do{if(A=!1,M=F.indexOf(R,M+1),-1===M){if(_||k){M=B+1;break}z("string")}for(T=M;F.charCodeAt(T-1)===r;)T-=1,A=!A}while(A);P=["string",F.slice(B,M+1),B,M],B=M;break;case y:w.lastIndex=B+1,w.test(F),M=0===w.lastIndex?F.length-1:w.lastIndex-2,P=["at-word",F.slice(B,M+1),B,M],B=M;break;case r:for(M=B,E=!0;F.charCodeAt(M+1)===r;)M+=1,E=!E;if(I=F.charCodeAt(M+1),E&&I!==n&&I!==o&&I!==s&&I!==a&&I!==l&&I!==i&&(M+=1,C.test(F.charAt(M)))){for(;C.test(F.charAt(M+1));)M+=1;F.charCodeAt(M+1)===o&&(M+=1)}P=["word",F.slice(B,M+1),B,M],B=M;break;default:I===n&&F.charCodeAt(B+1)===g?(M=F.indexOf("*/",B+2)+1,0===M&&(_||k?M=F.length:z("comment")),P=["comment",F.slice(B,M+1),B,M],B=M):(b.lastIndex=B+1,b.test(F),M=0===b.lastIndex?F.length-1:b.lastIndex-2,P=["word",F.slice(B,M+1),B,M],U.push(P),B=M)}return B++,P},position:function(){return B}}}}();const i={empty:!0,space:!0};return Qh=class{constructor(e){this.input=e,this.root=new n,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(t){let r,n,s,o=new e;o.name=t[1].slice(1),""===o.name&&this.unnamedAtrule(o,t),this.init(o,t[2]);let i=!1,a=!1,l=[],c=[];for(;!this.tokenizer.endOfFile();){if(r=(t=this.tokenizer.nextToken())[0],"("===r||"["===r?c.push("("===r?")":"]"):"{"===r&&c.length>0?c.push("}"):r===c[c.length-1]&&c.pop(),0===c.length){if(";"===r){o.source.end=this.getPosition(t[2]),o.source.end.offset++,this.semicolon=!0;break}if("{"===r){a=!0;break}if("}"===r){if(l.length>0){for(s=l.length-1,n=l[s];n&&"space"===n[0];)n=l[--s];n&&(o.source.end=this.getPosition(n[3]||n[2]),o.source.end.offset++)}this.end(t);break}l.push(t)}else l.push(t);if(this.tokenizer.endOfFile()){i=!0;break}}o.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(o.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(o,"params",l),i&&(t=l[l.length-1],o.source.end=this.getPosition(t[3]||t[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 s=t-1;s>=0&&(r=e[s],"space"===r[0]||(n+=1,2!==n));s--);throw this.input.error("Missed semicolon","word"===r[0]?r[3]+1:r[2])}colon(e){let t,r,n,s=0;for(let[o,i]of e.entries()){if(r=i,n=r[0],"("===n&&(s+=1),")"===n&&(s-=1),0===s&&":"===n){if(t){if("word"===t[0]&&"progid"===t[1])continue;return o}this.doubleColon(r)}t=r}return!1}comment(e){let r=new t;this.init(r,e[2]),r.source.end=this.getPosition(e[3]||e[2]),r.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))r.text="",r.raws.left=n,r.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);r.text=e[2],r.raws.left=e[1],r.raws.right=e[3]}}createTokenizer(){this.tokenizer=o(this.input)}decl(e,t){let n=new r;this.init(n,e[0][2]);let s,o=e[e.length-1];for(";"===o[0]&&(this.semicolon=!0,e.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}}(e)),n.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),n.raws.before+=e.shift()[1];for(n.source.start=this.getPosition(e[0][2]),n.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;n.prop+=e.shift()[1]}for(n.raws.between="";e.length;){if(s=e.shift(),":"===s[0]){n.raws.between+=s[1];break}"word"===s[0]&&/\w/.test(s[1])&&this.unknownWord([s]),n.raws.between+=s[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let i,a=[];for(;e.length&&(i=e[0][0],"space"===i||"comment"===i);)a.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(s=e[t],"!important"===s[1].toLowerCase()){n.important=!0;let r=this.stringFrom(e,t);r=this.spacesFromEnd(e)+r," !important"!==r&&(n.raws.important=r);break}if("important"===s[1].toLowerCase()){let r=e.slice(0),s="";for(let e=t;e>0;e--){let t=r[e][0];if(s.trim().startsWith("!")&&"space"!==t)break;s=r.pop()[1]+s}s.trim().startsWith("!")&&(n.important=!0,n.raws.important=s,e=r)}if("space"!==s[0]&&"comment"!==s[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(n,"value",a.concat(e),t),n.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new s;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 t=this.current.nodes[this.current.nodes.length-1];t&&"rule"===t.type&&!t.raws.ownSemicolon&&(t.raws.ownSemicolon=this.spaces,this.spaces="",t.source.end=this.getPosition(e[2]),t.source.end.offset+=t.raws.ownSemicolon.length)}}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,s=null,o=[],i=e[1].startsWith("--"),a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)s||(s=l),o.push("("===r?")":"]");else if(i&&n&&"{"===r)s||(s=l),o.push("}");else if(0===o.length){if(";"===r){if(n)return void this.decl(a,i);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&&(s=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(s),t&&n){if(!i)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,i)}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 s,o,a,l,c=r.length,u="",h=!0;for(let e=0;e<c;e+=1)s=r[e],o=s[0],"space"!==o||e!==c-1||n?"comment"===o?(l=r[e-1]?r[e-1][0]:"empty",a=r[e+1]?r[e+1][0]:"empty",i[l]||i[a]||","===u.slice(-1)?h=!1:u+=s[1]):u+=s[1]:h=!1;if(!h){let n=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:n,value:u}}e[t]=u}rule(e){e.pop();let t=new s;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 "+e[0][1],{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})}},Qh}function Ad(){if(ed)return Zh;ed=1;let e=bd(),t=Id(),r=Pd();function n(e,n){let s=new t(e,n),o=new r(s);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 Zh=n,n.default=n,e.registerParse(n),Zh}function Td(){if(rd)return td;rd=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 td=e,e.default=e,td}function Nd(){if(sd)return nd;sd=1;let e=Td();class t{get content(){return this.css}constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css="",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)}}return nd=t,t.default=t,nd}function Ld(){if(id)return od;id=1;let e={};return od=function(t){e[t]||(e[t]=!0,"undefined"!=typeof console&&console.warn&&console.warn(t))}}function Fd(){if(ld)return ad;ld=1;let e=bd(),t=Cd(),r=Rd(),n=Ad(),s=Nd(),o=Od(),i=wh(),{isClean:a,my:l}=gd(),c=Ld();const u={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},h={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},d={Once:!0,postcssPlugin:!0,prepare:!0};function p(e){return"object"==typeof e&&"function"==typeof e.then}function f(e){let t=!1,r=u[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 m(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 g(e){return e[a]=!1,e.nodes&&e.nodes.forEach(e=>g(e)),e}let v={};class y{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"}constructor(t,r,o){let i;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof y||r instanceof s)i=g(r.root),r.map&&(void 0===o.map&&(o.map={}),o.map.inline||(o.map.inline=!1),o.map.prev=r.map);else{let t=n;o.syntax&&(t=o.syntax.parse),o.parser&&(t=o.parser),t.parse&&(t=t.parse);try{i=t(r,o)}catch(e){this.processed=!0,this.error=e}i&&!i[l]&&e.rebuild(i)}else i=g(r);this.result=new s(t,i,o),this.helpers={...v,postcss:v,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,s=t.split("."),o=n.split(".");(s[0]!==o[0]||parseInt(s[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(!h[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!d[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 e=this.result.root;for(;!e[a];){e[a]=!0;let t=[m(e)];for(;t.length>0;){let e=this.visitTick(t);if(p(e))try{await e}catch(e){let r=t[t.length-1].node;throw this.handleError(e,r)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map(e=>r(e,this.helpers));await Promise.all(t)}else await r(e,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=i;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let n=new r(t,this.result.root,this.result.opts).generate();return this.result.css=n[0],this.result.map=n[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 e=this.result.root;for(;!e[a];)e[a]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||c("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(e){let t=e[e.length-1],{node:r,visitors:n}=t;if("root"!==r.type&&"document"!==r.type&&!r.parent)return void e.pop();if(n.length>0&&t.visitorIndex<n.length){let[e,s]=n[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===n.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return s(r.toProxy(),this.helpers)}catch(e){throw this.handleError(e,r)}}if(0!==t.iterator){let n,s=t.iterator;for(;n=r.nodes[r.indexes[s]];)if(r.indexes[s]+=1,!n[a])return n[a]=!0,void e.push(m(n));t.iterator=0,delete r.indexes[s]}let s=t.events;for(;t.eventIndex<s.length;){let e=s[t.eventIndex];if(t.eventIndex+=1,0===e)return void(r.nodes&&r.nodes.length&&(r[a]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[a]=!0;let t=f(e);for(let r of t)if(0===r)e.nodes&&e.each(e=>{e[a]||this.walkSync(e)});else{let t=this.listeners[r];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}}return y.registerPostcss=e=>{v=e},ad=y,y.default=y,o.registerLazyResult(y),t.registerLazyResult(y),ad}function _d(){if(dd)return hd;dd=1;let e=Cd(),t=Fd(),r=function(){if(ud)return cd;ud=1;let e=Rd(),t=Ad();const r=Nd();let n=wh(),s=Ld();class o{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,r=t;try{e=r(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"}constructor(t,s,o){let i;s=s.toString(),this.stringified=!1,this._processor=t,this._css=s,this._opts=o,this._map=void 0;let a=n;this.result=new r(this._processor,i,this._opts),this.result.css=s;let l=this;Object.defineProperty(this.result,"root",{get:()=>l.root});let c=new e(a,i,this._opts,s);if(c.isMap()){let[e,t]=c.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else c.clearAnnotation(),this.result.css=c.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||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}warnings(){return[]}}return cd=o,o.default=o,cd}(),n=Od();class s{constructor(e=[]){this.version="8.5.6",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(e,n={}){return this.plugins.length||n.parser||n.stringifier||n.syntax?new t(this,e,n):new r(this,e,n)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}return hd=s,s.default=s,n.registerProcessor(s),e.registerProcessor(s),hd}var Dd=function(){if(fd)return pd;fd=1;let e=Sd(),t=yd(),r=bd(),n=vh(),s=wd(),o=Cd(),i=function(){if(Gh)return Vh;Gh=1;let e=Sd(),t=yd(),r=wd(),n=Id(),s=kd(),o=Od(),i=Md();function a(l,c){if(Array.isArray(l))return l.map(e=>a(e));let{inputs:u,...h}=l;if(u){c=[];for(let e of u){let t={...e,__proto__:n.prototype};t.map&&(t.map={...t.map,__proto__:s.prototype}),c.push(t)}}if(h.nodes&&(h.nodes=l.nodes.map(e=>a(e,c))),h.source){let{inputId:e,...t}=h.source;h.source=t,null!=e&&(h.source.input=c[e])}if("root"===h.type)return new o(h);if("decl"===h.type)return new r(h);if("rule"===h.type)return new i(h);if("comment"===h.type)return new t(h);if("atrule"===h.type)return new e(h);throw new Error("Unknown node type: "+l.type)}return Vh=a,a.default=a,Vh}(),a=Id(),l=Fd(),c=Ed(),u=vd(),h=Ad(),d=_d(),p=Nd(),f=Od(),m=Md(),g=wh(),v=Td();function y(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new d(e)}return y.plugin=function(e,t){let r,n=!1;function s(...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 s=t(...r);return s.postcssPlugin=e,s.postcssVersion=(new d).version,s}return Object.defineProperty(s,"postcss",{get:()=>(r||(r=s()),r)}),s.process=function(e,t,r){return y([s(r)]).process(e,t)},s},y.stringify=g,y.parse=h,y.fromJSON=i,y.list=c,y.comment=e=>new t(e),y.atRule=t=>new e(t),y.decl=e=>new s(e),y.rule=e=>new m(e),y.root=e=>new f(e),y.document=e=>new o(e),y.CssSyntaxError=n,y.Declaration=s,y.Container=r,y.Processor=d,y.Document=o,y.Comment=t,y.Warning=v,y.AtRule=e,y.Result=p,y.Input=a,y.Rule=m,y.Root=f,y.Node=u,l.registerPostcss(y),pd=y,y.default=y,pd}();const Bd=oh(Dd);Bd.stringify,Bd.fromJSON,Bd.plugin,Bd.parse,Bd.list,Bd.document,Bd.comment,Bd.atRule,Bd.rule,Bd.decl,Bd.root,Bd.CssSyntaxError,Bd.Declaration,Bd.Container,Bd.Processor,Bd.Document,Bd.Comment,Bd.Warning,Bd.AtRule,Bd.Result,Bd.Input,Bd.Rule,Bd.Root,Bd.Node;class Ud{constructor(...e){sh(this,"parentElement",null),sh(this,"parentNode",null),sh(this,"ownerDocument"),sh(this,"firstChild",null),sh(this,"lastChild",null),sh(this,"previousSibling",null),sh(this,"nextSibling",null),sh(this,"ELEMENT_NODE",1),sh(this,"TEXT_NODE",3),sh(this,"nodeType"),sh(this,"nodeName"),sh(this,"RRNodeType")}get childNodes(){const e=[];let t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(!(e instanceof Ud))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.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"}}const jd={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},zd={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Wd={};function qd(e){if(Wd[e])return Wd[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 jd?jd[e]:void 0,s=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 zd?zd[e]:void 0,i=Boolean(o&&o.every(e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))}));if(s&&i)return Wd[e]=t.prototype,t.prototype;try{const n=document.createElement("iframe");document.body.appendChild(n);const s=n.contentWindow;if(!s)return t.prototype;const o=s[e].prototype;return document.body.removeChild(n),o?Wd[e]=o:r}catch{return r}}const $d={};function Vd(e,t,r){var n;const s=`${e}.${String(r)}`;if($d[s])return $d[s].call(t);const o=qd(e),i=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return i?($d[s]=i,i.call(t)):t[r]}const Gd={};function Hd(e,t,r){const n=`${e}.${String(r)}`;if(Gd[n])return Gd[n].bind(t);const s=qd(e)[r];return"function"!=typeof s?t[r]:(Gd[n]=s,s.bind(t))}function Jd(){return qd("MutationObserver").constructor}const Kd={childNodes:function(e){return Vd("Node",e,"childNodes")},parentNode:function(e){return Vd("Node",e,"parentNode")},parentElement:function(e){return Vd("Node",e,"parentElement")},textContent:function(e){return Vd("Node",e,"textContent")},contains:function(e,t){return Hd("Node",e,"contains")(t)},getRootNode:function(e){return Hd("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Vd("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Vd("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Vd("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Vd("Element",e,"querySelectorAll")(t)},mutationObserver:Jd};function Yd(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}const Qd="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.";let Xd={map:{},getId:()=>(console.error(Qd),-1),getNode:()=>(console.error(Qd),null),removeNodeFromMap(){console.error(Qd)},has:()=>(console.error(Qd),!1),reset(){console.error(Qd)}};function Zd(e,t,r={}){let n=null,s=0;return function(...o){const i=Date.now();s||!1!==r.leading||(s=i);const a=t-(i-s),l=this;a<=0||a>t?(n&&(clearTimeout(n),n=null),s=i,e.apply(l,o)):n||!1===r.trailing||(n=setTimeout(()=>{s=!1===r.leading?0:Date.now(),n=null,e.apply(l,o)},a))}}function ep(e,t,r,n,s=window){const o=s.Object.getOwnPropertyDescriptor(e,t);return s.Object.defineProperty(e,t,n?r:{set(e){setTimeout(()=>{r.set.call(this,e)},0),o&&o.set&&o.set.call(this,e)}}),()=>ep(e,t,o||{},!0)}function tp(e,t,r){try{if(!(t in e))return()=>{};const n=e[t],s=r(n);return"function"==typeof s&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=s,()=>{e[t]=n}}catch{return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Xd=new Proxy(Xd,{get:(e,t,r)=>("map"===t&&console.error(Qd),Reflect.get(e,t,r))}));let rp=Date.now;function np(e){var t,r,n,s;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=Kd.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=Kd.parentElement(o.body))?void 0:n.scrollTop)||(null==(s=null==o?void 0:o.body)?void 0:s.scrollTop)||0}}function sp(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function op(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function ip(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:Kd.parentElement(e)}function ap(e,t,r,n){if(!e)return!1;const s=ip(e);if(!s)return!1;try{if("string"==typeof t){if(s.classList.contains(t))return!0;if(n&&null!==s.closest("."+t))return!0}else if(vc(s,t,n))return!0}catch(e){}if(r){if(s.matches(r))return!0;if(n&&null!==s.closest(r))return!0}return!1}function lp(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||-2===t.getId(e)}function cp(e,t){if(jl(e))return!1;const r=t.getId(e);if(!t.has(r))return!0;const n=Kd.parentNode(e);return(!n||n.nodeType!==e.DOCUMENT_NODE)&&(!n||cp(n,t))}function up(e){return Boolean(e.changedTouches)}function hp(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function dp(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function pp(e){return!!e&&(e instanceof Ud&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(Kd.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(rp=()=>(new Date).getTime());class fp{constructor(){Ol(this,"id",1),Ol(this,"styleIDMap",new WeakMap),Ol(this,"idStyleMap",new Map)}getId(e){return this.styleIDMap.get(e)??-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++}}function mp(e){var t;let r=null;return"getRootNode"in e&&(null==(t=Kd.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&Kd.host(Kd.getRootNode(e))&&(r=Kd.host(Kd.getRootNode(e))),r}function gp(e){const t=e.ownerDocument;if(!t)return!1;const r=function(e){let t,r=e;for(;t=mp(r);)r=t;return r}(e);return Kd.contains(t,r)}function vp(e){const t=e.ownerDocument;return!!t&&(Kd.contains(t,e)||gp(e))}var yp=(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))(yp||{}),wp=(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))(wp||{}),bp=(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))(bp||{}),Sp=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Sp||{}),Cp=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Cp||{}),xp=(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))(xp||{}),kp=(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))(kp||{});function Ip(e){return"__ln"in e}class Op{constructor(){Ol(this,"length",0),Ol(this,"head",null),Ol(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&&Ip(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&&Ip(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--)}}const Ep=(e,t)=>`${e}@${t}`;class Mp{constructor(){Ol(this,"frozen",!1),Ol(this,"locked",!1),Ol(this,"texts",[]),Ol(this,"attributes",[]),Ol(this,"attributeMap",new WeakMap),Ol(this,"removes",[]),Ol(this,"mapRemoves",[]),Ol(this,"movedMap",{}),Ol(this,"addedSet",new Set),Ol(this,"movedSet",new Set),Ol(this,"droppedSet",new Set),Ol(this,"removesSubTreeCache",new Set),Ol(this,"mutationCb"),Ol(this,"blockClass"),Ol(this,"blockSelector"),Ol(this,"maskTextClass"),Ol(this,"maskTextSelector"),Ol(this,"inlineStylesheet"),Ol(this,"maskInputOptions"),Ol(this,"maskTextFn"),Ol(this,"maskInputFn"),Ol(this,"maskAttributeFn"),Ol(this,"keepIframeSrcFn"),Ol(this,"recordCanvas"),Ol(this,"inlineImages"),Ol(this,"slimDOMOptions"),Ol(this,"dataURLOptions"),Ol(this,"doc"),Ol(this,"mirror"),Ol(this,"iframeManager"),Ol(this,"stylesheetManager"),Ol(this,"shadowDomManager"),Ol(this,"canvasManager"),Ol(this,"processedNodeManager"),Ol(this,"captureAdoptedStyleSheets"),Ol(this,"unattachedDoc"),Ol(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),Ol(this,"emit",()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,r=new Op,n=e=>{let t=e,r=-2;for(;-2===r;)t=t&&t.nextSibling,r=t&&this.mirror.getId(t);return r},s=s=>{const o=Kd.parentNode(s);if(!o||!vp(s))return;let i=!1;if(s.nodeType===Node.TEXT_NODE){const e=o.tagName;if("TEXTAREA"===e)return;"STYLE"===e&&this.addedSet.has(o)&&(i=!0)}const a=jl(o)?this.mirror.getId(mp(s)):this.mirror.getId(o),l=n(s);if(-1===a||-1===l)return r.addNode(s);const c=Cc(s,{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=>{hp(e,this.mirror)&&this.iframeManager.addIframe(e),dp(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),pp(s)&&this.shadowDomManager.addShadowRoot(Kd.shadowRoot(s),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)},onAdoptedStyleSheet:this.captureAdoptedStyleSheets?e=>this.stylesheetManager.styleMirror.add(e):void 0,_emittedStyleIds:this.captureAdoptedStyleSheets?this.stylesheetManager.getInlinedAdoptedStyleSheetRuleIds():void 0,cssCaptured:i});c&&(e.push({parentId:a,nextId:l,node:c}),t.add(c.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const e of this.movedSet)Pp(this.removesSubTreeCache,e,this.mirror)&&!this.movedSet.has(Kd.parentNode(e))||s(e);for(const e of this.addedSet)Ap(this.droppedSet,e)||Pp(this.removesSubTreeCache,e,this.mirror)?Ap(this.movedSet,e)?s(e):this.droppedSet.add(e):s(e);let o=null;for(;r.length;){let e=null;if(o){const t=this.mirror.getId(Kd.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(Kd.parentNode(r.value));if(-1===n(r.value))continue;if(-1!==t){e=r;break}{const t=r.value,n=Kd.parentNode(t);if(n&&n.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const t=Kd.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),s(e.value)}const i={texts:this.texts.map(e=>{const t=e.node,r=Kd.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};(i.texts.length||i.attributes.length||i.removes.length||i.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(i))}),Ol(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(Kd.childNodes(e),e=>Kd.textContent(e)||"").join("");t.attributes.value=Vl({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:Jl(e),value:r,maskInputFn:this.maskInputFn})}),Ol(this,"processMutation",e=>{if(!lp(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=Kd.textContent(e.target);ap(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:yc(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,ip(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=Jl(t);n=Vl({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:e,value:n,maskInputFn:this.maskInputFn})}if(ap(e.target,this.blockClass,this.blockSelector,!1)||n===e.oldValue)return;let s=this.attributeMap.get(e.target);if("IFRAME"===t.tagName&&"src"===r&&!this.keepIframeSrcFn(n)){if(t.contentDocument)return;r="rr_src"}if(s||(s={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(s),this.attributeMap.set(e.target,s)),"type"===r&&"INPUT"===t.tagName&&"password"===(e.oldValue||"").toLowerCase()&&t.setAttribute("data-rr-is-password","true"),!gc(t.tagName,r)){if(s.attributes[r]=mc(this.doc,Gl(t.tagName),Gl(r),n),this.maskAttributeFn&&"string"==typeof s.attributes[r]){const e=this.maskAttributeFn(r,s.attributes[r],t);null!==e?s.attributes[r]=e:delete s.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)?s.styleDiff[e]=""===o?n:[n,o]:s._unchangedStyles[e]=[n,o]}for(const e of Array.from(r.style))""===t.style.getPropertyValue(e)&&(s.styleDiff[e]=!1)}else"open"===r&&"DIALOG"===t.tagName&&(t.matches("dialog:modal")?s.attributes.rr_open_mode="modal":s.attributes.rr_open_mode="non-modal")}break}case"childList":if(ap(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=jl(e.target)?this.mirror.getId(Kd.host(e.target)):this.mirror.getId(e.target);ap(e.target,this.blockClass,this.blockSelector,!1)||lp(t,this.mirror,this.slimDOMOptions)||(!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(Rp(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||cp(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Ep(r,n)]?Rp(this.movedSet,t):(this.removes.push({parentId:n,id:r,isShadow:!(!jl(e.target)||!zl(e.target))||void 0}),function(e,t){const r=[e];for(;r.length;){const e=r.pop();t.has(e)||(t.add(e),Kd.childNodes(e).forEach(e=>r.push(e)))}}(t,this.removesSubTreeCache)))),this.mapRemoves.push(t))})}}),Ol(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(lp(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[Ep(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);ap(e,this.blockClass,this.blockSelector,!1)||(Kd.childNodes(e).forEach(e=>this.genAdds(e)),pp(e)&&Kd.childNodes(Kd.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","captureAdoptedStyleSheets"].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()}}function Rp(e,t){e.delete(t),Kd.childNodes(t).forEach(t=>Rp(e,t))}function Pp(e,t,r){return 0!==e.size&&function(e,t){const r=Kd.parentNode(t);return!!r&&e.has(r)}(e,t)}function Ap(e,t){return 0!==e.size&&Tp(e,t)}function Tp(e,t){const r=Kd.parentNode(t);return!!r&&(!!e.has(r)||Tp(e,r))}let Np;const Lp=e=>{if(!Np)return e;return(...t)=>{try{return e(...t)}catch(e){if(Np&&!0===Np(e))return;throw e}}};function Fp(e){return(...t)=>{try{return e(...t)}catch(e){try{e._external_=!0}catch{}throw e}}}const _p=[];function Dp(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{}return e&&e.target}function Bp(e,t){const r=new Mp;_p.push(r),r.init(e);const n=new(Jd())(Lp(r.processMutations.bind(r)));return n.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),n}function Up({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,blockSelector:s,sampling:o}){if(!1===o.mouseInteraction)return()=>{};const i=!0===o.mouseInteraction||void 0===o.mouseInteraction?{}:o.mouseInteraction,a=[];let l=null;return Object.keys(bp).filter(e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==i[e]).forEach(o=>{let i=Gl(o);const c=(t=>o=>{const i=Dp(o);if(ap(i,n,s,!0))return;let a=null,c=t;if("pointerType"in o){switch(o.pointerType){case"mouse":a=Sp.Mouse;break;case"touch":a=Sp.Touch;break;case"pen":a=Sp.Pen}a===Sp.Touch?bp[t]===bp.MouseDown?c="TouchStart":bp[t]===bp.MouseUp&&(c="TouchEnd"):Sp.Pen}else up(o)&&(a=Sp.Touch);null!==a?(l=a,(c.startsWith("Touch")&&a===Sp.Touch||c.startsWith("Mouse")&&a===Sp.Mouse)&&(a=null)):bp[t]===bp.Click&&(a=l,l=null);const u=up(o)?o.changedTouches[0]:o;if(!u)return;const h=r.getId(i),{clientX:d,clientY:p}=u;Lp(e)({type:bp[c],id:h,x:d,y:p,...null!==a&&{pointerType:a}},o)})(o);if(window.PointerEvent)switch(bp[o]){case bp.MouseDown:case bp.MouseUp:i=i.replace("mouse","pointer");break;case bp.TouchStart:case bp.TouchEnd:return}a.push(Yd(i,c,t))}),Lp(()=>{a.forEach(e=>e())})}function jp({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:s,sampling:o}){const i=Lp(Zd(Lp(o=>{const i=Dp(o);if(!i||ap(i,n,s,!0))return;const a=r.getId(i);if(i===t&&t.defaultView){const r=np(t.defaultView);e({id:a,x:r.left,y:r.top})}else e({id:a,x:i.scrollLeft,y:i.scrollTop})}),o.scroll||100));return Yd("scroll",i,t)}const zp=["INPUT","TEXTAREA","SELECT"],Wp=new WeakMap;function qp(e){return function(e,t){if(Hp("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||Hp("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||Hp("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||Hp("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 $p(e,t,r){let n,s;return e?(e.ownerNode?n=t.getId(e.ownerNode):s=r.getId(e),{styleId:s,id:n}):{}}function Vp({mirror:e,stylesheetManager:t},r){var n,s,o;let i=null;i="#document"===r.nodeName?e.getId(r):e.getId(Kd.host(r));const a="#document"===r.nodeName?null==(n=r.defaultView)?void 0:n.Document:null==(o=null==(s=r.ownerDocument)?void 0:s.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!==i&&-1!==i&&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!==i&&-1!==i)try{t.adoptStyleSheets(e,i)}catch(e){}return n}}),Lp(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})})):()=>{}}function Gp(e,t={}){const r=e.doc.defaultView;if(!r)return()=>{};let n;!function(e,t){const{mutationCb:r,mousemoveCb:n,mouseInteractionCb:s,scrollCb:o,viewportResizeCb:i,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:c,styleDeclarationCb:u,canvasMutationCb:h,fontCb:d,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),s(e[0])},e.scrollCb=(...e)=>{t.scroll&&t.scroll(...e),o(...e)},e.viewportResizeCb=(...e)=>{t.viewportResize&&t.viewportResize(...e),i(...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),c(...e)},e.styleDeclarationCb=(...e)=>{t.styleDeclaration&&t.styleDeclaration(...e),u(...e)},e.canvasMutationCb=(...e)=>{t.canvasMutation&&t.canvasMutation(...e),h(...e)},e.fontCb=(...e)=>{t.font&&t.font(...e),d(...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=Bp(e,e.doc));const s=function({mousemoveCb:e,sampling:t,doc:r,mirror:n}){if(!1===t.mousemove)return()=>{};const s="number"==typeof t.mousemove?t.mousemove:50,o="number"==typeof t.mousemoveCallback?t.mousemoveCallback:500;let i,a=[];const l=Zd(Lp(t=>{const r=Date.now()-i;e(a.map(e=>(e.timeOffset-=r,e)),t),a=[],i=null}),o),c=Lp(Zd(Lp(e=>{const t=Dp(e),{clientX:r,clientY:s}=up(e)?e.changedTouches[0]:e;i||(i=rp()),a.push({x:r,y:s,id:n.getId(t),timeOffset:rp()-i}),l("undefined"!=typeof DragEvent&&e instanceof DragEvent?wp.Drag:e instanceof MouseEvent?wp.MouseMove:wp.TouchMove)}),s,{trailing:!1})),u=[Yd("mousemove",c,r),Yd("touchmove",c,r),Yd("drag",c,r)];return Lp(()=>{u.forEach(e=>e())})}(e),o=Up(e),i=jp(e),a=function({viewportResizeCb:e},{win:t}){let r=-1,n=-1;return Yd("resize",Lp(Zd(Lp(()=>{const t=sp(),s=op();r===t&&n===s||(e({width:Number(s),height:Number(t)}),r=t,n=s)}),200)),t)}(e,{win:r}),l=function({inputCb:e,doc:t,mirror:r,blockClass:n,blockSelector:s,ignoreClass:o,ignoreSelector:i,maskInputOptions:a,maskInputFn:l,sampling:c,userTriggeredOnInput:u}){function h(e){let r=Dp(e);const c=e.isTrusted,h=r&&r.tagName;if(r&&"OPTION"===h&&(r=Kd.parentElement(r)),!r||!h||zp.indexOf(h)<0||ap(r,n,s,!0))return;if(r.classList.contains(o)||i&&r.matches(i))return;let p=r.value,f=!1;const m=Jl(r)||"";"radio"===m||"checkbox"===m?f=r.checked:(a[h.toLowerCase()]||a[m])&&(p=Vl({element:r,maskInputOptions:a,tagName:h,type:m,value:p,maskInputFn:l})),d(r,u?{text:p,isChecked:f,userTriggered:c}:{text:p,isChecked:f});const g=r.name;"radio"===m&&g&&f&&t.querySelectorAll(`input[type="radio"][name="${g}"]`).forEach(e=>{if(e!==r){const t=e.value;d(e,u?{text:t,isChecked:!f,userTriggered:!1}:{text:t,isChecked:!f})}})}function d(t,n){const s=Wp.get(t);if(!s||s.text!==n.text||s.isChecked!==n.isChecked){Wp.set(t,n);const s=r.getId(t);Lp(e)({...n,id:s})}}const p=("last"===c.input?["change"]:["input","change"]).map(e=>Yd(e,Lp(h),t)),f=t.defaultView;if(!f)return()=>{p.forEach(e=>e())};const m=f.Object.getOwnPropertyDescriptor(f.HTMLInputElement.prototype,"value"),g=[[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 m&&m.set&&p.push(...g.map(e=>ep(e[0],e[1],{set(){Lp(h)({target:this,isTrusted:!1})}},!1,f))),Lp(()=>{p.forEach(e=>e())})}(e),c=function({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:s,doc:o}){const i=Lp(o=>Zd(Lp(s=>{const i=Dp(s);if(!i||ap(i,t,r,!0))return;const{currentTime:a,volume:l,muted:c,playbackRate:u,loop:h}=i;e({type:o,id:n.getId(i),currentTime:a,volume:l,muted:c,playbackRate:u,loop:h})}),s.media||500)),a=[Yd("play",i(xp.Play),o),Yd("pause",i(xp.Pause),o),Yd("seeked",i(xp.Seeked),o),Yd("volumechange",i(xp.VolumeChange),o),Yd("ratechange",i(xp.RateChange),o)];return Lp(()=>{a.forEach(e=>e())})}(e);let u=()=>{},h=()=>{},d=()=>{},p=()=>{};e.recordDOM&&(u=function({styleSheetRuleCb:e,mirror:t,stylesheetManager:r},{win:n}){if(!n.CSSStyleSheet||!n.CSSStyleSheet.prototype)return()=>{};const s=n.CSSStyleSheet.prototype.insertRule;n.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:Lp((n,s,o)=>{const[i,a]=o,{id:l,styleId:c}=$p(s,t,r.styleMirror);return(l&&-1!==l||c&&-1!==c)&&e({id:l,styleId:c,adds:[{rule:i,index:a}]}),Fp(()=>n.apply(s,o))()})}),n.CSSStyleSheet.prototype.addRule=function(e,t,r=this.cssRules.length){const s=`${e} { ${t} }`;return n.CSSStyleSheet.prototype.insertRule.apply(this,[s,r])};const o=n.CSSStyleSheet.prototype.deleteRule;let i,a;n.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:Lp((n,s,o)=>{const[i]=o,{id:a,styleId:l}=$p(s,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:i}]}),Fp(()=>n.apply(s,o))()})}),n.CSSStyleSheet.prototype.removeRule=function(e){return n.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},n.CSSStyleSheet.prototype.replace&&(i=n.CSSStyleSheet.prototype.replace,n.CSSStyleSheet.prototype.replace=new Proxy(i,{apply:Lp((n,s,o)=>{const[i]=o,{id:a,styleId:l}=$p(s,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,replace:i}),n.apply(s,o)})})),n.CSSStyleSheet.prototype.replaceSync&&(a=n.CSSStyleSheet.prototype.replaceSync,n.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:Lp((n,s,o)=>{const[i]=o,{id:a,styleId:l}=$p(s,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,replaceSync:i}),n.apply(s,o)})}));const l={};Jp("CSSGroupingRule")?l.CSSGroupingRule=n.CSSGroupingRule:(Jp("CSSMediaRule")&&(l.CSSMediaRule=n.CSSMediaRule),Jp("CSSConditionRule")&&(l.CSSConditionRule=n.CSSConditionRule),Jp("CSSSupportsRule")&&(l.CSSSupportsRule=n.CSSSupportsRule));const c={};return Object.entries(l).forEach(([n,s])=>{c[n]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=new Proxy(c[n].insertRule,{apply:Lp((n,s,o)=>{const[i,a]=o,{id:l,styleId:c}=$p(s.parentStyleSheet,t,r.styleMirror);return(l&&-1!==l||c&&-1!==c)&&e({id:l,styleId:c,adds:[{rule:i,index:[...qp(s),a||0]}]}),n.apply(s,o)})}),s.prototype.deleteRule=new Proxy(c[n].deleteRule,{apply:Lp((n,s,o)=>{const[i]=o,{id:a,styleId:l}=$p(s.parentStyleSheet,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:[...qp(s),i]}]}),n.apply(s,o)})})}),Lp(()=>{n.CSSStyleSheet.prototype.insertRule=s,n.CSSStyleSheet.prototype.deleteRule=o,i&&(n.CSSStyleSheet.prototype.replace=i),a&&(n.CSSStyleSheet.prototype.replaceSync=a),Object.entries(l).forEach(([e,t])=>{t.prototype.insertRule=c[e].insertRule,t.prototype.deleteRule=c[e].deleteRule})})}(e,{win:r}),h=Vp(e,e.doc),d=function({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:r,stylesheetManager:n},{win:s}){const o=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:Lp((s,i,a)=>{var l;const[c,u,h]=a;if(r.has(c))return o.apply(i,[c,u,h]);const{id:d,styleId:p}=$p(null==(l=i.parentRule)?void 0:l.parentStyleSheet,t,n.styleMirror);return(d&&-1!==d||p&&-1!==p)&&e({id:d,styleId:p,set:{property:c,value:u,priority:h},index:qp(i.parentRule)}),s.apply(i,a)})});const i=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(i,{apply:Lp((s,o,a)=>{var l;const[c]=a;if(r.has(c))return i.apply(o,[c]);const{id:u,styleId:h}=$p(null==(l=o.parentRule)?void 0:l.parentStyleSheet,t,n.styleMirror);return(u&&-1!==u||h&&-1!==h)&&e({id:u,styleId:h,remove:{property:c},index:qp(o.parentRule)}),s.apply(o,a)})}),Lp(()=>{s.CSSStyleDeclaration.prototype.setProperty=o,s.CSSStyleDeclaration.prototype.removeProperty=i})}(e,{win:r}),e.collectFonts&&(p=function({fontCb:e,doc:t}){const r=t.defaultView;if(!r)return()=>{};const n=[],s=new WeakMap,o=r.FontFace;r.FontFace=function(e,t,r){const n=new o(e,t,r);return s.set(n,{family:e,buffer:"string"!=typeof t,descriptors:r,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),n};const i=tp(t.fonts,"add",function(t){return function(r){return setTimeout(Lp(()=>{const t=s.get(r);t&&(e(t),s.delete(r))}),0),t.apply(this,[r])}});return n.push(()=>{r.FontFace=o}),n.push(i),Lp(()=>{n.forEach(e=>e())})}(e)));const f=function(e){const{doc:t,mirror:r,blockClass:n,blockSelector:s,selectionCb:o}=e;let i=!0;const a=Lp(()=>{const e=t.getSelection();if(!e||i&&(null==e?void 0:e.isCollapsed))return;i=e.isCollapsed||!1;const a=[],l=e.rangeCount||0;for(let t=0;t<l;t++){const o=e.getRangeAt(t),{startContainer:i,startOffset:l,endContainer:c,endOffset:u}=o;ap(i,n,s,!0)||ap(c,n,s,!0)||a.push({start:r.getId(i),startOffset:l,end:r.getId(c),endOffset:u})}o({ranges:a})});return a(),Yd("selectionchange",a)}(e),m=function({doc:e,customElementCb:t}){const r=e.defaultView;return r&&r.customElements?tp(r.customElements,"define",function(e){return function(r,n,s){try{t({define:{name:r}})}catch(e){console.warn(`Custom element callback failed for ${r}`)}return e.apply(this,[r,n,s])}}):()=>{}}(e),g=[];for(const t of e.plugins)g.push(t.observer(t.callback,r,t.options));return Lp(()=>{_p.forEach(e=>e.reset()),null==n||n.disconnect(),s(),o(),i(),a(),l(),c(),u(),h(),d(),p(),f(),m(),g.forEach(e=>e())})}function Hp(e){return void 0!==window[e]}function Jp(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class Kp{constructor(e){Ol(this,"iframeIdToRemoteIdMap",new WeakMap),Ol(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,n){const s=r||this.getIdToRemoteIdMap(e),o=n||this.getRemoteIdToIdMap(e);let i=s.get(t);return i||(i=this.generateIdFn(),s.set(t,i),o.set(i,t)),i}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 s=n.get(t);return s||-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}}class Yp{constructor(e){Ol(this,"iframes",new WeakMap),Ol(this,"crossOriginIframeMap",new WeakMap),Ol(this,"crossOriginIframeMirror",new Kp(ic)),Ol(this,"crossOriginIframeStyleMirror"),Ol(this,"crossOriginIframeRootIdMap",new WeakMap),Ol(this,"mirror"),Ol(this,"mutationCb"),Ol(this,"wrappedEmit"),Ol(this,"loadListener"),Ol(this,"stylesheetManager"),Ol(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Kp(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 yp.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:yp.IncrementalSnapshot,data:{source:wp.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case yp.Meta:case yp.Load:case yp.DomContentLoaded:return!1;case yp.Plugin:return t;case yp.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case yp.IncrementalSnapshot:switch(t.data.source){case wp.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 wp.Drag:case wp.TouchMove:case wp.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case wp.ViewportResize:return!1;case wp.MediaInteraction:case wp.MouseInteraction:case wp.Scroll:case wp.CanvasMutation:case wp.Input:return this.replaceIds(t.data,e,["id"]),t;case wp.StyleSheetRule:case wp.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case wp.Font:return t;case wp.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,["start","end"])}),t;case wp.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 s of n)(Array.isArray(t[s])||"number"==typeof t[s])&&(Array.isArray(t[s])?t[s]=e.getIds(r,t[s]):t[s]=e.getId(r,t[s]));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===kp.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(e=>{this.patchRootIdOnNode(e,t)})}}class Qp{constructor(e){Ol(this,"shadowDoms",new WeakSet),Ol(this,"mutationCb"),Ol(this,"scrollCb"),Ol(this,"bypassOptions"),Ol(this,"mirror"),Ol(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(!zl(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const r=Bp({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(jp({...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(Kd.host(e))),this.restoreHandlers.push(Vp({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(tp(e.prototype,"attachShadow",function(e){return function(n){const s=e.call(this,n),o=Kd.shadowRoot(this);return o&&vp(this)&&r.addShadowRoot(o,t),s}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch(e){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var Xp="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Zp="undefined"==typeof Uint8Array?[]:new Uint8Array(256),ef=0;ef<64;ef++)Zp[Xp.charCodeAt(ef)]=ef;const tf=new Map;const rf=(e,t,r)=>{if(!e||!of(e,t)&&"object"!=typeof e)return;const n=function(e,t){let r=tf.get(e);return r||(r=new Map,tf.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}(r,e.constructor.name);let s=n.indexOf(e);return-1===s&&(s=n.length,n.push(e)),s};function nf(e,t,r){if(e instanceof Array)return e.map(e=>nf(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:function(e){var t,r=new Uint8Array(e),n=r.length,s="";for(t=0;t<n;t+=3)s+=Xp[r[t]>>2],s+=Xp[(3&r[t])<<4|r[t+1]>>4],s+=Xp[(15&r[t+1])<<2|r[t+2]>>6],s+=Xp[63&r[t+2]];return n%3==2?s=s.substring(0,s.length-1)+"=":n%3==1&&(s=s.substring(0,s.length-2)+"=="),s}(e)}}if(e instanceof DataView){return{rr_type:e.constructor.name,args:[nf(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:[nf(e.data,t,r),e.width,e.height]}}if(of(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:rf(e,t,r)}}return e}const sf=(e,t,r)=>e.map(e=>nf(e,t,r)),of=(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]))};function af(e,t,r,n){const s=[];try{const o=tp(e.HTMLCanvasElement.prototype,"getContext",function(e){return function(s,...o){if(!ap(this,t,r,!0)){const e=function(e){return"experimental-webgl"===e?"webgl":e}(s);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,[s,...o])}});s.push(o)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{s.forEach(e=>e())}}function lf(e,t,r,n,s,o){const i=[],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=tp(e,l,function(e){return function(...i){const a=e.apply(this,i);if(rf(a,o,this),"tagName"in this.canvas&&!ap(this.canvas,n,s,!0)){const e=sf(i,o,this),n={type:t,property:l,args:e};r(this.canvas,n)}return a}});i.push(a)}catch{const n=ep(e,l,{set(e){r(this.canvas,{type:t,property:l,args:[e],setter:!0})}});i.push(n)}return i}const cf='(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',uf="undefined"!=typeof self&&self.Blob&&new Blob([cf],{type:"text/javascript;charset=utf-8"});function hf(e){let t;try{if(t=uf&&(self.URL||self.webkitURL).createObjectURL(uf),!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(cf),{name:null==e?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}class df{constructor(e){Ol(this,"pendingCanvasMutations",new Map),Ol(this,"rafStamps",{latestId:0,invokeId:null}),Ol(this,"mirror"),Ol(this,"mutationCb"),Ol(this,"resetObservers"),Ol(this,"frozen",!1),Ol(this,"locked",!1),Ol(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:s,recordCanvas:o,dataURLOptions:i}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,o&&"all"===t&&this.initCanvasMutationObserver(r,n,s),o&&"number"==typeof t&&this.initCanvasFPSObserver(t,r,n,s,{dataURLOptions:i})}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,s){const o=af(t,r,n,!0),i=new Map,a=new hf;a.onmessage=e=>{const{id:t}=e.data;if(i.set(t,!1),!("base64"in e.data))return;const{base64:r,type:n,width:s,height:o}=e.data;this.mutationCb({id:t,type:Cp["2D"],commands:[{property:"clearRect",args:[0,0,s,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 c,u=0;const h=e=>{u&&e-u<l||(u=e,(()=>{const e=[];return t.document.querySelectorAll("canvas").forEach(t=>{ap(t,r,n,!0)||e.push(t)}),e})().forEach(async e=>{var t;const r=this.mirror.getId(e);if(i.get(r))return;if(0===e.width||0===e.height)return;if(i.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:s.dataURLOptions},[n])})),c=requestAnimationFrame(h)};c=requestAnimationFrame(h),this.resetObservers=()=>{o(),cancelAnimationFrame(c)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const n=af(e,t,r,!1),s=function(e,t,r,n){const s=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const i of o)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[i])continue;const o=tp(t.CanvasRenderingContext2D.prototype,i,function(s){return function(...o){return ap(this.canvas,r,n,!0)||setTimeout(()=>{const r=sf(o,t,this);e(this.canvas,{type:Cp["2D"],property:i,args:r})},0),s.apply(this,o)}});s.push(o)}catch{const r=ep(t.CanvasRenderingContext2D.prototype,i,{set(t){e(this.canvas,{type:Cp["2D"],property:i,args:[t],setter:!0})}});s.push(r)}return()=>{s.forEach(e=>e())}}(this.processMutation.bind(this),e,t,r),o=function(e,t,r,n){const s=[];return s.push(...lf(t.WebGLRenderingContext.prototype,Cp.WebGL,e,r,n,t)),void 0!==t.WebGL2RenderingContext&&s.push(...lf(t.WebGL2RenderingContext.prototype,Cp.WebGL2,e,r,n,t)),()=>{s.forEach(e=>e())}}(this.processMutation.bind(this),e,t,r);this.resetObservers=()=>{n(),s(),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:s}=r[0];this.mutationCb({id:t,type:s,commands:n}),this.pendingCanvasMutations.delete(e)}}class pf{constructor(e){Ol(this,"trackedLinkElements",new WeakSet),Ol(this,"mutationCb"),Ol(this,"adoptedStyleSheetCb"),Ol(this,"styleMirror",new fp),Ol(this,"inlinedAdoptedStyleSheetRuleIds",new Set),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}getInlinedAdoptedStyleSheetRuleIds(){return this.inlinedAdoptedStyleSheetRuleIds}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:ql(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,this.inlinedAdoptedStyleSheetRuleIds.clear()}trackStylesheetInLinkElement(e){}}class ff{constructor(){Ol(this,"nodeMap",new WeakMap),Ol(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(){}}let mf,gf,vf,yf=!1;try{if(2!==Array.from([1],e=>2*e)[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(xl=e.contentWindow)?void 0:xl.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}const wf=new $l;function bf(e={}){const{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:s="rr-block",blockSelector:o=null,ignoreClass:i="rr-ignore",ignoreSelector:a=null,maskTextClass:l="rr-mask",maskTextSelector:c=null,inlineStylesheet:u=!0,maskAllInputs:h,maskInputOptions:d,slimDOMOptions:p,maskInputFn:f,maskTextFn:m,maskAttributeFn:g,hooks:v,packFn:y,sampling:w={},dataURLOptions:b={},mousemoveWait:S,recordDOM:C=!0,recordCanvas:x=!1,recordCrossOriginIframes:k=!1,recordAfter:I=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:O=!1,collectFonts:E=!1,inlineImages:M=!1,captureAdoptedStyleSheets:R=!1,plugins:P,keepIframeSrcFn:A=()=>!1,ignoreCSSAttributes:T=new Set([]),errorHandler:N,applyBackgroundColorToBlockedElements:L=!1}=e;Np=N;const F=!k||window.parent===window;let _=!1;if(!F)try{window.parent.document&&(_=!1)}catch(e){_=!0}if(F&&!t)throw new Error("emit function is required");if(!F&&!_)return()=>{};void 0!==S&&void 0===w.mousemove&&(w.mousemove=S),wf.reset();const D=!0===h?{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!==d?d:{password:!0},B=!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 U;!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 j=0;const z=e=>{for(const t of P||[])t.eventProcessor&&(e=t.eventProcessor(e));return y&&!_&&(e=y(e)),e};mf=(e,s)=>{var o;const i=e;if(i.timestamp=rp(),!(null==(o=_p[0])?void 0:o.isFrozen())||i.type===yp.FullSnapshot||i.type===yp.IncrementalSnapshot&&i.data.source===wp.Mutation||_p.forEach(e=>e.unfreeze()),F)null==t||t(z(i),s);else if(_){const e={type:"rrweb",event:z(i),origin:window.location.origin,isCheckout:s};window.parent.postMessage(e,"*")}if(i.type===yp.FullSnapshot)U=i,j=0;else if(i.type===yp.IncrementalSnapshot){if(i.data.source===wp.Mutation&&i.data.isAttachIframe)return;j++;const e=n&&j>=n,t=r&&i.timestamp-U.timestamp>r;(e||t)&&gf(!0)}};const W=e=>{mf({type:yp.IncrementalSnapshot,data:{source:wp.Mutation,...e}})},q=e=>mf({type:yp.IncrementalSnapshot,data:{source:wp.Scroll,...e}}),$=e=>mf({type:yp.IncrementalSnapshot,data:{source:wp.CanvasMutation,...e}}),V=new pf({mutationCb:W,adoptedStyleSheetCb:e=>mf({type:yp.IncrementalSnapshot,data:{source:wp.AdoptedStyleSheet,...e}})}),G=new Yp({mirror:wf,mutationCb:W,stylesheetManager:V,recordCrossOriginIframes:k,wrappedEmit:mf});for(const e of P||[])e.getMirror&&e.getMirror({nodeMirror:wf,crossOriginIframeMirror:G.crossOriginIframeMirror,crossOriginIframeStyleMirror:G.crossOriginIframeStyleMirror});const H=new ff;vf=new df({recordCanvas:x,mutationCb:$,win:window,blockClass:s,blockSelector:o,mirror:wf,sampling:w.canvas,dataURLOptions:b});const J=new Qp({mutationCb:W,scrollCb:q,bypassOptions:{blockClass:s,blockSelector:o,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskInputOptions:D,dataURLOptions:b,maskTextFn:m,maskInputFn:f,maskAttributeFn:g,recordCanvas:x,inlineImages:M,sampling:w,slimDOMOptions:B,iframeManager:G,stylesheetManager:V,canvasManager:vf,keepIframeSrcFn:A,processedNodeManager:H,captureAdoptedStyleSheets:R},mirror:wf});gf=(e=!1)=>{if(!C)return;mf({type:yp.Meta,data:{href:window.location.href,width:op(),height:sp()}},e),V.reset(),J.init(),_p.forEach(e=>e.lock());const t=function(e,t){const{mirror:r=new $l,blockClass:n="rr-block",blockSelector:s=null,maskTextClass:o="rr-mask",maskTextSelector:i=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:c=!1,maskAllInputs:u=!1,maskTextFn:h,maskInputFn:d,maskAttributeFn:p,slimDOM:f=!1,dataURLOptions:m,preserveWhiteSpace:g,onSerialize:v,onAdoptedStyleSheet:y,_emittedStyleIds:w,onIframeLoad:b,iframeLoadTimeout:S,onStylesheetLoad:C,stylesheetLoadTimeout:x,keepIframeSrcFn:k=()=>!1,applyBackgroundColorToBlockedElements:I=!1}=t||{};return Cc(e,{doc:e,mirror:r,blockClass:n,blockSelector:s,maskTextClass:o,maskTextSelector:i,skipChild:!1,inlineStylesheet:a,maskInputOptions:!0===u?{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===u?{password:!0}:u,maskTextFn:h,maskInputFn:d,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:m,inlineImages:l,recordCanvas:c,preserveWhiteSpace:g,onSerialize:v,onAdoptedStyleSheet:y,_emittedStyleIds:w,onIframeLoad:b,iframeLoadTimeout:S,onStylesheetLoad:C,stylesheetLoadTimeout:x,keepIframeSrcFn:k,newlyAddedElement:!1,applyBackgroundColorToBlockedElements:I})}(document,{mirror:wf,blockClass:s,blockSelector:o,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskAllInputs:D,maskTextFn:m,maskInputFn:f,maskAttributeFn:g,slimDOM:B,dataURLOptions:b,recordCanvas:x,inlineImages:M,applyBackgroundColorToBlockedElements:L,onSerialize:e=>{hp(e,wf)&&G.addIframe(e),dp(e,wf)&&V.trackLinkElement(e),pp(e)&&J.addShadowRoot(Kd.shadowRoot(e),document)},onAdoptedStyleSheet:R?e=>V.styleMirror.add(e):void 0,_emittedStyleIds:R?V.getInlinedAdoptedStyleSheetRuleIds():void 0,onIframeLoad:(e,t)=>{G.attachIframe(e,t),J.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{V.attachLinkElement(e,t)},keepIframeSrcFn:A});if(!t)return console.warn("Failed to snapshot the document");mf({type:yp.FullSnapshot,data:{node:t,initialOffset:np(window)}},e),_p.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&V.adoptStyleSheets(document.adoptedStyleSheets,wf.getId(document))};try{const e=[],t=e=>{var t;return Lp(Gp)({mutationCb:W,mousemoveCb:(e,t)=>mf({type:yp.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>mf({type:yp.IncrementalSnapshot,data:{source:wp.MouseInteraction,...e}}),scrollCb:q,viewportResizeCb:e=>mf({type:yp.IncrementalSnapshot,data:{source:wp.ViewportResize,...e}}),inputCb:e=>mf({type:yp.IncrementalSnapshot,data:{source:wp.Input,...e}}),mediaInteractionCb:e=>mf({type:yp.IncrementalSnapshot,data:{source:wp.MediaInteraction,...e}}),styleSheetRuleCb:e=>mf({type:yp.IncrementalSnapshot,data:{source:wp.StyleSheetRule,...e}}),styleDeclarationCb:e=>mf({type:yp.IncrementalSnapshot,data:{source:wp.StyleDeclaration,...e}}),canvasMutationCb:$,fontCb:e=>mf({type:yp.IncrementalSnapshot,data:{source:wp.Font,...e}}),selectionCb:e=>{mf({type:yp.IncrementalSnapshot,data:{source:wp.Selection,...e}})},customElementCb:e=>{mf({type:yp.IncrementalSnapshot,data:{source:wp.CustomElement,...e}})},blockClass:s,ignoreClass:i,ignoreSelector:a,maskTextClass:l,maskTextSelector:c,maskInputOptions:D,inlineStylesheet:u,sampling:w,recordDOM:C,recordCanvas:x,inlineImages:M,userTriggeredOnInput:O,collectFonts:E,doc:e,maskInputFn:f,maskTextFn:m,maskAttributeFn:g,keepIframeSrcFn:A,blockSelector:o,slimDOMOptions:B,dataURLOptions:b,mirror:wf,iframeManager:G,stylesheetManager:V,shadowDomManager:J,processedNodeManager:H,captureAdoptedStyleSheets:R,canvasManager:vf,ignoreCSSAttributes:T,plugins:(null==(t=null==P?void 0:P.filter(e=>e.observer))?void 0:t.map(e=>({observer:e.observer,options:e.options,callback:t=>mf({type:yp.Plugin,data:{plugin:e.name,payload:t}})})))||[]},v)};G.addLoadListener(r=>{try{e.push(t(r.contentDocument))}catch(e){console.warn(e)}});const r=()=>{gf(),e.push(t(document)),yf=!0};return"interactive"===document.readyState||"complete"===document.readyState?r():(e.push(Yd("DOMContentLoaded",()=>{mf({type:yp.DomContentLoaded,data:{}}),"DOMContentLoaded"===I&&r()})),e.push(Yd("load",()=>{mf({type:yp.Load,data:{}}),"load"===I&&r()},window))),()=>{e.forEach(e=>e()),H.destroy(),yf=!1,Np=void 0}}catch(e){console.warn(e)}}var Sf;bf.addCustomEvent=(e,t)=>{if(!yf)throw new Error("please add custom event after start recording");mf({type:yp.Custom,data:{tag:e,payload:t}})},bf.freezePage=()=>{_p.forEach(e=>e.freeze())},bf.takeFullSnapshot=e=>{if(!yf)throw new Error("please take full snapshot after start recording");gf(e)},bf.mirror=wf,bf.supportsNativeMouseInteraction=!0,function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(Sf||(Sf={}));var Cf=Object.freeze({__proto__:null,record:bf}),xf=function(e){return void 0!==e&&("boolean"==typeof e?e:!1!==e.enabled)},kf=function(e,t,r,n){var s=function(e){var t;return"object"==typeof e&&null!==e?{allowlist:null!==(t=e.allowlist)&&void 0!==t?t:[],excludelist:e.excludelist||e.blocklist||[]}:{allowlist:[],excludelist:[]}}(t),o=function(e,t,r){if(0===t.length&&0===r.length)return e;var n=t.length>0?t:["/**"];try{var s=JSON.parse(e);return ee(s,n,r),JSON.stringify(s)}catch(t){return e}}(e,s.allowlist,s.excludelist);return n(o,r)},If=["image/","audio/","video/","application/octet-stream","font/"];function Of(e,t){return function(e,t){t<0&&(t=0);for(var r=e.length,n=0,s=0;s<r;s++){var o=e.charCodeAt(s),i=1,a=1;if(o<=127)i=1;else if(o<=2047)i=2;else if(o>=55296&&o<=56319){var l=s+1<r?e.charCodeAt(s+1):NaN;l>=56320&&l<=57343?(i=4,a=2):i=3}else i=3;if(n+i>t)break;n+=i,2===a&&s++}return s>=r?{value:e,truncated:!1}:{value:e.slice(0,s),truncated:!0}}(e,t)}var Ef=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=g();if(t){var r=t.fetch;r&&(t.fetch=function(t,n){return l(e,void 0,void 0,function(){var e,s,o,i,a,l,u,h,d,p,f,m,g=this;return c(this,function(c){switch(c.label){case 0:e=Date.now(),s={timestamp:e,type:"fetch",method:(null==n?void 0:n.method)||"GET",url:t.toString(),requestHeaders:null==n?void 0:n.headers},(o=null===(f=this.networkConfig)||void 0===f?void 0:f.body)&&xf(o.request)&&void 0!==(i=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!==(m=o.maxBodySizeBytes)&&void 0!==m?m:10240,s.requestBody=kf(i,o.request,a,Of).value),c.label=1;case 1:return c.trys.push([1,3,,4]),[4,r(t,n)];case 2:return l=c.sent(),d=Date.now(),s.status=l.status,s.duration=d-e,u={},l.headers.forEach(function(e,t){u[t]=e}),s.responseHeaders=u,o&&xf(o.response)?!function(e){return!!e&&If.some(function(t){return e.toLowerCase().startsWith(t)})}(u["content-type"]||null)?l.clone().text().then(function(e){var t,r=null!==(t=o.maxBodySizeBytes)&&void 0!==t?t:10240,n=kf(e,o.response,r,Of),i=n.value,a=n.truncated;s.responseBody=i,s.responseBodyStatus=a?"truncated":"captured",g.notifyEvent(s)},function(){s.responseBodyStatus="error",g.notifyEvent(s)}):(s.responseBodyStatus="skipped_binary",this.notifyEvent(s)):this.notifyEvent(s),[2,l];case 3:throw h=c.sent(),d=Date.now(),s.duration=d-e,p=h,s.error={name:p.name||"UnknownError",message:p.message||"An unknown error occurred"},this.notifyEvent(s),h;case 4:return[2]}})})},this.fetchObserver=function(){t.fetch=r})}},e}(),Mf=Object.freeze({__proto__:null,NetworkObservers:Ef});return e.SessionReplayPlugin=bn,e.plugin=Sn,e.sessionReplayPlugin=Sn,Object.defineProperty(e,"__esModule",{value:!0}),e}({});
|
|
2
2
|
//# sourceMappingURL=plugin-session-replay-browser-min.js.map
|