@amplitude/plugin-session-replay-browser 1.22.26-perfrecord-init-prelease.0 → 1.22.26

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.
@@ -1,2 +1,2 @@
1
- var sessionReplay=function(e){"use strict";var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},t(e,r)};function r(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}var n,s,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 i(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 a(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 l(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 c(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 u(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"}(n||(n={})),function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"}(s||(s={}));var h,d="".concat("AMP","_unsent"),p="$default_instance",f="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"}(h||(h={}));var m,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},y=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"}(m||(m={}));var v="Amplitude Logger ",w=function(){function e(){this.logLevel=m.None}return e.prototype.disable=function(){this.logLevel=m.None},e.prototype.enable=function(e){void 0===e&&(e=m.Warn),this.logLevel=e},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<m.Verbose||console.log("".concat(v,"[Log]: ").concat(e.join(" ")))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<m.Warn||console.warn("".concat(v,"[Warn]: ").concat(e.join(" ")))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<m.Error||console.error("".concat(v,"[Error]: ").concat(e.join(" ")))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<m.Debug||console.log("".concat(v,"[Debug]: ").concat(e.join(" ")))},e}(),b=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,instanceName:p,logLevel:m.Warn,loggerProvider:new w,offline:!1,optOut:!1,serverUrl:f,serverZone:"US",useBatch:!1}},S=function(){function e(e){var t,r,n,s;this._optOut=!1;var o=b();this.apiKey=e.apiKey,this.flushIntervalMillis=null!==(t=e.flushIntervalMillis)&&void 0!==t?t:o.flushIntervalMillis,this.flushMaxRetries=e.flushMaxRetries||o.flushMaxRetries,this.flushQueueSize=e.flushQueueSize||o.flushQueueSize,this.instanceName=e.instanceName||o.instanceName,this.loggerProvider=e.loggerProvider||o.loggerProvider,this.logLevel=null!==(r=e.logLevel)&&void 0!==r?r:o.logLevel,this.minIdLength=e.minIdLength,this.plan=e.plan,this.ingestionMetadata=e.ingestionMetadata,this.offline=void 0!==e.offline?e.offline:o.offline,this.optOut=null!==(n=e.optOut)&&void 0!==n?n:o.optOut,this.serverUrl=e.serverUrl,this.serverZone=e.serverZone||o.serverZone,this.storageProvider=e.storageProvider,this.transportProvider=e.transportProvider,this.useBatch=null!==(s=e.useBatch)&&void 0!==s?s:o.useBatch,this.loggerProvider.enable(this.logLevel);var i=I(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}(),C=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":f},I=function(e,t,r){if(void 0===e&&(e=""),void 0===t&&(t=b().serverZone),void 0===r&&(r=b().useBatch),e)return{serverUrl:e,serverZone:void 0};var n=["US","EU"].includes(t)?t:b().serverZone;return{serverZone:n,serverUrl:C(n,r)}},x=function(){function e(){}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:k(),platform:"Web",os:void 0,deviceModel:void 0}},e}(),k=function(){return"undefined"!=typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},O=function(){function e(){this.queue=[]}return e.prototype.logEvent=function(e){this.receiver?this.receiver(e):this.queue.length<512&&this.queue.push(e)},e.prototype.setEventReceiver=function(e){this.receiver=e,this.queue.length>0&&(this.queue.forEach(function(t){e(t)}),this.queue=[])},e}(),E=function(){return E=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},E.apply(this,arguments)};function R(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 A(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"==typeof SuppressedError&&SuppressedError;var M=function(e,t){var r,n,s=typeof e;if(s!==typeof t)return!1;try{for(var o=R(["string","number","boolean","undefined"]),i=o.next();!i.done;i=o.next()){if(i.value===s)return e===t}}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}if(null==e&&null==t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;var a=Array.isArray(e),l=Array.isArray(t);if(a!==l)return!1;if(!a||!l){var c=Object.keys(e).sort(),u=Object.keys(t).sort();if(!M(c,u))return!1;var h=!0;return Object.keys(e).forEach(function(r){M(e[r],t[r])||(h=!1)}),h}for(var d=0;d<e.length;d++)if(!M(e[d],t[d]))return!1;return!0};Object.entries||(Object.entries=function(e){for(var t=Object.keys(e),r=t.length,n=new Array(r);r--;)n[r]=[t[r],e[t[r]]];return n});var P,N=function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var e=this,t=E({},this.identity.userProperties),r=E(E({},this.identity),{userProperties:t});return{setUserId:function(e){return r.userId=e,this},setDeviceId:function(e){return r.deviceId=e,this},setUserProperties:function(e){return r.userProperties=e,this},setOptOut:function(e){return r.optOut=e,this},updateUserProperties:function(e){var t,n,s,o,i,a,l=r.userProperties||{};try{for(var c=R(Object.entries(e)),u=c.next();!u.done;u=c.next()){var h=A(u.value,2),d=h[0],p=h[1];switch(d){case"$set":try{for(var f=(s=void 0,R(Object.entries(p))),m=f.next();!m.done;m=f.next()){var g=A(m.value,2),y=g[0],v=g[1];l[y]=v}}catch(e){s={error:e}}finally{try{m&&!m.done&&(o=f.return)&&o.call(f)}finally{if(s)throw s.error}}break;case"$unset":try{for(var w=(i=void 0,R(Object.keys(p))),b=w.next();!b.done;b=w.next()){delete l[y=b.value]}}catch(e){i={error:e}}finally{try{b&&!b.done&&(a=w.return)&&a.call(w)}finally{if(i)throw i.error}}break;case"$clearAll":l={}}}}catch(e){t={error:e}}finally{try{u&&!u.done&&(n=c.return)&&n.call(c)}finally{if(t)throw t.error}}return r.userProperties=l,this},commit:function(){return e.setIdentity(r),this}}},e.prototype.getIdentity=function(){return E({},this.identity)},e.prototype.setIdentity=function(e){var t=E({},this.identity);this.identity=E({},e),M(t,this.identity)||this.listeners.forEach(function(t){t(e)})},e.prototype.addIdentityListener=function(e){this.listeners.add(e)},e.prototype.removeIdentityListener=function(e){this.listeners.delete(e)},e}(),T="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:self,D=function(){function e(){this.identityStore=new N,this.eventBridge=new O,this.applicationContextProvider=new x}return e.getInstance=function(t){return T.analyticsConnectorInstances||(T.analyticsConnectorInstances={}),T.analyticsConnectorInstances[t]||(T.analyticsConnectorInstances[t]=new e),T.analyticsConnectorInstances[t]},e}(),L=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<m.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}},_=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},F=function(){function e(){}return e.prototype.send=function(e,t){return Promise.resolve(null)},e.prototype.buildResponse=function(e){var t,r,n,s,o,i,a,l,c,u,d,p,f,m,g,y,v,w,b,S,C,I;if("object"!=typeof e)return null;var x=e.code||0,k=this.buildStatus(x);switch(k){case h.Success:return{status:k,statusCode:x,body:{eventsIngested:null!==(t=e.events_ingested)&&void 0!==t?t:0,payloadSizeBytes:null!==(r=e.payload_size_bytes)&&void 0!==r?r:0,serverUploadTime:null!==(n=e.server_upload_time)&&void 0!==n?n:0}};case h.Invalid:return{status:k,statusCode:x,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!==(d=e.silenced_devices)&&void 0!==d?d:[],silencedEvents:null!==(p=e.silenced_events)&&void 0!==p?p:[],throttledDevices:null!==(f=e.throttled_devices)&&void 0!==f?f:{},throttledEvents:null!==(m=e.throttled_events)&&void 0!==m?m:[]}};case h.PayloadTooLarge:return{status:k,statusCode:x,body:{error:null!==(g=e.error)&&void 0!==g?g:""}};case h.RateLimit:return{status:k,statusCode:x,body:{error:null!==(y=e.error)&&void 0!==y?y:"",epsThreshold:null!==(v=e.eps_threshold)&&void 0!==v?v: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!==(I=e.throttled_events)&&void 0!==I?I:[]}};case h.Timeout:default:return{status:k,statusCode:x}}},e.prototype.buildStatus=function(e){return e>=200&&e<300?h.Success:429===e?h.RateLimit:413===e?h.PayloadTooLarge:408===e?h.Timeout:e>=400&&e<500?h.Invalid:e>=500?h.Failed:h.Unknown},e}(),B=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.send=function(e,t){return i(this,void 0,void 0,function(){var r,n,s;return a(this,function(o){switch(o.label){case 0:if("undefined"==typeof fetch)throw new Error("FetchTransport is not supported");return r={headers:{"Content-Type":"application/json",Accept:"*/*"},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}(F);!function(e){e.US="US",e.EU="EU",e.STAGING="STAGING"}(P||(P={}));var U,j="[Amplitude]",z="".concat(j," Session Replay ID"),W=P.US,V={enabled:!0},G="".concat(j," Session Replay Debug"),Z="amp-mask";!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"}(U||(U={}));var Y=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}(),K="medium";var J,q,$=function(e,t,r){switch(t){case"light":if("input"!==e)return!0;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":case"conservative":return!0;default:return $(e,K,r)}},X=function(e,t){return function(r,n){return function(e,t,r){var n,s,o;if(void 0===t&&(t={defaultMaskLevel:K}),r){if(r.closest("."+Z))return!0;var i=(null!==(n=t.maskSelector)&&void 0!==n?n:[]).some(function(e){return r.closest(e)});if(i)return!0;if(r.closest(".amp-unmask"))return!1;var a=(null!==(s=t.unmaskSelector)&&void 0!==s?s:[]).some(function(e){return r.closest(e)});if(a)return!1}return $(e,null!==(o=t.defaultMaskLevel)&&void 0!==o?o:K,r)}(e,t,n)?r.replace(/[^\s]/g,"*"):r}},H=function(e,t){return t||(e===P.STAGING?"https://api-sr.stag2.amplitude.com/sessions/v2/track":e===P.EU?"https://api-sr.eu.amplitude.com/sessions/v2/track":"https://api-sr.amplitude.com/sessions/v2/track")},Q=function(e){var t=e.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*").replace(/\?/g,".");return new RegExp("^".concat(t,"$"))},ee=function(e,t){var r,n;try{for(var s=l(t),o=s.next();!o.done;o=s.next()){var i=o.value,a=Q(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},te=function(){return i(void 0,void 0,void 0,function(){var e,t,r,n,s,o,i;return a(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/1024):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:""}]}})})},re=function(e){var t=o({},e),r=t.apiKey;return t.apiKey="****".concat(r.substring(r.length-4)),t},ne=function(){return{flushMaxRetries:2,logLevel:m.Warn,loggerProvider:new w,transportProvider:new B}},se=function(e){function t(t,r){var n,s,i,a,l,c=this,u=ne();return(c=e.call(this,o(o({transportProvider:u.transportProvider,loggerProvider:new Y(r.loggerProvider||u.loggerProvider)},r),{apiKey:t}))||this).flushMaxRetries=void 0!==r.flushMaxRetries&&r.flushMaxRetries<=u.flushMaxRetries?r.flushMaxRetries:u.flushMaxRetries,c.apiKey=t,c.sampleRate=r.sampleRate||0,c.serverZone=r.serverZone||W,c.configServerUrl=r.configServerUrl,c.trackServerUrl=r.trackServerUrl,c.shouldInlineStylesheet=r.shouldInlineStylesheet,c.version=r.version,c.performanceConfig=r.performanceConfig||V,c.storeType=null!==(n=r.storeType)&&void 0!==n?n:"idb",c.applyBackgroundColorToBlockedElements=null!==(s=r.applyBackgroundColorToBlockedElements)&&void 0!==s&&s,c.enableUrlChangePolling=null!==(i=r.enableUrlChangePolling)&&void 0!==i&&i,c.urlChangePollingInterval=null!==(a=r.urlChangePollingInterval)&&void 0!==a?a:1e3,c.captureDocumentTitle=null!==(l=r.captureDocumentTitle)&&void 0!==l&&l,r.privacyConfig&&(c.privacyConfig=r.privacyConfig),r.interactionConfig&&(c.interactionConfig=r.interactionConfig,c.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")}(c.interactionConfig.ugcFilterRules)),r.debugMode&&(c.debugMode=r.debugMode),r.experimental&&(c.experimental=r.experimental),r.omitElementTags&&(c.omitElementTags=r.omitElementTags),c}return r(t,e),t}(S),oe=(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))(oe||{}),ie=(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))(ie||{});!function(e){e.US="US",e.EU="EU",e.STAGING="STAGING"}(J||(J={})),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"}(q||(q={}));var ae=function(){function e(){}return e.prototype.send=function(e,t){return Promise.resolve(null)},e.prototype.buildResponse=function(e){var t,r,n,s,o,i,a,l,c,u,h,d,p,f,m,g,y,v,w,b,S,C;if("object"!=typeof e)return null;var I=e.code||0,x=this.buildStatus(I);switch(x){case q.Success:return{status:x,statusCode:I,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 q.Invalid:return{status:x,statusCode:I,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!==(p=e.throttled_devices)&&void 0!==p?p:{},throttledEvents:null!==(f=e.throttled_events)&&void 0!==f?f:[]}};case q.PayloadTooLarge:return{status:x,statusCode:I,body:{error:null!==(m=e.error)&&void 0!==m?m:""}};case q.RateLimit:return{status:x,statusCode:I,body:{error:null!==(g=e.error)&&void 0!==g?g:"",epsThreshold:null!==(y=e.eps_threshold)&&void 0!==y?y:0,throttledDevices:null!==(v=e.throttled_devices)&&void 0!==v?v:{},throttledUsers:null!==(w=e.throttled_users)&&void 0!==w?w:{},exceededDailyQuotaDevices:null!==(b=e.exceeded_daily_quota_devices)&&void 0!==b?b:{},exceededDailyQuotaUsers:null!==(S=e.exceeded_daily_quota_users)&&void 0!==S?S:{},throttledEvents:null!==(C=e.throttled_events)&&void 0!==C?C:[]}};case q.Timeout:default:return{status:x,statusCode:I}}},e.prototype.buildStatus=function(e){return e>=200&&e<300?q.Success:429===e?q.RateLimit:413===e?q.PayloadTooLarge:408===e?q.Timeout:e>=400&&e<500?q.Invalid:e>=500?q.Failed:q.Unknown},e}(),le="Remote config fetch rejected due to timeout after 5 seconds",ce="Unexpected error occurred",ue=function(){function e(e){var t=e.localConfig,r=e.configKeys,n=this;this.retryTimeout=1e3,this.attempts=0,this.sessionTargetingMatch=!1,this.metrics={},this.getRemoteNamespaceConfig=function(e,t){return i(n,void 0,void 0,function(){var r,n,s;return a(this,function(o){switch(o.label){case 0:return r=Date.now(),[4,this.fetchWithTimeout(t)];case 1:return(n=o.sent())&&(s=n.configs&&n.configs[e])?(this.metrics.fetchTimeAPISuccess=Date.now()-r,[2,s]):(this.metrics.fetchTimeAPIFail=Date.now()-r,[2,void 0])}})})},this.getRemoteConfig=function(e,t,r){return i(n,void 0,void 0,function(){var n;return a(this,function(s){switch(s.label){case 0:return[4,this.getRemoteNamespaceConfig(e,r)];case 1:return[2,null==(n=s.sent())?void 0:n[t]]}})})},this.fetchWithTimeout=function(e){return i(n,void 0,void 0,function(){var t,r,n;return a(this,function(s){switch(s.label){case 0:return t=new AbortController,r=setTimeout(function(){return t.abort()},5e3),[4,this.fetchRemoteConfig(t.signal,e)];case 1:return n=s.sent(),clearTimeout(r),[2,n]}})})},this.fetchRemoteConfig=function(e,t){return i(n,void 0,void 0,function(){var r,n,s,i,c,u,h,d,p,f,m,g;return a(this,function(a){switch(a.label){case 0:if(t===this.lastFetchedSessionId&&this.attempts>=this.localConfig.flushMaxRetries)return[2,this.completeRequest({err:"Remote config fetch rejected due to exceeded retry count"})];if(e.aborted)return[2,this.completeRequest({err:le})];t!==this.lastFetchedSessionId&&(this.lastFetchedSessionId=t,this.attempts=0),a.label=1;case 1:a.trys.push([1,3,,4]),r=new URLSearchParams({api_key:this.localConfig.apiKey});try{for(n=l(this.configKeys),s=n.next();!s.done;s=n.next())i=s.value,r.append("config_keys",i)}catch(e){f={error:e}}finally{try{s&&!s.done&&(m=n.return)&&m.call(n)}finally{if(f)throw f.error}}return t&&r.set("session_id",String(t)),c={headers:{Accept:"*/*"},method:"GET"},u="".concat(this.getServerUrl(),"?").concat(r.toString()),this.attempts+=1,[4,fetch(u,o(o({},c),{signal:e}))];case 2:if(null===(h=a.sent()))return[2,this.completeRequest({err:ce})];switch((new ae).buildStatus(h.status)){case q.Success:return this.attempts=0,[2,this.parseAndStoreConfig(h)];case q.Failed:return[2,this.retryFetch(e,t)];default:return[2,this.completeRequest({err:"Network error occurred, remote config fetch failed"})]}case 3:return d=a.sent(),p=d,e.aborted?[2,this.completeRequest({err:le})]:[2,this.completeRequest({err:null!==(g=p.message)&&void 0!==g?g:ce})];case 4:return[2]}})})},this.retryFetch=function(e,t){return i(n,void 0,void 0,function(){var r=this;return a(this,function(n){switch(n.label){case 0:return[4,new Promise(function(e){return setTimeout(e,r.attempts*r.retryTimeout)})];case 1:return n.sent(),[2,this.fetchRemoteConfig(e,t)]}})})},this.parseAndStoreConfig=function(e){return i(n,void 0,void 0,function(){var t;return a(this,function(r){switch(r.label){case 0:return[4,e.json()];case 1:return t=r.sent(),this.completeRequest({success:"Remote config successfully fetched"}),[2,t]}})})},this.localConfig=t,this.configKeys=r}return e.prototype.getServerUrl=function(){return this.localConfig.configServerUrl?this.localConfig.configServerUrl:this.localConfig.serverZone===J.STAGING?"https://sr-client-cfg.stag2.amplitude.com/config":this.localConfig.serverZone===J.EU?"https://sr-client-cfg.eu.amplitude.com/config":"https://sr-client-cfg.amplitude.com/config"},e.prototype.completeRequest=function(e){var t=e.err,r=e.success;if(t)throw new Error(t);r&&this.localConfig.loggerProvider.log(r)},e}(),he=function(e){var t=e.localConfig,r=e.configKeys;return i(void 0,void 0,void 0,function(){return a(this,function(e){return[2,new ue({localConfig:t,configKeys:r})]})})},de=function(){function e(e,t){this.localConfig=t,this.remoteConfigFetch=e}return e.prototype.generateJoinedConfig=function(e){var t,r,n,s;return i(this,void 0,void 0,function(){var i,u,h,d,p,f,m,g,y,v,w,b,S,C,I,x,k,O,E,R,A,M,P;return a(this,function(a){switch(a.label){case 0:(i=o({},this.localConfig)).optOut=this.localConfig.optOut,i.captureEnabled=!0,a.label=1;case 1:return a.trys.push([1,3,,4]),[4,this.remoteConfigFetch.getRemoteNamespaceConfig("sessionReplay",e)];case 2:return(h=a.sent())&&(d=h.sr_sampling_config,p=h.sr_privacy_config,f=h.sr_targeting_config,m=null===(t=i.interactionConfig)||void 0===t?void 0:t.ugcFilterRules,i.interactionConfig=h.sr_interaction_config,i.interactionConfig&&m&&(i.interactionConfig.ugcFilterRules=m),i.loggingConfig=h.sr_logging_config,(d||p||f)&&(u={},d&&(u.sr_sampling_config=d),p&&(u.sr_privacy_config=p),f&&(u.sr_targeting_config=f))),[3,4];case 3:return g=a.sent(),y=g,this.localConfig.loggerProvider.warn(y.message),i.captureEnabled=!1,[3,4];case 4:if(!u)return[2,{localConfig:this.localConfig,joinedConfig:i,remoteConfig:u}];if(v=u.sr_sampling_config,w=u.sr_privacy_config,b=u.sr_targeting_config,v&&Object.keys(v).length>0?(Object.prototype.hasOwnProperty.call(v,"capture_enabled")?i.captureEnabled=v.capture_enabled:i.captureEnabled=!1,Object.prototype.hasOwnProperty.call(v,"sample_rate")&&(i.sampleRate=v.sample_rate)):(i.captureEnabled=!0,this.localConfig.loggerProvider.debug("Remote config successfully fetched, but no values set for project, Session Replay capture enabled.")),w){S=null!==(r=i.privacyConfig)&&void 0!==r?r:{},C={defaultMaskLevel:null!==(s=null!==(n=w.defaultMaskLevel)&&void 0!==n?n:S.defaultMaskLevel)&&void 0!==s?s:"medium",blockSelector:[],maskSelector:[],unmaskSelector:[]},I=function(e){var t,r,n,s,o,i,a,c,u,h={};"string"==typeof e.blockSelector&&(e.blockSelector=[e.blockSelector]);try{for(var d=l(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=l(null!==(c=e.maskSelector)&&void 0!==c?c:[]),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=l(null!==(u=e.unmaskSelector)&&void 0!==u?u:[]),y=g.next();!y.done;y=g.next()){h[y.value]="unmask"}}catch(e){o={error:e}}finally{try{y&&!y.done&&(i=g.return)&&i.call(g)}finally{if(o)throw o.error}}return h},x=o(o({},I(S)),I(w));try{for(k=l(Object.entries(x)),O=k.next();!O.done;O=k.next())E=c(O.value,2),R=E[0],"mask"===(A=E[1])?C.maskSelector.push(R):"block"===A?C.blockSelector.push(R):"unmask"===A&&C.unmaskSelector.push(R)}catch(e){M={error:e}}finally{try{O&&!O.done&&(P=k.return)&&P.call(k)}finally{if(M)throw M.error}}i.privacyConfig=function(e,t){var r=document.createDocumentFragment(),n=function(e){if(void 0===e&&(e=[]),"string"==typeof e&&(e=[e]),e=e.filter(function(e){try{r.querySelector(e)}catch(r){return t.warn('[session-replay-browser] omitting selector "'.concat(e,'" because it is invalid')),!1}return!0}),0!==e.length)return e};return e.blockSelector=n(e.blockSelector),e.maskSelector=n(e.maskSelector),e.unmaskSelector=n(e.unmaskSelector),e}(C,this.localConfig.loggerProvider)}return b&&Object.keys(b).length>0&&(i.targetingConfig=b),this.localConfig.loggerProvider.debug(JSON.stringify({name:"session replay joined config",config:re(i)},null,2)),[2,{localConfig:this.localConfig,joinedConfig:i,remoteConfig:u}]}})})},e}(),pe=function(e,t){return i(void 0,void 0,void 0,function(){var r,n;return a(this,function(s){switch(s.label){case 0:return r=new se(e,t),[4,he({localConfig:r,configKeys:["sessionReplay"]})];case 1:return n=s.sent(),[2,new de(n,r)]}})})},fe=Uint8Array,me=Uint16Array,ge=Uint32Array,ye=new fe([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),ve=new fe([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),we=new fe([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),be=function(e,t){for(var r=new me(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];var s=new ge(r[30]);for(n=1;n<30;++n)for(var o=r[n];o<r[n+1];++o)s[o]=o-r[n]<<5|n;return[r,s]},Se=be(ye,2),Ce=Se[0],Ie=Se[1];Ce[28]=258,Ie[258]=28;for(var xe=be(ve,0)[1],ke=new me(32768),Oe=0;Oe<32768;++Oe){var Ee=(43690&Oe)>>>1|(21845&Oe)<<1;Ee=(61680&(Ee=(52428&Ee)>>>2|(13107&Ee)<<2))>>>4|(3855&Ee)<<4,ke[Oe]=((65280&Ee)>>>8|(255&Ee)<<8)>>>1}var Re=function(e,t,r){for(var n=e.length,s=0,o=new me(t);s<n;++s)++o[e[s]-1];var i,a=new me(t);for(s=0;s<t;++s)a[s]=a[s-1]+o[s-1]<<1;if(r){i=new me(1<<t);var l=15-t;for(s=0;s<n;++s)if(e[s])for(var c=s<<4|e[s],u=t-e[s],h=a[e[s]-1]++<<u,d=h|(1<<u)-1;h<=d;++h)i[ke[h]>>>l]=c}else for(i=new me(n),s=0;s<n;++s)i[s]=ke[a[e[s]-1]++]>>>15-e[s];return i},Ae=new fe(288);for(Oe=0;Oe<144;++Oe)Ae[Oe]=8;for(Oe=144;Oe<256;++Oe)Ae[Oe]=9;for(Oe=256;Oe<280;++Oe)Ae[Oe]=7;for(Oe=280;Oe<288;++Oe)Ae[Oe]=8;var Me=new fe(32);for(Oe=0;Oe<32;++Oe)Me[Oe]=5;var Pe=Re(Ae,9,0),Ne=Re(Me,5,0),Te=function(e){return(e/8|0)+(7&e&&1)},De=function(e,t,r){(null==r||r>e.length)&&(r=e.length);var n=new(e instanceof me?me:e instanceof ge?ge:fe)(r-t);return n.set(e.subarray(t,r)),n},Le=function(e,t,r){r<<=7&t;var n=t/8|0;e[n]|=r,e[n+1]|=r>>>8},_e=function(e,t,r){r<<=7&t;var n=t/8|0;e[n]|=r,e[n+1]|=r>>>8,e[n+2]|=r>>>16},Fe=function(e,t){for(var r=[],n=0;n<e.length;++n)e[n]&&r.push({s:n,f:e[n]});var s=r.length,o=r.slice();if(!s)return[new fe(0),0];if(1==s){var i=new fe(r[0].s+1);return i[r[0].s]=1,[i,1]}r.sort(function(e,t){return e.f-t.f}),r.push({s:-1,f:25001});var a=r[0],l=r[1],c=0,u=1,h=2;for(r[0]={s:-1,f:a.f+l.f,l:a,r:l};u!=s-1;)a=r[r[c].f<r[h].f?c++:h++],l=r[c!=u&&r[c].f<r[h].f?c++:h++],r[u++]={s:-1,f:a.f+l.f,l:a,r:l};var d=o[0].s;for(n=1;n<s;++n)o[n].s>d&&(d=o[n].s);var p=new me(d+1),f=Be(r[u-1],p,0);if(f>t){n=0;var m=0,g=f-t,y=1<<g;for(o.sort(function(e,t){return p[t.s]-p[e.s]||e.f-t.f});n<s;++n){var v=o[n].s;if(!(p[v]>t))break;m+=y-(1<<f-p[v]),p[v]=t}for(m>>>=g;m>0;){var w=o[n].s;p[w]<t?m-=1<<t-p[w]++-1:++n}for(;n>=0&&m;--n){var b=o[n].s;p[b]==t&&(--p[b],++m)}f=t}return[new fe(p),f]},Be=function(e,t,r){return-1==e.s?Math.max(Be(e.l,t,r+1),Be(e.r,t,r+1)):t[e.s]=r},Ue=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new me(++t),n=0,s=e[0],o=1,i=function(e){r[n++]=e},a=1;a<=t;++a)if(e[a]==s&&a!=t)++o;else{if(!s&&o>2){for(;o>138;o-=138)i(32754);o>2&&(i(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(i(s),--o;o>6;o-=6)i(8304);o>2&&(i(o-3<<5|8208),o=0)}for(;o--;)i(s);o=1,s=e[a]}return[r.subarray(0,n),t]},je=function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},ze=function(e,t,r){var n=r.length,s=Te(t+2);e[s]=255&n,e[s+1]=n>>>8,e[s+2]=255^e[s],e[s+3]=255^e[s+1];for(var o=0;o<n;++o)e[s+o+4]=r[o];return 8*(s+4+n)},We=function(e,t,r,n,s,o,i,a,l,c,u){Le(t,u++,r),++s[256];for(var h=Fe(s,15),d=h[0],p=h[1],f=Fe(o,15),m=f[0],g=f[1],y=Ue(d),v=y[0],w=y[1],b=Ue(m),S=b[0],C=b[1],I=new me(19),x=0;x<v.length;++x)I[31&v[x]]++;for(x=0;x<S.length;++x)I[31&S[x]]++;for(var k=Fe(I,7),O=k[0],E=k[1],R=19;R>4&&!O[we[R-1]];--R);var A,M,P,N,T=c+5<<3,D=je(s,Ae)+je(o,Me)+i,L=je(s,d)+je(o,m)+i+14+3*R+je(I,O)+(2*I[16]+3*I[17]+7*I[18]);if(T<=D&&T<=L)return ze(t,u,e.subarray(l,l+c));if(Le(t,u,1+(L<D)),u+=2,L<D){A=Re(d,p,0),M=d,P=Re(m,g,0),N=m;var _=Re(O,E,0);Le(t,u,w-257),Le(t,u+5,C-1),Le(t,u+10,R-4),u+=14;for(x=0;x<R;++x)Le(t,u+3*x,O[we[x]]);u+=3*R;for(var F=[v,S],B=0;B<2;++B){var U=F[B];for(x=0;x<U.length;++x){var j=31&U[x];Le(t,u,_[j]),u+=O[j],j>15&&(Le(t,u,U[x]>>>5&127),u+=U[x]>>>12)}}}else A=Pe,M=Ae,P=Ne,N=Me;for(x=0;x<a;++x)if(n[x]>255){j=n[x]>>>18&31;_e(t,u,A[j+257]),u+=M[j+257],j>7&&(Le(t,u,n[x]>>>23&31),u+=ye[j]);var z=31&n[x];_e(t,u,P[z]),u+=N[z],z>3&&(_e(t,u,n[x]>>>5&8191),u+=ve[z])}else _e(t,u,A[n[x]]),u+=M[n[x]];return _e(t,u,A[256]),u+M[256]},Ve=new ge([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Ge=function(e,t,r,n,s){return function(e,t,r,n,s,o){var i=e.length,a=new fe(n+i+5*(1+Math.floor(i/7e3))+s),l=a.subarray(n,a.length-s),c=0;if(!t||i<8)for(var u=0;u<=i;u+=65535){var h=u+65535;h<i?c=ze(l,c,e.subarray(u,h)):(l[u]=o,c=ze(l,c,e.subarray(u,i)))}else{for(var d=Ve[t-1],p=d>>>13,f=8191&d,m=(1<<r)-1,g=new me(32768),y=new me(m+1),v=Math.ceil(r/3),w=2*v,b=function(t){return(e[t]^e[t+1]<<v^e[t+2]<<w)&m},S=new ge(25e3),C=new me(288),I=new me(32),x=0,k=0,O=(u=0,0),E=0,R=0;u<i;++u){var A=b(u),M=32767&u,P=y[A];if(g[M]=P,y[A]=M,E<=u){var N=i-u;if((x>7e3||O>24576)&&N>423){c=We(e,l,0,S,C,I,k,O,R,u-R,c),O=x=k=0,R=u;for(var T=0;T<286;++T)C[T]=0;for(T=0;T<30;++T)I[T]=0}var D=2,L=0,_=f,F=M-P&32767;if(N>2&&A==b(u-F))for(var B=Math.min(p,N)-1,U=Math.min(32767,u),j=Math.min(258,N);F<=U&&--_&&M!=P;){if(e[u+D]==e[u+D-F]){for(var z=0;z<j&&e[u+z]==e[u+z-F];++z);if(z>D){if(D=z,L=F,z>B)break;var W=Math.min(F,z-2),V=0;for(T=0;T<W;++T){var G=u-F+T+32768&32767,Z=G-g[G]+32768&32767;Z>V&&(V=Z,P=G)}}}F+=(M=P)-(P=g[M])+32768&32767}if(L){S[O++]=268435456|Ie[D]<<18|xe[L];var Y=31&Ie[D],K=31&xe[L];k+=ye[Y]+ve[K],++C[257+Y],++I[K],E=u+D,++x}else S[O++]=e[u],++C[e[u]]}}c=We(e,l,o,S,C,I,k,O,R,u-R,c)}return De(a,0,n+Te(c)+s)}(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,r,n,!s)};function Ze(e,t){void 0===t&&(t={});var r=function(){var e=1,t=0;return{p:function(r){for(var n=e,s=t,o=r.length,i=0;i!=o;){for(var a=Math.min(i+5552,o);i<a;++i)s+=n+=r[i];n%=65521,s%=65521}e=n,t=s},d:function(){return(e>>>8<<16|(255&t)<<8|t>>>8)+2*((255&e)<<23)}}}();r.p(e);var n,s,o,i=Ge(e,t,2,4);return n=i,s=t.level,o=0==s?0:s<6?1:9==s?3:2,n[0]=120,n[1]=o<<6|(o?32-2*o:1),function(e,t,r){for(;r;++t)e[t]=r,r>>>=8}(i,i.length-4,r.d()),i}const Ye=e=>{const t={...e,v:"v1"};return function(e,t){var r="";if(!t&&"undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);for(var n=0;n<e.length;){var s=e[n++];s<128||t?r+=String.fromCharCode(s):s<224?r+=String.fromCharCode((31&s)<<6|63&e[n++]):s<240?r+=String.fromCharCode((15&s)<<12|(63&e[n++])<<6|63&e[n++]):(s=((15&s)<<18|(63&e[n++])<<12|(63&e[n++])<<6|63&e[n++])-65536,r+=String.fromCharCode(55296|s>>10,56320|1023&s))}return r}(Ze(function(e,t){var r=e.length;if(!t&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var n=new fe(e.length+(e.length>>>1)),s=0,o=function(e){n[s++]=e},i=0;i<r;++i){if(s+5>n.length){var a=new fe(s+8+(r-i<<1));a.set(n),n=a}var l=e.charCodeAt(i);l<128||t?o(l):l<2048?(o(192|l>>>6),o(128|63&l)):l>55295&&l<57344?(o(240|(l=65536+(1047552&l)|1023&e.charCodeAt(++i))>>>18),o(128|l>>>12&63),o(128|l>>>6&63),o(128|63&l)):(o(224|l>>>12),o(128|l>>>6&63),o(128|63&l))}return De(n,0,s)}(JSON.stringify(t))),!0)};var Ke=function(){function e(e,t,r,n){var s,o=this;this.taskQueue=[],this.isProcessing=!1,this.compressEvent=function(e){var t=Ye(e);return JSON.stringify(t)},this.addCompressedEventToManager=function(e,t){o.eventsManager&&o.deviceId&&o.eventsManager.addEvent({event:{type:"replay",data:e},sessionId:t,deviceId:o.deviceId})},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.terminate=function(){var e;null===(e=o.worker)||void 0===e||e.terminate()};var i=g();if(this.canUseIdleCallback=i&&"requestIdleCallback"in i,this.eventsManager=e,this.config=t,this.deviceId=r,this.timeout=(null===(s=t.performanceConfig)||void 0===s?void 0:s.timeout)||2e3,n){t.loggerProvider.log("[Experimental] Enabling web worker for compression");var a=new Worker(URL.createObjectURL(new Blob([n],{type:"application/javascript"})));a.onerror=function(e){t.loggerProvider.error(e)},a.onmessage=function(e){var t=e.data,r=t.compressedEvent,n=t.sessionId;o.addCompressedEventToManager(r,n)},this.worker=a}}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;this.canUseIdleCallback&&(null===(r=this.config.performanceConfig)||void 0===r?void 0:r.enabled)?(this.config.loggerProvider.debug("Enqueuing event for processing during idle time."),this.taskQueue.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){for(var t=this;this.taskQueue.length>0&&(e.timeRemaining()>0||e.didTimeout);){var r=this.taskQueue.shift();if(r){var n=r.event,s=r.sessionId;this.addCompressedEvent(n,s)}}this.taskQueue.length>0?requestIdleCallback(function(e){t.processQueue(e)},{timeout:this.timeout}):this.isProcessing=!1},e}(),Je="Failed to store session replay events in IndexedDB",qe="1.28.22-perfrecord-init-prelease.0",$e=function(){function e(e){var t=e.trackServerUrl,r=e.loggerProvider,n=e.payloadBatcher;this.storageKey="",this.retryTimeout=1e3,this.scheduled=null,this.queue=[],this.loggerProvider=r,this.payloadBatcher=n||function(e){return e},this.trackServerUrl=t}return e.prototype.sendEventsList=function(e){this.addToQueue(o(o({},e),{attempts:0,timeout:0}))},e.prototype.addToQueue=function(){for(var e=this,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];t.filter(function(t){return t.attempts<(t.flushMaxRetries||0)?(t.attempts+=1,!0):(e.completeRequest({context:t,err:"Session replay event batch rejected due to exceeded retry count"}),!1)}).forEach(function(t){e.queue=e.queue.concat(t),0!==t.timeout?setTimeout(function(){t.timeout=0,e.schedule(0)},t.timeout):e.schedule(0)})},e.prototype.schedule=function(e){var t=this;this.scheduled||(this.scheduled=setTimeout(function(){t.flush(!0).then(function(){t.queue.length>0&&t.schedule(e)})},e))},e.prototype.flush=function(e){return void 0===e&&(e=!1),i(this,void 0,void 0,function(){var t,r,n=this;return a(this,function(s){switch(s.label){case 0:return t=[],r=[],this.queue.forEach(function(e){return 0===e.timeout?t.push(e):r.push(e)}),this.queue=r,this.scheduled&&(clearTimeout(this.scheduled),this.scheduled=null),[4,Promise.all(t.map(function(t){return n.send(t,e)}))];case 1:return s.sent(),[2]}})})},e.prototype.send=function(e,t){var r,n;return void 0===t&&(t=!0),i(this,void 0,void 0,function(){var s,o,i,l,c,u,h,d,p,f,m,y,v;return a(this,function(a){switch(a.label){case 0:if(!(s=e.apiKey))return[2,this.completeRequest({context:e,err:"Session replay event batch not sent due to missing api key"})];if(!(o=e.deviceId))return[2,this.completeRequest({context:e,err:"Session replay event batch not sent due to missing device ID"})];if(w=g(),i=(null==w?void 0:w.location)?w.location.href:"",l=qe,c=e.sampleRate,u=new URLSearchParams({device_id:o,session_id:"".concat(e.sessionId),type:"".concat(e.type)}),h="".concat((null===(r=e.version)||void 0===r?void 0:r.type)||"standalone","/").concat((null===(n=e.version)||void 0===n?void 0:n.version)||l),0===(d=this.payloadBatcher({version:1,events:e.events})).events.length)return this.completeRequest({context:e}),[2];a.label=1;case 1:return a.trys.push([1,3,,4]),p={headers:{"Content-Type":"application/json",Accept:"*/*",Authorization:"Bearer ".concat(s),"X-Client-Version":l,"X-Client-Library":h,"X-Client-Url":i.substring(0,1e3),"X-Client-Sample-Rate":"".concat(c)},body:JSON.stringify(d),method:"POST"},f="".concat(H(e.serverZone,this.trackServerUrl),"?").concat(u.toString()),[4,fetch(f,p)];case 2:if(null===(m=a.sent()))return this.completeRequest({context:e,err:"Unexpected error occurred"}),[2];if(t)this.handleReponse(m.status,e);else{y="";try{y=JSON.stringify(m.body,null,2)}catch(e){}this.completeRequest({context:e,success:"".concat(m.status,": ").concat(y)})}return[3,4];case 3:return v=a.sent(),this.completeRequest({context:e,err:v}),[3,4];case 4:return[2]}var w})})},e.prototype.handleReponse=function(e,t){switch((new F).buildStatus(e)){case h.Success:this.handleSuccessResponse(t);break;case h.Failed:this.handleOtherResponse(t);break;default:this.completeRequest({context:t,err:"Network error occurred, event batch rejected"})}},e.prototype.handleSuccessResponse=function(e){var t=Math.round(new Blob(e.events).size/1024);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){this.addToQueue(o(o({},e),{timeout:e.attempts*this.retryTimeout}))},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}();const Xe=(e,t)=>t.some(t=>e instanceof t);let He,Qe;const et=new WeakMap,tt=new WeakMap,rt=new WeakMap;let nt={get(e,t,r){if(e instanceof IDBTransaction){if("done"===t)return et.get(e);if("store"===t)return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return at(e[t])},set:(e,t,r)=>(e[t]=r,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function st(e){nt=e(nt)}function ot(e){return(Qe||(Qe=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(lt(this),t),at(this.request)}:function(...t){return at(e.apply(lt(this),t))}}function it(e){return"function"==typeof e?ot(e):(e instanceof IDBTransaction&&function(e){if(et.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)});et.set(e,t)}(e),Xe(e,He||(He=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,nt):e)}function at(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(at(e.result)),n()},o=()=>{r(e.error),n()};e.addEventListener("success",s),e.addEventListener("error",o)});return rt.set(t,e),t}(e);if(tt.has(e))return tt.get(e);const t=it(e);return t!==e&&(tt.set(e,t),rt.set(t,e)),t}const lt=e=>rt.get(e);function ct(e,t,{blocked:r,upgrade:n,blocking:s,terminated:o}={}){const i=indexedDB.open(e,t),a=at(i);return n&&i.addEventListener("upgradeneeded",e=>{n(at(i.result),e.oldVersion,e.newVersion,at(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"],ht=["put","add","delete","clear"],dt=new Map;function pt(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(dt.get(t))return dt.get(t);const r=t.replace(/FromIndex$/,""),n=t!==r,s=ht.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 dt.set(t,o),o}st(e=>({...e,get:(t,r,n)=>pt(t,r)||e.get(t,r,n),has:(t,r)=>!!pt(t,r)||e.has(t,r)}));const ft=["continue","continuePrimaryKey","advance"],mt={},gt=new WeakMap,yt=new WeakMap,vt={get(e,t){if(!ft.includes(t))return e[t];let r=mt[t];return r||(r=mt[t]=function(...e){gt.set(this,yt.get(this)[t](...e))}),r}};async function*wt(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;const r=new Proxy(t,vt);for(yt.set(r,t),rt.set(r,lt(t));t;)yield r,t=await(gt.get(r)||t.continue()),gt.delete(r)}function bt(e,t){return t===Symbol.asyncIterator&&Xe(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===t&&Xe(e,[IDBIndex,IDBObjectStore])}st(e=>({...e,get:(t,r,n)=>bt(t,r)?wt:e.get(t,r,n),has:(t,r)=>bt(t,r)||e.has(t,r)}));var St,Ct=function(){function e(e){var t,r,n,s=this;this.minInterval=500,this.maxInterval=1e4,this.maxPersistedEventsSize=1e6,this.interval=this.minInterval,this._timeAtLastSplit=Date.now(),this.shouldSplitEventsList=function(e,t){var r=s.getStringSize(t);return s.getEventsArraySize(e)+r>=s.maxPersistedEventsSize||!!(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}return Object.defineProperty(e.prototype,"timeAtLastSplit",{get:function(){return this._timeAtLastSplit},enumerable:!1,configurable:!0}),e.prototype.getStringSize=function(e){return e.length},e.prototype.getEventsArraySize=function(e){var t,r,n=0;try{for(var s=l(e),o=s.next();!o.done;o=s.next()){var i=o.value;n+=this.getStringSize(i)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}return n+(2+Math.max(0,e.length-1)+2*e.length)},e}();!function(e){e.RECORDING="recording",e.SENT="sent"}(St||(St={}));var It="sessionCurrentSequence",xt="sequencesToSend",kt=function(){var e=g();return new Promise(function(t,r){if(!e)return r(new Error("Global scope not found"));if(!e.indexedDB)return r(new Error("Session Replay: cannot find indexedDB"));try{var n=e.indexedDB.open("keyval-store");n.onupgradeneeded=function(){1===n.result.version&&(n.result.close(),n.transaction&&n.transaction.abort(),e.indexedDB.deleteDatabase("keyval-store"),t())},n.onsuccess=function(){t(n.result)},n.onerror=function(){r(n.error)}}catch(e){r(e)}})},Ot=function(e){return i(void 0,void 0,void 0,function(){var t;return a(this,function(r){switch(r.label){case 0:return e.length>0?(t=e.splice(0,10),[4,Promise.all(t)]):[3,2];case 1:return r.sent(),[3,0];case 2:return[2]}})})},Et=function(e){var t,r;return e.objectStoreNames.contains(It)||(r=e.createObjectStore(It,{keyPath:"sessionId"})),e.objectStoreNames.contains(xt)||(t=e.createObjectStore(xt,{keyPath:"sequenceId",autoIncrement:!0})).createIndex("sessionId","sessionId"),{sequencesStore:t,currentSequenceStore:r}},Rt=function(e){return i(void 0,void 0,void 0,function(){return a(this,function(t){switch(t.label){case 0:return[4,ct(e,1,{upgrade:Et})];case 1:return[2,t.sent()]}})})},At=function(e){function t(t){var r=e.call(this,t)||this;return r.getSequencesToSend=function(){return i(r,void 0,void 0,function(){var e,t,r,n,s,o;return a(this,function(i){switch(i.label){case 0:return i.trys.push([0,5,,6]),e=[],[4,this.db.transaction("sequencesToSend").store.openCursor()];case 1:t=i.sent(),i.label=2;case 2:return t?(r=t.value,n=r.sessionId,s=r.events,e.push({events:s,sequenceId:t.key,sessionId:n}),[4,t.continue()]):[3,4];case 3:return t=i.sent(),[3,2];case 4:return[2,e];case 5:return o=i.sent(),this.loggerProvider.warn("".concat(Je,": ").concat(o)),[3,6];case 6:return[2,void 0]}})})},r.storeCurrentSequence=function(e){return i(r,void 0,void 0,function(){var t,r,n;return a(this,function(s){switch(s.label){case 0:return s.trys.push([0,4,,5]),[4,this.db.get(It,e)];case 1:return(t=s.sent())?[4,this.db.put(xt,{sessionId:e,events:t.events})]:[2,void 0];case 2:return r=s.sent(),[4,this.db.put(It,{sessionId:e,events:[]})];case 3:return s.sent(),[2,o(o({},t),{sessionId:e,sequenceId:r})];case 4:return n=s.sent(),this.loggerProvider.warn("".concat(Je,": ").concat(n)),[3,5];case 5:return[2,void 0]}})})},r.addEventToCurrentSequence=function(e,t){return i(r,void 0,void 0,function(){var r,n,s,o,i,l;return a(this,function(a){switch(a.label){case 0:return a.trys.push([0,10,,11]),[4,(r=this.db.transaction(It,"readwrite")).store.get(e)];case 1:return(n=a.sent())?[3,3]:[4,r.store.put({sessionId:e,events:[t]})];case 2:return a.sent(),[2];case 3:return s=void 0,this.shouldSplitEventsList(n.events,t)?(s=n.events,[4,r.store.put({sessionId:e,events:[t]})]):[3,5];case 4:return a.sent(),[3,7];case 5:return o=n.events.concat(t),[4,r.store.put({sessionId:e,events:o})];case 6:a.sent(),a.label=7;case 7:return[4,r.done];case 8:return a.sent(),s?[4,this.storeSendingEvents(e,s)]:[2,void 0];case 9:return(i=a.sent())?[2,{events:s,sessionId:e,sequenceId:i}]:[2,void 0];case 10:return l=a.sent(),this.loggerProvider.warn("".concat(Je,": ").concat(l)),[3,11];case 11:return[2,void 0]}})})},r.storeSendingEvents=function(e,t){return i(r,void 0,void 0,function(){var r;return a(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.db.put(xt,{sessionId:e,events:t})];case 1:return[2,n.sent()];case 2:return r=n.sent(),this.loggerProvider.warn("".concat(Je,": ").concat(r)),[3,3];case 3:return[2,void 0]}})})},r.cleanUpSessionEventsStore=function(e,t){return i(r,void 0,void 0,function(){var e;return a(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(xt,t)];case 2:return r.sent(),[3,4];case 3:return e=r.sent(),this.loggerProvider.warn("".concat(Je,": ").concat(e)),[3,4];case 4:return[2]}})})},r.transitionFromKeyValStore=function(e){return i(r,void 0,void 0,function(){var t,r,n,s,o,l,h,p,f=this;return a(this,function(m){switch(m.label){case 0:return m.trys.push([0,6,,7]),[4,kt()];case 1:if(!(t=m.sent()))return[2];r=function(e,t){return i(f,void 0,void 0,function(){var r,n,s=this;return a(this,function(o){switch(o.label){case 0:return r=t.sessionSequences,n=[],Object.keys(r).forEach(function(o){var l=parseInt(o,10),h=r[l];if(l===t.currentSequenceId){var d=h.events.map(function(t){return i(s,void 0,void 0,function(){return a(this,function(r){return[2,this.addEventToCurrentSequence(e,t)]})})});n.push.apply(n,u([],c(d),!1))}else h.status!==St.SENT&&n.push(s.storeSendingEvents(e,h.events))}),[4,Ot(n)];case 1:return o.sent(),[2]}})})},n="".concat(d,"_").concat(this.apiKey.substring(0,10)),m.label=2;case 2:return m.trys.push([2,4,,5]),s=t.transaction("keyval").objectStore("keyval").getAll(n),o=new Promise(function(t){s.onsuccess=function(n){return i(f,void 0,void 0,function(){var s,o,i,l=this;return a(this,function(a){switch(a.label){case 0:return s=n&&n.target.result,(o=s&&s[0])?(i=[],Object.keys(o).forEach(function(t){var n=parseInt(t,10),s=o[n];if(e===n)i.push(r(n,s));else{var a=s.sessionSequences;Object.keys(a).forEach(function(e){var t=parseInt(e,10);a[t].status!==St.SENT&&i.push(l.storeSendingEvents(n,a[t].events))})}}),[4,Ot(i)]):[3,2];case 1:a.sent(),a.label=2;case 2:return t(),[2]}})})}}),[4,o];case 3:return m.sent(),(l=g())&&l.indexedDB.deleteDatabase("keyval-store"),[3,5];case 4:return h=m.sent(),this.loggerProvider.warn("Failed to transition session replay events from keyval to new store: ".concat(h)),[3,5];case 5:return[3,7];case 6:return p=m.sent(),this.loggerProvider.warn("Failed to access keyval store: ".concat(p,". For more information, visit: https://www.docs.developers.amplitude.com/session-replay/sdks/standalone/#indexeddb-best-practices")),[3,7];case 7:return[2]}})})},r.apiKey=t.apiKey,r.db=t.db,r}return r(t,e),t.new=function(e,r,n){return i(this,void 0,void 0,function(){var s,i,l,c,u;return a(this,function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),s="replay"===e?"":"_".concat(e),i="".concat(r.apiKey.substring(0,10),"_amp_session_replay_events").concat(s),[4,Rt(i)];case 1:return l=a.sent(),[4,(c=new t(o(o({},r),{db:l}))).transitionFromKeyValStore(n)];case 2:return a.sent(),[2,c];case 3:return u=a.sent(),r.loggerProvider.warn("".concat(Je,": ").concat(u)),[3,4];case 4:return[2]}})})},t.prototype.getCurrentSequenceEvents=function(e){return i(this,void 0,void 0,function(){var t,r,n,s,o,i,c;return a(this,function(a){switch(a.label){case 0:return e?[4,this.db.get("sessionCurrentSequence",e)]:[3,2];case 1:return(s=a.sent())?[2,[s]]:[2,void 0];case 2:t=[],a.label=3;case 3:return a.trys.push([3,8,9,10]),[4,this.db.getAll("sessionCurrentSequence")];case 4:r=l.apply(void 0,[a.sent()]),n=r.next(),a.label=5;case 5:if(n.done)return[3,7];s=n.value,t.push(s),a.label=6;case 6:return n=r.next(),[3,5];case 7:return[3,10];case 8:return o=a.sent(),i={error:o},[3,10];case 9:try{n&&!n.done&&(c=r.return)&&c.call(r)}finally{if(i)throw i.error}return[7];case 10:return[2,t]}})})},t}(Ct),Mt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.finalizedSequences={},t.sequences={},t.sequenceId=0,t}return r(t,e),t.prototype.resetCurrentSequence=function(e){this.sequences[e]=[]},t.prototype.addSequence=function(e){var t=this.sequenceId++,r=u([],c(this.sequences[e]),!1);return this.finalizedSequences[t]={sessionId:e,events:r},this.resetCurrentSequence(e),{sequenceId:t,events:r,sessionId:e}},t.prototype.getSequencesToSend=function(){return i(this,void 0,void 0,function(){return a(this,function(e){return[2,Object.entries(this.finalizedSequences).map(function(e){var t=c(e,2),r=t[0],n=t[1],s=n.sessionId,o=n.events;return{sequenceId:Number(r),sessionId:s,events:o}})]})})},t.prototype.storeCurrentSequence=function(e){return i(this,void 0,void 0,function(){return a(this,function(t){return this.sequences[e]?[2,this.addSequence(e)]:[2,void 0]})})},t.prototype.addEventToCurrentSequence=function(e,t){return i(this,void 0,void 0,function(){var r;return a(this,function(n){return this.sequences[e]||this.resetCurrentSequence(e),this.shouldSplitEventsList(this.sequences[e],t)&&(r=this.addSequence(e)),this.sequences[e].push(t),[2,r]})})},t.prototype.storeSendingEvents=function(e,t){return i(this,void 0,void 0,function(){return a(this,function(r){return this.finalizedSequences[this.sequenceId]={sessionId:e,events:t},[2,this.sequenceId++]})})},t.prototype.cleanUpSessionEventsStore=function(e,t){return i(this,void 0,void 0,function(){return a(this,function(e){return void 0!==t&&delete this.finalizedSequences[t],[2]})})},t}(Ct),Pt=function(e){var t=e.config,r=e.sessionId,n=e.minInterval,s=e.maxInterval,l=e.type,c=e.payloadBatcher,u=e.storeType;return i(void 0,void 0,void 0,function(){function e(e){return void 0===e&&(e=!1),i(this,void 0,void 0,function(){return a(this,function(t){return[2,h.flush(e)]})})}var h,d,p,f,m,g,y,v,w;return a(this,function(b){switch(b.label){case 0:return h=new $e(o(o({},t),{loggerProvider:t.loggerProvider,payloadBatcher:c})),d=function(){return new Mt({loggerProvider:t.loggerProvider,maxInterval:s,minInterval:n})},p=function(){return i(void 0,void 0,void 0,function(){var e;return a(this,function(o){switch(o.label){case 0:return[4,At.new(l,{loggerProvider:t.loggerProvider,minInterval:n,maxInterval:s,apiKey:t.apiKey},r)];case 1:return e=o.sent(),t.loggerProvider.log("Failed to initialize idb store, falling back to memory store."),[2,null!=e?e:d()]}})})},"idb"!==u?[3,2]:[4,p()];case 1:return m=b.sent(),[3,3];case 2:m=d(),b.label=3;case 3:return f=m,g=function(e){var r=e.events,n=e.sessionId,s=e.deviceId,o=e.sequenceId;t.debugMode&&te().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(){}),h.sendEventsList({events:r,sessionId:n,flushMaxRetries:t.flushMaxRetries,apiKey:t.apiKey,deviceId:s,sampleRate:t.sampleRate,serverZone:t.serverZone,version:t.version,type:l,onComplete:function(){return i(void 0,void 0,void 0,function(){return a(this,function(e){switch(e.label){case 0:return[4,f.cleanUpSessionEventsStore(n,o)];case 1:return e.sent(),[2]}})})}})},y=function(e){var r=e.sessionId,n=e.deviceId;f.storeCurrentSequence(r).then(function(e){e&&g({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)})},v=function(e){var t=e.deviceId;return i(void 0,void 0,void 0,function(){var e;return a(this,function(r){switch(r.label){case 0:return[4,f.getSequencesToSend()];case 1:return(e=r.sent())&&e.forEach(function(e){g({sequenceId:e.sequenceId,events:e.events,sessionId:e.sessionId,deviceId:t})}),[2]}})})},w=function(e){var r=e.event,n=e.sessionId,s=e.deviceId;f.addEventToCurrentSequence(n,r.data).then(function(e){return e&&g({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:y,addEvent:w,sendStoredEvents:v,flush:e}]}})})},Nt=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 i(this,void 0,void 0,function(){var t;return a(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 i(this,void 0,void 0,function(){var t;return a(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}();const Tt={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Dt={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Lt={};function _t(e){if(Lt[e])return Lt[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 Tt?Tt[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 Dt?Dt[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 Lt[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?Lt[e]=o:r}catch{return r}}const Ft={};function Bt(e,t,r){var n;const s=`${e}.${String(r)}`;if(Ft[s])return Ft[s].call(t);const o=_t(e),i=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return i?(Ft[s]=i,i.call(t)):t[r]}const Ut={};function jt(e,t,r){const n=`${e}.${String(r)}`;if(Ut[n])return Ut[n].bind(t);const s=_t(e)[r];return"function"!=typeof s?t[r]:(Ut[n]=s,s.bind(t))}const zt={childNodes:function(e){return Bt("Node",e,"childNodes")},parentNode:function(e){return Bt("Node",e,"parentNode")},parentElement:function(e){return Bt("Node",e,"parentElement")},textContent:function(e){return Bt("Node",e,"textContent")},contains:function(e,t){return jt("Node",e,"contains")(t)},getRootNode:function(e){return jt("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Bt("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Bt("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Bt("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Bt("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return _t("MutationObserver").constructor}};function Wt(){var e=g();return(null==e?void 0:e.innerHeight)||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight||0}function Vt(){var e=g();return(null==e?void 0:e.innerWidth)||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth||0}var Gt,Zt,Yt;function Kt(e,t){if(Yt=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};Gt=o(o({},r),t),Zt=function(e,t){if(e.nodeType===Node.DOCUMENT_NODE)return e;if(e===t.root)return e.ownerDocument;return e}(Gt.root,r);var n=Jt(e,"all",function(){return Jt(e,"two",function(){return Jt(e,"one",function(){return Jt(e,"none")})})});if(n){var s=sr(or(n,e));return s.length>0&&(n=s[0]),$t(n)}throw new Error("Selector was not found.")}function Jt(e,t,r){for(var n=null,s=[],o=e,i=0,a=function(){var e,a,h=(new Date).getTime()-Yt.getTime();if(void 0!==Gt.timeoutMs&&h>Gt.timeoutMs)throw new Error("Timeout: Can't find a unique selector after ".concat(h,"ms"));var d=tr(function(e){var t=e.getAttribute("id");if(t&&Gt.idName(t))return{name:"#"+CSS.escape(t),penalty:0};return null}(o))||tr.apply(void 0,u([],c(function(e){var t=Array.from(e.attributes).filter(function(e){return Gt.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))||tr.apply(void 0,u([],c(function(e){var t=Array.from(e.classList).filter(Gt.className);return t.map(function(e){return{name:"."+CSS.escape(e),penalty:1}})}(o)),!1))||tr(function(e){var t=e.tagName.toLowerCase();if(Gt.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&&(d=d.concat(d.filter(er).map(function(e){return Qt(e,p)})));else if("two"==t)d=d.slice(0,1),p&&(d=d.concat(d.filter(er).map(function(e){return Qt(e,p)})));else if("one"==t){var f=c(d=d.slice(0,1),1)[0];p&&er(f)&&(d=[Qt(f,p)])}else"none"==t&&(d=[{name:"*",penalty:3}],p&&(d=[Qt(d[0],p)]));try{for(var m=(e=void 0,l(d)),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(d),s.length>=Gt.seedMinLength&&(n=qt(s,r)))return"break";o=o.parentElement,i++};o;){if("break"===a())break}return n||(n=qt(s,r)),!n&&r?r():n}function qt(e,t){var r,n,s=sr(nr(e));if(s.length>Gt.threshold)return t?t():null;try{for(var o=l(s),i=o.next();!i.done;i=o.next()){var a=i.value;if(Ht(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 $t(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 Xt(e){return e.map(function(e){return e.penalty}).reduce(function(e,t){return e+t},0)}function Ht(e){var t=$t(e);switch(Zt.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 Qt(e,t){return{name:e.name+":nth-child(".concat(t,")"),penalty:e.penalty+1}}function er(e){return"html"!==e.name&&!e.name.startsWith("#")}function tr(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e.filter(rr);return r.length>0?r:null}function rr(e){return null!=e}function nr(e,t){var r,n,s,o,i,c;return void 0===t&&(t=[]),a(this,function(a){switch(a.label){case 0:if(!(e.length>0))return[3,9];a.label=1;case 1:a.trys.push([1,6,7,8]),r=l(e[0]),n=r.next(),a.label=2;case 2:return n.done?[3,5]:(s=n.value,[5,l(nr(e.slice(1,e.length),t.concat(s)))]);case 3:a.sent(),a.label=4;case 4:return n=r.next(),[3,2];case 5:return[3,8];case 6:return o=a.sent(),i={error:o},[3,8];case 7:try{n&&!n.done&&(c=r.return)&&c.call(r)}finally{if(i)throw i.error}return[7];case 8:return[3,11];case 9:return[4,t];case 10:a.sent(),a.label=11;case 11:return[2]}})}function sr(e){return u([],c(e),!1).sort(function(e,t){return Xt(e)-Xt(t)})}function or(e,t,r){var n,s,o;return void 0===r&&(r={counter:0,visited:new Map}),a(this,function(i){switch(i.label){case 0:if(!(e.length>2&&e.length>Gt.optimizedMinLength))return[3,5];n=1,i.label=1;case 1:return n<e.length-1?r.counter>Gt.maxNumberOfTries?[2]:(r.counter+=1,(s=u([],c(e),!1)).splice(n,1),o=$t(s),r.visited.has(o)?[2]:Ht(s)&&function(e,t){return Zt.querySelector($t(e))===t}(s,t)?[4,s]:[3,4]):[3,5];case 2:return i.sent(),r.visited.set(o,!0),[5,l(or(s,t,r))];case 3:i.sent(),i.label=4;case 4:return n++,[3,1];case 5:return[2]}})}var ir=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}},ar=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)}},lr=function(e,t){var r=t.eventsManager,n=t.sessionId,s=t.deviceIdFn,o=t.mirror,i=t.ugcFilterRules;return function(t){if(t.type===ie.Click){var a=g();if(a){var l=a.location,c=a.innerHeight,u=a.innerWidth;if(l){var h=t.x,d=t.y;if(void 0!==h&&void 0!==d){var p,f=o.getNode(t.id);if(f)try{p=Kt(f)}catch(t){e.debug("error resolving selector from finder")}var m=function(e){var t,r,n,s,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=zt.parentElement(o.body))||void 0===t?void 0:t.scrollLeft)||(null===(r=null==o?void 0:o.body)||void 0===r?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=zt.parentElement(o.body))||void 0===n?void 0:n.scrollTop)||(null===(s=null==o?void 0:o.body)||void 0===s?void 0:s.scrollTop)||0}}(a),y={x:h+m.left,y:d+m.top,selector:p,viewportHeight:c,viewportWidth:u,pageUrl:ee(l.href,i),timestamp:Date.now(),type:"click"},v=s();v&&r.addEvent({sessionId:n,event:{type:"interaction",data:JSON.stringify(y)},deviceId:v})}}}}}},cr=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=H(t.serverZone,t.trackServerUrl),this.apiKey=t.apiKey,this.context=e}return e.prototype.send=function(e,t){var r=this.context,n=r.sessionId,s=r.type,o=new URLSearchParams({device_id:e,session_id:String(n),type:String(s),api_key:this.apiKey}),i="".concat(this.basePageUrl,"?").concat(o.toString());this.sendBeacon(i,t)||this.sendXhr(i,t)},e}(),ur=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=e(),i=g();i&&o&&r.transport.send(o,{version:1,events:[{maxScrollX:r._maxScrollX,maxScrollY:r._maxScrollY,maxScrollWidth:r._maxScrollWidth,maxScrollHeight:r._maxScrollHeight,viewportHeight:Wt(),viewportWidth:Vt(),pageUrl:ee(i.location.href,null!==(s=null===(n=r.config.interactionConfig)||void 0===n?void 0:n.ugcFilterRules)&&void 0!==s?s:[]),timestamp:r.timestamp,type:"scroll"}]})}},this._maxScrollX=0,this._maxScrollY=0,this._maxScrollWidth=Vt(),this._maxScrollHeight=Wt(),this.config=t,this.transport=e}return e.default=function(t,r){return new e(new cr(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}),e.prototype.update=function(e){var t=Date.now();if(e.x>this._maxScrollX){var r=Vt();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=Wt();this._maxScrollY=e.y;var o=e.y+s;o>this._maxScrollHeight&&(this._maxScrollHeight=o),this.timestamp=t}},e}(),hr=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))},dr=function(){var e=this;this.dbs={},this.createStore=function(t){return i(e,void 0,void 0,function(){return a(this,function(e){switch(e.label){case 0:return[4,ct(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 i(e,void 0,void 0,function(){var e,r;return a(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 i(e,void 0,void 0,function(){var e,t,o,i;return a(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(),r.warn("Failed to get targeting match for session id ".concat(s,": ").concat(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 i(e,void 0,void 0,function(){var e,t,i;return a(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(),r.warn("Failed to store targeting match for session id ".concat(s,": ").concat(i)),[3,4];case 4:return[2,void 0]}})})},this.clearStoreOfOldSessions=function(t){var r=t.loggerProvider,n=t.apiKey,s=t.currentSessionId;return i(e,void 0,void 0,function(){var e,t,o,i,l,c,u,h;return a(this,function(a){switch(a.label){case 0:return a.trys.push([0,8,,9]),[4,this.openOrCreateDB(n)];case 1:return e=a.sent(),t=String(s),[4,(o=e.transaction("sessionTargetingMatch","readwrite")).store.getAll()];case 2:i=a.sent(),l=0,a.label=3;case 3:return l<i.length?(c=i[l],u=Date.now()-c.lastUpdated,c.sessionId!==t&&u>1728e5?[4,o.store.delete(c.sessionId)]:[3,5]):[3,6];case 4:a.sent(),a.label=5;case 5:return l++,[3,3];case 6:return[4,o.done];case 7:return a.sent(),[3,9];case 8:return h=a.sent(),r.warn("Failed to clear old targeting matches for sessions: ".concat(h)),[3,9];case 9:return[2]}})})}},pr=new dr,fr=function(e){var t=e.sessionId,r=e.targetingConfig,n=e.loggerProvider,s=e.apiKey,l=e.targetingParams;return i(void 0,void 0,void 0,function(){var e,i,c,u;return a(this,function(a){switch(a.label){case 0:return[4,pr.clearStoreOfOldSessions({loggerProvider:n,apiKey:s,currentSessionId:t})];case 1:return a.sent(),[4,pr.getTargetingMatchForSession({loggerProvider:n,apiKey:s,sessionId:t})];case 2:if(!0===a.sent())return[2,!0];e=!0,a.label=3;case 3:return a.trys.push([3,6,,7]),[4,Promise.resolve().then(function(){return bn})];case 4:return[4,(0,a.sent().evaluateTargeting)(o(o({},l),{flag:r,sessionId:t,apiKey:s,loggerProvider:n}))];case 5:return(i=a.sent())&&i.sr_targeting_config&&(e="on"===i.sr_targeting_config.key),pr.storeTargetingMatchForSession({loggerProvider:n,apiKey:s,sessionId:t,targetingMatch:e}),[3,7];case 6:return c=a.sent(),u=c,n.warn(u.message),[3,7];case 7:return[2,e]}})})};function mr(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:1e3,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?ee(s,c):s,title:o,viewportHeight:e,viewportWidth:t,type:"url-change-event"}}();t(n)}},g=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=e.apply(this,t);return m(),n}},y=function(){m()};if(u){var v=r.setInterval(function(){m()},h);return m(),function(){v&&r.clearInterval(v)}}if(r.history){var w=r.history.pushState.bind(r.history),b=r.history.replaceState.bind(r.history);return r.history.pushState=g(w),r.history.replaceState=g(b),r.addEventListener("popstate",m),r.addEventListener("hashchange",y),m(),function(){r.history.pushState=w,r.history.replaceState=b,r.removeEventListener("popstate",m),r.removeEventListener("hashchange",y)}}return r.addEventListener("hashchange",y),m(),function(){r.removeEventListener("hashchange",y)}},options:e}}mr();var gr,yr,vr,wr=function(){function e(){var e=this;this.name="@amplitude/session-replay-browser",this.recordCancelCallback=null,this.eventCount=0,this.sessionTargetingMatch=!1,this.pageLeaveFns=[],this.recordFunction=null,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(){e.recordEvents(!1)},this.pageLeaveListener=function(t){e.pageLeaveFns.forEach(function(e){e(t)})},this.evaluateTargetingAndCapture=function(t,r,n){return void 0===r&&(r=!1),void 0===n&&(n=!1),i(e,void 0,void 0,function(){var e,o;return a(this,function(i){switch(i.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,!this.config.targetingConfig||this.sessionTargetingMatch?[3,2]:((e=t.event)&&Object.values(s).includes(e.event_type)&&(e=void 0),o=this,[4,fr({sessionId:this.identifiers.sessionId,targetingConfig:this.config.targetingConfig,loggerProvider:this.loggerProvider,apiKey:this.config.apiKey,targetingParams:{userProperties:t.userProperties,event:e}})]);case 1:o.sessionTargetingMatch=i.sent(),this.loggerProvider.debug(JSON.stringify({name:"targeted replay capture config",sessionTargetingMatch:this.sessionTargetingMatch,event:e,targetingParams:t},null,2)),i.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:i.sent(),i.label=5;case 5:return[2]}})})},this.addCustomRRWebEvent=function(t,r,n){return void 0===r&&(r={}),void 0===n&&(n=!0),i(e,void 0,void 0,function(){var e,s,i,l;return a(this,function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),e=void 0,(s=this.config)&&t!==U.METADATA?(e={config:re(s),version:qe},n?[4,te()]:[3,2]):[3,2];case 1:i=a.sent(),e=o(o({},i),e),a.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 l=a.sent(),this.loggerProvider.debug("Error while adding custom replay capture event: ",l),[3,4];case 4:return[2]}})})},this.stopRecordingEvents=function(){var t;try{e.loggerProvider.log("Session Replay capture stopping."),e.recordCancelCallback&&e.recordCancelCallback(),e.recordCancelCallback=null,null===(t=e.networkObservers)||void 0===t||t.stop()}catch(t){var r=t;e.loggerProvider.warn("Error occurred while stopping replay capture: ".concat(r.toString()))}},this.loggerProvider=new Y(new w)}return e.prototype.init=function(e,t){return y(this._init(e,t))},e.prototype._init=function(e,t){var r,n,s,o,l,h,d;return i(this,void 0,void 0,function(){var i,p,f,m,y,v,b,S,C,I,x,k,O,E,R,A,M;return a(this,function(a){switch(a.label){case 0:return this.loggerProvider=new Y(t.loggerProvider||new w),Object.prototype.hasOwnProperty.call(t,"logLevel")&&this.loggerProvider.enable(t.logLevel),this.identifiers=new hr({sessionId:t.sessionId,deviceId:t.deviceId}),i=this,[4,pe(e,t)];case 1:return i.joinedConfigGenerator=a.sent(),[4,this.joinedConfigGenerator.generateJoinedConfig(this.identifiers.sessionId)];case 2:p=a.sent(),f=p.joinedConfig,m=p.localConfig,y=p.remoteConfig,this.config=f,this.setMetadata(t.sessionId,f,m,y,null===(r=t.version)||void 0===r?void 0:r.version,qe,null===(n=t.version)||void 0===n?void 0:n.type),t.sessionId&&(null===(s=this.config.interactionConfig)||void 0===s?void 0:s.enabled)&&(v=ur.default({sessionId:t.sessionId,type:"interaction"},this.config),this.pageLeaveFns=[v.send(this.getDeviceId.bind(this)).bind(v)],this.scrollHook=v.hook.bind(v)),b=[],"idb"!==(S=this.config.storeType)||(null===(o=g())||void 0===o?void 0:o.indexedDB)||(S="memory",this.loggerProvider.warn("Could not use preferred indexedDB storage, reverting to in memory option.")),this.loggerProvider.log("Using ".concat(S," for event storage.")),a.label=3;case 3:return a.trys.push([3,5,,6]),[4,Pt({config:this.config,sessionId:this.identifiers.sessionId,type:"replay",storeType:S})];case 4:return C=a.sent(),b.push({name:"replay",manager:C}),[3,6];case 5:return I=a.sent(),E=I,this.loggerProvider.warn("Error occurred while creating replay events manager: ".concat(E.toString())),[3,6];case 6:if(!(null===(l=this.config.interactionConfig)||void 0===l?void 0:l.enabled))return[3,10];x=this.config.interactionConfig.batch?ar:ir,a.label=7;case 7:return a.trys.push([7,9,,10]),[4,Pt({config:this.config,sessionId:this.identifiers.sessionId,type:"interaction",minInterval:null!==(h=this.config.interactionConfig.trackEveryNms)&&void 0!==h?h:3e4,maxInterval:6e4,payloadBatcher:x,storeType:S})];case 8:return k=a.sent(),b.push({name:"interaction",manager:k}),[3,10];case 9:return O=a.sent(),E=O,this.loggerProvider.warn("Error occurred while creating interaction events manager: ".concat(E.toString())),[3,10];case 10:return this.eventsManager=new(Nt.bind.apply(Nt,u([void 0],c(b),!1))),this.eventCompressor&&this.eventCompressor.terminate(),R=void 0,A=g(),(null===(d=this.config.experimental)||void 0===d?void 0:d.useWebWorker)&&A&&A.Worker?[4,Promise.resolve().then(function(){return Sn})]:[3,12];case 11:M=a.sent().compressionScript,R=M,a.label=12;case 12:return this.eventCompressor=new Ke(this.eventsManager,this.config,this.getDeviceId(),R),[4,this.initializeNetworkObservers()];case 13:return a.sent(),this.loggerProvider.log("Installing @amplitude/session-replay-browser."),this.teardownEventListeners(!1),[4,this.evaluateTargetingAndCapture({userProperties:t.userProperties},!0)];case 14:return a.sent(),[2]}})})},e.prototype.setSessionId=function(e,t){return y(this.asyncSetSessionId(e,t))},e.prototype.asyncSetSessionId=function(e,t,r){var n;return i(this,void 0,void 0,function(){var s,o,i;return a(this,function(a){switch(a.label){case 0:return this.sessionTargetingMatch=!1,this.lastShouldRecordDecision=void 0,(s=this.identifiers&&this.identifiers.sessionId)&&this.sendEvents(s),o=t||this.getDeviceId(),this.identifiers=new hr({sessionId:e,deviceId:o}),this.joinedConfigGenerator&&s?[4,this.joinedConfigGenerator.generateJoinedConfig(this.identifiers.sessionId)]:[3,2];case 1:i=a.sent().joinedConfig,this.config=i,a.label=2;case 2:return(null===(n=this.config)||void 0===n?void 0:n.targetingConfig)?[4,this.evaluateTargetingAndCapture({userProperties:null==r?void 0:r.userProperties},!1,!0)]:[3,4];case 3:return a.sent(),[3,6];case 4:return[4,this.recordEvents()];case 5:a.sent(),a.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={})[z]=r.sessionReplayId?r.sessionReplayId:null,s=e,t.debugMode&&(s[G]=JSON.stringify({appHash:_(t.apiKey).toString()}))),this.addCustomRRWebEvent(U.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=e||(null===(t=this.identifiers)||void 0===t?void 0:t.sessionId),n=this.getDeviceId();this.eventsManager&&r&&n&&this.eventsManager.sendCurrentSequenceEvents({sessionId:r,deviceId:n})},e.prototype.initialize=function(e){var t;return void 0===e&&(e=!1),i(this,void 0,void 0,function(){var r;return a(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,n;(null===(e=this.config)||void 0===e?void 0:e.instanceName)&&(r=(n=this.config.instanceName,void 0===n&&(n=p),D.getInstance(n)).identityStore.getIdentity().optOut);return void 0!==r?r:null===(t=this.config)||void 0===t?void 0:t.optOut},e.prototype.getShouldRecord=function(){if(!this.identifiers||!this.config||!this.identifiers.sessionId)return this.loggerProvider.warn("Session is not being recorded due to lack of config, please call sessionReplay.init."),!1;if(!this.config.captureEnabled)return this.loggerProvider.log("Session ".concat(this.identifiers.sessionId," not being captured due to capture being disabled for project or because the remote config could not be fetched.")),!1;if(this.shouldOptOut())return this.loggerProvider.log("Opting session ".concat(this.identifiers.sessionId," out of recording due to optOut config.")),!1;var e,t,r,n=!1,s="",o=!1;this.config.targetingConfig?this.sessionTargetingMatch?(s="Capturing replays for session ".concat(this.identifiers.sessionId," due to matching targeting conditions."),this.loggerProvider.log(s),n=!0,o=!0):(s="Not capturing replays for session ".concat(this.identifiers.sessionId," due to not matching targeting conditions."),this.loggerProvider.log(s),n=!1,o=!1):(e=this.identifiers.sessionId,t=this.config.sampleRate,r=_(e.toString()),31*Math.abs(r)%1e6/1e6<t)?(n=!0,o=!0):(s="Opting session ".concat(this.identifiers.sessionId," out of recording due to sample rate."),this.loggerProvider.log(s),n=!1,o=!1);return this.lastShouldRecordDecision!==n&&this.config.targetingConfig&&(this.addCustomRRWebEvent(U.TARGETING_DECISION,{message:s,sessionId:this.identifiers.sessionId,matched:o,targetingParams:this.lastTargetingParams}),this.lastShouldRecordDecision=n),n},e.prototype.getBlockSelectors=function(){var e,t,r,n=null!==(r=null===(t=null===(e=this.config)||void 0===e?void 0:e.privacyConfig)||void 0===t?void 0:t.blockSelector)&&void 0!==r?r:[];if(0!==n.length)return n},e.prototype.getMaskTextSelectors=function(){var e,t,r,n;if("conservative"===(null===(t=null===(e=this.config)||void 0===e?void 0:e.privacyConfig)||void 0===t?void 0:t.defaultMaskLevel))return"*";var s=null===(n=null===(r=this.config)||void 0===r?void 0:r.privacyConfig)||void 0===n?void 0:n.maskSelector;return s||void 0},e.prototype.getRecordingPlugins=function(e){var t,r,n,s,o,l;return i(this,void 0,void 0,function(){var i,c,u,h;return a(this,function(a){switch(a.label){case 0:i=[];try{c=mr({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}),i.push(c)}catch(e){this.loggerProvider.warn("Failed to create URL tracking plugin:",e)}if(!(null===(l=null==e?void 0:e.console)||void 0===l?void 0:l.enabled))return[3,4];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,Promise.resolve().then(function(){return nd})];case 2:return u=a.sent().getRecordConsolePlugin,i.push(u({level:e.console.levels})),[3,4];case 3:return h=a.sent(),this.loggerProvider.warn("Failed to load console plugin:",h),[3,4];case 4:return[2,i.length>0?i:void 0]}})})},e.prototype.getRecordFunction=function(){return i(this,void 0,void 0,function(){var e,t;return a(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 vC})];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){var t,r,n,s,o;return void 0===e&&(e=!0),i(this,void 0,void 0,function(){var i,l,c,u,h,d,p,f,m,g,y,v,w,b=this;return a(this,function(a){switch(a.label){case 0:return i=this.config,l=this.getShouldRecord(),c=null===(t=this.identifiers)||void 0===t?void 0:t.sessionId,l&&c&&i?(this.stopRecordingEvents(),[4,this.getRecordFunction()]):[2];case 1:return(u=a.sent())?[4,this.initializeNetworkObservers()]:[2];case 2:a.sent(),null===(r=this.networkObservers)||void 0===r||r.start(function(e){b.addCustomRRWebEvent(U.FETCH_REQUEST,e)}),h=i.privacyConfig,d=i.interactionConfig,p=i.loggingConfig,f=(null==d?void 0:d.enabled)?{mouseInteraction:this.eventsManager&&lr(this.loggerProvider,{eventsManager:this.eventsManager,sessionId:c,deviceIdFn:this.getDeviceId.bind(this),mirror:u.mirror,ugcFilterRules:null!==(n=d.ugcFilterRules)&&void 0!==n?n:[]}),scroll:this.scrollHook}:{},m=(null==d?void 0:d.enabled)&&d.ugcFilterRules?d.ugcFilterRules:[],this.loggerProvider.log("Session Replay capture beginning for ".concat(c,".")),a.label=3;case 3:return a.trys.push([3,5,,6]),g=this,y=u,w={emit:function(e){if(b.shouldOptOut())return b.loggerProvider.log("Opting session ".concat(c," out of recording due to optOut config.")),b.stopRecordingEvents(),void b.sendEvents();e.type===oe.Meta&&(e.data.href=ee(e.data.href,m)),b.eventCompressor&&b.eventCompressor.enqueueEvent(e,c)},inlineStylesheet:i.shouldInlineStylesheet,hooks:f,maskAllInputs:!0,maskTextClass:Z,blockClass:"amp-block",blockSelector:this.getBlockSelectors(),applyBackgroundColorToBlockedElements:i.applyBackgroundColorToBlockedElements,maskInputFn:X("input",h),maskTextFn:X("text",h),maskTextSelector:this.getMaskTextSelectors(),recordCanvas:!1,slimDOMOptions:{script:null===(s=i.omitElementTags)||void 0===s?void 0:s.script,comment:null===(o=i.omitElementTags)||void 0===o?void 0:o.comment},errorHandler:function(e){var t=e;if(t.message.includes("insertRule")&&t.message.includes("CSSStyleSheet"))throw t;if(t._external_)throw t;return b.loggerProvider.warn("Error while capturing replay: ",t.toString()),!0}},[4,this.getRecordingPlugins(p)];case 4:return g.recordCancelCallback=y.apply(void 0,[(w.plugins=a.sent(),w)]),this.addCustomRRWebEvent(U.DEBUG_INFO),e&&this.addCustomRRWebEvent(U.METADATA,this.metadata),[3,6];case 5:return v=a.sent(),this.loggerProvider.warn("Failed to initialize session replay:",v),[3,6];case 6:return[2]}})})},e.prototype.getDeviceId=function(){var e;return null===(e=this.identifiers)||void 0===e?void 0:e.deviceId},e.prototype.getSessionId=function(){var e;return null===(e=this.identifiers)||void 0===e?void 0:e.sessionId},e.prototype.flush=function(e){var t;return void 0===e&&(e=!1),i(this,void 0,void 0,function(){return a(this,function(r){return[2,null===(t=this.eventsManager)||void 0===t?void 0:t.flush(e)]})})},e.prototype.shutdown=function(){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 i(this,void 0,void 0,function(){var n,s;return a(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 bC})];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}(),br=function(e){return function(){var t=e.config||ne();return{logger:t.loggerProvider,logLevel:t.logLevel}}},Sr=function(){var e=new wr;return{init:L(e.init.bind(e),"init",br(e)),evaluateTargetingAndCapture:L(e.evaluateTargetingAndCapture.bind(e),"evaluateTargetingAndRecord",br(e)),setSessionId:L(e.setSessionId.bind(e),"setSessionId",br(e)),getSessionId:L(e.getSessionId.bind(e),"getSessionId",br(e)),getSessionReplayProperties:L(e.getSessionReplayProperties.bind(e),"getSessionReplayProperties",br(e)),flush:L(e.flush.bind(e),"flush",br(e)),shutdown:L(e.shutdown.bind(e),"shutdown",br(e))}}(),Cr=Sr.init,Ir=Sr.setSessionId,xr=Sr.getSessionId,kr=Sr.getSessionReplayProperties,Or=Sr.flush,Er=Sr.shutdown,Rr=Sr.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"}(gr||(gr={})),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"}(yr||(yr={})),function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"}(vr||(vr={}));const Ar=[gr.SET,gr.SET_ONCE,gr.ADD,gr.APPEND,gr.PREPEND,gr.POSTINSERT],Mr="1.22.26-perfrecord-init-prelease.0";class Pr{constructor(e){this.name=Pr.pluginName,this.type="enrichment",this.sessionReplay={flush:Or,getSessionId:xr,getSessionReplayProperties:kr,init:Cr,setSessionId:Ir,shutdown:Er,evaluateTargetingAndCapture:Rr},this.options=Object.assign({forceSessionTracking:!1},e),this.srInitOptions=this.options}setup(e,t){var r,n,s,o,a;return i(this,void 0,void 0,function*(){try{null==e||e.loggerProvider.log(`Installing @amplitude/plugin-session-replay, version ${Mr}.`),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 i=(t=this.config.instanceName,void 0===t&&(t="$default_instance"),D.getInstance(t)).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,trackServerUrl:this.options.trackServerUrl,sampleRate:this.options.sampleRate,privacyConfig:{blockSelector:null===(n=this.options.privacyConfig)||void 0===n?void 0:n.blockSelector,maskSelector:null===(s=this.options.privacyConfig)||void 0===s?void 0:s.maskSelector,unmaskSelector:null===(o=this.options.privacyConfig)||void 0===o?void 0:o.unmaskSelector,defaultMaskLevel:null===(a=this.options.privacyConfig)||void 0===a?void 0:a.defaultMaskLevel},debugMode:this.options.debugMode,shouldInlineStylesheet:this.options.shouldInlineStylesheet,version:{type:"plugin",version:Mr},performanceConfig:this.options.performanceConfig,storeType:this.options.storeType,experimental:this.options.experimental,userProperties:i,omitElementTags:this.options.omitElementTags,applyBackgroundColorToBlockedElements:this.options.applyBackgroundColorToBlockedElements,interactionConfig:this.options.interactionConfig,captureDocumentTitle:this.options.captureDocumentTitle,enableUrlChangePolling:this.options.enableUrlChangePolling,urlChangePollingInterval:this.options.urlChangePollingInterval},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){return i(this,void 0,void 0,function*(){this.config.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){return i(this,void 0,void 0,function*(){this.config.loggerProvider.debug(`optOut is changed to ${String(e)}, calling ${e?"sessionReplay.shutdown()":"sessionReplay.init()"}.`),e?this.sessionReplay.shutdown():yield this.sessionReplay.init(this.config.apiKey,this.srInitOptions).promise})}execute(e){var t;return i(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 t=this.config.sessionId;if(t&&t!==this.sessionReplay.getSessionId()&&(yield this.sessionReplay.setSessionId(t).promise),t&&t===e.session_id){let t;e.event_type===s.IDENTIFY&&(t=(e=>{if(!e.user_properties)return;let t={};return Object.keys(e.user_properties).forEach(r=>{if(Ar.includes(r)){const n=e.user_properties&&e.user_properties[r];t=Object.assign(Object.assign({},t),n)}}),t})(e)),yield this.sessionReplay.evaluateTargetingAndCapture({event:e,userProperties:t});const r=this.sessionReplay.getSessionReplayProperties();e.event_properties=Object.assign(Object.assign({},e.event_properties),r)}}return Promise.resolve(e)}catch(r){return null===(t=this.config)||void 0===t||t.loggerProvider.error(`Session Replay: Failed to enrich event due to ${r.message}`),Promise.resolve(e)}})}teardown(){var e;return i(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()}}Pr.pluginName="@amplitude/plugin-session-replay-browser";const Nr=e=>new Pr(e);var Tr=function(e,t){return Tr=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])},Tr(e,t)};var Dr=function(){return Dr=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},Dr.apply(this,arguments)};function Lr(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 _r="is",Fr="is not",Br="contains",Ur="does not contain",jr="less",zr="less or equal",Wr="greater",Vr="greater or equal",Gr="version less",Zr="version less or equal",Yr="version greater",Kr="version greater or equal",Jr="set is",qr="set is not",$r="set contains",Xr="set does not contain",Hr="set contains any",Qr="set does not contain any",en="regex match",tn="regex does not match",rn=-862048943,nn=461845907,sn=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=cn(r,i<<2);o=on(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,rn),c=ln(c,15),o^=c=Math.imul(c,nn);break;case 2:c^=r[l+1]<<8,c^=r[l],c=Math.imul(c,rn),c=ln(c,15),o^=c=Math.imul(c,nn);break;case 1:c^=r[l],c=Math.imul(c,rn),c=ln(c,15),o^=c=Math.imul(c,nn)}return an(o^=n)>>>0},on=function(e,t){var r=e,n=t;return r=Math.imul(r,rn),r=ln(r,15),r=Math.imul(r,nn),n=ln(n^=r,13),(n=Math.imul(n,5))+-430675100|0},an=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},ln=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},cn=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 un(r)},un=function(e){return(-16777216&e)>>>24|(16711680&e)>>>8|(65280&e)<<8|(255&e)<<24},hn=function(e,t){var r,n;if(t&&0!==t.length){try{for(var s=Lr(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}},dn="^".concat("(\\d+)\\.(\\d+)","(\\.").concat("(\\d+)").concat("(-(([-\\w]+\\.?)*))?",")?$"),pn=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(dn).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}(),fn=function(){function e(){}return e.prototype.evaluate=function(e,t){var r,n,s={},o={context:e,result:s};try{for(var i=Lr(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=Lr(t.segments),i=o.next();!i.done;i=o.next()){var a=i.value;if(s=this.evaluateSegment(e,t,a)){var l=Dr(Dr(Dr({},t.metadata),a.metadata),s.metadata);s=Dr(Dr({},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=Lr(r.conditions),l=a.next();!l.done;l=a.next()){var c,u=l.value,h=!0;try{for(var d=(o=void 0,Lr(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=hn(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 sn(e)},e.prototype.bucket=function(e,t){var r,n,s,o;if(!t.bucket)return t.variant;var i=this.coerceString(hn(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=Lr(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,Lr(p.distributions)),y=g.next();!y.done;y=g.next()){var v=y.value,w=v.range[0],b=v.range[1];if(u>=w&&u<b)return v.variant}}catch(e){s={error:e}}finally{try{y&&!y.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 _r:case Br:case jr:case zr:case Wr:case Vr:case Gr:case Zr:case Yr:case Kr:case Jr:case $r:case Hr:return r;case Fr:case Ur:case Xr:case Qr:return!r;default:return!1}},e.prototype.matchSet=function(e,t,r){switch(t){case Jr:return this.setEquals(e,r);case qr:return!this.setEquals(e,r);case $r:return this.matchesSetContainsAll(e,r);case Xr:return!this.matchesSetContainsAll(e,r);case Hr:return this.matchesSetContainsAny(e,r);case Qr:return!this.matchesSetContainsAny(e,r);default:return!1}},e.prototype.matchString=function(e,t,r){var n=this;switch(t){case _r:return this.matchesIs(e,r);case Fr:return!this.matchesIs(e,r);case Br:return this.matchesContains(e,r);case Ur:return!this.matchesContains(e,r);case jr:case zr:case Wr:case Vr:return this.matchesComparable(e,t,r,function(e){return n.parseNumber(e)},this.comparator);case Gr:case Zr:case Yr:case Kr:return this.matchesComparable(e,t,r,function(e){return pn.parse(e)},this.versionComparator);case en:return this.matchesRegex(e,r);case tn: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=Lr(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 jr:case Gr:return e<r;case zr:case Zr:return e<=r;case Wr:case Yr:return e>r;case Vr:case Kr:return e>=r;default:return!1}},e.prototype.versionComparator=function(e,t,r){var n=e.compareTo(r);switch(t){case jr:case Gr:return n<0;case zr:case Zr:return n<=0;case Wr:case Yr:return n>0;case Vr:case Kr: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 Jr:case qr:case $r:case Xr:case Hr:case Qr: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=Lr(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=Lr(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}Tr(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})(t,e)}(Error);var mn,gn=function(){var e=this;this.dbs={},this.createStore=function(t){return i(e,void 0,void 0,function(){return a(this,function(e){switch(e.label){case 0:return[4,ct(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 i(e,void 0,void 0,function(){var e,r;return a(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,l=t.loggerProvider,c=t.tx;return i(e,void 0,void 0,function(){var e,t,i,u,h,d,p,f,m;return a(this,function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),e=String(r),[4,c.store.get(e)];case 1:return t=a.sent(),i=t?t.eventTypes:{},u=i[n]||{},h=o(o({},i),((f={})[n]=o(o({},u),((m={})[s]={event_type:n},m)),f)),d={sessionId:e,eventTypes:h,lastUpdated:Date.now()},[4,c.store.put(d)];case 2:return a.sent(),[2,h];case 3:return p=a.sent(),l.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 i(e,void 0,void 0,function(){var e,t,o,i,l,c;return a(this,function(a){switch(a.label){case 0:return a.trys.push([0,6,,7]),e=String(r),[4,s.store.getAll()];case 1:t=a.sent(),o=0,a.label=2;case 2:return o<t.length?(i=t[o],l=Date.now()-i.lastUpdated,i.sessionId!==e&&l>1728e5?[4,s.store.delete(i.sessionId)]:[3,4]):[3,5];case 3:a.sent(),a.label=4;case 4:return o++,[3,2];case 5:return[3,7];case 6:return c=a.sent(),n.warn("Failed to clear old session event types for targeting: ".concat(c)),[3,7];case 7:return[2]}})})},this.storeEventTypeForSession=function(t){var r=t.loggerProvider,n=t.sessionId,s=t.eventType,o=t.eventTime,l=t.apiKey;return i(e,void 0,void 0,function(){var e,t,i,c;return a(this,function(a){switch(a.label){case 0:return a.trys.push([0,5,,6]),[4,this.openOrCreateDB(l)];case 1:return e=a.sent(),(t=e.transaction("eventTypesForSession","readwrite"))?[4,this.updateEventListForSession({sessionId:n,tx:t,loggerProvider:r,eventType:s,eventTime:o})]:[2];case 2:return i=a.sent(),[4,this.deleteOldSessionEventTypes({currentSessionId:n,tx:t,loggerProvider:r})];case 3:return a.sent(),[4,t.done];case 4:return a.sent(),[2,i];case 5:return c=a.sent(),r.warn("Failed to store events for targeting ".concat(n,": ").concat(c)),[3,6];case 6:return[2,void 0]}})})}},yn=new gn,vn=function(){var e=this;this.evaluateTargeting=function(t){var r=t.apiKey,n=t.loggerProvider,s=t.event,o=t.sessionId,l=t.userProperties,c=t.deviceId,u=t.flag;return i(e,void 0,void 0,function(){var e,t,i,h;return a(this,function(a){switch(a.label){case 0:return s&&s.time?[4,yn.storeEventTypeForSession({loggerProvider:n,apiKey:r,sessionId:o,eventType:s.event_type,eventTime:s.time})]:[3,2];case 1:return t=a.sent(),[3,3];case 2:t=void 0,a.label=3;case 3:return i=(e=t)&&new Set(Object.keys(e)),h={session_id:o,event:s,event_types:i&&Array.from(i),user:{device_id:c,user_properties:l}},[2,this.evaluationEngine.evaluate(h,[u])]}})})},this.evaluationEngine=new fn},wn=function(){var e=new vn;return{evaluateTargeting:e.evaluateTargeting.bind(e)}}().evaluateTargeting,bn=Object.freeze({__proto__:null,evaluateTargeting:wn}),Sn=Object.freeze({__proto__:null,compressionScript:'var WebWorker=function(r){"use strict";var n=Uint8Array,e=Uint16Array,f=Uint32Array,t=new n([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),a=new n([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),o=new n([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),i=function(r,n){for(var t=new e(31),a=0;a<31;++a)t[a]=n+=1<<r[a-1];var o=new f(t[30]);for(a=1;a<30;++a)for(var i=t[a];i<t[a+1];++i)o[i]=i-t[a]<<5|a;return[t,o]},v=i(t,2),u=v[0],s=v[1];u[28]=258,s[258]=28;for(var l=i(a,0)[1],c=new e(32768),h=0;h<32768;++h){var g=(43690&h)>>>1|(21845&h)<<1;g=(61680&(g=(52428&g)>>>2|(13107&g)<<2))>>>4|(3855&g)<<4,c[h]=((65280&g)>>>8|(255&g)<<8)>>>1}var w=function(r,n,f){for(var t=r.length,a=0,o=new e(n);a<t;++a)++o[r[a]-1];var i,v=new e(n);for(a=0;a<n;++a)v[a]=v[a-1]+o[a-1]<<1;if(f){i=new e(1<<n);var u=15-n;for(a=0;a<t;++a)if(r[a])for(var s=a<<4|r[a],l=n-r[a],h=v[r[a]-1]++<<l,g=h|(1<<l)-1;h<=g;++h)i[c[h]>>>u]=s}else for(i=new e(t),a=0;a<t;++a)i[a]=c[v[r[a]-1]++]>>>15-r[a];return i},d=new n(288);for(h=0;h<144;++h)d[h]=8;for(h=144;h<256;++h)d[h]=9;for(h=256;h<280;++h)d[h]=7;for(h=280;h<288;++h)d[h]=8;var m=new n(32);for(h=0;h<32;++h)m[h]=5;var y=w(d,9,0),M=w(m,5,0),p=function(r){return(r/8|0)+(7&r&&1)},b=function(r,t,a){(null==a||a>r.length)&&(a=r.length);var o=new(r instanceof e?e:r instanceof f?f:n)(a-t);return o.set(r.subarray(t,a)),o},C=function(r,n,e){e<<=7&n;var f=n/8|0;r[f]|=e,r[f+1]|=e>>>8},S=function(r,n,e){e<<=7&n;var f=n/8|0;r[f]|=e,r[f+1]|=e>>>8,r[f+2]|=e>>>16},x=function(r,f){for(var t=[],a=0;a<r.length;++a)r[a]&&t.push({s:a,f:r[a]});var o=t.length,i=t.slice();if(!o)return[new n(0),0];if(1==o){var v=new n(t[0].s+1);return v[t[0].s]=1,[v,1]}t.sort(function(r,n){return r.f-n.f}),t.push({s:-1,f:25001});var u=t[0],s=t[1],l=0,c=1,h=2;for(t[0]={s:-1,f:u.f+s.f,l:u,r:s};c!=o-1;)u=t[t[l].f<t[h].f?l++:h++],s=t[l!=c&&t[l].f<t[h].f?l++:h++],t[c++]={s:-1,f:u.f+s.f,l:u,r:s};var g=i[0].s;for(a=1;a<o;++a)i[a].s>g&&(g=i[a].s);var w=new e(g+1),d=A(t[c-1],w,0);if(d>f){a=0;var m=0,y=d-f,M=1<<y;for(i.sort(function(r,n){return w[n.s]-w[r.s]||r.f-n.f});a<o;++a){var p=i[a].s;if(!(w[p]>f))break;m+=M-(1<<d-w[p]),w[p]=f}for(m>>>=y;m>0;){var b=i[a].s;w[b]<f?m-=1<<f-w[b]++-1:++a}for(;a>=0&&m;--a){var C=i[a].s;w[C]==f&&(--w[C],++m)}d=f}return[new n(w),d]},A=function(r,n,e){return-1==r.s?Math.max(A(r.l,n,e+1),A(r.r,n,e+1)):n[r.s]=e},O=function(r){for(var n=r.length;n&&!r[--n];);for(var f=new e(++n),t=0,a=r[0],o=1,i=function(r){f[t++]=r},v=1;v<=n;++v)if(r[v]==a&&v!=n)++o;else{if(!a&&o>2){for(;o>138;o-=138)i(32754);o>2&&(i(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(i(a),--o;o>6;o-=6)i(8304);o>2&&(i(o-3<<5|8208),o=0)}for(;o--;)i(a);o=1,a=r[v]}return[f.subarray(0,t),n]},T=function(r,n){for(var e=0,f=0;f<n.length;++f)e+=r[f]*n[f];return e},k=function(r,n,e){var f=e.length,t=p(n+2);r[t]=255&f,r[t+1]=f>>>8,r[t+2]=255^r[t],r[t+3]=255^r[t+1];for(var a=0;a<f;++a)r[t+a+4]=e[a];return 8*(t+4+f)},E=function(r,n,f,i,v,u,s,l,c,h,g){C(n,g++,f),++v[256];for(var p=x(v,15),b=p[0],A=p[1],E=x(u,15),J=E[0],N=E[1],U=O(b),D=U[0],I=U[1],W=O(J),_=W[0],j=W[1],P=new e(19),q=0;q<D.length;++q)P[31&D[q]]++;for(q=0;q<_.length;++q)P[31&_[q]]++;for(var z=x(P,7),B=z[0],F=z[1],G=19;G>4&&!B[o[G-1]];--G);var H,K,L,Q,R=h+5<<3,V=T(v,d)+T(u,m)+s,X=T(v,b)+T(u,J)+s+14+3*G+T(P,B)+(2*P[16]+3*P[17]+7*P[18]);if(R<=V&&R<=X)return k(n,g,r.subarray(c,c+h));if(C(n,g,1+(X<V)),g+=2,X<V){H=w(b,A,0),K=b,L=w(J,N,0),Q=J;var Y=w(B,F,0);C(n,g,I-257),C(n,g+5,j-1),C(n,g+10,G-4),g+=14;for(q=0;q<G;++q)C(n,g+3*q,B[o[q]]);g+=3*G;for(var Z=[D,_],$=0;$<2;++$){var rr=Z[$];for(q=0;q<rr.length;++q){var nr=31&rr[q];C(n,g,Y[nr]),g+=B[nr],nr>15&&(C(n,g,rr[q]>>>5&127),g+=rr[q]>>>12)}}}else H=y,K=d,L=M,Q=m;for(q=0;q<l;++q)if(i[q]>255){nr=i[q]>>>18&31;S(n,g,H[nr+257]),g+=K[nr+257],nr>7&&(C(n,g,i[q]>>>23&31),g+=t[nr]);var er=31&i[q];S(n,g,L[er]),g+=Q[er],er>3&&(S(n,g,i[q]>>>5&8191),g+=a[er])}else S(n,g,H[i[q]]),g+=K[i[q]];return S(n,g,H[256]),g+K[256]},J=new f([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),N=function(r,o,i,v,u){return function(r,o,i,v,u,c){var h=r.length,g=new n(v+h+5*(1+Math.floor(h/7e3))+u),w=g.subarray(v,g.length-u),d=0;if(!o||h<8)for(var m=0;m<=h;m+=65535){var y=m+65535;y<h?d=k(w,d,r.subarray(m,y)):(w[m]=c,d=k(w,d,r.subarray(m,h)))}else{for(var M=J[o-1],C=M>>>13,S=8191&M,x=(1<<i)-1,A=new e(32768),O=new e(x+1),T=Math.ceil(i/3),N=2*T,U=function(n){return(r[n]^r[n+1]<<T^r[n+2]<<N)&x},D=new f(25e3),I=new e(288),W=new e(32),_=0,j=0,P=(m=0,0),q=0,z=0;m<h;++m){var B=U(m),F=32767&m,G=O[B];if(A[F]=G,O[B]=F,q<=m){var H=h-m;if((_>7e3||P>24576)&&H>423){d=E(r,w,0,D,I,W,j,P,z,m-z,d),P=_=j=0,z=m;for(var K=0;K<286;++K)I[K]=0;for(K=0;K<30;++K)W[K]=0}var L=2,Q=0,R=S,V=F-G&32767;if(H>2&&B==U(m-V))for(var X=Math.min(C,H)-1,Y=Math.min(32767,m),Z=Math.min(258,H);V<=Y&&--R&&F!=G;){if(r[m+L]==r[m+L-V]){for(var $=0;$<Z&&r[m+$]==r[m+$-V];++$);if($>L){if(L=$,Q=V,$>X)break;var rr=Math.min(V,$-2),nr=0;for(K=0;K<rr;++K){var er=m-V+K+32768&32767,fr=er-A[er]+32768&32767;fr>nr&&(nr=fr,G=er)}}}V+=(F=G)-(G=A[F])+32768&32767}if(Q){D[P++]=268435456|s[L]<<18|l[Q];var tr=31&s[L],ar=31&l[Q];j+=t[tr]+a[ar],++I[257+tr],++W[ar],q=m+L,++_}else D[P++]=r[m],++I[r[m]]}}d=E(r,w,c,D,I,W,j,P,z,m-z,d)}return b(g,0,v+p(d)+u)}(r,null==o.level?6:o.level,null==o.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(r.length)))):12+o.mem,i,v,!u)};function U(r,n){void 0===n&&(n={});var e=function(){var r=1,n=0;return{p:function(e){for(var f=r,t=n,a=e.length,o=0;o!=a;){for(var i=Math.min(o+5552,a);o<i;++o)t+=f+=e[o];f%=65521,t%=65521}r=f,n=t},d:function(){return(r>>>8<<16|(255&n)<<8|n>>>8)+2*((255&r)<<23)}}}();e.p(r);var f,t,a,o=N(r,n,2,4);return f=o,t=n.level,a=0==t?0:t<6?1:9==t?3:2,f[0]=120,f[1]=a<<6|(a?32-2*a:1),function(r,n,e){for(;e;++n)r[n]=e,e>>>=8}(o,o.length-4,e.d()),o}const D=r=>{const e={...r,v:"v1"};return function(r,n){var e="";if(!n&&"undefined"!=typeof TextDecoder)return(new TextDecoder).decode(r);for(var f=0;f<r.length;){var t=r[f++];t<128||n?e+=String.fromCharCode(t):t<224?e+=String.fromCharCode((31&t)<<6|63&r[f++]):t<240?e+=String.fromCharCode((15&t)<<12|(63&r[f++])<<6|63&r[f++]):(t=((15&t)<<18|(63&r[f++])<<12|(63&r[f++])<<6|63&r[f++])-65536,e+=String.fromCharCode(55296|t>>10,56320|1023&t))}return e}(U(function(r,e){var f=r.length;if(!e&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(r);for(var t=new n(r.length+(r.length>>>1)),a=0,o=function(r){t[a++]=r},i=0;i<f;++i){if(a+5>t.length){var v=new n(a+8+(f-i<<1));v.set(t),t=v}var u=r.charCodeAt(i);u<128||e?o(u):u<2048?(o(192|u>>>6),o(128|63&u)):u>55295&&u<57344?(o(240|(u=65536+(1047552&u)|1023&r.charCodeAt(++i))>>>18),o(128|u>>>12&63),o(128|u>>>6&63),o(128|63&u)):(o(224|u>>>12),o(128|u>>>6&63),o(128|63&u))}return b(t,0,a)}(JSON.stringify(e))),!0)};onmessage=r=>{const{event:n,sessionId:e}="string"==typeof r.data?JSON.parse(r.data):r.data,f=JSON.stringify(D(n));postMessage({compressedEvent:f,sessionId:e})};const I=onmessage;return r.compressionOnMessage=I,Object.defineProperty(r,"__esModule",{value:!0}),r}({});\n'}),Cn=Object.defineProperty,In=(e,t,r)=>((e,t,r)=>t in e?Cn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),xn=Object.defineProperty,kn=(e,t,r)=>((e,t,r)=>t in e?xn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),On=Object.defineProperty,En=(e,t,r)=>((e,t,r)=>t in e?On(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);const Rn={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},An={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Mn={};function Pn(e){if(Mn[e])return Mn[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 Rn?Rn[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 An?An[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 Mn[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?Mn[e]=o:r}catch{return r}}const Nn={};function Tn(e,t,r){var n;const s=`${e}.${String(r)}`;if(Nn[s])return Nn[s].call(t);const o=Pn(e),i=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return i?(Nn[s]=i,i.call(t)):t[r]}const Dn={};function Ln(e,t,r){const n=`${e}.${String(r)}`;if(Dn[n])return Dn[n].bind(t);const s=Pn(e)[r];return"function"!=typeof s?t[r]:(Dn[n]=s,s.bind(t))}const _n={childNodes:function(e){return Tn("Node",e,"childNodes")},parentNode:function(e){return Tn("Node",e,"parentNode")},parentElement:function(e){return Tn("Node",e,"parentElement")},textContent:function(e){return Tn("Node",e,"textContent")},contains:function(e,t){return Ln("Node",e,"contains")(t)},getRootNode:function(e){return Ln("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Tn("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Tn("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Tn("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Tn("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return Pn("MutationObserver").constructor}};class Fn{constructor(){En(this,"idNodeMap",new Map),En(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 Bn(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&Bn(_n.parentNode(e),t,r);for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!!r&&Bn(_n.parentNode(e),t,r)}function Un(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function jn(e){if(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 zn={exports:{}},Wn=String,Vn=function(){return{isColorSupported:!1,reset:Wn,bold:Wn,dim:Wn,italic:Wn,underline:Wn,inverse:Wn,hidden:Wn,strikethrough:Wn,black:Wn,red:Wn,green:Wn,yellow:Wn,blue:Wn,magenta:Wn,cyan:Wn,white:Wn,gray:Wn,bgBlack:Wn,bgRed:Wn,bgGreen:Wn,bgYellow:Wn,bgBlue:Wn,bgMagenta:Wn,bgCyan:Wn,bgWhite:Wn}};zn.exports=Vn(),zn.exports.createColors=Vn;var Gn=zn.exports;const Zn=jn(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let Yn=Gn,Kn=Zn,Jn=class e extends Error{constructor(t,r,n,s,o,i){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),s&&(this.source=s),i&&(this.plugin=i),void 0!==r&&void 0!==n&&("number"==typeof r?(this.line=r,this.column=n):(this.line=r.line,this.column=r.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}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(e){if(!this.source)return"";let t=this.source;null==e&&(e=Yn.isColorSupported),Kn&&e&&(t=Kn(t));let r,n,s=t.split(/\r?\n/),o=Math.max(this.line-3,0),i=Math.min(this.line+2,s.length),a=String(i).length;if(e){let{bold:e,gray:t,red:s}=Yn.createColors(!0);r=t=>e(s(t)),n=e=>t(e)}else r=n=e=>e;return s.slice(o,i).map((e,t)=>{let s=o+1+t,i=" "+(" "+s).slice(-a)+" | ";if(s===this.line){let t=n(i.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return r(">")+n(i)+e+"\n "+t+r("^")}return" "+n(i)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};var qn=Jn;Jn.default=Jn;var $n={};$n.isClean=Symbol("isClean"),$n.my=Symbol("my");const Xn={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let Hn=class{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(e,t,r){let n;if(r||(r=t),t&&(n=e.raws[t],void 0!==n))return n;let s=e.parent;if("before"===r){if(!s||"root"===s.type&&s.first===e)return"";if(s&&"document"===s.type)return""}if(!s)return Xn[r];let o=e.root();if(o.rawCache||(o.rawCache={}),void 0!==o.rawCache[r])return o.rawCache[r];if("before"===r||"after"===r)return this.beforeAfter(e,r);{let s="raw"+((i=r)[0].toUpperCase()+i.slice(1));this[s]?n=this[s](o,e):o.walk(e=>{if(n=e.raws[t],void 0!==n)return!1})}var i;return void 0===n&&(n=Xn[r]),o.rawCache[r]=n,n}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)}};var Qn=Hn;Hn.default=Hn;let es=Qn;function ts(e,t){new es(t).stringify(e)}var rs=ts;ts.default=ts;let{isClean:ns,my:ss}=$n,os=qn,is=Qn,as=rs;function ls(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=>ls(e,r)):("object"===o&&null!==s&&(s=ls(s)),r[n]=s)}return r}let cs=class{constructor(e={}){this.raws={},this[ns]=!1,this[ss]=!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=ls(this);for(let r in e)t[r]=e[r];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:r,start:n}=this.rangeBy(t);return this.source.input.error(e,{column:n.column,line:n.line},{column:r.column,line:r.line},t)}return new os(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markDirty(){if(this[ns]){this[ns]=!1;let e=this;for(;e=e.parent;)e[ns]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){let n=(t=this.toString()).indexOf(e.word);-1!==n&&(r=this.positionInside(n,t))}return r}positionInside(e,t){let r=t||this.toString(),n=this.source.start.column,s=this.source.start.line;for(let t=0;t<e;t++)"\n"===r[t]?(n=1,s+=1):n+=1;return{column:n,line:s}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let n=this.toString(),s=n.indexOf(e.word);-1!==s&&(t=this.positionInside(s,n),r=this.positionInside(s+e.word.length,n))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return(new is).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let n of e)n===this?r=!0:r?(this.parent.insertAfter(t,n),t=n):this.parent.insertBefore(t,n);r||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let r={},n=null==t;t=t||new Map;let 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){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=as){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){let n={node:this};for(let e in r)n[e]=r[e];return e.warn(t,n)}get proxyOf(){return this}};var us=cs;cs.default=cs;let hs=us,ds=class extends hs{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}};var ps=ds;ds.default=ds;var fs={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(r=t)=>{let n="",s=r;for(;s--;)n+=e[Math.random()*e.length|0];return n}};let{SourceMapConsumer:ms,SourceMapGenerator:gs}=Zn,{existsSync:ys,readFileSync:vs}=Zn,{dirname:ws,join:bs}=Zn;let Ss=class{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,n=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=ws(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new ms(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t;let r=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+r)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let r=e.lastIndexOf(t.pop()),n=e.indexOf("*/",r);r>-1&&n>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,n)))}loadFile(e){if(this.root=ws(e),ys(e))return this.mapFile=e,vs(e,"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 ms)return gs.fromSourceMap(t).toString();if(t instanceof gs)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=bs(ws(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)}};var Cs=Ss;Ss.default=Ss;let{SourceMapConsumer:Is,SourceMapGenerator:xs}=Zn,{fileURLToPath:ks,pathToFileURL:Os}=Zn,{isAbsolute:Es,resolve:Rs}=Zn,{nanoid:As}=fs,Ms=Zn,Ps=qn,Ns=Cs,Ts=Symbol("fromOffsetCache"),Ds=Boolean(Is&&xs),Ls=Boolean(Rs&&Es),_s=class{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!Ls||/^\w+:\/\//.test(t.from)||Es(t.from)?this.file=t.from:this.file=Rs(t.from)),Ls&&Ds){let e=new Ns(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+As(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let s,o,i;if(t&&"object"==typeof t){let e=t,n=r;if("number"==typeof e.offset){let n=this.fromOffset(e.offset);t=n.line,r=n.col}else t=e.line,r=e.column;if("number"==typeof n.offset){let e=this.fromOffset(n.offset);o=e.line,i=e.col}else o=n.line,i=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let a=this.origin(t,r,o,i);return s=a?new Ps(e,void 0===a.endLine?a.line:{column:a.column,line:a.line},void 0===a.endLine?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,n.plugin):new Ps(e,void 0===o?t:{column:r,line:t},void 0===o?r:{column:i,line:o},this.css,this.file,n.plugin),s.input={column:r,endColumn:i,endLine:o,line:t,source:this.css},this.file&&(Os&&(s.input.url=Os(this.file).toString()),s.input.file=this.file),s}fromOffset(e){let t,r;if(this[Ts])r=this[Ts];else{let e=this.css.split("\n");r=new Array(e.length);let t=0;for(let n=0,s=e.length;n<s;n++)r[n]=t,t+=e[n].length+1;this[Ts]=r}t=r[r.length-1];let n=0;if(e>=t)n=r.length-1;else{let t,s=r.length-2;for(;n<s;)if(t=n+(s-n>>1),e<r[t])s=t-1;else{if(!(e>=r[t+1])){n=t;break}n=t+1}}return{col:e-r[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:Rs(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,n){if(!this.map)return!1;let s,o,i=this.map.consumer(),a=i.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof r&&(s=i.originalPositionFor({column:n,line:r})),o=Es(a.source)?Os(a.source):new URL(a.source,this.map.consumer().sourceRoot||Os(this.map.mapFile));let l={column:a.column,endColumn:s&&s.column,endLine:s&&s.line,line:a.line,url:o.toString()};if("file:"===o.protocol){if(!ks)throw new Error("file: protocol is not available in this PostCSS build");l.file=ks(o)}let c=i.sourceContentFor(a.source);return c&&(l.source=c),l}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}};var Fs=_s;_s.default=_s,Ms&&Ms.registerInput&&Ms.registerInput(_s);let{SourceMapConsumer:Bs,SourceMapGenerator:Us}=Zn,{dirname:js,relative:zs,resolve:Ws,sep:Vs}=Zn,{pathToFileURL:Gs}=Zn,Zs=Fs,Ys=Boolean(Bs&&Us),Ks=Boolean(js&&Ws&&zs&&Vs);var Js=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 e of this.previous()){let t,r=this.toUrl(this.path(e.file)),n=e.root||js(e.file);!1===this.mapOpts.sourcesContent?(t=new Bs(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,r,this.toUrl(this.path(n)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),Ks&&Ys&&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=Us.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new Us({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 Us({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))),e=i.match(/\n/g),e?(r+=e.length,t=i.lastIndexOf("\n"),n=i.length-t):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(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?js(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=js(Ws(r,this.mapOpts.annotation)));let n=zs(r,e);return this.memoizedPaths.set(e,n),n}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 Zs(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(Gs){let t=Gs(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;"\\"===Vs&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let qs=us,$s=class extends qs{constructor(e){super(e),this.type="comment"}};var Xs=$s;$s.default=$s;let Hs,Qs,eo,to,{isClean:ro,my:no}=$n,so=ps,oo=Xs,io=us;function ao(e){return e.map(e=>(e.nodes&&(e.nodes=ao(e.nodes)),delete e.source,e))}function lo(e){if(e[ro]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)lo(t)}let co=class e extends io{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(t,r){if("string"==typeof t)t=ao(Hs(t).nodes);else if(void 0===t)t=[];else if(Array.isArray(t)){t=t.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===t.type&&"document"!==this.type){t=t.nodes.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if(t.type)t=[t];else if(t.prop){if(void 0===t.value)throw new Error("Value field is missed in node creation");"string"!=typeof t.value&&(t.value=String(t.value)),t=[new so(t)]}else if(t.selector)t=[new Qs(t)];else if(t.name)t=[new eo(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new oo(t)]}return t.map(t=>(t[no]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[ro]&&lo(t),void 0===t.raws.before&&r&&void 0!==r.raws.before&&(t.raws.before=r.raws.before.replace(/\S/g,"")),t.parent=this.proxyOf,t))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls(n=>{t.props&&!t.props.includes(n.prop)||t.fast&&!n.value.includes(t.fast)||(n.value=n.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,r)=>{let n;try{n=e(t,r)}catch(e){throw t.addToError(e)}return!1!==n&&t.walk&&(n=t.walk(e)),n})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("atrule"===r.type&&e.test(r.name))return t(r,n)}):this.walk((r,n)=>{if("atrule"===r.type&&r.name===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("atrule"===e.type)return t(e,r)}))}walkComments(e){return this.walk((t,r)=>{if("comment"===t.type)return e(t,r)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("decl"===r.type&&e.test(r.prop))return t(r,n)}):this.walk((r,n)=>{if("decl"===r.type&&r.prop===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("decl"===e.type)return t(e,r)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("rule"===r.type&&e.test(r.selector))return t(r,n)}):this.walk((r,n)=>{if("rule"===r.type&&r.selector===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("rule"===e.type)return t(e,r)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};co.registerParse=e=>{Hs=e},co.registerRule=e=>{Qs=e},co.registerAtRule=e=>{eo=e},co.registerRoot=e=>{to=e};var uo=co;co.default=co,co.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,eo.prototype):"rule"===e.type?Object.setPrototypeOf(e,Qs.prototype):"decl"===e.type?Object.setPrototypeOf(e,so.prototype):"comment"===e.type?Object.setPrototypeOf(e,oo.prototype):"root"===e.type&&Object.setPrototypeOf(e,to.prototype),e[no]=!0,e.nodes&&e.nodes.forEach(e=>{co.rebuild(e)})};let ho,po,fo=uo,mo=class extends fo{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new ho(new po,this,e).stringify()}};mo.registerLazyResult=e=>{ho=e},mo.registerProcessor=e=>{po=e};var go=mo;mo.default=mo;let yo={};var vo=function(e){yo[e]||(yo[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let wo=class{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}};var bo=wo;wo.default=wo;let So=bo,Co=class{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let r=new So(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};var Io=Co;Co.default=Co;const xo="'".charCodeAt(0),ko='"'.charCodeAt(0),Oo="\\".charCodeAt(0),Eo="/".charCodeAt(0),Ro="\n".charCodeAt(0),Ao=" ".charCodeAt(0),Mo="\f".charCodeAt(0),Po="\t".charCodeAt(0),No="\r".charCodeAt(0),To="[".charCodeAt(0),Do="]".charCodeAt(0),Lo="(".charCodeAt(0),_o=")".charCodeAt(0),Fo="{".charCodeAt(0),Bo="}".charCodeAt(0),Uo=";".charCodeAt(0),jo="*".charCodeAt(0),zo=":".charCodeAt(0),Wo="@".charCodeAt(0),Vo=/[\t\n\f\r "#'()/;[\\\]{}]/g,Go=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Zo=/.[\r\n"'(/\\]/,Yo=/[\da-f]/i;let Ko=uo,Jo=class extends Ko{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)}};var qo=Jo;Jo.default=Jo,Ko.registerAtRule(Jo);let $o,Xo,Ho=uo,Qo=class extends Ho{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(e={}){return new $o(new Xo,this,e).stringify()}};Qo.registerLazyResult=e=>{$o=e},Qo.registerProcessor=e=>{Xo=e};var ei=Qo;Qo.default=Qo,Ho.registerRoot(Qo);let ti={comma:e=>ti.split(e,[","],!0),space:e=>ti.split(e,[" ","\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}};var ri=ti;ti.default=ti;let ni=uo,si=ri,oi=class extends ni{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return si.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)}};var ii=oi;oi.default=oi,ni.registerRule(oi);let ai=ps,li=function(e,t={}){let r,n,s,o,i,a,l,c,u,h,d=e.css.valueOf(),p=t.ignoreErrors,f=d.length,m=0,g=[],y=[];function v(t){throw e.error("Unclosed "+t,m)}return{back:function(e){y.push(e)},endOfFile:function(){return 0===y.length&&m>=f},nextToken:function(e){if(y.length)return y.pop();if(m>=f)return;let t=!!e&&e.ignoreUnclosed;switch(r=d.charCodeAt(m),r){case Ro:case Ao:case Po:case No:case Mo:n=m;do{n+=1,r=d.charCodeAt(n)}while(r===Ao||r===Ro||r===Po||r===No||r===Mo);h=["space",d.slice(m,n)],m=n-1;break;case To:case Do:case Fo:case Bo:case zo:case Uo:case _o:{let e=String.fromCharCode(r);h=[e,e,m];break}case Lo:if(c=g.length?g.pop()[1]:"",u=d.charCodeAt(m+1),"url"===c&&u!==xo&&u!==ko&&u!==Ao&&u!==Ro&&u!==Po&&u!==Mo&&u!==No){n=m;do{if(a=!1,n=d.indexOf(")",n+1),-1===n){if(p||t){n=m;break}v("bracket")}for(l=n;d.charCodeAt(l-1)===Oo;)l-=1,a=!a}while(a);h=["brackets",d.slice(m,n+1),m,n],m=n}else n=d.indexOf(")",m+1),o=d.slice(m,n+1),-1===n||Zo.test(o)?h=["(","(",m]:(h=["brackets",o,m,n],m=n);break;case xo:case ko:s=r===xo?"'":'"',n=m;do{if(a=!1,n=d.indexOf(s,n+1),-1===n){if(p||t){n=m+1;break}v("string")}for(l=n;d.charCodeAt(l-1)===Oo;)l-=1,a=!a}while(a);h=["string",d.slice(m,n+1),m,n],m=n;break;case Wo:Vo.lastIndex=m+1,Vo.test(d),n=0===Vo.lastIndex?d.length-1:Vo.lastIndex-2,h=["at-word",d.slice(m,n+1),m,n],m=n;break;case Oo:for(n=m,i=!0;d.charCodeAt(n+1)===Oo;)n+=1,i=!i;if(r=d.charCodeAt(n+1),i&&r!==Eo&&r!==Ao&&r!==Ro&&r!==Po&&r!==No&&r!==Mo&&(n+=1,Yo.test(d.charAt(n)))){for(;Yo.test(d.charAt(n+1));)n+=1;d.charCodeAt(n+1)===Ao&&(n+=1)}h=["word",d.slice(m,n+1),m,n],m=n;break;default:r===Eo&&d.charCodeAt(m+1)===jo?(n=d.indexOf("*/",m+2)+1,0===n&&(p||t?n=d.length:v("comment")),h=["comment",d.slice(m,n+1),m,n],m=n):(Go.lastIndex=m+1,Go.test(d),n=0===Go.lastIndex?d.length-1:Go.lastIndex-2,h=["word",d.slice(m,n+1),m,n],g.push(h),m=n)}return m++,h},position:function(){return m}}},ci=Xs,ui=qo,hi=ei,di=ii;const pi={empty:!0,space:!0};var fi=class{constructor(e){this.input=e,this.root=new hi,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,r,n,s=new ui;s.name=e[1].slice(1),""===s.name&&this.unnamedAtrule(s,e),this.init(s,e[2]);let o=!1,i=!1,a=[],l=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?l.push("("===t?")":"]"):"{"===t&&l.length>0?l.push("}"):t===l[l.length-1]&&l.pop(),0===l.length){if(";"===t){s.source.end=this.getPosition(e[2]),s.source.end.offset++,this.semicolon=!0;break}if("{"===t){i=!0;break}if("}"===t){if(a.length>0){for(n=a.length-1,r=a[n];r&&"space"===r[0];)r=a[--n];r&&(s.source.end=this.getPosition(r[3]||r[2]),s.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}s.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(s.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(s,"params",a),o&&(e=a[a.length-1],s.source.end=this.getPosition(e[3]||e[2]),s.source.end.offset++,this.spaces=s.raws.between,s.raws.between="")):(s.raws.afterName="",s.params=""),i&&(s.nodes=[],this.current=s)}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(t=i,r=t[0],"("===r&&(s+=1),")"===r&&(s-=1),0===s&&":"===r){if(n){if("word"===n[0]&&"progid"===n[1])continue;return o}this.doubleColon(t)}n=t}return!1}comment(e){let t=new ci;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text="",t.raws.left=r,t.raws.right="";else{let e=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=li(this.input)}decl(e,t){let r=new ai;this.init(r,e[0][2]);let n,s=e[e.length-1];for(";"===s[0]&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(s[3]||s[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)),r.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),r.raws.before+=e.shift()[1];for(r.source.start=this.getPosition(e[0][2]),r.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;r.prop+=e.shift()[1]}for(r.raws.between="";e.length;){if(n=e.shift(),":"===n[0]){r.raws.between+=n[1];break}"word"===n[0]&&/\w/.test(n[1])&&this.unknownWord([n]),r.raws.between+=n[1]}"_"!==r.prop[0]&&"*"!==r.prop[0]||(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let o,i=[];for(;e.length&&(o=e[0][0],"space"===o||"comment"===o);)i.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(n=e[t],"!important"===n[1].toLowerCase()){r.important=!0;let n=this.stringFrom(e,t);n=this.spacesFromEnd(e)+n," !important"!==n&&(r.raws.important=n);break}if("important"===n[1].toLowerCase()){let n=e.slice(0),s="";for(let e=t;e>0;e--){let t=n[e][0];if(0===s.trim().indexOf("!")&&"space"!==t)break;s=n.pop()[1]+s}0===s.trim().indexOf("!")&&(r.important=!0,r.raws.important=s,e=n)}if("space"!==n[0]&&"comment"!==n[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(r.raws.between+=i.map(e=>e[1]).join(""),i=[]),this.raw(r,"value",i.concat(e),t),r.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 di;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,r=null,n=!1,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,i,a,l=r.length,c="",u=!0;for(let e=0;e<l;e+=1)s=r[e],o=s[0],"space"!==o||e!==l-1||n?"comment"===o?(a=r[e-1]?r[e-1][0]:"empty",i=r[e+1]?r[e+1][0]:"empty",pi[a]||pi[i]||","===c.slice(-1)?u=!1:c+=s[1]):c+=s[1]:u=!1;if(!u){let n=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:n,value:c}}e[t]=c}rule(e){e.pop();let t=new di;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let n=t;n<e.length;n++)r+=e[n][1];return e.splice(t,e.length-t),r}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}};let mi=uo,gi=fi,yi=Fs;function vi(e,t){let r=new yi(e,t),n=new gi(r);try{n.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&t&&t.from&&(/\.scss$/i.test(t.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(t.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(t.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return n.root}var wi=vi;vi.default=vi,mi.registerParse(vi);let{isClean:bi,my:Si}=$n,Ci=Js,Ii=rs,xi=uo,ki=go,Oi=vo,Ei=Io,Ri=wi,Ai=ei;const Mi={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Pi={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},Ni={Once:!0,postcssPlugin:!0,prepare:!0};function Ti(e){return"object"==typeof e&&"function"==typeof e.then}function Di(e){let t=!1,r=Mi[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 Li(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:Di(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function _i(e){return e[bi]=!1,e.nodes&&e.nodes.forEach(e=>_i(e)),e}let Fi={},Bi=class e{constructor(t,r,n){let s;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof e||r instanceof Ei)s=_i(r.root),r.map&&(void 0===n.map&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=r.map);else{let e=Ri;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{s=e(r,n)}catch(e){this.processed=!0,this.error=e}s&&!s[Si]&&xi.rebuild(s)}else s=_i(r);this.result=new Ei(t,s,n),this.helpers={...Fi,postcss:Fi,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(!Pi[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Ni[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(Ti(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[bi];){e[bi]=!0;let t=[Li(e)];for(;t.length>0;){let e=this.visitTick(t);if(Ti(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 Ti(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=Ii;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new Ci(t,this.result.root,this.result.opts).generate();return this.result.css=r[0],this.result.map=r[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(Ti(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[bi];)e[bi]=!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||Oi("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(Ti(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[bi])return n[bi]=!0,void e.push(Li(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[bi]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[bi]=!0;let t=Di(e);for(let r of t)if(0===r)e.nodes&&e.each(e=>{e[bi]||this.walkSync(e)});else{let t=this.listeners[r];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};Bi.registerPostcss=e=>{Fi=e};var Ui=Bi;Bi.default=Bi,Ai.registerLazyResult(Bi),ki.registerLazyResult(Bi);let ji=Js,zi=rs,Wi=vo,Vi=wi;const Gi=Io;let Zi=class{constructor(e,t,r){let n;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;let s=zi;this.result=new Gi(this._processor,n,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let i=new ji(s,n,this._opts,t);if(i.isMap()){let[e,t]=i.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else i.clearAnnotation(),this.result.css=i.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||Wi("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=Vi;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}};var Yi=Zi;Zi.default=Zi;let Ki=Yi,Ji=Ui,qi=go,$i=ei,Xi=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new Ji(this,e,t):new Ki(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var Hi=Xi;Xi.default=Xi,$i.registerProcessor(Xi),qi.registerProcessor(Xi);let Qi=ps,ea=Cs,ta=Xs,ra=qo,na=Fs,sa=ei,oa=ii;function ia(e,t){if(Array.isArray(e))return e.map(e=>ia(e));let{inputs:r,...n}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:na.prototype};r.map&&(r.map={...r.map,__proto__:ea.prototype}),t.push(r)}}if(n.nodes&&(n.nodes=e.nodes.map(e=>ia(e,t))),n.source){let{inputId:e,...r}=n.source;n.source=r,null!=e&&(n.source.input=t[e])}if("root"===n.type)return new sa(n);if("decl"===n.type)return new Qi(n);if("rule"===n.type)return new oa(n);if("comment"===n.type)return new ta(n);if("atrule"===n.type)return new ra(n);throw new Error("Unknown node type: "+e.type)}var aa=ia;ia.default=ia;let la=qn,ca=ps,ua=Ui,ha=uo,da=Hi,pa=rs,fa=aa,ma=go,ga=bo,ya=Xs,va=qo,wa=Io,ba=Fs,Sa=wi,Ca=ri,Ia=ii,xa=ei,ka=us;function Oa(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new da(e)}Oa.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 da).version,s}return Object.defineProperty(s,"postcss",{get:()=>(r||(r=s()),r)}),s.process=function(e,t,r){return Oa([s(r)]).process(e,t)},s},Oa.stringify=pa,Oa.parse=Sa,Oa.fromJSON=fa,Oa.list=Ca,Oa.comment=e=>new ya(e),Oa.atRule=e=>new va(e),Oa.decl=e=>new ca(e),Oa.rule=e=>new Ia(e),Oa.root=e=>new xa(e),Oa.document=e=>new ma(e),Oa.CssSyntaxError=la,Oa.Declaration=ca,Oa.Container=ha,Oa.Processor=da,Oa.Document=ma,Oa.Comment=ya,Oa.Warning=ga,Oa.AtRule=va,Oa.Result=wa,Oa.Input=ba,Oa.Rule=Ia,Oa.Root=xa,Oa.Node=ka,ua.registerPostcss(Oa);var Ea=Oa;Oa.default=Oa;const Ra=Un(Ea);Ra.stringify,Ra.fromJSON,Ra.plugin,Ra.parse,Ra.list,Ra.document,Ra.comment,Ra.atRule,Ra.rule,Ra.decl,Ra.root,Ra.CssSyntaxError,Ra.Declaration,Ra.Container,Ra.Processor,Ra.Document,Ra.Comment,Ra.Warning,Ra.AtRule,Ra.Result,Ra.Input,Ra.Rule,Ra.Root,Ra.Node;var Aa=Object.defineProperty,Ma=(e,t,r)=>((e,t,r)=>t in e?Aa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);function Pa(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Na(e){if(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 Ta={exports:{}},Da=String,La=function(){return{isColorSupported:!1,reset:Da,bold:Da,dim:Da,italic:Da,underline:Da,inverse:Da,hidden:Da,strikethrough:Da,black:Da,red:Da,green:Da,yellow:Da,blue:Da,magenta:Da,cyan:Da,white:Da,gray:Da,bgBlack:Da,bgRed:Da,bgGreen:Da,bgYellow:Da,bgBlue:Da,bgMagenta:Da,bgCyan:Da,bgWhite:Da}};Ta.exports=La(),Ta.exports.createColors=La;var _a=Ta.exports;const Fa=Na(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let Ba=_a,Ua=Fa,ja=class e extends Error{constructor(t,r,n,s,o,i){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),s&&(this.source=s),i&&(this.plugin=i),void 0!==r&&void 0!==n&&("number"==typeof r?(this.line=r,this.column=n):(this.line=r.line,this.column=r.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}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(e){if(!this.source)return"";let t=this.source;null==e&&(e=Ba.isColorSupported),Ua&&e&&(t=Ua(t));let r,n,s=t.split(/\r?\n/),o=Math.max(this.line-3,0),i=Math.min(this.line+2,s.length),a=String(i).length;if(e){let{bold:e,gray:t,red:s}=Ba.createColors(!0);r=t=>e(s(t)),n=e=>t(e)}else r=n=e=>e;return s.slice(o,i).map((e,t)=>{let s=o+1+t,i=" "+(" "+s).slice(-a)+" | ";if(s===this.line){let t=n(i.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return r(">")+n(i)+e+"\n "+t+r("^")}return" "+n(i)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};var za=ja;ja.default=ja;var Wa={};Wa.isClean=Symbol("isClean"),Wa.my=Symbol("my");const Va={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let Ga=class{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(e,t,r){let n;if(r||(r=t),t&&(n=e.raws[t],void 0!==n))return n;let s=e.parent;if("before"===r){if(!s||"root"===s.type&&s.first===e)return"";if(s&&"document"===s.type)return""}if(!s)return Va[r];let o=e.root();if(o.rawCache||(o.rawCache={}),void 0!==o.rawCache[r])return o.rawCache[r];if("before"===r||"after"===r)return this.beforeAfter(e,r);{let s="raw"+((i=r)[0].toUpperCase()+i.slice(1));this[s]?n=this[s](o,e):o.walk(e=>{if(n=e.raws[t],void 0!==n)return!1})}var i;return void 0===n&&(n=Va[r]),o.rawCache[r]=n,n}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)}};var Za=Ga;Ga.default=Ga;let Ya=Za;function Ka(e,t){new Ya(t).stringify(e)}var Ja=Ka;Ka.default=Ka;let{isClean:qa,my:$a}=Wa,Xa=za,Ha=Za,Qa=Ja;function el(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=>el(e,r)):("object"===o&&null!==s&&(s=el(s)),r[n]=s)}return r}let tl=class{constructor(e={}){this.raws={},this[qa]=!1,this[$a]=!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=el(this);for(let r in e)t[r]=e[r];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:r,start:n}=this.rangeBy(t);return this.source.input.error(e,{column:n.column,line:n.line},{column:r.column,line:r.line},t)}return new Xa(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markDirty(){if(this[qa]){this[qa]=!1;let e=this;for(;e=e.parent;)e[qa]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){let n=(t=this.toString()).indexOf(e.word);-1!==n&&(r=this.positionInside(n,t))}return r}positionInside(e,t){let r=t||this.toString(),n=this.source.start.column,s=this.source.start.line;for(let t=0;t<e;t++)"\n"===r[t]?(n=1,s+=1):n+=1;return{column:n,line:s}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let n=this.toString(),s=n.indexOf(e.word);-1!==s&&(t=this.positionInside(s,n),r=this.positionInside(s+e.word.length,n))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return(new Ha).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let n of e)n===this?r=!0:r?(this.parent.insertAfter(t,n),t=n):this.parent.insertBefore(t,n);r||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let r={},n=null==t;t=t||new Map;let 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){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=Qa){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){let n={node:this};for(let e in r)n[e]=r[e];return e.warn(t,n)}get proxyOf(){return this}};var rl=tl;tl.default=tl;let nl=rl,sl=class extends nl{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}};var ol=sl;sl.default=sl;var il={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(r=t)=>{let n="",s=r;for(;s--;)n+=e[Math.random()*e.length|0];return n}};let{SourceMapConsumer:al,SourceMapGenerator:ll}=Fa,{existsSync:cl,readFileSync:ul}=Fa,{dirname:hl,join:dl}=Fa;let pl=class{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,n=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=hl(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new al(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t;let r=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+r)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let r=e.lastIndexOf(t.pop()),n=e.indexOf("*/",r);r>-1&&n>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,n)))}loadFile(e){if(this.root=hl(e),cl(e))return this.mapFile=e,ul(e,"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 al)return ll.fromSourceMap(t).toString();if(t instanceof ll)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=dl(hl(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)}};var fl=pl;pl.default=pl;let{SourceMapConsumer:ml,SourceMapGenerator:gl}=Fa,{fileURLToPath:yl,pathToFileURL:vl}=Fa,{isAbsolute:wl,resolve:bl}=Fa,{nanoid:Sl}=il,Cl=Fa,Il=za,xl=fl,kl=Symbol("fromOffsetCache"),Ol=Boolean(ml&&gl),El=Boolean(bl&&wl),Rl=class{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!El||/^\w+:\/\//.test(t.from)||wl(t.from)?this.file=t.from:this.file=bl(t.from)),El&&Ol){let e=new xl(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+Sl(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let s,o,i;if(t&&"object"==typeof t){let e=t,n=r;if("number"==typeof e.offset){let n=this.fromOffset(e.offset);t=n.line,r=n.col}else t=e.line,r=e.column;if("number"==typeof n.offset){let e=this.fromOffset(n.offset);o=e.line,i=e.col}else o=n.line,i=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let a=this.origin(t,r,o,i);return s=a?new Il(e,void 0===a.endLine?a.line:{column:a.column,line:a.line},void 0===a.endLine?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,n.plugin):new Il(e,void 0===o?t:{column:r,line:t},void 0===o?r:{column:i,line:o},this.css,this.file,n.plugin),s.input={column:r,endColumn:i,endLine:o,line:t,source:this.css},this.file&&(vl&&(s.input.url=vl(this.file).toString()),s.input.file=this.file),s}fromOffset(e){let t,r;if(this[kl])r=this[kl];else{let e=this.css.split("\n");r=new Array(e.length);let t=0;for(let n=0,s=e.length;n<s;n++)r[n]=t,t+=e[n].length+1;this[kl]=r}t=r[r.length-1];let n=0;if(e>=t)n=r.length-1;else{let t,s=r.length-2;for(;n<s;)if(t=n+(s-n>>1),e<r[t])s=t-1;else{if(!(e>=r[t+1])){n=t;break}n=t+1}}return{col:e-r[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:bl(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,n){if(!this.map)return!1;let s,o,i=this.map.consumer(),a=i.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof r&&(s=i.originalPositionFor({column:n,line:r})),o=wl(a.source)?vl(a.source):new URL(a.source,this.map.consumer().sourceRoot||vl(this.map.mapFile));let l={column:a.column,endColumn:s&&s.column,endLine:s&&s.line,line:a.line,url:o.toString()};if("file:"===o.protocol){if(!yl)throw new Error("file: protocol is not available in this PostCSS build");l.file=yl(o)}let c=i.sourceContentFor(a.source);return c&&(l.source=c),l}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}};var Al=Rl;Rl.default=Rl,Cl&&Cl.registerInput&&Cl.registerInput(Rl);let{SourceMapConsumer:Ml,SourceMapGenerator:Pl}=Fa,{dirname:Nl,relative:Tl,resolve:Dl,sep:Ll}=Fa,{pathToFileURL:_l}=Fa,Fl=Al,Bl=Boolean(Ml&&Pl),Ul=Boolean(Nl&&Dl&&Tl&&Ll);var jl=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 e of this.previous()){let t,r=this.toUrl(this.path(e.file)),n=e.root||Nl(e.file);!1===this.mapOpts.sourcesContent?(t=new Ml(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,r,this.toUrl(this.path(n)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),Ul&&Bl&&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=Pl.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new Pl({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 Pl({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))),e=i.match(/\n/g),e?(r+=e.length,t=i.lastIndexOf("\n"),n=i.length-t):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(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?Nl(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=Nl(Dl(r,this.mapOpts.annotation)));let n=Tl(r,e);return this.memoizedPaths.set(e,n),n}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 Fl(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(_l){let t=_l(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;"\\"===Ll&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let zl=rl,Wl=class extends zl{constructor(e){super(e),this.type="comment"}};var Vl=Wl;Wl.default=Wl;let Gl,Zl,Yl,Kl,{isClean:Jl,my:ql}=Wa,$l=ol,Xl=Vl,Hl=rl;function Ql(e){return e.map(e=>(e.nodes&&(e.nodes=Ql(e.nodes)),delete e.source,e))}function ec(e){if(e[Jl]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)ec(t)}let tc=class e extends Hl{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(t,r){if("string"==typeof t)t=Ql(Gl(t).nodes);else if(void 0===t)t=[];else if(Array.isArray(t)){t=t.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===t.type&&"document"!==this.type){t=t.nodes.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if(t.type)t=[t];else if(t.prop){if(void 0===t.value)throw new Error("Value field is missed in node creation");"string"!=typeof t.value&&(t.value=String(t.value)),t=[new $l(t)]}else if(t.selector)t=[new Zl(t)];else if(t.name)t=[new Yl(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new Xl(t)]}return t.map(t=>(t[ql]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[Jl]&&ec(t),void 0===t.raws.before&&r&&void 0!==r.raws.before&&(t.raws.before=r.raws.before.replace(/\S/g,"")),t.parent=this.proxyOf,t))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls(n=>{t.props&&!t.props.includes(n.prop)||t.fast&&!n.value.includes(t.fast)||(n.value=n.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,r)=>{let n;try{n=e(t,r)}catch(e){throw t.addToError(e)}return!1!==n&&t.walk&&(n=t.walk(e)),n})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("atrule"===r.type&&e.test(r.name))return t(r,n)}):this.walk((r,n)=>{if("atrule"===r.type&&r.name===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("atrule"===e.type)return t(e,r)}))}walkComments(e){return this.walk((t,r)=>{if("comment"===t.type)return e(t,r)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("decl"===r.type&&e.test(r.prop))return t(r,n)}):this.walk((r,n)=>{if("decl"===r.type&&r.prop===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("decl"===e.type)return t(e,r)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("rule"===r.type&&e.test(r.selector))return t(r,n)}):this.walk((r,n)=>{if("rule"===r.type&&r.selector===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("rule"===e.type)return t(e,r)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};tc.registerParse=e=>{Gl=e},tc.registerRule=e=>{Zl=e},tc.registerAtRule=e=>{Yl=e},tc.registerRoot=e=>{Kl=e};var rc=tc;tc.default=tc,tc.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,Yl.prototype):"rule"===e.type?Object.setPrototypeOf(e,Zl.prototype):"decl"===e.type?Object.setPrototypeOf(e,$l.prototype):"comment"===e.type?Object.setPrototypeOf(e,Xl.prototype):"root"===e.type&&Object.setPrototypeOf(e,Kl.prototype),e[ql]=!0,e.nodes&&e.nodes.forEach(e=>{tc.rebuild(e)})};let nc,sc,oc=rc,ic=class extends oc{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new nc(new sc,this,e).stringify()}};ic.registerLazyResult=e=>{nc=e},ic.registerProcessor=e=>{sc=e};var ac=ic;ic.default=ic;let lc={};var cc=function(e){lc[e]||(lc[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let uc=class{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}};var hc=uc;uc.default=uc;let dc=hc,pc=class{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let r=new dc(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};var fc=pc;pc.default=pc;const mc="'".charCodeAt(0),gc='"'.charCodeAt(0),yc="\\".charCodeAt(0),vc="/".charCodeAt(0),wc="\n".charCodeAt(0),bc=" ".charCodeAt(0),Sc="\f".charCodeAt(0),Cc="\t".charCodeAt(0),Ic="\r".charCodeAt(0),xc="[".charCodeAt(0),kc="]".charCodeAt(0),Oc="(".charCodeAt(0),Ec=")".charCodeAt(0),Rc="{".charCodeAt(0),Ac="}".charCodeAt(0),Mc=";".charCodeAt(0),Pc="*".charCodeAt(0),Nc=":".charCodeAt(0),Tc="@".charCodeAt(0),Dc=/[\t\n\f\r "#'()/;[\\\]{}]/g,Lc=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,_c=/.[\r\n"'(/\\]/,Fc=/[\da-f]/i;let Bc=rc,Uc=class extends Bc{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)}};var jc=Uc;Uc.default=Uc,Bc.registerAtRule(Uc);let zc,Wc,Vc=rc,Gc=class extends Vc{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(e={}){return new zc(new Wc,this,e).stringify()}};Gc.registerLazyResult=e=>{zc=e},Gc.registerProcessor=e=>{Wc=e};var Zc=Gc;Gc.default=Gc,Vc.registerRoot(Gc);let Yc={comma:e=>Yc.split(e,[","],!0),space:e=>Yc.split(e,[" ","\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}};var Kc=Yc;Yc.default=Yc;let Jc=rc,qc=Kc,$c=class extends Jc{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return qc.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)}};var Xc=$c;$c.default=$c,Jc.registerRule($c);let Hc=ol,Qc=function(e,t={}){let r,n,s,o,i,a,l,c,u,h,d=e.css.valueOf(),p=t.ignoreErrors,f=d.length,m=0,g=[],y=[];function v(t){throw e.error("Unclosed "+t,m)}return{back:function(e){y.push(e)},endOfFile:function(){return 0===y.length&&m>=f},nextToken:function(e){if(y.length)return y.pop();if(m>=f)return;let t=!!e&&e.ignoreUnclosed;switch(r=d.charCodeAt(m),r){case wc:case bc:case Cc:case Ic:case Sc:n=m;do{n+=1,r=d.charCodeAt(n)}while(r===bc||r===wc||r===Cc||r===Ic||r===Sc);h=["space",d.slice(m,n)],m=n-1;break;case xc:case kc:case Rc:case Ac:case Nc:case Mc:case Ec:{let e=String.fromCharCode(r);h=[e,e,m];break}case Oc:if(c=g.length?g.pop()[1]:"",u=d.charCodeAt(m+1),"url"===c&&u!==mc&&u!==gc&&u!==bc&&u!==wc&&u!==Cc&&u!==Sc&&u!==Ic){n=m;do{if(a=!1,n=d.indexOf(")",n+1),-1===n){if(p||t){n=m;break}v("bracket")}for(l=n;d.charCodeAt(l-1)===yc;)l-=1,a=!a}while(a);h=["brackets",d.slice(m,n+1),m,n],m=n}else n=d.indexOf(")",m+1),o=d.slice(m,n+1),-1===n||_c.test(o)?h=["(","(",m]:(h=["brackets",o,m,n],m=n);break;case mc:case gc:s=r===mc?"'":'"',n=m;do{if(a=!1,n=d.indexOf(s,n+1),-1===n){if(p||t){n=m+1;break}v("string")}for(l=n;d.charCodeAt(l-1)===yc;)l-=1,a=!a}while(a);h=["string",d.slice(m,n+1),m,n],m=n;break;case Tc:Dc.lastIndex=m+1,Dc.test(d),n=0===Dc.lastIndex?d.length-1:Dc.lastIndex-2,h=["at-word",d.slice(m,n+1),m,n],m=n;break;case yc:for(n=m,i=!0;d.charCodeAt(n+1)===yc;)n+=1,i=!i;if(r=d.charCodeAt(n+1),i&&r!==vc&&r!==bc&&r!==wc&&r!==Cc&&r!==Ic&&r!==Sc&&(n+=1,Fc.test(d.charAt(n)))){for(;Fc.test(d.charAt(n+1));)n+=1;d.charCodeAt(n+1)===bc&&(n+=1)}h=["word",d.slice(m,n+1),m,n],m=n;break;default:r===vc&&d.charCodeAt(m+1)===Pc?(n=d.indexOf("*/",m+2)+1,0===n&&(p||t?n=d.length:v("comment")),h=["comment",d.slice(m,n+1),m,n],m=n):(Lc.lastIndex=m+1,Lc.test(d),n=0===Lc.lastIndex?d.length-1:Lc.lastIndex-2,h=["word",d.slice(m,n+1),m,n],g.push(h),m=n)}return m++,h},position:function(){return m}}},eu=Vl,tu=jc,ru=Zc,nu=Xc;const su={empty:!0,space:!0};var ou=class{constructor(e){this.input=e,this.root=new ru,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,r,n,s=new tu;s.name=e[1].slice(1),""===s.name&&this.unnamedAtrule(s,e),this.init(s,e[2]);let o=!1,i=!1,a=[],l=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?l.push("("===t?")":"]"):"{"===t&&l.length>0?l.push("}"):t===l[l.length-1]&&l.pop(),0===l.length){if(";"===t){s.source.end=this.getPosition(e[2]),s.source.end.offset++,this.semicolon=!0;break}if("{"===t){i=!0;break}if("}"===t){if(a.length>0){for(n=a.length-1,r=a[n];r&&"space"===r[0];)r=a[--n];r&&(s.source.end=this.getPosition(r[3]||r[2]),s.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}s.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(s.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(s,"params",a),o&&(e=a[a.length-1],s.source.end=this.getPosition(e[3]||e[2]),s.source.end.offset++,this.spaces=s.raws.between,s.raws.between="")):(s.raws.afterName="",s.params=""),i&&(s.nodes=[],this.current=s)}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(t=i,r=t[0],"("===r&&(s+=1),")"===r&&(s-=1),0===s&&":"===r){if(n){if("word"===n[0]&&"progid"===n[1])continue;return o}this.doubleColon(t)}n=t}return!1}comment(e){let t=new eu;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text="",t.raws.left=r,t.raws.right="";else{let e=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=Qc(this.input)}decl(e,t){let r=new Hc;this.init(r,e[0][2]);let n,s=e[e.length-1];for(";"===s[0]&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(s[3]||s[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)),r.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),r.raws.before+=e.shift()[1];for(r.source.start=this.getPosition(e[0][2]),r.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;r.prop+=e.shift()[1]}for(r.raws.between="";e.length;){if(n=e.shift(),":"===n[0]){r.raws.between+=n[1];break}"word"===n[0]&&/\w/.test(n[1])&&this.unknownWord([n]),r.raws.between+=n[1]}"_"!==r.prop[0]&&"*"!==r.prop[0]||(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let o,i=[];for(;e.length&&(o=e[0][0],"space"===o||"comment"===o);)i.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(n=e[t],"!important"===n[1].toLowerCase()){r.important=!0;let n=this.stringFrom(e,t);n=this.spacesFromEnd(e)+n," !important"!==n&&(r.raws.important=n);break}if("important"===n[1].toLowerCase()){let n=e.slice(0),s="";for(let e=t;e>0;e--){let t=n[e][0];if(0===s.trim().indexOf("!")&&"space"!==t)break;s=n.pop()[1]+s}0===s.trim().indexOf("!")&&(r.important=!0,r.raws.important=s,e=n)}if("space"!==n[0]&&"comment"!==n[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(r.raws.between+=i.map(e=>e[1]).join(""),i=[]),this.raw(r,"value",i.concat(e),t),r.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 nu;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,r=null,n=!1,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,i,a,l=r.length,c="",u=!0;for(let e=0;e<l;e+=1)s=r[e],o=s[0],"space"!==o||e!==l-1||n?"comment"===o?(a=r[e-1]?r[e-1][0]:"empty",i=r[e+1]?r[e+1][0]:"empty",su[a]||su[i]||","===c.slice(-1)?u=!1:c+=s[1]):c+=s[1]:u=!1;if(!u){let n=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:n,value:c}}e[t]=c}rule(e){e.pop();let t=new nu;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let n=t;n<e.length;n++)r+=e[n][1];return e.splice(t,e.length-t),r}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}};let iu=rc,au=ou,lu=Al;function cu(e,t){let r=new lu(e,t),n=new au(r);try{n.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&t&&t.from&&(/\.scss$/i.test(t.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(t.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(t.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return n.root}var uu=cu;cu.default=cu,iu.registerParse(cu);let{isClean:hu,my:du}=Wa,pu=jl,fu=Ja,mu=rc,gu=ac,yu=cc,vu=fc,wu=uu,bu=Zc;const Su={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Cu={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},Iu={Once:!0,postcssPlugin:!0,prepare:!0};function xu(e){return"object"==typeof e&&"function"==typeof e.then}function ku(e){let t=!1,r=Su[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 Ou(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:ku(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function Eu(e){return e[hu]=!1,e.nodes&&e.nodes.forEach(e=>Eu(e)),e}let Ru={},Au=class e{constructor(t,r,n){let s;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof e||r instanceof vu)s=Eu(r.root),r.map&&(void 0===n.map&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=r.map);else{let e=wu;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{s=e(r,n)}catch(e){this.processed=!0,this.error=e}s&&!s[du]&&mu.rebuild(s)}else s=Eu(r);this.result=new vu(t,s,n),this.helpers={...Ru,postcss:Ru,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(!Cu[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Iu[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(xu(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[hu];){e[hu]=!0;let t=[Ou(e)];for(;t.length>0;){let e=this.visitTick(t);if(xu(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 xu(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=fu;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new pu(t,this.result.root,this.result.opts).generate();return this.result.css=r[0],this.result.map=r[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(xu(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[hu];)e[hu]=!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||yu("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(xu(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[hu])return n[hu]=!0,void e.push(Ou(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[hu]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[hu]=!0;let t=ku(e);for(let r of t)if(0===r)e.nodes&&e.each(e=>{e[hu]||this.walkSync(e)});else{let t=this.listeners[r];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};Au.registerPostcss=e=>{Ru=e};var Mu=Au;Au.default=Au,bu.registerLazyResult(Au),gu.registerLazyResult(Au);let Pu=jl,Nu=Ja,Tu=cc,Du=uu;const Lu=fc;let _u=class{constructor(e,t,r){let n;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;let s=Nu;this.result=new Lu(this._processor,n,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let i=new Pu(s,n,this._opts,t);if(i.isMap()){let[e,t]=i.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else i.clearAnnotation(),this.result.css=i.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||Tu("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=Du;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}};var Fu=_u;_u.default=_u;let Bu=Fu,Uu=Mu,ju=ac,zu=Zc,Wu=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new Uu(this,e,t):new Bu(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var Vu=Wu;Wu.default=Wu,zu.registerProcessor(Wu),ju.registerProcessor(Wu);let Gu=ol,Zu=fl,Yu=Vl,Ku=jc,Ju=Al,qu=Zc,$u=Xc;function Xu(e,t){if(Array.isArray(e))return e.map(e=>Xu(e));let{inputs:r,...n}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:Ju.prototype};r.map&&(r.map={...r.map,__proto__:Zu.prototype}),t.push(r)}}if(n.nodes&&(n.nodes=e.nodes.map(e=>Xu(e,t))),n.source){let{inputId:e,...r}=n.source;n.source=r,null!=e&&(n.source.input=t[e])}if("root"===n.type)return new qu(n);if("decl"===n.type)return new Gu(n);if("rule"===n.type)return new $u(n);if("comment"===n.type)return new Yu(n);if("atrule"===n.type)return new Ku(n);throw new Error("Unknown node type: "+e.type)}var Hu=Xu;Xu.default=Xu;let Qu=za,eh=ol,th=Mu,rh=rc,nh=Vu,sh=Ja,oh=Hu,ih=ac,ah=hc,lh=Vl,ch=jc,uh=fc,hh=Al,dh=uu,ph=Kc,fh=Xc,mh=Zc,gh=rl;function yh(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new nh(e)}yh.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 nh).version,s}return Object.defineProperty(s,"postcss",{get:()=>(r||(r=s()),r)}),s.process=function(e,t,r){return yh([s(r)]).process(e,t)},s},yh.stringify=sh,yh.parse=dh,yh.fromJSON=oh,yh.list=ph,yh.comment=e=>new lh(e),yh.atRule=e=>new ch(e),yh.decl=e=>new eh(e),yh.rule=e=>new fh(e),yh.root=e=>new mh(e),yh.document=e=>new ih(e),yh.CssSyntaxError=Qu,yh.Declaration=eh,yh.Container=rh,yh.Processor=nh,yh.Document=ih,yh.Comment=lh,yh.Warning=ah,yh.AtRule=ch,yh.Result=uh,yh.Input=hh,yh.Rule=fh,yh.Root=mh,yh.Node=gh,th.registerPostcss(yh);var vh=yh;yh.default=yh;const wh=Pa(vh);wh.stringify,wh.fromJSON,wh.plugin,wh.parse,wh.list,wh.document,wh.comment,wh.atRule,wh.rule,wh.decl,wh.root,wh.CssSyntaxError,wh.Declaration,wh.Container,wh.Processor,wh.Document,wh.Comment,wh.Warning,wh.AtRule,wh.Result,wh.Input,wh.Rule,wh.Root,wh.Node;class bh{constructor(...e){Ma(this,"parentElement",null),Ma(this,"parentNode",null),Ma(this,"ownerDocument"),Ma(this,"firstChild",null),Ma(this,"lastChild",null),Ma(this,"previousSibling",null),Ma(this,"nextSibling",null),Ma(this,"ELEMENT_NODE",1),Ma(this,"TEXT_NODE",3),Ma(this,"nodeType"),Ma(this,"nodeName"),Ma(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 bh))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 Sh={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Ch={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Ih={};function xh(e){if(Ih[e])return Ih[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 Sh?Sh[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 Ch?Ch[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 Ih[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?Ih[e]=o:r}catch{return r}}const kh={};function Oh(e,t,r){var n;const s=`${e}.${String(r)}`;if(kh[s])return kh[s].call(t);const o=xh(e),i=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return i?(kh[s]=i,i.call(t)):t[r]}const Eh={};function Rh(e,t,r){const n=`${e}.${String(r)}`;if(Eh[n])return Eh[n].bind(t);const s=xh(e)[r];return"function"!=typeof s?t[r]:(Eh[n]=s,s.bind(t))}const Ah={childNodes:function(e){return Oh("Node",e,"childNodes")},parentNode:function(e){return Oh("Node",e,"parentNode")},parentElement:function(e){return Oh("Node",e,"parentElement")},textContent:function(e){return Oh("Node",e,"textContent")},contains:function(e,t){return Rh("Node",e,"contains")(t)},getRootNode:function(e){return Rh("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Oh("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Oh("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Oh("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Oh("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return xh("MutationObserver").constructor}};const Mh="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 Ph={map:{},getId:()=>(console.error(Mh),-1),getNode:()=>(console.error(Mh),null),removeNodeFromMap(){console.error(Mh)},has:()=>(console.error(Mh),!1),reset(){console.error(Mh)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Ph=new Proxy(Ph,{get:(e,t,r)=>("map"===t&&console.error(Mh),Reflect.get(e,t,r))}));let Nh=Date.now;function Th(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:Ah.parentElement(e)}/[1-9][0-9]{12}/.test(Date.now().toString())||(Nh=()=>(new Date).getTime());function Dh(e){var t;let r=null;return"getRootNode"in e&&(null==(t=Ah.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&Ah.host(Ah.getRootNode(e))&&(r=Ah.host(Ah.getRootNode(e))),r}function Lh(e){let t,r=e;for(;t=Dh(r);)r=t;return r}function _h(e){const t=e.ownerDocument;if(!t)return!1;const r=Lh(e);return Ah.contains(t,r)}const Fh=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){kn(this,"id",1),kn(this,"styleIDMap",new WeakMap),kn(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 Ph},closestElementOfNode:Th,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:Lh,getShadowHost:Dh,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=Ah.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=Ah.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 bh&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(Ah.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&&(Ah.contains(t,e)||_h(e))},isAncestorRemoved:function e(t,r){if(function(e){const t=e&&"host"in e&&"mode"in e&&_n.host(e)||null;return Boolean(t&&"shadowRoot"in t&&_n.shadowRoot(t)===e)}(t))return!1;const n=r.getId(t);if(!r.has(n))return!0;const s=Ah.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=Th(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(Bn(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 Nh},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:_h,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 Bh="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Uh="undefined"==typeof Uint8Array?[]:new Uint8Array(256),jh=0;jh<64;jh++)Uh[Bh.charCodeAt(jh)]=jh;var zh,Wh,Vh;"undefined"!=typeof window&&window.Blob&&new Blob([(zh="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Uint8Array.from(atob(zh),e=>e.charCodeAt(0)))],{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==(mn=e.contentWindow)?void 0:mn.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}new Fn,(Vh=Wh||(Wh={}))[Vh.NotStarted=0]="NotStarted",Vh[Vh.Running=1]="Running",Vh[Vh.Stopped=2]="Stopped";class Gh{constructor(e){In(this,"fileName"),In(this,"functionName"),In(this,"lineNumber"),In(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 Zh=/(^|@)\S+:\d+/,Yh=/^\s*at .*(\S+:\d+|\(native\))/m,Kh=/^(eval@)?(\[native code])?$/,Jh={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(Yh)?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(Yh)},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 Gh({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(Kh)},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 Gh({functionName:e});{const t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),n=r&&r[1]?r[1]:void 0,s=this.extractLocation(e.replace(t,""));return new Gh({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 Gh({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 Gh({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(Zh)&&!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 Gh({functionName:n,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})},this)}};function qh(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 $h(e){return"[object Object]"===Object.prototype.toString.call(e)}function Xh(e,t){if(0===t)return!0;const r=Object.keys(e);for(const n of r)if($h(e[n])&&Xh(e[n],t-1))return!0;return!1}function Hh(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($h(e)&&Object.keys(e).length>r.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if($h(e)&&Xh(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]=qh(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 Qh={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 ed(e,t,r){const n=r?Object.assign({},Qh,r):Qh,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=Jh.parse(s).map(e=>e.toString()),i=[Hh(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=[Hh(`Uncaught (in promise) ${r.name}: ${r.message}`,n.stringifyOptions)]):(r=new Error,s=[Hh("Uncaught (in promise)",n.stringifyOptions),Hh(t.reason,n.stringifyOptions)]);const o=Jh.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]?Fh.patch(t,r,t=>(...s)=>{if(t.apply(this,s),!("assert"===r&&s[0]||a)){a=!0;try{const t=Jh.parse(new Error).map(e=>e.toString()).splice(1),o=("assert"===r?s.slice(1):s).map(e=>Hh(e,n.stringifyOptions));i++,i<n.lengthThreshold?e({level:r,trace:t,payload:o}):i===n.lengthThreshold&&e({level:"warn",trace:[],payload:[Hh("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...s)}finally{a=!1}}}):()=>{}}}const td="rrweb/console@1";var rd,nd=Object.freeze({__proto__:null,PLUGIN_NAME:td,getRecordConsolePlugin:e=>({name:td,observer:ed,options:e})}),sd=Object.defineProperty,od=(e,t,r)=>((e,t,r)=>t in e?sd(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),id=Object.defineProperty,ad=(e,t,r)=>((e,t,r)=>t in e?id(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),ld=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(ld||{});const cd={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},ud={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},hd={};function dd(e){if(hd[e])return hd[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 cd?cd[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 ud?ud[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 hd[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?hd[e]=o:r}catch{return r}}const pd={};function fd(e,t,r){var n;const s=`${e}.${String(r)}`;if(pd[s])return pd[s].call(t);const o=dd(e),i=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return i?(pd[s]=i,i.call(t)):t[r]}const md={};function gd(e,t,r){const n=`${e}.${String(r)}`;if(md[n])return md[n].bind(t);const s=dd(e)[r];return"function"!=typeof s?t[r]:(md[n]=s,s.bind(t))}const yd={childNodes:function(e){return fd("Node",e,"childNodes")},parentNode:function(e){return fd("Node",e,"parentNode")},parentElement:function(e){return fd("Node",e,"parentElement")},textContent:function(e){return fd("Node",e,"textContent")},contains:function(e,t){return gd("Node",e,"contains")(t)},getRootNode:function(e){return gd("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?fd("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?fd("Element",e,"shadowRoot"):null},querySelector:function(e,t){return fd("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return fd("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return dd("MutationObserver").constructor}};function vd(e){return e.nodeType===e.ELEMENT_NODE}function wd(e){const t=e&&"host"in e&&"mode"in e&&yd.host(e)||null;return Boolean(t&&"shadowRoot"in t&&yd.shadowRoot(t)===e)}function bd(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function Sd(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=>Cd(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 Cd(e,t){if(function(e){return"styleSheet"in e}(e)){let t;try{t=Sd(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?Td(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?Td(r,t):r}}class Id{constructor(){ad(this,"idNodeMap",new Map),ad(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 xd({element:e,maskInputOptions:t,tagName:r,type:n,value:s,maskInputFn:o}){let i=s||"";const a=n&&kd(n);return(t[r.toLowerCase()]||a&&t[a])&&(i=o?o(i,e):"*".repeat(i.length)),i}function kd(e){return e.toLowerCase()}const Od="__rrweb_original__";function Ed(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?kd(t):null}function Rd(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 Ad=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Md=/^(?:[a-z+]+:)?\/\//i,Pd=/^www\..*/i,Nd=/^(data:)([^,]*),(.*)/i;function Td(e,t){return(e||"").replace(Ad,(e,r,n,s,o,i)=>{const a=n||o||i,l=r||s||"";if(!a)return e;if(Md.test(a)||Pd.test(a))return`url(${l}${a}${l})`;if(Nd.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 Dd(e,t=!1){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function Ld(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=Dd(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=Dd(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=Dd(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=Dd(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 _d="lightgrey";let Fd=1;const Bd=new RegExp("[^a-z0-9-_:]");function Ud(){return Fd++}let jd,zd;const Wd=/^[^ \t\n\r\u000c]+/,Vd=/^[, \t\n\r\u000c]+/;const Gd=new WeakMap;function Zd(e,t){return t&&""!==t.trim()?Kd(e,t):t}function Yd(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function Kd(e,t){let r=Gd.get(e);if(r||(r=e.createElement("a"),Gd.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function Jd(e,t,r,n){return n?"src"===r||"href"===r&&("use"!==t||"#"!==n[0])||"xlink:href"===r&&"#"!==n[0]?Zd(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(Vd),!(r>=t.length);){let o=n(Wd);if(","===o.slice(-1))o=Zd(e,o.substring(0,o.length-1)),s.push(o);else{let n="";o=Zd(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?Td(n,Kd(e)):"object"===t&&"data"===r?Zd(e,n):n:Zd(e,n):n}function qd(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function $d(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&$d(yd.parentNode(e),t,r);for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!!r&&$d(yd.parentNode(e),t,r)}function Xd(e,t,r,n){let s;if(vd(e)){if(s=e,!yd.childNodes(s).length)return!1}else{if(null===yd.parentElement(e))return!1;s=yd.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($d(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 Hd(e,t){const{doc:r,mirror:n,blockClass:s,blockSelector:o,needsMask:i,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:c,maskInputFn:u,dataURLOptions:h={},inlineImages:d,recordCanvas:p,keepIframeSrcFn:f,newlyAddedElement:m=!1,cssCaptured:g=!1,applyBackgroundColorToBlockedElements:y=!1}=t,v=function(e,t){if(!t.hasNode(e))return;const r=t.getId(e);return 1===r?void 0:r}(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:ld.Document,childNodes:[],compatMode:e.compatMode}:{type:ld.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:ld.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:v};case e.ELEMENT_NODE:return function(e,t){const{doc:r,blockClass:n,blockSelector:s,inlineStylesheet:o,maskInputOptions:i={},maskInputFn:a,dataURLOptions:l={},inlineImages:c,recordCanvas:u,keepIframeSrcFn:h,newlyAddedElement:d=!1,rootId:p,applyBackgroundColorToBlockedElements:f=!1}=t,m=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),g=function(e){if(e instanceof HTMLFormElement)return"form";const t=kd(e.tagName);return Bd.test(t)?"div":t}(e);let y={};const v=e.attributes.length;for(let t=0;t<v;t++){const n=e.attributes[t];qd(g,n.name,n.value)||(y[n.name]=Jd(r,g,kd(n.name),n.value))}if("link"===g&&o){const t=Array.from(r.styleSheets).find(t=>t.href===e.href);let n=null;t&&(n=Sd(t)),n&&(delete y.rel,delete y.href,y._cssText=n)}if("style"===g&&e.sheet){let t=Sd(e.sheet);t&&(e.childNodes.length>1&&(t=Ld(t,e)),y._cssText=t)}if("input"===g||"textarea"===g||"select"===g){const t=e.value,r=e.checked;"radio"!==y.type&&"checkbox"!==y.type&&"submit"!==y.type&&"button"!==y.type&&t?y.value=xd({element:e,type:Ed(e),tagName:g,value:t,maskInputOptions:i,maskInputFn:a}):r&&(y.checked=r)}"option"===g&&(e.selected&&!i.select?y.selected=!0:delete y.selected);"dialog"===g&&e.open&&(y.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal");if("canvas"===g&&u)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=Od in s?s[Od]: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(l.type,l.quality));else if(!("__context"in e)){const t=e.toDataURL(l.type,l.quality),n=r.createElement("canvas");n.width=e.width,n.height=e.height;t!==n.toDataURL(l.type,l.quality)&&(y.rr_dataURL=t)}if("img"===g&&c){jd||(jd=r.createElement("canvas"),zd=jd.getContext("2d"));const t=e,n=t.currentSrc||t.getAttribute("src")||"<unknown-src>",s=t.crossOrigin,o=()=>{t.removeEventListener("load",o);try{jd.width=t.naturalWidth,jd.height=t.naturalHeight,zd.drawImage(t,0,0),y.rr_dataURL=jd.toDataURL(l.type,l.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"===g||"video"===g){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}d||(e.scrollLeft&&(y.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(y.rr_scrollTop=e.scrollTop));if(m){const{width:t,height:r}=e.getBoundingClientRect();y={class:y.class,rr_width:`${t}px`,rr_height:`${r}px`,...f?{rr_background_color:_d}:{}}}"iframe"!==g||h(y.src)||(e.contentDocument||(y.rr_src=y.src),delete y.src);let w;try{customElements.get(g)&&(w=!0)}catch(e){}return{type:ld.Element,tagName:g,attributes:y,childNodes:[],isSVG:Yd(e)||void 0,needBlock:m,rootId:p,isCustom:w}}(e,{doc:r,blockClass:s,blockSelector:o,inlineStylesheet:a,maskInputOptions:l,maskInputFn:u,dataURLOptions:h,inlineImages:d,recordCanvas:p,keepIframeSrcFn:f,newlyAddedElement:m,rootId:v,applyBackgroundColorToBlockedElements:y});case e.TEXT_NODE:return function(e,t){const{needsMask:r,maskTextFn:n,rootId:s,cssCaptured:o}=t,i=yd.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=yd.textContent(e),c&&l&&(l=Td(l,Kd(t.doc))));!c&&!u&&l&&r&&(l=n?n(l,yd.parentElement(e)):l.replace(/[\S]/g,"*"));return{type:ld.Text,textContent:l||"",rootId:s}}(e,{doc:r,needsMask:i,maskTextFn:c,rootId:v,cssCaptured:g});case e.CDATA_SECTION_NODE:return{type:ld.CDATA,textContent:"",rootId:v};case e.COMMENT_NODE:return{type:ld.Comment,textContent:yd.textContent(e)||"",rootId:v};default:return!1}}function Qd(e){return null==e?"":e.toLowerCase()}function ep(e,t){const{doc:r,mirror:n,blockClass:s,blockSelector:o,maskTextClass:i,maskTextSelector:a,skipChild:l=!1,inlineStylesheet:c=!0,maskInputOptions:u={},maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:f={},inlineImages:m=!1,recordCanvas:g=!1,onSerialize:y,onIframeLoad:v,iframeLoadTimeout:w=5e3,onStylesheetLoad:b,stylesheetLoadTimeout:S=5e3,keepIframeSrcFn:C=()=>!1,newlyAddedElement:I=!1,cssCaptured:x=!1,applyBackgroundColorToBlockedElements:k=!1}=t;let{needsMask:O}=t,{preserveWhiteSpace:E=!0}=t;if(!O){O=Xd(e,i,a,void 0===O)}const R=Hd(e,{doc:r,mirror:n,blockClass:s,blockSelector:o,needsMask:O,inlineStylesheet:c,maskInputOptions:u,maskTextFn:h,maskInputFn:d,dataURLOptions:f,inlineImages:m,recordCanvas:g,keepIframeSrcFn:C,newlyAddedElement:I,cssCaptured:x,applyBackgroundColorToBlockedElements:k});if(!R)return console.warn(e,"not serialized"),null;let A;A=n.hasNode(e)?n.getId(e):function(e,t){if(t.comment&&e.type===ld.Comment)return!0;if(e.type===ld.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel||"modulepreload"===e.attributes.rel)&&"script"===e.attributes.as||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===Rd(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(Qd(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Qd(e.attributes.name)||"icon"===Qd(e.attributes.rel)||"apple-touch-icon"===Qd(e.attributes.rel)||"shortcut icon"===Qd(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&Qd(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Qd(e.attributes.property).match(/^(og|twitter|fb):/)||Qd(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===Qd(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===Qd(e.attributes.name)||"googlebot"===Qd(e.attributes.name)||"bingbot"===Qd(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===Qd(e.attributes.name)||"generator"===Qd(e.attributes.name)||"framework"===Qd(e.attributes.name)||"publisher"===Qd(e.attributes.name)||"progid"===Qd(e.attributes.name)||Qd(e.attributes.property).match(/^article:/)||Qd(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===Qd(e.attributes.name)||"yandex-verification"===Qd(e.attributes.name)||"csrf-token"===Qd(e.attributes.name)||"p:domain_verify"===Qd(e.attributes.name)||"verify-v1"===Qd(e.attributes.name)||"verification"===Qd(e.attributes.name)||"shopify-checkout-api-token"===Qd(e.attributes.name)))return!0}}return!1}(R,p)||!E&&R.type===ld.Text&&!R.textContent.replace(/^\s+|\s+$/gm,"").length?-2:Ud();const M=Object.assign(R,{id:A});if(n.add(e,M),-2===A)return null;y&&y(e);let P=!l;if(M.type===ld.Element){P=P&&!M.needBlock,delete M.needBlock;const t=yd.shadowRoot(e);t&&bd(t)&&(M.isShadowHost=!0)}if((M.type===ld.Document||M.type===ld.Element)&&P){p.headWhitespace&&M.type===ld.Element&&"head"===M.tagName&&(E=!1);const t={doc:r,mirror:n,blockClass:s,blockSelector:o,needsMask:O,maskTextClass:i,maskTextSelector:a,skipChild:l,inlineStylesheet:c,maskInputOptions:u,maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:f,inlineImages:m,recordCanvas:g,preserveWhiteSpace:E,onSerialize:y,onIframeLoad:v,iframeLoadTimeout:w,onStylesheetLoad:b,stylesheetLoadTimeout:S,keepIframeSrcFn:C,cssCaptured:!1,applyBackgroundColorToBlockedElements:k};if(M.type===ld.Element&&"textarea"===M.tagName&&void 0!==M.attributes.value);else{M.type===ld.Element&&void 0!==M.attributes._cssText&&"string"==typeof M.attributes._cssText&&(t.cssCaptured=!0);for(const r of Array.from(yd.childNodes(e))){const e=ep(r,t);e&&M.childNodes.push(e)}}let I=null;if(vd(e)&&(I=yd.shadowRoot(e)))for(const e of Array.from(yd.childNodes(I))){const r=ep(e,t);r&&(bd(I)&&(r.isShadow=!0),M.childNodes.push(r))}}const N=yd.parentNode(e);return N&&wd(N)&&bd(N)&&(M.isShadow=!0),M.type===ld.Element&&"iframe"===M.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&&v){const r=ep(t,{doc:t,mirror:n,blockClass:s,blockSelector:o,needsMask:O,maskTextClass:i,maskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:f,inlineImages:m,recordCanvas:g,preserveWhiteSpace:E,onSerialize:y,onIframeLoad:v,iframeLoadTimeout:w,onStylesheetLoad:b,stylesheetLoadTimeout:S,keepIframeSrcFn:C});r&&v(e,r)}},w),M.type===ld.Element&&"link"===M.tagName&&"string"==typeof M.attributes.rel&&("stylesheet"===M.attributes.rel||"preload"===M.attributes.rel&&"string"==typeof M.attributes.href&&"css"===Rd(M.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(b){const t=ep(e,{doc:r,mirror:n,blockClass:s,blockSelector:o,needsMask:O,maskTextClass:i,maskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:f,inlineImages:m,recordCanvas:g,preserveWhiteSpace:E,onSerialize:y,onIframeLoad:v,iframeLoadTimeout:w,onStylesheetLoad:b,stylesheetLoadTimeout:S,keepIframeSrcFn:C});t&&b(e,t)}},S),M}function tp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function rp(e){if(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 np={exports:{}},sp=String,op=function(){return{isColorSupported:!1,reset:sp,bold:sp,dim:sp,italic:sp,underline:sp,inverse:sp,hidden:sp,strikethrough:sp,black:sp,red:sp,green:sp,yellow:sp,blue:sp,magenta:sp,cyan:sp,white:sp,gray:sp,bgBlack:sp,bgRed:sp,bgGreen:sp,bgYellow:sp,bgBlue:sp,bgMagenta:sp,bgCyan:sp,bgWhite:sp}};np.exports=op(),np.exports.createColors=op;var ip=np.exports;const ap=rp(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let lp=ip,cp=ap,up=class e extends Error{constructor(t,r,n,s,o,i){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),s&&(this.source=s),i&&(this.plugin=i),void 0!==r&&void 0!==n&&("number"==typeof r?(this.line=r,this.column=n):(this.line=r.line,this.column=r.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}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(e){if(!this.source)return"";let t=this.source;null==e&&(e=lp.isColorSupported),cp&&e&&(t=cp(t));let r,n,s=t.split(/\r?\n/),o=Math.max(this.line-3,0),i=Math.min(this.line+2,s.length),a=String(i).length;if(e){let{bold:e,gray:t,red:s}=lp.createColors(!0);r=t=>e(s(t)),n=e=>t(e)}else r=n=e=>e;return s.slice(o,i).map((e,t)=>{let s=o+1+t,i=" "+(" "+s).slice(-a)+" | ";if(s===this.line){let t=n(i.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return r(">")+n(i)+e+"\n "+t+r("^")}return" "+n(i)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};var hp=up;up.default=up;var dp={};dp.isClean=Symbol("isClean"),dp.my=Symbol("my");const pp={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let fp=class{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(e,t,r){let n;if(r||(r=t),t&&(n=e.raws[t],void 0!==n))return n;let s=e.parent;if("before"===r){if(!s||"root"===s.type&&s.first===e)return"";if(s&&"document"===s.type)return""}if(!s)return pp[r];let o=e.root();if(o.rawCache||(o.rawCache={}),void 0!==o.rawCache[r])return o.rawCache[r];if("before"===r||"after"===r)return this.beforeAfter(e,r);{let s="raw"+((i=r)[0].toUpperCase()+i.slice(1));this[s]?n=this[s](o,e):o.walk(e=>{if(n=e.raws[t],void 0!==n)return!1})}var i;return void 0===n&&(n=pp[r]),o.rawCache[r]=n,n}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)}};var mp=fp;fp.default=fp;let gp=mp;function yp(e,t){new gp(t).stringify(e)}var vp=yp;yp.default=yp;let{isClean:wp,my:bp}=dp,Sp=hp,Cp=mp,Ip=vp;function xp(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=>xp(e,r)):("object"===o&&null!==s&&(s=xp(s)),r[n]=s)}return r}let kp=class{constructor(e={}){this.raws={},this[wp]=!1,this[bp]=!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=xp(this);for(let r in e)t[r]=e[r];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:r,start:n}=this.rangeBy(t);return this.source.input.error(e,{column:n.column,line:n.line},{column:r.column,line:r.line},t)}return new Sp(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markDirty(){if(this[wp]){this[wp]=!1;let e=this;for(;e=e.parent;)e[wp]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){let n=(t=this.toString()).indexOf(e.word);-1!==n&&(r=this.positionInside(n,t))}return r}positionInside(e,t){let r=t||this.toString(),n=this.source.start.column,s=this.source.start.line;for(let t=0;t<e;t++)"\n"===r[t]?(n=1,s+=1):n+=1;return{column:n,line:s}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let n=this.toString(),s=n.indexOf(e.word);-1!==s&&(t=this.positionInside(s,n),r=this.positionInside(s+e.word.length,n))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return(new Cp).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let n of e)n===this?r=!0:r?(this.parent.insertAfter(t,n),t=n):this.parent.insertBefore(t,n);r||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let r={},n=null==t;t=t||new Map;let 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){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=Ip){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){let n={node:this};for(let e in r)n[e]=r[e];return e.warn(t,n)}get proxyOf(){return this}};var Op=kp;kp.default=kp;let Ep=Op,Rp=class extends Ep{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}};var Ap=Rp;Rp.default=Rp;var Mp={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(r=t)=>{let n="",s=r;for(;s--;)n+=e[Math.random()*e.length|0];return n}};let{SourceMapConsumer:Pp,SourceMapGenerator:Np}=ap,{existsSync:Tp,readFileSync:Dp}=ap,{dirname:Lp,join:_p}=ap;let Fp=class{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,n=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=Lp(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new Pp(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t;let r=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+r)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let r=e.lastIndexOf(t.pop()),n=e.indexOf("*/",r);r>-1&&n>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,n)))}loadFile(e){if(this.root=Lp(e),Tp(e))return this.mapFile=e,Dp(e,"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 Pp)return Np.fromSourceMap(t).toString();if(t instanceof Np)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=_p(Lp(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)}};var Bp=Fp;Fp.default=Fp;let{SourceMapConsumer:Up,SourceMapGenerator:jp}=ap,{fileURLToPath:zp,pathToFileURL:Wp}=ap,{isAbsolute:Vp,resolve:Gp}=ap,{nanoid:Zp}=Mp,Yp=ap,Kp=hp,Jp=Bp,qp=Symbol("fromOffsetCache"),$p=Boolean(Up&&jp),Xp=Boolean(Gp&&Vp),Hp=class{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!Xp||/^\w+:\/\//.test(t.from)||Vp(t.from)?this.file=t.from:this.file=Gp(t.from)),Xp&&$p){let e=new Jp(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+Zp(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let s,o,i;if(t&&"object"==typeof t){let e=t,n=r;if("number"==typeof e.offset){let n=this.fromOffset(e.offset);t=n.line,r=n.col}else t=e.line,r=e.column;if("number"==typeof n.offset){let e=this.fromOffset(n.offset);o=e.line,i=e.col}else o=n.line,i=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let a=this.origin(t,r,o,i);return s=a?new Kp(e,void 0===a.endLine?a.line:{column:a.column,line:a.line},void 0===a.endLine?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,n.plugin):new Kp(e,void 0===o?t:{column:r,line:t},void 0===o?r:{column:i,line:o},this.css,this.file,n.plugin),s.input={column:r,endColumn:i,endLine:o,line:t,source:this.css},this.file&&(Wp&&(s.input.url=Wp(this.file).toString()),s.input.file=this.file),s}fromOffset(e){let t,r;if(this[qp])r=this[qp];else{let e=this.css.split("\n");r=new Array(e.length);let t=0;for(let n=0,s=e.length;n<s;n++)r[n]=t,t+=e[n].length+1;this[qp]=r}t=r[r.length-1];let n=0;if(e>=t)n=r.length-1;else{let t,s=r.length-2;for(;n<s;)if(t=n+(s-n>>1),e<r[t])s=t-1;else{if(!(e>=r[t+1])){n=t;break}n=t+1}}return{col:e-r[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:Gp(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,n){if(!this.map)return!1;let s,o,i=this.map.consumer(),a=i.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof r&&(s=i.originalPositionFor({column:n,line:r})),o=Vp(a.source)?Wp(a.source):new URL(a.source,this.map.consumer().sourceRoot||Wp(this.map.mapFile));let l={column:a.column,endColumn:s&&s.column,endLine:s&&s.line,line:a.line,url:o.toString()};if("file:"===o.protocol){if(!zp)throw new Error("file: protocol is not available in this PostCSS build");l.file=zp(o)}let c=i.sourceContentFor(a.source);return c&&(l.source=c),l}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}};var Qp=Hp;Hp.default=Hp,Yp&&Yp.registerInput&&Yp.registerInput(Hp);let{SourceMapConsumer:ef,SourceMapGenerator:tf}=ap,{dirname:rf,relative:nf,resolve:sf,sep:of}=ap,{pathToFileURL:af}=ap,lf=Qp,cf=Boolean(ef&&tf),uf=Boolean(rf&&sf&&nf&&of);var hf=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 e of this.previous()){let t,r=this.toUrl(this.path(e.file)),n=e.root||rf(e.file);!1===this.mapOpts.sourcesContent?(t=new ef(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,r,this.toUrl(this.path(n)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),uf&&cf&&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=tf.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new tf({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 tf({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))),e=i.match(/\n/g),e?(r+=e.length,t=i.lastIndexOf("\n"),n=i.length-t):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(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?rf(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=rf(sf(r,this.mapOpts.annotation)));let n=nf(r,e);return this.memoizedPaths.set(e,n),n}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 lf(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(af){let t=af(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;"\\"===of&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let df=Op,pf=class extends df{constructor(e){super(e),this.type="comment"}};var ff=pf;pf.default=pf;let mf,gf,yf,vf,{isClean:wf,my:bf}=dp,Sf=Ap,Cf=ff,If=Op;function xf(e){return e.map(e=>(e.nodes&&(e.nodes=xf(e.nodes)),delete e.source,e))}function kf(e){if(e[wf]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)kf(t)}let Of=class e extends If{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(t,r){if("string"==typeof t)t=xf(mf(t).nodes);else if(void 0===t)t=[];else if(Array.isArray(t)){t=t.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===t.type&&"document"!==this.type){t=t.nodes.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if(t.type)t=[t];else if(t.prop){if(void 0===t.value)throw new Error("Value field is missed in node creation");"string"!=typeof t.value&&(t.value=String(t.value)),t=[new Sf(t)]}else if(t.selector)t=[new gf(t)];else if(t.name)t=[new yf(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new Cf(t)]}return t.map(t=>(t[bf]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[wf]&&kf(t),void 0===t.raws.before&&r&&void 0!==r.raws.before&&(t.raws.before=r.raws.before.replace(/\S/g,"")),t.parent=this.proxyOf,t))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls(n=>{t.props&&!t.props.includes(n.prop)||t.fast&&!n.value.includes(t.fast)||(n.value=n.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,r)=>{let n;try{n=e(t,r)}catch(e){throw t.addToError(e)}return!1!==n&&t.walk&&(n=t.walk(e)),n})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("atrule"===r.type&&e.test(r.name))return t(r,n)}):this.walk((r,n)=>{if("atrule"===r.type&&r.name===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("atrule"===e.type)return t(e,r)}))}walkComments(e){return this.walk((t,r)=>{if("comment"===t.type)return e(t,r)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("decl"===r.type&&e.test(r.prop))return t(r,n)}):this.walk((r,n)=>{if("decl"===r.type&&r.prop===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("decl"===e.type)return t(e,r)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("rule"===r.type&&e.test(r.selector))return t(r,n)}):this.walk((r,n)=>{if("rule"===r.type&&r.selector===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("rule"===e.type)return t(e,r)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};Of.registerParse=e=>{mf=e},Of.registerRule=e=>{gf=e},Of.registerAtRule=e=>{yf=e},Of.registerRoot=e=>{vf=e};var Ef=Of;Of.default=Of,Of.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,yf.prototype):"rule"===e.type?Object.setPrototypeOf(e,gf.prototype):"decl"===e.type?Object.setPrototypeOf(e,Sf.prototype):"comment"===e.type?Object.setPrototypeOf(e,Cf.prototype):"root"===e.type&&Object.setPrototypeOf(e,vf.prototype),e[bf]=!0,e.nodes&&e.nodes.forEach(e=>{Of.rebuild(e)})};let Rf,Af,Mf=Ef,Pf=class extends Mf{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new Rf(new Af,this,e).stringify()}};Pf.registerLazyResult=e=>{Rf=e},Pf.registerProcessor=e=>{Af=e};var Nf=Pf;Pf.default=Pf;let Tf={};var Df=function(e){Tf[e]||(Tf[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let Lf=class{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}};var _f=Lf;Lf.default=Lf;let Ff=_f,Bf=class{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let r=new Ff(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};var Uf=Bf;Bf.default=Bf;const jf="'".charCodeAt(0),zf='"'.charCodeAt(0),Wf="\\".charCodeAt(0),Vf="/".charCodeAt(0),Gf="\n".charCodeAt(0),Zf=" ".charCodeAt(0),Yf="\f".charCodeAt(0),Kf="\t".charCodeAt(0),Jf="\r".charCodeAt(0),qf="[".charCodeAt(0),$f="]".charCodeAt(0),Xf="(".charCodeAt(0),Hf=")".charCodeAt(0),Qf="{".charCodeAt(0),em="}".charCodeAt(0),tm=";".charCodeAt(0),rm="*".charCodeAt(0),nm=":".charCodeAt(0),sm="@".charCodeAt(0),om=/[\t\n\f\r "#'()/;[\\\]{}]/g,im=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,am=/.[\r\n"'(/\\]/,lm=/[\da-f]/i;let cm=Ef,um=class extends cm{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)}};var hm=um;um.default=um,cm.registerAtRule(um);let dm,pm,fm=Ef,mm=class extends fm{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(e={}){return new dm(new pm,this,e).stringify()}};mm.registerLazyResult=e=>{dm=e},mm.registerProcessor=e=>{pm=e};var gm=mm;mm.default=mm,fm.registerRoot(mm);let ym={comma:e=>ym.split(e,[","],!0),space:e=>ym.split(e,[" ","\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}};var vm=ym;ym.default=ym;let wm=Ef,bm=vm,Sm=class extends wm{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return bm.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)}};var Cm=Sm;Sm.default=Sm,wm.registerRule(Sm);let Im=Ap,xm=function(e,t={}){let r,n,s,o,i,a,l,c,u,h,d=e.css.valueOf(),p=t.ignoreErrors,f=d.length,m=0,g=[],y=[];function v(t){throw e.error("Unclosed "+t,m)}return{back:function(e){y.push(e)},endOfFile:function(){return 0===y.length&&m>=f},nextToken:function(e){if(y.length)return y.pop();if(m>=f)return;let t=!!e&&e.ignoreUnclosed;switch(r=d.charCodeAt(m),r){case Gf:case Zf:case Kf:case Jf:case Yf:n=m;do{n+=1,r=d.charCodeAt(n)}while(r===Zf||r===Gf||r===Kf||r===Jf||r===Yf);h=["space",d.slice(m,n)],m=n-1;break;case qf:case $f:case Qf:case em:case nm:case tm:case Hf:{let e=String.fromCharCode(r);h=[e,e,m];break}case Xf:if(c=g.length?g.pop()[1]:"",u=d.charCodeAt(m+1),"url"===c&&u!==jf&&u!==zf&&u!==Zf&&u!==Gf&&u!==Kf&&u!==Yf&&u!==Jf){n=m;do{if(a=!1,n=d.indexOf(")",n+1),-1===n){if(p||t){n=m;break}v("bracket")}for(l=n;d.charCodeAt(l-1)===Wf;)l-=1,a=!a}while(a);h=["brackets",d.slice(m,n+1),m,n],m=n}else n=d.indexOf(")",m+1),o=d.slice(m,n+1),-1===n||am.test(o)?h=["(","(",m]:(h=["brackets",o,m,n],m=n);break;case jf:case zf:s=r===jf?"'":'"',n=m;do{if(a=!1,n=d.indexOf(s,n+1),-1===n){if(p||t){n=m+1;break}v("string")}for(l=n;d.charCodeAt(l-1)===Wf;)l-=1,a=!a}while(a);h=["string",d.slice(m,n+1),m,n],m=n;break;case sm:om.lastIndex=m+1,om.test(d),n=0===om.lastIndex?d.length-1:om.lastIndex-2,h=["at-word",d.slice(m,n+1),m,n],m=n;break;case Wf:for(n=m,i=!0;d.charCodeAt(n+1)===Wf;)n+=1,i=!i;if(r=d.charCodeAt(n+1),i&&r!==Vf&&r!==Zf&&r!==Gf&&r!==Kf&&r!==Jf&&r!==Yf&&(n+=1,lm.test(d.charAt(n)))){for(;lm.test(d.charAt(n+1));)n+=1;d.charCodeAt(n+1)===Zf&&(n+=1)}h=["word",d.slice(m,n+1),m,n],m=n;break;default:r===Vf&&d.charCodeAt(m+1)===rm?(n=d.indexOf("*/",m+2)+1,0===n&&(p||t?n=d.length:v("comment")),h=["comment",d.slice(m,n+1),m,n],m=n):(im.lastIndex=m+1,im.test(d),n=0===im.lastIndex?d.length-1:im.lastIndex-2,h=["word",d.slice(m,n+1),m,n],g.push(h),m=n)}return m++,h},position:function(){return m}}},km=ff,Om=hm,Em=gm,Rm=Cm;const Am={empty:!0,space:!0};var Mm=class{constructor(e){this.input=e,this.root=new Em,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,r,n,s=new Om;s.name=e[1].slice(1),""===s.name&&this.unnamedAtrule(s,e),this.init(s,e[2]);let o=!1,i=!1,a=[],l=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?l.push("("===t?")":"]"):"{"===t&&l.length>0?l.push("}"):t===l[l.length-1]&&l.pop(),0===l.length){if(";"===t){s.source.end=this.getPosition(e[2]),s.source.end.offset++,this.semicolon=!0;break}if("{"===t){i=!0;break}if("}"===t){if(a.length>0){for(n=a.length-1,r=a[n];r&&"space"===r[0];)r=a[--n];r&&(s.source.end=this.getPosition(r[3]||r[2]),s.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}s.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(s.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(s,"params",a),o&&(e=a[a.length-1],s.source.end=this.getPosition(e[3]||e[2]),s.source.end.offset++,this.spaces=s.raws.between,s.raws.between="")):(s.raws.afterName="",s.params=""),i&&(s.nodes=[],this.current=s)}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(t=i,r=t[0],"("===r&&(s+=1),")"===r&&(s-=1),0===s&&":"===r){if(n){if("word"===n[0]&&"progid"===n[1])continue;return o}this.doubleColon(t)}n=t}return!1}comment(e){let t=new km;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text="",t.raws.left=r,t.raws.right="";else{let e=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=xm(this.input)}decl(e,t){let r=new Im;this.init(r,e[0][2]);let n,s=e[e.length-1];for(";"===s[0]&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(s[3]||s[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)),r.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),r.raws.before+=e.shift()[1];for(r.source.start=this.getPosition(e[0][2]),r.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;r.prop+=e.shift()[1]}for(r.raws.between="";e.length;){if(n=e.shift(),":"===n[0]){r.raws.between+=n[1];break}"word"===n[0]&&/\w/.test(n[1])&&this.unknownWord([n]),r.raws.between+=n[1]}"_"!==r.prop[0]&&"*"!==r.prop[0]||(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let o,i=[];for(;e.length&&(o=e[0][0],"space"===o||"comment"===o);)i.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(n=e[t],"!important"===n[1].toLowerCase()){r.important=!0;let n=this.stringFrom(e,t);n=this.spacesFromEnd(e)+n," !important"!==n&&(r.raws.important=n);break}if("important"===n[1].toLowerCase()){let n=e.slice(0),s="";for(let e=t;e>0;e--){let t=n[e][0];if(0===s.trim().indexOf("!")&&"space"!==t)break;s=n.pop()[1]+s}0===s.trim().indexOf("!")&&(r.important=!0,r.raws.important=s,e=n)}if("space"!==n[0]&&"comment"!==n[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(r.raws.between+=i.map(e=>e[1]).join(""),i=[]),this.raw(r,"value",i.concat(e),t),r.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 Rm;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,r=null,n=!1,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,i,a,l=r.length,c="",u=!0;for(let e=0;e<l;e+=1)s=r[e],o=s[0],"space"!==o||e!==l-1||n?"comment"===o?(a=r[e-1]?r[e-1][0]:"empty",i=r[e+1]?r[e+1][0]:"empty",Am[a]||Am[i]||","===c.slice(-1)?u=!1:c+=s[1]):c+=s[1]:u=!1;if(!u){let n=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:n,value:c}}e[t]=c}rule(e){e.pop();let t=new Rm;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let n=t;n<e.length;n++)r+=e[n][1];return e.splice(t,e.length-t),r}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}};let Pm=Ef,Nm=Mm,Tm=Qp;function Dm(e,t){let r=new Tm(e,t),n=new Nm(r);try{n.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&t&&t.from&&(/\.scss$/i.test(t.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(t.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(t.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return n.root}var Lm=Dm;Dm.default=Dm,Pm.registerParse(Dm);let{isClean:_m,my:Fm}=dp,Bm=hf,Um=vp,jm=Ef,zm=Nf,Wm=Df,Vm=Uf,Gm=Lm,Zm=gm;const Ym={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Km={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},Jm={Once:!0,postcssPlugin:!0,prepare:!0};function qm(e){return"object"==typeof e&&"function"==typeof e.then}function $m(e){let t=!1,r=Ym[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 Xm(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:$m(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function Hm(e){return e[_m]=!1,e.nodes&&e.nodes.forEach(e=>Hm(e)),e}let Qm={},eg=class e{constructor(t,r,n){let s;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof e||r instanceof Vm)s=Hm(r.root),r.map&&(void 0===n.map&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=r.map);else{let e=Gm;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{s=e(r,n)}catch(e){this.processed=!0,this.error=e}s&&!s[Fm]&&jm.rebuild(s)}else s=Hm(r);this.result=new Vm(t,s,n),this.helpers={...Qm,postcss:Qm,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(!Km[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Jm[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(qm(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[_m];){e[_m]=!0;let t=[Xm(e)];for(;t.length>0;){let e=this.visitTick(t);if(qm(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 qm(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=Um;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new Bm(t,this.result.root,this.result.opts).generate();return this.result.css=r[0],this.result.map=r[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(qm(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[_m];)e[_m]=!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||Wm("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(qm(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[_m])return n[_m]=!0,void e.push(Xm(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[_m]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[_m]=!0;let t=$m(e);for(let r of t)if(0===r)e.nodes&&e.each(e=>{e[_m]||this.walkSync(e)});else{let t=this.listeners[r];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};eg.registerPostcss=e=>{Qm=e};var tg=eg;eg.default=eg,Zm.registerLazyResult(eg),zm.registerLazyResult(eg);let rg=hf,ng=vp,sg=Df,og=Lm;const ig=Uf;let ag=class{constructor(e,t,r){let n;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;let s=ng;this.result=new ig(this._processor,n,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let i=new rg(s,n,this._opts,t);if(i.isMap()){let[e,t]=i.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else i.clearAnnotation(),this.result.css=i.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||sg("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=og;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}};var lg=ag;ag.default=ag;let cg=lg,ug=tg,hg=Nf,dg=gm,pg=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new ug(this,e,t):new cg(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var fg=pg;pg.default=pg,dg.registerProcessor(pg),hg.registerProcessor(pg);let mg=Ap,gg=Bp,yg=ff,vg=hm,wg=Qp,bg=gm,Sg=Cm;function Cg(e,t){if(Array.isArray(e))return e.map(e=>Cg(e));let{inputs:r,...n}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:wg.prototype};r.map&&(r.map={...r.map,__proto__:gg.prototype}),t.push(r)}}if(n.nodes&&(n.nodes=e.nodes.map(e=>Cg(e,t))),n.source){let{inputId:e,...r}=n.source;n.source=r,null!=e&&(n.source.input=t[e])}if("root"===n.type)return new bg(n);if("decl"===n.type)return new mg(n);if("rule"===n.type)return new Sg(n);if("comment"===n.type)return new yg(n);if("atrule"===n.type)return new vg(n);throw new Error("Unknown node type: "+e.type)}var Ig=Cg;Cg.default=Cg;let xg=hp,kg=Ap,Og=tg,Eg=Ef,Rg=fg,Ag=vp,Mg=Ig,Pg=Nf,Ng=_f,Tg=ff,Dg=hm,Lg=Uf,_g=Qp,Fg=Lm,Bg=vm,Ug=Cm,jg=gm,zg=Op;function Wg(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new Rg(e)}Wg.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 Rg).version,s}return Object.defineProperty(s,"postcss",{get:()=>(r||(r=s()),r)}),s.process=function(e,t,r){return Wg([s(r)]).process(e,t)},s},Wg.stringify=Ag,Wg.parse=Fg,Wg.fromJSON=Mg,Wg.list=Bg,Wg.comment=e=>new Tg(e),Wg.atRule=e=>new Dg(e),Wg.decl=e=>new kg(e),Wg.rule=e=>new Ug(e),Wg.root=e=>new jg(e),Wg.document=e=>new Pg(e),Wg.CssSyntaxError=xg,Wg.Declaration=kg,Wg.Container=Eg,Wg.Processor=Rg,Wg.Document=Pg,Wg.Comment=Tg,Wg.Warning=Ng,Wg.AtRule=Dg,Wg.Result=Lg,Wg.Input=_g,Wg.Rule=Ug,Wg.Root=jg,Wg.Node=zg,Og.registerPostcss(Wg);var Vg=Wg;Wg.default=Wg;const Gg=tp(Vg);Gg.stringify,Gg.fromJSON,Gg.plugin,Gg.parse,Gg.list,Gg.document,Gg.comment,Gg.atRule,Gg.rule,Gg.decl,Gg.root,Gg.CssSyntaxError,Gg.Declaration,Gg.Container,Gg.Processor,Gg.Document,Gg.Comment,Gg.Warning,Gg.AtRule,Gg.Result,Gg.Input,Gg.Rule,Gg.Root,Gg.Node;var Zg=Object.defineProperty,Yg=(e,t,r)=>((e,t,r)=>t in e?Zg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);function Kg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Jg(e){if(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 qg={exports:{}},$g=String,Xg=function(){return{isColorSupported:!1,reset:$g,bold:$g,dim:$g,italic:$g,underline:$g,inverse:$g,hidden:$g,strikethrough:$g,black:$g,red:$g,green:$g,yellow:$g,blue:$g,magenta:$g,cyan:$g,white:$g,gray:$g,bgBlack:$g,bgRed:$g,bgGreen:$g,bgYellow:$g,bgBlue:$g,bgMagenta:$g,bgCyan:$g,bgWhite:$g}};qg.exports=Xg(),qg.exports.createColors=Xg;var Hg=qg.exports;const Qg=Jg(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let ey=Hg,ty=Qg,ry=class e extends Error{constructor(t,r,n,s,o,i){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),s&&(this.source=s),i&&(this.plugin=i),void 0!==r&&void 0!==n&&("number"==typeof r?(this.line=r,this.column=n):(this.line=r.line,this.column=r.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}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(e){if(!this.source)return"";let t=this.source;null==e&&(e=ey.isColorSupported),ty&&e&&(t=ty(t));let r,n,s=t.split(/\r?\n/),o=Math.max(this.line-3,0),i=Math.min(this.line+2,s.length),a=String(i).length;if(e){let{bold:e,gray:t,red:s}=ey.createColors(!0);r=t=>e(s(t)),n=e=>t(e)}else r=n=e=>e;return s.slice(o,i).map((e,t)=>{let s=o+1+t,i=" "+(" "+s).slice(-a)+" | ";if(s===this.line){let t=n(i.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return r(">")+n(i)+e+"\n "+t+r("^")}return" "+n(i)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};var ny=ry;ry.default=ry;var sy={};sy.isClean=Symbol("isClean"),sy.my=Symbol("my");const oy={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let iy=class{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(e,t,r){let n;if(r||(r=t),t&&(n=e.raws[t],void 0!==n))return n;let s=e.parent;if("before"===r){if(!s||"root"===s.type&&s.first===e)return"";if(s&&"document"===s.type)return""}if(!s)return oy[r];let o=e.root();if(o.rawCache||(o.rawCache={}),void 0!==o.rawCache[r])return o.rawCache[r];if("before"===r||"after"===r)return this.beforeAfter(e,r);{let s="raw"+((i=r)[0].toUpperCase()+i.slice(1));this[s]?n=this[s](o,e):o.walk(e=>{if(n=e.raws[t],void 0!==n)return!1})}var i;return void 0===n&&(n=oy[r]),o.rawCache[r]=n,n}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)}};var ay=iy;iy.default=iy;let ly=ay;function cy(e,t){new ly(t).stringify(e)}var uy=cy;cy.default=cy;let{isClean:hy,my:dy}=sy,py=ny,fy=ay,my=uy;function gy(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=>gy(e,r)):("object"===o&&null!==s&&(s=gy(s)),r[n]=s)}return r}let yy=class{constructor(e={}){this.raws={},this[hy]=!1,this[dy]=!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=gy(this);for(let r in e)t[r]=e[r];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:r,start:n}=this.rangeBy(t);return this.source.input.error(e,{column:n.column,line:n.line},{column:r.column,line:r.line},t)}return new py(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markDirty(){if(this[hy]){this[hy]=!1;let e=this;for(;e=e.parent;)e[hy]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){let n=(t=this.toString()).indexOf(e.word);-1!==n&&(r=this.positionInside(n,t))}return r}positionInside(e,t){let r=t||this.toString(),n=this.source.start.column,s=this.source.start.line;for(let t=0;t<e;t++)"\n"===r[t]?(n=1,s+=1):n+=1;return{column:n,line:s}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let n=this.toString(),s=n.indexOf(e.word);-1!==s&&(t=this.positionInside(s,n),r=this.positionInside(s+e.word.length,n))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return(new fy).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let n of e)n===this?r=!0:r?(this.parent.insertAfter(t,n),t=n):this.parent.insertBefore(t,n);r||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let r={},n=null==t;t=t||new Map;let 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){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=my){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){let n={node:this};for(let e in r)n[e]=r[e];return e.warn(t,n)}get proxyOf(){return this}};var vy=yy;yy.default=yy;let wy=vy,by=class extends wy{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}};var Sy=by;by.default=by;var Cy={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(r=t)=>{let n="",s=r;for(;s--;)n+=e[Math.random()*e.length|0];return n}};let{SourceMapConsumer:Iy,SourceMapGenerator:xy}=Qg,{existsSync:ky,readFileSync:Oy}=Qg,{dirname:Ey,join:Ry}=Qg;let Ay=class{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,n=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=Ey(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new Iy(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t;let r=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+r)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let r=e.lastIndexOf(t.pop()),n=e.indexOf("*/",r);r>-1&&n>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,n)))}loadFile(e){if(this.root=Ey(e),ky(e))return this.mapFile=e,Oy(e,"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 Iy)return xy.fromSourceMap(t).toString();if(t instanceof xy)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=Ry(Ey(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)}};var My=Ay;Ay.default=Ay;let{SourceMapConsumer:Py,SourceMapGenerator:Ny}=Qg,{fileURLToPath:Ty,pathToFileURL:Dy}=Qg,{isAbsolute:Ly,resolve:_y}=Qg,{nanoid:Fy}=Cy,By=Qg,Uy=ny,jy=My,zy=Symbol("fromOffsetCache"),Wy=Boolean(Py&&Ny),Vy=Boolean(_y&&Ly),Gy=class{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!Vy||/^\w+:\/\//.test(t.from)||Ly(t.from)?this.file=t.from:this.file=_y(t.from)),Vy&&Wy){let e=new jy(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+Fy(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let s,o,i;if(t&&"object"==typeof t){let e=t,n=r;if("number"==typeof e.offset){let n=this.fromOffset(e.offset);t=n.line,r=n.col}else t=e.line,r=e.column;if("number"==typeof n.offset){let e=this.fromOffset(n.offset);o=e.line,i=e.col}else o=n.line,i=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let a=this.origin(t,r,o,i);return s=a?new Uy(e,void 0===a.endLine?a.line:{column:a.column,line:a.line},void 0===a.endLine?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,n.plugin):new Uy(e,void 0===o?t:{column:r,line:t},void 0===o?r:{column:i,line:o},this.css,this.file,n.plugin),s.input={column:r,endColumn:i,endLine:o,line:t,source:this.css},this.file&&(Dy&&(s.input.url=Dy(this.file).toString()),s.input.file=this.file),s}fromOffset(e){let t,r;if(this[zy])r=this[zy];else{let e=this.css.split("\n");r=new Array(e.length);let t=0;for(let n=0,s=e.length;n<s;n++)r[n]=t,t+=e[n].length+1;this[zy]=r}t=r[r.length-1];let n=0;if(e>=t)n=r.length-1;else{let t,s=r.length-2;for(;n<s;)if(t=n+(s-n>>1),e<r[t])s=t-1;else{if(!(e>=r[t+1])){n=t;break}n=t+1}}return{col:e-r[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:_y(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,n){if(!this.map)return!1;let s,o,i=this.map.consumer(),a=i.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof r&&(s=i.originalPositionFor({column:n,line:r})),o=Ly(a.source)?Dy(a.source):new URL(a.source,this.map.consumer().sourceRoot||Dy(this.map.mapFile));let l={column:a.column,endColumn:s&&s.column,endLine:s&&s.line,line:a.line,url:o.toString()};if("file:"===o.protocol){if(!Ty)throw new Error("file: protocol is not available in this PostCSS build");l.file=Ty(o)}let c=i.sourceContentFor(a.source);return c&&(l.source=c),l}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}};var Zy=Gy;Gy.default=Gy,By&&By.registerInput&&By.registerInput(Gy);let{SourceMapConsumer:Yy,SourceMapGenerator:Ky}=Qg,{dirname:Jy,relative:qy,resolve:$y,sep:Xy}=Qg,{pathToFileURL:Hy}=Qg,Qy=Zy,ev=Boolean(Yy&&Ky),tv=Boolean(Jy&&$y&&qy&&Xy);var rv=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 e of this.previous()){let t,r=this.toUrl(this.path(e.file)),n=e.root||Jy(e.file);!1===this.mapOpts.sourcesContent?(t=new Yy(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,r,this.toUrl(this.path(n)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),tv&&ev&&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=Ky.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new Ky({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 Ky({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))),e=i.match(/\n/g),e?(r+=e.length,t=i.lastIndexOf("\n"),n=i.length-t):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(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?Jy(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=Jy($y(r,this.mapOpts.annotation)));let n=qy(r,e);return this.memoizedPaths.set(e,n),n}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 Qy(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(Hy){let t=Hy(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;"\\"===Xy&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let nv=vy,sv=class extends nv{constructor(e){super(e),this.type="comment"}};var ov=sv;sv.default=sv;let iv,av,lv,cv,{isClean:uv,my:hv}=sy,dv=Sy,pv=ov,fv=vy;function mv(e){return e.map(e=>(e.nodes&&(e.nodes=mv(e.nodes)),delete e.source,e))}function gv(e){if(e[uv]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)gv(t)}let yv=class e extends fv{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(t,r){if("string"==typeof t)t=mv(iv(t).nodes);else if(void 0===t)t=[];else if(Array.isArray(t)){t=t.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===t.type&&"document"!==this.type){t=t.nodes.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if(t.type)t=[t];else if(t.prop){if(void 0===t.value)throw new Error("Value field is missed in node creation");"string"!=typeof t.value&&(t.value=String(t.value)),t=[new dv(t)]}else if(t.selector)t=[new av(t)];else if(t.name)t=[new lv(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new pv(t)]}return t.map(t=>(t[hv]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[uv]&&gv(t),void 0===t.raws.before&&r&&void 0!==r.raws.before&&(t.raws.before=r.raws.before.replace(/\S/g,"")),t.parent=this.proxyOf,t))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls(n=>{t.props&&!t.props.includes(n.prop)||t.fast&&!n.value.includes(t.fast)||(n.value=n.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,r)=>{let n;try{n=e(t,r)}catch(e){throw t.addToError(e)}return!1!==n&&t.walk&&(n=t.walk(e)),n})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("atrule"===r.type&&e.test(r.name))return t(r,n)}):this.walk((r,n)=>{if("atrule"===r.type&&r.name===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("atrule"===e.type)return t(e,r)}))}walkComments(e){return this.walk((t,r)=>{if("comment"===t.type)return e(t,r)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("decl"===r.type&&e.test(r.prop))return t(r,n)}):this.walk((r,n)=>{if("decl"===r.type&&r.prop===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("decl"===e.type)return t(e,r)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("rule"===r.type&&e.test(r.selector))return t(r,n)}):this.walk((r,n)=>{if("rule"===r.type&&r.selector===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("rule"===e.type)return t(e,r)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};yv.registerParse=e=>{iv=e},yv.registerRule=e=>{av=e},yv.registerAtRule=e=>{lv=e},yv.registerRoot=e=>{cv=e};var vv=yv;yv.default=yv,yv.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,lv.prototype):"rule"===e.type?Object.setPrototypeOf(e,av.prototype):"decl"===e.type?Object.setPrototypeOf(e,dv.prototype):"comment"===e.type?Object.setPrototypeOf(e,pv.prototype):"root"===e.type&&Object.setPrototypeOf(e,cv.prototype),e[hv]=!0,e.nodes&&e.nodes.forEach(e=>{yv.rebuild(e)})};let wv,bv,Sv=vv,Cv=class extends Sv{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new wv(new bv,this,e).stringify()}};Cv.registerLazyResult=e=>{wv=e},Cv.registerProcessor=e=>{bv=e};var Iv=Cv;Cv.default=Cv;let xv={};var kv=function(e){xv[e]||(xv[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let Ov=class{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}};var Ev=Ov;Ov.default=Ov;let Rv=Ev,Av=class{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let r=new Rv(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};var Mv=Av;Av.default=Av;const Pv="'".charCodeAt(0),Nv='"'.charCodeAt(0),Tv="\\".charCodeAt(0),Dv="/".charCodeAt(0),Lv="\n".charCodeAt(0),_v=" ".charCodeAt(0),Fv="\f".charCodeAt(0),Bv="\t".charCodeAt(0),Uv="\r".charCodeAt(0),jv="[".charCodeAt(0),zv="]".charCodeAt(0),Wv="(".charCodeAt(0),Vv=")".charCodeAt(0),Gv="{".charCodeAt(0),Zv="}".charCodeAt(0),Yv=";".charCodeAt(0),Kv="*".charCodeAt(0),Jv=":".charCodeAt(0),qv="@".charCodeAt(0),$v=/[\t\n\f\r "#'()/;[\\\]{}]/g,Xv=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Hv=/.[\r\n"'(/\\]/,Qv=/[\da-f]/i;let ew=vv,tw=class extends ew{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)}};var rw=tw;tw.default=tw,ew.registerAtRule(tw);let nw,sw,ow=vv,iw=class extends ow{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(e={}){return new nw(new sw,this,e).stringify()}};iw.registerLazyResult=e=>{nw=e},iw.registerProcessor=e=>{sw=e};var aw=iw;iw.default=iw,ow.registerRoot(iw);let lw={comma:e=>lw.split(e,[","],!0),space:e=>lw.split(e,[" ","\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}};var cw=lw;lw.default=lw;let uw=vv,hw=cw,dw=class extends uw{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return hw.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)}};var pw=dw;dw.default=dw,uw.registerRule(dw);let fw=Sy,mw=function(e,t={}){let r,n,s,o,i,a,l,c,u,h,d=e.css.valueOf(),p=t.ignoreErrors,f=d.length,m=0,g=[],y=[];function v(t){throw e.error("Unclosed "+t,m)}return{back:function(e){y.push(e)},endOfFile:function(){return 0===y.length&&m>=f},nextToken:function(e){if(y.length)return y.pop();if(m>=f)return;let t=!!e&&e.ignoreUnclosed;switch(r=d.charCodeAt(m),r){case Lv:case _v:case Bv:case Uv:case Fv:n=m;do{n+=1,r=d.charCodeAt(n)}while(r===_v||r===Lv||r===Bv||r===Uv||r===Fv);h=["space",d.slice(m,n)],m=n-1;break;case jv:case zv:case Gv:case Zv:case Jv:case Yv:case Vv:{let e=String.fromCharCode(r);h=[e,e,m];break}case Wv:if(c=g.length?g.pop()[1]:"",u=d.charCodeAt(m+1),"url"===c&&u!==Pv&&u!==Nv&&u!==_v&&u!==Lv&&u!==Bv&&u!==Fv&&u!==Uv){n=m;do{if(a=!1,n=d.indexOf(")",n+1),-1===n){if(p||t){n=m;break}v("bracket")}for(l=n;d.charCodeAt(l-1)===Tv;)l-=1,a=!a}while(a);h=["brackets",d.slice(m,n+1),m,n],m=n}else n=d.indexOf(")",m+1),o=d.slice(m,n+1),-1===n||Hv.test(o)?h=["(","(",m]:(h=["brackets",o,m,n],m=n);break;case Pv:case Nv:s=r===Pv?"'":'"',n=m;do{if(a=!1,n=d.indexOf(s,n+1),-1===n){if(p||t){n=m+1;break}v("string")}for(l=n;d.charCodeAt(l-1)===Tv;)l-=1,a=!a}while(a);h=["string",d.slice(m,n+1),m,n],m=n;break;case qv:$v.lastIndex=m+1,$v.test(d),n=0===$v.lastIndex?d.length-1:$v.lastIndex-2,h=["at-word",d.slice(m,n+1),m,n],m=n;break;case Tv:for(n=m,i=!0;d.charCodeAt(n+1)===Tv;)n+=1,i=!i;if(r=d.charCodeAt(n+1),i&&r!==Dv&&r!==_v&&r!==Lv&&r!==Bv&&r!==Uv&&r!==Fv&&(n+=1,Qv.test(d.charAt(n)))){for(;Qv.test(d.charAt(n+1));)n+=1;d.charCodeAt(n+1)===_v&&(n+=1)}h=["word",d.slice(m,n+1),m,n],m=n;break;default:r===Dv&&d.charCodeAt(m+1)===Kv?(n=d.indexOf("*/",m+2)+1,0===n&&(p||t?n=d.length:v("comment")),h=["comment",d.slice(m,n+1),m,n],m=n):(Xv.lastIndex=m+1,Xv.test(d),n=0===Xv.lastIndex?d.length-1:Xv.lastIndex-2,h=["word",d.slice(m,n+1),m,n],g.push(h),m=n)}return m++,h},position:function(){return m}}},gw=ov,yw=rw,vw=aw,ww=pw;const bw={empty:!0,space:!0};var Sw=class{constructor(e){this.input=e,this.root=new vw,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,r,n,s=new yw;s.name=e[1].slice(1),""===s.name&&this.unnamedAtrule(s,e),this.init(s,e[2]);let o=!1,i=!1,a=[],l=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?l.push("("===t?")":"]"):"{"===t&&l.length>0?l.push("}"):t===l[l.length-1]&&l.pop(),0===l.length){if(";"===t){s.source.end=this.getPosition(e[2]),s.source.end.offset++,this.semicolon=!0;break}if("{"===t){i=!0;break}if("}"===t){if(a.length>0){for(n=a.length-1,r=a[n];r&&"space"===r[0];)r=a[--n];r&&(s.source.end=this.getPosition(r[3]||r[2]),s.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}s.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(s.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(s,"params",a),o&&(e=a[a.length-1],s.source.end=this.getPosition(e[3]||e[2]),s.source.end.offset++,this.spaces=s.raws.between,s.raws.between="")):(s.raws.afterName="",s.params=""),i&&(s.nodes=[],this.current=s)}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(t=i,r=t[0],"("===r&&(s+=1),")"===r&&(s-=1),0===s&&":"===r){if(n){if("word"===n[0]&&"progid"===n[1])continue;return o}this.doubleColon(t)}n=t}return!1}comment(e){let t=new gw;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text="",t.raws.left=r,t.raws.right="";else{let e=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=mw(this.input)}decl(e,t){let r=new fw;this.init(r,e[0][2]);let n,s=e[e.length-1];for(";"===s[0]&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(s[3]||s[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)),r.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),r.raws.before+=e.shift()[1];for(r.source.start=this.getPosition(e[0][2]),r.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;r.prop+=e.shift()[1]}for(r.raws.between="";e.length;){if(n=e.shift(),":"===n[0]){r.raws.between+=n[1];break}"word"===n[0]&&/\w/.test(n[1])&&this.unknownWord([n]),r.raws.between+=n[1]}"_"!==r.prop[0]&&"*"!==r.prop[0]||(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let o,i=[];for(;e.length&&(o=e[0][0],"space"===o||"comment"===o);)i.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(n=e[t],"!important"===n[1].toLowerCase()){r.important=!0;let n=this.stringFrom(e,t);n=this.spacesFromEnd(e)+n," !important"!==n&&(r.raws.important=n);break}if("important"===n[1].toLowerCase()){let n=e.slice(0),s="";for(let e=t;e>0;e--){let t=n[e][0];if(0===s.trim().indexOf("!")&&"space"!==t)break;s=n.pop()[1]+s}0===s.trim().indexOf("!")&&(r.important=!0,r.raws.important=s,e=n)}if("space"!==n[0]&&"comment"!==n[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(r.raws.between+=i.map(e=>e[1]).join(""),i=[]),this.raw(r,"value",i.concat(e),t),r.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 ww;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,r=null,n=!1,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,i,a,l=r.length,c="",u=!0;for(let e=0;e<l;e+=1)s=r[e],o=s[0],"space"!==o||e!==l-1||n?"comment"===o?(a=r[e-1]?r[e-1][0]:"empty",i=r[e+1]?r[e+1][0]:"empty",bw[a]||bw[i]||","===c.slice(-1)?u=!1:c+=s[1]):c+=s[1]:u=!1;if(!u){let n=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:n,value:c}}e[t]=c}rule(e){e.pop();let t=new ww;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let n=t;n<e.length;n++)r+=e[n][1];return e.splice(t,e.length-t),r}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}};let Cw=vv,Iw=Sw,xw=Zy;function kw(e,t){let r=new xw(e,t),n=new Iw(r);try{n.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&t&&t.from&&(/\.scss$/i.test(t.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(t.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(t.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return n.root}var Ow=kw;kw.default=kw,Cw.registerParse(kw);let{isClean:Ew,my:Rw}=sy,Aw=rv,Mw=uy,Pw=vv,Nw=Iv,Tw=kv,Dw=Mv,Lw=Ow,_w=aw;const Fw={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Bw={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},Uw={Once:!0,postcssPlugin:!0,prepare:!0};function jw(e){return"object"==typeof e&&"function"==typeof e.then}function zw(e){let t=!1,r=Fw[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 Ww(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:zw(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function Vw(e){return e[Ew]=!1,e.nodes&&e.nodes.forEach(e=>Vw(e)),e}let Gw={},Zw=class e{constructor(t,r,n){let s;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof e||r instanceof Dw)s=Vw(r.root),r.map&&(void 0===n.map&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=r.map);else{let e=Lw;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{s=e(r,n)}catch(e){this.processed=!0,this.error=e}s&&!s[Rw]&&Pw.rebuild(s)}else s=Vw(r);this.result=new Dw(t,s,n),this.helpers={...Gw,postcss:Gw,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(!Bw[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Uw[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(jw(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Ew];){e[Ew]=!0;let t=[Ww(e)];for(;t.length>0;){let e=this.visitTick(t);if(jw(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 jw(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=Mw;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new Aw(t,this.result.root,this.result.opts).generate();return this.result.css=r[0],this.result.map=r[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(jw(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Ew];)e[Ew]=!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||Tw("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(jw(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[Ew])return n[Ew]=!0,void e.push(Ww(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[Ew]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[Ew]=!0;let t=zw(e);for(let r of t)if(0===r)e.nodes&&e.each(e=>{e[Ew]||this.walkSync(e)});else{let t=this.listeners[r];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};Zw.registerPostcss=e=>{Gw=e};var Yw=Zw;Zw.default=Zw,_w.registerLazyResult(Zw),Nw.registerLazyResult(Zw);let Kw=rv,Jw=uy,qw=kv,$w=Ow;const Xw=Mv;let Hw=class{constructor(e,t,r){let n;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;let s=Jw;this.result=new Xw(this._processor,n,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let i=new Kw(s,n,this._opts,t);if(i.isMap()){let[e,t]=i.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else i.clearAnnotation(),this.result.css=i.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||qw("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=$w;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}};var Qw=Hw;Hw.default=Hw;let eb=Qw,tb=Yw,rb=Iv,nb=aw,sb=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new tb(this,e,t):new eb(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var ob=sb;sb.default=sb,nb.registerProcessor(sb),rb.registerProcessor(sb);let ib=Sy,ab=My,lb=ov,cb=rw,ub=Zy,hb=aw,db=pw;function pb(e,t){if(Array.isArray(e))return e.map(e=>pb(e));let{inputs:r,...n}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:ub.prototype};r.map&&(r.map={...r.map,__proto__:ab.prototype}),t.push(r)}}if(n.nodes&&(n.nodes=e.nodes.map(e=>pb(e,t))),n.source){let{inputId:e,...r}=n.source;n.source=r,null!=e&&(n.source.input=t[e])}if("root"===n.type)return new hb(n);if("decl"===n.type)return new ib(n);if("rule"===n.type)return new db(n);if("comment"===n.type)return new lb(n);if("atrule"===n.type)return new cb(n);throw new Error("Unknown node type: "+e.type)}var fb=pb;pb.default=pb;let mb=ny,gb=Sy,yb=Yw,vb=vv,wb=ob,bb=uy,Sb=fb,Cb=Iv,Ib=Ev,xb=ov,kb=rw,Ob=Mv,Eb=Zy,Rb=Ow,Ab=cw,Mb=pw,Pb=aw,Nb=vy;function Tb(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new wb(e)}Tb.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 wb).version,s}return Object.defineProperty(s,"postcss",{get:()=>(r||(r=s()),r)}),s.process=function(e,t,r){return Tb([s(r)]).process(e,t)},s},Tb.stringify=bb,Tb.parse=Rb,Tb.fromJSON=Sb,Tb.list=Ab,Tb.comment=e=>new xb(e),Tb.atRule=e=>new kb(e),Tb.decl=e=>new gb(e),Tb.rule=e=>new Mb(e),Tb.root=e=>new Pb(e),Tb.document=e=>new Cb(e),Tb.CssSyntaxError=mb,Tb.Declaration=gb,Tb.Container=vb,Tb.Processor=wb,Tb.Document=Cb,Tb.Comment=xb,Tb.Warning=Ib,Tb.AtRule=kb,Tb.Result=Ob,Tb.Input=Eb,Tb.Rule=Mb,Tb.Root=Pb,Tb.Node=Nb,yb.registerPostcss(Tb);var Db=Tb;Tb.default=Tb;const Lb=Kg(Db);Lb.stringify,Lb.fromJSON,Lb.plugin,Lb.parse,Lb.list,Lb.document,Lb.comment,Lb.atRule,Lb.rule,Lb.decl,Lb.root,Lb.CssSyntaxError,Lb.Declaration,Lb.Container,Lb.Processor,Lb.Document,Lb.Comment,Lb.Warning,Lb.AtRule,Lb.Result,Lb.Input,Lb.Rule,Lb.Root,Lb.Node;class _b{constructor(...e){Yg(this,"parentElement",null),Yg(this,"parentNode",null),Yg(this,"ownerDocument"),Yg(this,"firstChild",null),Yg(this,"lastChild",null),Yg(this,"previousSibling",null),Yg(this,"nextSibling",null),Yg(this,"ELEMENT_NODE",1),Yg(this,"TEXT_NODE",3),Yg(this,"nodeType"),Yg(this,"nodeName"),Yg(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 _b))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 Fb={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Bb={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Ub={};function jb(e){if(Ub[e])return Ub[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 Fb?Fb[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 Bb?Bb[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 Ub[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?Ub[e]=o:r}catch{return r}}const zb={};function Wb(e,t,r){var n;const s=`${e}.${String(r)}`;if(zb[s])return zb[s].call(t);const o=jb(e),i=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return i?(zb[s]=i,i.call(t)):t[r]}const Vb={};function Gb(e,t,r){const n=`${e}.${String(r)}`;if(Vb[n])return Vb[n].bind(t);const s=jb(e)[r];return"function"!=typeof s?t[r]:(Vb[n]=s,s.bind(t))}function Zb(){return jb("MutationObserver").constructor}const Yb={childNodes:function(e){return Wb("Node",e,"childNodes")},parentNode:function(e){return Wb("Node",e,"parentNode")},parentElement:function(e){return Wb("Node",e,"parentElement")},textContent:function(e){return Wb("Node",e,"textContent")},contains:function(e,t){return Gb("Node",e,"contains")(t)},getRootNode:function(e){return Gb("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Wb("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Wb("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Wb("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Wb("Element",e,"querySelectorAll")(t)},mutationObserver:Zb};function Kb(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}const Jb="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 qb={map:{},getId:()=>(console.error(Jb),-1),getNode:()=>(console.error(Jb),null),removeNodeFromMap(){console.error(Jb)},has:()=>(console.error(Jb),!1),reset(){console.error(Jb)}};function $b(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 Xb(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)}}),()=>Xb(e,t,o||{},!0)}function Hb(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&&(qb=new Proxy(qb,{get:(e,t,r)=>("map"===t&&console.error(Jb),Reflect.get(e,t,r))}));let Qb=Date.now;function eS(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=Yb.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=Yb.parentElement(o.body))?void 0:n.scrollTop)||(null==(s=null==o?void 0:o.body)?void 0:s.scrollTop)||0}}function tS(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function rS(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function nS(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:Yb.parentElement(e)}function sS(e,t,r,n){if(!e)return!1;const s=nS(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($d(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 oS(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||-2===t.getId(e)}function iS(e,t){if(wd(e))return!1;const r=t.getId(e);if(!t.has(r))return!0;const n=Yb.parentNode(e);return(!n||n.nodeType!==e.DOCUMENT_NODE)&&(!n||iS(n,t))}function aS(e){return Boolean(e.changedTouches)}function lS(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function cS(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function uS(e){return!!e&&(e instanceof _b&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(Yb.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(Qb=()=>(new Date).getTime());class hS{constructor(){od(this,"id",1),od(this,"styleIDMap",new WeakMap),od(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 dS(e){var t;let r=null;return"getRootNode"in e&&(null==(t=Yb.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&Yb.host(Yb.getRootNode(e))&&(r=Yb.host(Yb.getRootNode(e))),r}function pS(e){const t=e.ownerDocument;if(!t)return!1;const r=function(e){let t,r=e;for(;t=dS(r);)r=t;return r}(e);return Yb.contains(t,r)}function fS(e){const t=e.ownerDocument;return!!t&&(Yb.contains(t,e)||pS(e))}var mS=(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))(mS||{}),gS=(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))(gS||{}),yS=(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))(yS||{}),vS=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(vS||{}),wS=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(wS||{}),bS=(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))(bS||{}),SS=(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))(SS||{});function CS(e){return"__ln"in e}class IS{constructor(){od(this,"length",0),od(this,"head",null),od(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&&CS(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&&CS(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 xS=(e,t)=>`${e}@${t}`;class kS{constructor(){od(this,"frozen",!1),od(this,"locked",!1),od(this,"texts",[]),od(this,"attributes",[]),od(this,"attributeMap",new WeakMap),od(this,"removes",[]),od(this,"mapRemoves",[]),od(this,"movedMap",{}),od(this,"addedSet",new Set),od(this,"movedSet",new Set),od(this,"droppedSet",new Set),od(this,"removesSubTreeCache",new Set),od(this,"mutationCb"),od(this,"blockClass"),od(this,"blockSelector"),od(this,"maskTextClass"),od(this,"maskTextSelector"),od(this,"inlineStylesheet"),od(this,"maskInputOptions"),od(this,"maskTextFn"),od(this,"maskInputFn"),od(this,"keepIframeSrcFn"),od(this,"recordCanvas"),od(this,"inlineImages"),od(this,"slimDOMOptions"),od(this,"dataURLOptions"),od(this,"doc"),od(this,"mirror"),od(this,"iframeManager"),od(this,"stylesheetManager"),od(this,"shadowDomManager"),od(this,"canvasManager"),od(this,"processedNodeManager"),od(this,"unattachedDoc"),od(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),od(this,"emit",()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,r=new IS,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=Yb.parentNode(s);if(!o||!fS(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=wd(o)?this.mirror.getId(dS(s)):this.mirror.getId(o),l=n(s);if(-1===a||-1===l)return r.addNode(s);const c=ep(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=>{lS(e,this.mirror)&&this.iframeManager.addIframe(e),cS(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),uS(s)&&this.shadowDomManager.addShadowRoot(Yb.shadowRoot(s),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)},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)ES(this.removesSubTreeCache,e,this.mirror)&&!this.movedSet.has(Yb.parentNode(e))||s(e);for(const e of this.addedSet)RS(this.droppedSet,e)||ES(this.removesSubTreeCache,e,this.mirror)?RS(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(Yb.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(Yb.parentNode(r.value));if(-1===n(r.value))continue;if(-1!==t){e=r;break}{const t=r.value,n=Yb.parentNode(t);if(n&&n.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const t=Yb.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=Yb.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))}),od(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(Yb.childNodes(e),e=>Yb.textContent(e)||"").join("");t.attributes.value=xd({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:Ed(e),value:r,maskInputFn:this.maskInputFn})}),od(this,"processMutation",e=>{if(!oS(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=Yb.textContent(e.target);sS(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:Xd(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,nS(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=Ed(t);n=xd({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:e,value:n,maskInputFn:this.maskInputFn})}if(sS(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"),!qd(t.tagName,r))if(s.attributes[r]=Jd(this.doc,kd(t.tagName),kd(r),n),"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(sS(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=wd(e.target)?this.mirror.getId(Yb.host(e.target)):this.mirror.getId(e.target);sS(e.target,this.blockClass,this.blockSelector,!1)||oS(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(OS(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||iS(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[xS(r,n)]?OS(this.movedSet,t):(this.removes.push({parentId:n,id:r,isShadow:!(!wd(e.target)||!bd(e.target))||void 0}),function(e,t){const r=[e];for(;r.length;){const e=r.pop();t.has(e)||(t.add(e),Yb.childNodes(e).forEach(e=>r.push(e)))}}(t,this.removesSubTreeCache))),this.mapRemoves.push(t))})}}),od(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(oS(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[xS(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);sS(e,this.blockClass,this.blockSelector,!1)||(Yb.childNodes(e).forEach(e=>this.genAdds(e)),uS(e)&&Yb.childNodes(Yb.shadowRoot(e)).forEach(t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)}))}})}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(t=>{this[t]=e[t]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function OS(e,t){e.delete(t),Yb.childNodes(t).forEach(t=>OS(e,t))}function ES(e,t,r){return 0!==e.size&&function(e,t){const r=Yb.parentNode(t);return!!r&&e.has(r)}(e,t)}function RS(e,t){return 0!==e.size&&AS(e,t)}function AS(e,t){const r=Yb.parentNode(t);return!!r&&(!!e.has(r)||AS(e,r))}let MS;const PS=e=>{if(!MS)return e;return(...t)=>{try{return e(...t)}catch(e){if(MS&&!0===MS(e))return;throw e}}};function NS(e){return(...t)=>{try{return e(...t)}catch(e){try{e._external_=!0}catch{}throw e}}}const TS=[];function DS(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 LS(e,t){const r=new kS;TS.push(r),r.init(e);const n=new(Zb())(PS(r.processMutations.bind(r)));return n.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),n}function _S({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(yS).filter(e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==i[e]).forEach(o=>{let i=kd(o);const c=(t=>o=>{const i=DS(o);if(sS(i,n,s,!0))return;let a=null,c=t;if("pointerType"in o){switch(o.pointerType){case"mouse":a=vS.Mouse;break;case"touch":a=vS.Touch;break;case"pen":a=vS.Pen}a===vS.Touch?yS[t]===yS.MouseDown?c="TouchStart":yS[t]===yS.MouseUp&&(c="TouchEnd"):vS.Pen}else aS(o)&&(a=vS.Touch);null!==a?(l=a,(c.startsWith("Touch")&&a===vS.Touch||c.startsWith("Mouse")&&a===vS.Mouse)&&(a=null)):yS[t]===yS.Click&&(a=l,l=null);const u=aS(o)?o.changedTouches[0]:o;if(!u)return;const h=r.getId(i),{clientX:d,clientY:p}=u;PS(e)({type:yS[c],id:h,x:d,y:p,...null!==a&&{pointerType:a}})})(o);if(window.PointerEvent)switch(yS[o]){case yS.MouseDown:case yS.MouseUp:i=i.replace("mouse","pointer");break;case yS.TouchStart:case yS.TouchEnd:return}a.push(Kb(i,c,t))}),PS(()=>{a.forEach(e=>e())})}function FS({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:s,sampling:o}){const i=PS($b(PS(o=>{const i=DS(o);if(!i||sS(i,n,s,!0))return;const a=r.getId(i);if(i===t&&t.defaultView){const r=eS(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 Kb("scroll",i,t)}const BS=["INPUT","TEXTAREA","SELECT"],US=new WeakMap;function jS(e){return function(e,t){if(GS("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||GS("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||GS("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||GS("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 zS(e,t,r){let n,s;return e?(e.ownerNode?n=t.getId(e.ownerNode):s=r.getId(e),{styleId:s,id:n}):{}}function WS({mirror:e,stylesheetManager:t},r){var n,s,o;let i=null;i="#document"===r.nodeName?e.getId(r):e.getId(Yb.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}}),PS(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})})):()=>{}}function VS(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)},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=LS(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=$b(PS(t=>{const r=Date.now()-i;e(a.map(e=>(e.timeOffset-=r,e)),t),a=[],i=null}),o),c=PS($b(PS(e=>{const t=DS(e),{clientX:r,clientY:s}=aS(e)?e.changedTouches[0]:e;i||(i=Qb()),a.push({x:r,y:s,id:n.getId(t),timeOffset:Qb()-i}),l("undefined"!=typeof DragEvent&&e instanceof DragEvent?gS.Drag:e instanceof MouseEvent?gS.MouseMove:gS.TouchMove)}),s,{trailing:!1})),u=[Kb("mousemove",c,r),Kb("touchmove",c,r),Kb("drag",c,r)];return PS(()=>{u.forEach(e=>e())})}(e),o=_S(e),i=FS(e),a=function({viewportResizeCb:e},{win:t}){let r=-1,n=-1;return Kb("resize",PS($b(PS(()=>{const t=tS(),s=rS();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=DS(e);const c=e.isTrusted,h=r&&r.tagName;if(r&&"OPTION"===h&&(r=Yb.parentElement(r)),!r||!h||BS.indexOf(h)<0||sS(r,n,s,!0))return;if(r.classList.contains(o)||i&&r.matches(i))return;let p=r.value,f=!1;const m=Ed(r)||"";"radio"===m||"checkbox"===m?f=r.checked:(a[h.toLowerCase()]||a[m])&&(p=xd({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=US.get(t);if(!s||s.text!==n.text||s.isChecked!==n.isChecked){US.set(t,n);const s=r.getId(t);PS(e)({...n,id:s})}}const p=("last"===c.input?["change"]:["input","change"]).map(e=>Kb(e,PS(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=>Xb(e[0],e[1],{set(){PS(h)({target:this,isTrusted:!1})}},!1,f))),PS(()=>{p.forEach(e=>e())})}(e),c=function({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:s,doc:o}){const i=PS(o=>$b(PS(s=>{const i=DS(s);if(!i||sS(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=[Kb("play",i(bS.Play),o),Kb("pause",i(bS.Pause),o),Kb("seeked",i(bS.Seeked),o),Kb("volumechange",i(bS.VolumeChange),o),Kb("ratechange",i(bS.RateChange),o)];return PS(()=>{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:PS((n,s,o)=>{const[i,a]=o,{id:l,styleId:c}=zS(s,t,r.styleMirror);return(l&&-1!==l||c&&-1!==c)&&e({id:l,styleId:c,adds:[{rule:i,index:a}]}),NS(()=>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:PS((n,s,o)=>{const[i]=o,{id:a,styleId:l}=zS(s,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:i}]}),NS(()=>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:PS((n,s,o)=>{const[i]=o,{id:a,styleId:l}=zS(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:PS((n,s,o)=>{const[i]=o,{id:a,styleId:l}=zS(s,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,replaceSync:i}),n.apply(s,o)})}));const l={};ZS("CSSGroupingRule")?l.CSSGroupingRule=n.CSSGroupingRule:(ZS("CSSMediaRule")&&(l.CSSMediaRule=n.CSSMediaRule),ZS("CSSConditionRule")&&(l.CSSConditionRule=n.CSSConditionRule),ZS("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:PS((n,s,o)=>{const[i,a]=o,{id:l,styleId:c}=zS(s.parentStyleSheet,t,r.styleMirror);return(l&&-1!==l||c&&-1!==c)&&e({id:l,styleId:c,adds:[{rule:i,index:[...jS(s),a||0]}]}),n.apply(s,o)})}),s.prototype.deleteRule=new Proxy(c[n].deleteRule,{apply:PS((n,s,o)=>{const[i]=o,{id:a,styleId:l}=zS(s.parentStyleSheet,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:[...jS(s),i]}]}),n.apply(s,o)})})}),PS(()=>{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=WS(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:PS((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}=zS(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:jS(i.parentRule)}),s.apply(i,a)})});const i=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(i,{apply:PS((s,o,a)=>{var l;const[c]=a;if(r.has(c))return i.apply(o,[c]);const{id:u,styleId:h}=zS(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:jS(o.parentRule)}),s.apply(o,a)})}),PS(()=>{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=Hb(t.fonts,"add",function(t){return function(r){return setTimeout(PS(()=>{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),PS(()=>{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=PS(()=>{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;sS(i,n,s,!0)||sS(c,n,s,!0)||a.push({start:r.getId(i),startOffset:l,end:r.getId(c),endOffset:u})}o({ranges:a})});return a(),Kb("selectionchange",a)}(e),m=function({doc:e,customElementCb:t}){const r=e.defaultView;return r&&r.customElements?Hb(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 PS(()=>{TS.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 GS(e){return void 0!==window[e]}function ZS(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class YS{constructor(e){od(this,"iframeIdToRemoteIdMap",new WeakMap),od(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 KS{constructor(e){od(this,"iframes",new WeakMap),od(this,"crossOriginIframeMap",new WeakMap),od(this,"crossOriginIframeMirror",new YS(Ud)),od(this,"crossOriginIframeStyleMirror"),od(this,"crossOriginIframeRootIdMap",new WeakMap),od(this,"mirror"),od(this,"mutationCb"),od(this,"wrappedEmit"),od(this,"loadListener"),od(this,"stylesheetManager"),od(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new YS(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 mS.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:mS.IncrementalSnapshot,data:{source:gS.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case mS.Meta:case mS.Load:case mS.DomContentLoaded:return!1;case mS.Plugin:return t;case mS.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case mS.IncrementalSnapshot:switch(t.data.source){case gS.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 gS.Drag:case gS.TouchMove:case gS.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case gS.ViewportResize:return!1;case gS.MediaInteraction:case gS.MouseInteraction:case gS.Scroll:case gS.CanvasMutation:case gS.Input:return this.replaceIds(t.data,e,["id"]),t;case gS.StyleSheetRule:case gS.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case gS.Font:return t;case gS.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,["start","end"])}),t;case gS.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===SS.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(e=>{this.patchRootIdOnNode(e,t)})}}class JS{constructor(e){od(this,"shadowDoms",new WeakSet),od(this,"mutationCb"),od(this,"scrollCb"),od(this,"bypassOptions"),od(this,"mirror"),od(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(!bd(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const r=LS({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(FS({...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(Yb.host(e))),this.restoreHandlers.push(WS({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(Hb(e.prototype,"attachShadow",function(e){return function(n){const s=e.call(this,n),o=Yb.shadowRoot(this);return o&&fS(this)&&r.addShadowRoot(o,t),s}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch(e){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var qS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",$S="undefined"==typeof Uint8Array?[]:new Uint8Array(256),XS=0;XS<64;XS++)$S[qS.charCodeAt(XS)]=XS;const HS=new Map;const QS=(e,t,r)=>{if(!e||!rC(e,t)&&"object"!=typeof e)return;const n=function(e,t){let r=HS.get(e);return r||(r=new Map,HS.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 eC(e,t,r){if(e instanceof Array)return e.map(e=>eC(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+=qS[r[t]>>2],s+=qS[(3&r[t])<<4|r[t+1]>>4],s+=qS[(15&r[t+1])<<2|r[t+2]>>6],s+=qS[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:[eC(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:[eC(e.data,t,r),e.width,e.height]}}if(rC(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:QS(e,t,r)}}return e}const tC=(e,t,r)=>e.map(e=>eC(e,t,r)),rC=(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 nC(e,t,r,n){const s=[];try{const o=Hb(e.HTMLCanvasElement.prototype,"getContext",function(e){return function(s,...o){if(!sS(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 sC(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=Hb(e,l,function(e){return function(...i){const a=e.apply(this,i);if(QS(a,o,this),"tagName"in this.canvas&&!sS(this.canvas,n,s,!0)){const e=tC(i,o,this),n={type:t,property:l,args:e};r(this.canvas,n)}return a}});i.push(a)}catch{const n=Xb(e,l,{set(e){r(this.canvas,{type:t,property:l,args:[e],setter:!0})}});i.push(n)}return i}const oC="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",iC="undefined"!=typeof window&&window.Blob&&new Blob([(e=>Uint8Array.from(atob(e),e=>e.charCodeAt(0)))(oC)],{type:"text/javascript;charset=utf-8"});function aC(e){let t;try{if(t=iC&&(window.URL||window.webkitURL).createObjectURL(iC),!t)throw"";const r=new Worker(t,{name:null==e?void 0:e.name});return r.addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(t)}),r}catch(t){return new Worker("data:text/javascript;base64,"+oC,{name:null==e?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}class lC{constructor(e){od(this,"pendingCanvasMutations",new Map),od(this,"rafStamps",{latestId:0,invokeId:null}),od(this,"mirror"),od(this,"mutationCb"),od(this,"resetObservers"),od(this,"frozen",!1),od(this,"locked",!1),od(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=nC(t,r,n,!0),i=new Map,a=new aC;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:wS["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=>{sS(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=nC(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=Hb(t.CanvasRenderingContext2D.prototype,i,function(s){return function(...o){return sS(this.canvas,r,n,!0)||setTimeout(()=>{const r=tC(o,t,this);e(this.canvas,{type:wS["2D"],property:i,args:r})},0),s.apply(this,o)}});s.push(o)}catch{const r=Xb(t.CanvasRenderingContext2D.prototype,i,{set(t){e(this.canvas,{type:wS["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(...sC(t.WebGLRenderingContext.prototype,wS.WebGL,e,r,n,t)),void 0!==t.WebGL2RenderingContext&&s.push(...sC(t.WebGL2RenderingContext.prototype,wS.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 cC{constructor(e){od(this,"trackedLinkElements",new WeakSet),od(this,"mutationCb"),od(this,"adoptedStyleSheetCb"),od(this,"styleMirror",new hS),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(0===e.length)return;const r={id:t,styleIds:[]},n=[];for(const t of e){let e;this.styleMirror.has(t)?e=this.styleMirror.getId(t):(e=this.styleMirror.add(t),n.push({styleId:e,rules:Array.from(t.rules||CSSRule,(e,r)=>({rule:Cd(e,t.href),index:r}))})),r.styleIds.push(e)}n.length>0&&(r.styles=n),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class uC{constructor(){od(this,"nodeMap",new WeakMap),od(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 hC,dC,pC,fC=!1;try{if(2!==Array.from([1],e=>2*e)[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(rd=e.contentWindow)?void 0:rd.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}const mC=new Id;function gC(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,hooks:g,packFn:y,sampling:v={},dataURLOptions:w={},mousemoveWait:b,recordDOM:S=!0,recordCanvas:C=!1,recordCrossOriginIframes:I=!1,recordAfter:x=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:k=!1,collectFonts:O=!1,inlineImages:E=!1,plugins:R,keepIframeSrcFn:A=()=>!1,ignoreCSSAttributes:M=new Set([]),errorHandler:P,applyBackgroundColorToBlockedElements:N=!1}=e;MS=P;const T=!I||window.parent===window;let D=!1;if(!T)try{window.parent.document&&(D=!1)}catch(e){D=!0}if(T&&!t)throw new Error("emit function is required");if(!T&&!D)return()=>{};void 0!==b&&void 0===v.mousemove&&(v.mousemove=b),mC.reset();const L=!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},_=!0===p||"all"===p?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===p,headMetaDescKeywords:"all"===p,headTitleMutations:"all"===p}:p||{};let F;!function(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}();let B=0;const U=e=>{for(const t of R||[])t.eventProcessor&&(e=t.eventProcessor(e));return y&&!D&&(e=y(e)),e};hC=(e,s)=>{var o;const i=e;if(i.timestamp=Qb(),!(null==(o=TS[0])?void 0:o.isFrozen())||i.type===mS.FullSnapshot||i.type===mS.IncrementalSnapshot&&i.data.source===gS.Mutation||TS.forEach(e=>e.unfreeze()),T)null==t||t(U(i),s);else if(D){const e={type:"rrweb",event:U(i),origin:window.location.origin,isCheckout:s};window.parent.postMessage(e,"*")}if(i.type===mS.FullSnapshot)F=i,B=0;else if(i.type===mS.IncrementalSnapshot){if(i.data.source===gS.Mutation&&i.data.isAttachIframe)return;B++;const e=n&&B>=n,t=r&&i.timestamp-F.timestamp>r;(e||t)&&dC(!0)}};const j=e=>{hC({type:mS.IncrementalSnapshot,data:{source:gS.Mutation,...e}})},z=e=>hC({type:mS.IncrementalSnapshot,data:{source:gS.Scroll,...e}}),W=e=>hC({type:mS.IncrementalSnapshot,data:{source:gS.CanvasMutation,...e}}),V=new cC({mutationCb:j,adoptedStyleSheetCb:e=>hC({type:mS.IncrementalSnapshot,data:{source:gS.AdoptedStyleSheet,...e}})}),G=new KS({mirror:mC,mutationCb:j,stylesheetManager:V,recordCrossOriginIframes:I,wrappedEmit:hC});for(const e of R||[])e.getMirror&&e.getMirror({nodeMirror:mC,crossOriginIframeMirror:G.crossOriginIframeMirror,crossOriginIframeStyleMirror:G.crossOriginIframeStyleMirror});const Z=new uC;pC=new lC({recordCanvas:C,mutationCb:W,win:window,blockClass:s,blockSelector:o,mirror:mC,sampling:v.canvas,dataURLOptions:w});const Y=new JS({mutationCb:j,scrollCb:z,bypassOptions:{blockClass:s,blockSelector:o,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskInputOptions:L,dataURLOptions:w,maskTextFn:m,maskInputFn:f,recordCanvas:C,inlineImages:E,sampling:v,slimDOMOptions:_,iframeManager:G,stylesheetManager:V,canvasManager:pC,keepIframeSrcFn:A,processedNodeManager:Z},mirror:mC});dC=(e=!1)=>{if(!S)return;hC({type:mS.Meta,data:{href:window.location.href,width:rS(),height:tS()}},e),V.reset(),Y.init(),TS.forEach(e=>e.lock());const t=function(e,t){const{mirror:r=new Id,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,slimDOM:p=!1,dataURLOptions:f,preserveWhiteSpace:m,onSerialize:g,onIframeLoad:y,iframeLoadTimeout:v,onStylesheetLoad:w,stylesheetLoadTimeout:b,keepIframeSrcFn:S=()=>!1,applyBackgroundColorToBlockedElements:C=!1}=t||{};return ep(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,slimDOMOptions:!0===p||"all"===p?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===p,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===p?{}:p,dataURLOptions:f,inlineImages:l,recordCanvas:c,preserveWhiteSpace:m,onSerialize:g,onIframeLoad:y,iframeLoadTimeout:v,onStylesheetLoad:w,stylesheetLoadTimeout:b,keepIframeSrcFn:S,newlyAddedElement:!1,applyBackgroundColorToBlockedElements:C})}(document,{mirror:mC,blockClass:s,blockSelector:o,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskAllInputs:L,maskTextFn:m,maskInputFn:f,slimDOM:_,dataURLOptions:w,recordCanvas:C,inlineImages:E,applyBackgroundColorToBlockedElements:N,onSerialize:e=>{lS(e,mC)&&G.addIframe(e),cS(e,mC)&&V.trackLinkElement(e),uS(e)&&Y.addShadowRoot(Yb.shadowRoot(e),document)},onIframeLoad:(e,t)=>{G.attachIframe(e,t),Y.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{V.attachLinkElement(e,t)},keepIframeSrcFn:A});if(!t)return console.warn("Failed to snapshot the document");hC({type:mS.FullSnapshot,data:{node:t,initialOffset:eS(window)}},e),TS.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&V.adoptStyleSheets(document.adoptedStyleSheets,mC.getId(document))};try{const e=[],t=e=>{var t;return PS(VS)({mutationCb:j,mousemoveCb:(e,t)=>hC({type:mS.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>hC({type:mS.IncrementalSnapshot,data:{source:gS.MouseInteraction,...e}}),scrollCb:z,viewportResizeCb:e=>hC({type:mS.IncrementalSnapshot,data:{source:gS.ViewportResize,...e}}),inputCb:e=>hC({type:mS.IncrementalSnapshot,data:{source:gS.Input,...e}}),mediaInteractionCb:e=>hC({type:mS.IncrementalSnapshot,data:{source:gS.MediaInteraction,...e}}),styleSheetRuleCb:e=>hC({type:mS.IncrementalSnapshot,data:{source:gS.StyleSheetRule,...e}}),styleDeclarationCb:e=>hC({type:mS.IncrementalSnapshot,data:{source:gS.StyleDeclaration,...e}}),canvasMutationCb:W,fontCb:e=>hC({type:mS.IncrementalSnapshot,data:{source:gS.Font,...e}}),selectionCb:e=>{hC({type:mS.IncrementalSnapshot,data:{source:gS.Selection,...e}})},customElementCb:e=>{hC({type:mS.IncrementalSnapshot,data:{source:gS.CustomElement,...e}})},blockClass:s,ignoreClass:i,ignoreSelector:a,maskTextClass:l,maskTextSelector:c,maskInputOptions:L,inlineStylesheet:u,sampling:v,recordDOM:S,recordCanvas:C,inlineImages:E,userTriggeredOnInput:k,collectFonts:O,doc:e,maskInputFn:f,maskTextFn:m,keepIframeSrcFn:A,blockSelector:o,slimDOMOptions:_,dataURLOptions:w,mirror:mC,iframeManager:G,stylesheetManager:V,shadowDomManager:Y,processedNodeManager:Z,canvasManager:pC,ignoreCSSAttributes:M,plugins:(null==(t=null==R?void 0:R.filter(e=>e.observer))?void 0:t.map(e=>({observer:e.observer,options:e.options,callback:t=>hC({type:mS.Plugin,data:{plugin:e.name,payload:t}})})))||[]},g)};G.addLoadListener(r=>{try{e.push(t(r.contentDocument))}catch(e){console.warn(e)}});const r=()=>{dC(),e.push(t(document)),fC=!0};return"interactive"===document.readyState||"complete"===document.readyState?r():(e.push(Kb("DOMContentLoaded",()=>{hC({type:mS.DomContentLoaded,data:{}}),"DOMContentLoaded"===x&&r()})),e.push(Kb("load",()=>{hC({type:mS.Load,data:{}}),"load"===x&&r()},window))),()=>{e.forEach(e=>e()),Z.destroy(),fC=!1,MS=void 0}}catch(e){console.warn(e)}}var yC;gC.addCustomEvent=(e,t)=>{if(!fC)throw new Error("please add custom event after start recording");hC({type:mS.Custom,data:{tag:e,payload:t}})},gC.freezePage=()=>{TS.forEach(e=>e.freeze())},gC.takeFullSnapshot=e=>{if(!fC)throw new Error("please take full snapshot after start recording");dC(e)},gC.mirror=mC,function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(yC||(yC={}));var vC=Object.freeze({__proto__:null,record:gC}),wC=function(){function e(){this.fetchObserver=null}return e.prototype.start=function(e){this.eventCallback=e,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},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 i(e,void 0,void 0,function(){var e,s,o,i,l,c,u;return a(this,function(a){switch(a.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},a.label=1;case 1:return a.trys.push([1,3,,4]),[4,r(t,n)];case 2:return o=a.sent(),c=Date.now(),s.status=o.status,s.duration=c-e,i={},o.headers.forEach(function(e,t){i[t]=e}),s.responseHeaders=i,this.notifyEvent(s),[2,o];case 3:throw l=a.sent(),c=Date.now(),s.duration=c-e,u=l,s.error={name:u.name||"UnknownError",message:u.message||"An unknown error occurred"},this.notifyEvent(s),l;case 4:return[2]}})})},this.fetchObserver=function(){t.fetch=r})}},e}(),bC=Object.freeze({__proto__:null,NetworkObservers:wC});return e.SessionReplayPlugin=Pr,e.plugin=Nr,e.sessionReplayPlugin=Nr,Object.defineProperty(e,"__esModule",{value:!0}),e}({});
1
+ var sessionReplay=function(e){"use strict";var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},t(e,r)};function r(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}var n,s,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 i(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 a(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 l(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 c(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 u(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"}(n||(n={})),function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"}(s||(s={}));var h,d="".concat("AMP","_unsent"),p="$default_instance",f="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"}(h||(h={}));var m,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},y=u([],c(Array(256).keys()),!1).map(function(e){return e.toString(16).padStart(2,"0")}),v=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,v)}(e);var n=r.crypto.getRandomValues(new Uint8Array(16));return n[6]=15&n[6]|64,n[8]=63&n[8]|128,u([],c(n.entries()),!1).map(function(e){var t=c(e,2),r=t[0],n=t[1];return[4,6,8,10].includes(r)?"-".concat(y[n]):y[n]}).join("")},w=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"}(m||(m={}));var b="Amplitude Logger ",S=function(){function e(){this.logLevel=m.None}return e.prototype.disable=function(){this.logLevel=m.None},e.prototype.enable=function(e){void 0===e&&(e=m.Warn),this.logLevel=e},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<m.Verbose||console.log("".concat(b,"[Log]: ").concat(e.join(" ")))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<m.Warn||console.warn("".concat(b,"[Warn]: ").concat(e.join(" ")))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<m.Error||console.error("".concat(b,"[Error]: ").concat(e.join(" ")))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<m.Debug||console.log("".concat(b,"[Debug]: ").concat(e.join(" ")))},e}(),C=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,instanceName:p,logLevel:m.Warn,loggerProvider:new S,offline:!1,optOut:!1,serverUrl:f,serverZone:"US",useBatch:!1}},I=function(){function e(e){var t,r,n,s;this._optOut=!1;var o=C();this.apiKey=e.apiKey,this.flushIntervalMillis=null!==(t=e.flushIntervalMillis)&&void 0!==t?t:o.flushIntervalMillis,this.flushMaxRetries=e.flushMaxRetries||o.flushMaxRetries,this.flushQueueSize=e.flushQueueSize||o.flushQueueSize,this.instanceName=e.instanceName||o.instanceName,this.loggerProvider=e.loggerProvider||o.loggerProvider,this.logLevel=null!==(r=e.logLevel)&&void 0!==r?r:o.logLevel,this.minIdLength=e.minIdLength,this.plan=e.plan,this.ingestionMetadata=e.ingestionMetadata,this.offline=void 0!==e.offline?e.offline:o.offline,this.optOut=null!==(n=e.optOut)&&void 0!==n?n:o.optOut,this.serverUrl=e.serverUrl,this.serverZone=e.serverZone||o.serverZone,this.storageProvider=e.storageProvider,this.transportProvider=e.transportProvider,this.useBatch=null!==(s=e.useBatch)&&void 0!==s?s:o.useBatch,this.loggerProvider.enable(this.logLevel);var i=k(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}(),x=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":f},k=function(e,t,r){if(void 0===e&&(e=""),void 0===t&&(t=C().serverZone),void 0===r&&(r=C().useBatch),e)return{serverUrl:e,serverZone:void 0};var n=["US","EU"].includes(t)?t:C().serverZone;return{serverZone:n,serverUrl:x(n,r)}},O=function(){function e(){}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:E(),platform:"Web",os:void 0,deviceModel:void 0}},e}(),E=function(){return"undefined"!=typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},R=function(){function e(){this.queue=[]}return e.prototype.logEvent=function(e){this.receiver?this.receiver(e):this.queue.length<512&&this.queue.push(e)},e.prototype.setEventReceiver=function(e){this.receiver=e,this.queue.length>0&&(this.queue.forEach(function(t){e(t)}),this.queue=[])},e}(),A=function(){return A=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},A.apply(this,arguments)};function M(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 P(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"==typeof SuppressedError&&SuppressedError;var N=function(e,t){var r,n,s=typeof e;if(s!==typeof t)return!1;try{for(var o=M(["string","number","boolean","undefined"]),i=o.next();!i.done;i=o.next()){if(i.value===s)return e===t}}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}if(null==e&&null==t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;var a=Array.isArray(e),l=Array.isArray(t);if(a!==l)return!1;if(!a||!l){var c=Object.keys(e).sort(),u=Object.keys(t).sort();if(!N(c,u))return!1;var h=!0;return Object.keys(e).forEach(function(r){N(e[r],t[r])||(h=!1)}),h}for(var d=0;d<e.length;d++)if(!N(e[d],t[d]))return!1;return!0};Object.entries||(Object.entries=function(e){for(var t=Object.keys(e),r=t.length,n=new Array(r);r--;)n[r]=[t[r],e[t[r]]];return n});var T,D=function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var e=this,t=A({},this.identity.userProperties),r=A(A({},this.identity),{userProperties:t});return{setUserId:function(e){return r.userId=e,this},setDeviceId:function(e){return r.deviceId=e,this},setUserProperties:function(e){return r.userProperties=e,this},setOptOut:function(e){return r.optOut=e,this},updateUserProperties:function(e){var t,n,s,o,i,a,l=r.userProperties||{};try{for(var c=M(Object.entries(e)),u=c.next();!u.done;u=c.next()){var h=P(u.value,2),d=h[0],p=h[1];switch(d){case"$set":try{for(var f=(s=void 0,M(Object.entries(p))),m=f.next();!m.done;m=f.next()){var g=P(m.value,2),y=g[0],v=g[1];l[y]=v}}catch(e){s={error:e}}finally{try{m&&!m.done&&(o=f.return)&&o.call(f)}finally{if(s)throw s.error}}break;case"$unset":try{for(var w=(i=void 0,M(Object.keys(p))),b=w.next();!b.done;b=w.next()){delete l[y=b.value]}}catch(e){i={error:e}}finally{try{b&&!b.done&&(a=w.return)&&a.call(w)}finally{if(i)throw i.error}}break;case"$clearAll":l={}}}}catch(e){t={error:e}}finally{try{u&&!u.done&&(n=c.return)&&n.call(c)}finally{if(t)throw t.error}}return r.userProperties=l,this},commit:function(){return e.setIdentity(r),this}}},e.prototype.getIdentity=function(){return A({},this.identity)},e.prototype.setIdentity=function(e){var t=A({},this.identity);this.identity=A({},e),N(t,this.identity)||this.listeners.forEach(function(t){t(e)})},e.prototype.addIdentityListener=function(e){this.listeners.add(e)},e.prototype.removeIdentityListener=function(e){this.listeners.delete(e)},e}(),L="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:self,F=function(){function e(){this.identityStore=new D,this.eventBridge=new R,this.applicationContextProvider=new O}return e.getInstance=function(t){return L.analyticsConnectorInstances||(L.analyticsConnectorInstances={}),L.analyticsConnectorInstances[t]||(L.analyticsConnectorInstances[t]=new e),L.analyticsConnectorInstances[t]},e}(),_=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<m.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}},B=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},U=function(){function e(){}return e.prototype.send=function(e,t){return Promise.resolve(null)},e.prototype.buildResponse=function(e){var t,r,n,s,o,i,a,l,c,u,d,p,f,m,g,y,v,w,b,S,C,I;if("object"!=typeof e)return null;var x=e.code||0,k=this.buildStatus(x);switch(k){case h.Success:return{status:k,statusCode:x,body:{eventsIngested:null!==(t=e.events_ingested)&&void 0!==t?t:0,payloadSizeBytes:null!==(r=e.payload_size_bytes)&&void 0!==r?r:0,serverUploadTime:null!==(n=e.server_upload_time)&&void 0!==n?n:0}};case h.Invalid:return{status:k,statusCode:x,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!==(d=e.silenced_devices)&&void 0!==d?d:[],silencedEvents:null!==(p=e.silenced_events)&&void 0!==p?p:[],throttledDevices:null!==(f=e.throttled_devices)&&void 0!==f?f:{},throttledEvents:null!==(m=e.throttled_events)&&void 0!==m?m:[]}};case h.PayloadTooLarge:return{status:k,statusCode:x,body:{error:null!==(g=e.error)&&void 0!==g?g:""}};case h.RateLimit:return{status:k,statusCode:x,body:{error:null!==(y=e.error)&&void 0!==y?y:"",epsThreshold:null!==(v=e.eps_threshold)&&void 0!==v?v: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!==(I=e.throttled_events)&&void 0!==I?I:[]}};case h.Timeout:default:return{status:k,statusCode:x}}},e.prototype.buildStatus=function(e){return e>=200&&e<300?h.Success:429===e?h.RateLimit:413===e?h.PayloadTooLarge:408===e?h.Timeout:e>=400&&e<500?h.Invalid:e>=500?h.Failed:h.Unknown},e}(),j=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.send=function(e,t){return i(this,void 0,void 0,function(){var r,n,s;return a(this,function(o){switch(o.label){case 0:if("undefined"==typeof fetch)throw new Error("FetchTransport is not supported");return r={headers:{"Content-Type":"application/json",Accept:"*/*"},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}(U),z=function(){function e(e,t){this.key="AMP_remote_config_".concat(e.substring(0,10)),this.logger=t}return e.prototype.fetchConfig=function(){var e=null,t={remoteConfig:null,lastFetch:new Date};try{e=localStorage.getItem(this.key)}catch(e){return this.logger.debug("Remote config localstorage failed to access: ",e),Promise.resolve(t)}if(null===e)return this.logger.debug("Remote config localstorage gets null because the key does not exist"),Promise.resolve(t);try{var r=JSON.parse(e);return this.logger.debug("Remote config localstorage parsed successfully: ".concat(JSON.stringify(r))),Promise.resolve({remoteConfig:r.remoteConfig,lastFetch:new Date(r.lastFetch)})}catch(e){return this.logger.debug("Remote config localstorage failed to parse: ",e),localStorage.removeItem(this.key),Promise.resolve(t)}},e.prototype.setConfig=function(e){try{return localStorage.setItem(this.key,JSON.stringify(e)),this.logger.debug("Remote config localstorage set successfully."),Promise.resolve(!0)}catch(e){this.logger.debug("Remote config localstorage failed to set: ",e)}return Promise.resolve(!1)},e}(),W=function(){function e(e,t,r){void 0===r&&(r="US"),this.callbackInfos=[],this.apiKey=e,this.serverUrl="US"===r?"https://sr-client-cfg.amplitude.com/config":"https://sr-client-cfg.eu.amplitude.com/config",this.logger=t,this.storage=new z(e,t)}return e.prototype.subscribe=function(e,t,r){var n=v(),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 i(this,void 0,void 0,function(){var e,t=this;return a(this,function(r){switch(r.label){case 0:return[4,this.fetch()];case 1:return e=r.sent(),this.storage.setConfig(e),this.callbackInfos.forEach(function(r){t.sendCallback(r,e,"remote")}),[2]}})})},e.prototype.subscribeAll=function(e){return i(this,void 0,void 0,function(){var t,r,n,s=this;return a(this,function(o){switch(o.label){case 0:return t=this.fetch().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))),this.sendCallback(e,n,"cache")),[4,t];case 2:return o.sent(),[2]}})})},e.prototype.subscribeWaitForRemote=function(e,t){return i(this,void 0,void 0,function(){var r,n;return a(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.fetch(),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),i(this,void 0,void 0,function(){var r,n,s,o,i,l,c=this;return a(this,function(u){switch(u.label){case 0:r=t/e,n={remoteConfig:null,lastFetch:new Date},s=function(n){var s,i,l,u,h;return a(this,function(a){switch(a.label){case 0:s=new AbortController,i=setTimeout(function(){return s.abort()},t),a.label=1;case 1:return a.trys.push([1,7,8,9]),[4,fetch(o.getUrlParams(),{method:"GET",headers:{Accept:"*/*"},signal:s.signal})];case 2:return(l=a.sent()).ok?[3,4]:[4,l.text()];case 3:return u=a.sent(),o.logger.debug("Remote config client fetch with retry time ".concat(e," failed with ").concat(l.status,": ").concat(u)),[3,6];case 4:return[4,l.json()];case 5:return[2,{value:{remoteConfig:a.sent(),lastFetch:new Date}}];case 6:return[3,9];case 7:return(h=a.sent())instanceof Error&&"AbortError"===h.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: "),h),[3,9];case 8:return clearTimeout(i),[7];case 9:return n<e-1?[4,new Promise(function(e){return setTimeout(e,c.getJitterDelay(r))})]:[3,11];case 10:a.sent(),a.label=11;case 11:return[2]}})},o=this,i=0,u.label=1;case 1:return i<e?[5,s(i)]:[3,4];case 2:if("object"==typeof(l=u.sent()))return[2,l.value];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 t=encodeURIComponent(this.apiKey),r=new URLSearchParams;return r.append("config_group",e.CONFIG_GROUP),"".concat(this.serverUrl,"/").concat(t,"?").concat(r.toString())},e.CONFIG_GROUP="browser",e}();!function(e){e.US="US",e.EU="EU",e.STAGING="STAGING"}(T||(T={}));var V,G="[Amplitude]",Z="".concat(G," Session Replay ID"),Y=T.US,J={enabled:!0},K="".concat(G," Session Replay Debug"),$="amp-mask";!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"}(V||(V={}));var q=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}(),X="medium";var H=function(e,t,r){switch(t){case"light":if("input"!==e)return!0;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":case"conservative":return!0;default:return H(e,X,r)}},Q=function(e,t){return function(r,n){return function(e,t,r){var n,s,o;if(void 0===t&&(t={defaultMaskLevel:X}),r){if(r.closest("."+$))return!0;var i=(null!==(n=t.maskSelector)&&void 0!==n?n:[]).some(function(e){return r.closest(e)});if(i)return!0;if(r.closest(".amp-unmask"))return!1;var a=(null!==(s=t.unmaskSelector)&&void 0!==s?s:[]).some(function(e){return r.closest(e)});if(a)return!1}return H(e,null!==(o=t.defaultMaskLevel)&&void 0!==o?o:X,r)}(e,t,n)?r.replace(/[^\s]/g,"*"):r}},ee=function(e,t){return t||(e===T.STAGING?"https://api-sr.stag2.amplitude.com/sessions/v2/track":e===T.EU?"https://api-sr.eu.amplitude.com/sessions/v2/track":"https://api-sr.amplitude.com/sessions/v2/track")},te=function(e){var t=e.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*").replace(/\?/g,".");return new RegExp("^".concat(t,"$"))},re=function(e,t){var r,n;try{for(var s=l(t),o=s.next();!o.done;o=s.next()){var i=o.value,a=te(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},ne=function(){return i(void 0,void 0,void 0,function(){var e,t,r,n,s,o,i;return a(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/1024):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:""}]}})})},se=function(e){var t=o({},e),r=t.apiKey;return t.apiKey="****".concat(r.substring(r.length-4)),t},oe=function(){return{flushMaxRetries:2,logLevel:m.Warn,loggerProvider:new S,transportProvider:new j}},ie=function(e){function t(t,r){var n,s,i,a,l,c=this,u=oe();return(c=e.call(this,o(o({transportProvider:u.transportProvider,loggerProvider:new q(r.loggerProvider||u.loggerProvider)},r),{apiKey:t}))||this).flushMaxRetries=void 0!==r.flushMaxRetries&&r.flushMaxRetries<=u.flushMaxRetries?r.flushMaxRetries:u.flushMaxRetries,c.apiKey=t,c.sampleRate=r.sampleRate||0,c.serverZone=r.serverZone||Y,c.configServerUrl=r.configServerUrl,c.trackServerUrl=r.trackServerUrl,c.shouldInlineStylesheet=r.shouldInlineStylesheet,c.version=r.version,c.performanceConfig=r.performanceConfig||J,c.storeType=null!==(n=r.storeType)&&void 0!==n?n:"idb",c.applyBackgroundColorToBlockedElements=null!==(s=r.applyBackgroundColorToBlockedElements)&&void 0!==s&&s,c.enableUrlChangePolling=null!==(i=r.enableUrlChangePolling)&&void 0!==i&&i,c.urlChangePollingInterval=null!==(a=r.urlChangePollingInterval)&&void 0!==a?a:1e3,c.captureDocumentTitle=null!==(l=r.captureDocumentTitle)&&void 0!==l&&l,r.privacyConfig&&(c.privacyConfig=r.privacyConfig),r.interactionConfig&&(c.interactionConfig=r.interactionConfig,c.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")}(c.interactionConfig.ugcFilterRules)),r.debugMode&&(c.debugMode=r.debugMode),r.experimental&&(c.experimental=r.experimental),r.omitElementTags&&(c.omitElementTags=r.omitElementTags),c}return r(t,e),t}(I),ae=(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))(ae||{}),le=(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))(le||{}),ce=function(){function e(e,t){this.localConfig=t,this.remoteConfigClient=e}return e.prototype.generateJoinedConfig=function(){var e,t,r;return i(this,void 0,void 0,function(){var n,s,i,u,h,d,p,f,m,g,y,v,w,b,S,C,I=this;return a(this,function(a){switch(a.label){case 0:return(n=o({},this.localConfig)).optOut=this.localConfig.optOut,n.captureEnabled=!0,[4,new Promise(function(e){I.remoteConfigClient.subscribe("configs.sessionReplay","all",function(t,r){var o;if(I.localConfig.loggerProvider.debug("Session Replay remote configuration received from ".concat(r,":"),JSON.stringify(t,null,2)),t){var i=t,a=i.sr_sampling_config,l=i.sr_privacy_config,c=i.sr_targeting_config,u=null===(o=n.interactionConfig)||void 0===o?void 0:o.ugcFilterRules;n.interactionConfig=i.sr_interaction_config,n.interactionConfig&&u&&(n.interactionConfig.ugcFilterRules=u),n.loggingConfig=i.sr_logging_config,(a||l||c)&&(s={},a&&(s.sr_sampling_config=a),l&&(s.sr_privacy_config=l),c&&(s.sr_targeting_config=c))}e()})})];case 1:if(a.sent(),!s)return[2,{localConfig:this.localConfig,joinedConfig:n,remoteConfig:s}];if(i=s.sr_sampling_config,u=s.sr_privacy_config,h=s.sr_targeting_config,i&&Object.keys(i).length>0?(Object.prototype.hasOwnProperty.call(i,"capture_enabled")?n.captureEnabled=i.capture_enabled:n.captureEnabled=!1,Object.prototype.hasOwnProperty.call(i,"sample_rate")&&(n.sampleRate=i.sample_rate)):(n.captureEnabled=!0,this.localConfig.loggerProvider.debug("Remote config successfully fetched, but no values set for project, Session Replay capture enabled.")),u){d=null!==(e=n.privacyConfig)&&void 0!==e?e:{},p={defaultMaskLevel:null!==(r=null!==(t=u.defaultMaskLevel)&&void 0!==t?t:d.defaultMaskLevel)&&void 0!==r?r:"medium",blockSelector:[],maskSelector:[],unmaskSelector:[]},f=function(e){var t,r,n,s,o,i,a,c,u,h={};"string"==typeof e.blockSelector&&(e.blockSelector=[e.blockSelector]);try{for(var d=l(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=l(null!==(c=e.maskSelector)&&void 0!==c?c:[]),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=l(null!==(u=e.unmaskSelector)&&void 0!==u?u:[]),y=g.next();!y.done;y=g.next()){h[y.value]="unmask"}}catch(e){o={error:e}}finally{try{y&&!y.done&&(i=g.return)&&i.call(g)}finally{if(o)throw o.error}}return h},m=o(o({},f(d)),f(u));try{for(g=l(Object.entries(m)),y=g.next();!y.done;y=g.next())v=c(y.value,2),w=v[0],"mask"===(b=v[1])?p.maskSelector.push(w):"block"===b?p.blockSelector.push(w):"unmask"===b&&p.unmaskSelector.push(w)}catch(e){S={error:e}}finally{try{y&&!y.done&&(C=g.return)&&C.call(g)}finally{if(S)throw S.error}}n.privacyConfig=(x=p,k=this.localConfig.loggerProvider,O=document.createDocumentFragment(),E=function(e){if(void 0===e&&(e=[]),"string"==typeof e&&(e=[e]),e=e.filter(function(e){try{O.querySelector(e)}catch(t){return k.warn('[session-replay-browser] omitting selector "'.concat(e,'" because it is invalid')),!1}return!0}),0!==e.length)return e},x.blockSelector=E(x.blockSelector),x.maskSelector=E(x.maskSelector),x.unmaskSelector=E(x.unmaskSelector),x)}return h&&Object.keys(h).length>0&&(n.targetingConfig=h),this.localConfig.loggerProvider.debug(JSON.stringify({name:"session replay joined config",config:se(n)},null,2)),[2,{localConfig:this.localConfig,joinedConfig:n,remoteConfig:s}]}var x,k,O,E})})},e}(),ue=function(e,t){return i(void 0,void 0,void 0,function(){var r,n;return a(this,function(s){return r=new ie(e,t),n=new W(e,r.loggerProvider,r.serverZone),[2,new ce(n,r)]})})},he=Uint8Array,de=Uint16Array,pe=Uint32Array,fe=new he([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),me=new he([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),ge=new he([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ye=function(e,t){for(var r=new de(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];var s=new pe(r[30]);for(n=1;n<30;++n)for(var o=r[n];o<r[n+1];++o)s[o]=o-r[n]<<5|n;return[r,s]},ve=ye(fe,2),we=ve[0],be=ve[1];we[28]=258,be[258]=28;for(var Se=ye(me,0)[1],Ce=new de(32768),Ie=0;Ie<32768;++Ie){var xe=(43690&Ie)>>>1|(21845&Ie)<<1;xe=(61680&(xe=(52428&xe)>>>2|(13107&xe)<<2))>>>4|(3855&xe)<<4,Ce[Ie]=((65280&xe)>>>8|(255&xe)<<8)>>>1}var ke=function(e,t,r){for(var n=e.length,s=0,o=new de(t);s<n;++s)++o[e[s]-1];var i,a=new de(t);for(s=0;s<t;++s)a[s]=a[s-1]+o[s-1]<<1;if(r){i=new de(1<<t);var l=15-t;for(s=0;s<n;++s)if(e[s])for(var c=s<<4|e[s],u=t-e[s],h=a[e[s]-1]++<<u,d=h|(1<<u)-1;h<=d;++h)i[Ce[h]>>>l]=c}else for(i=new de(n),s=0;s<n;++s)i[s]=Ce[a[e[s]-1]++]>>>15-e[s];return i},Oe=new he(288);for(Ie=0;Ie<144;++Ie)Oe[Ie]=8;for(Ie=144;Ie<256;++Ie)Oe[Ie]=9;for(Ie=256;Ie<280;++Ie)Oe[Ie]=7;for(Ie=280;Ie<288;++Ie)Oe[Ie]=8;var Ee=new he(32);for(Ie=0;Ie<32;++Ie)Ee[Ie]=5;var Re=ke(Oe,9,0),Ae=ke(Ee,5,0),Me=function(e){return(e/8|0)+(7&e&&1)},Pe=function(e,t,r){(null==r||r>e.length)&&(r=e.length);var n=new(e instanceof de?de:e instanceof pe?pe:he)(r-t);return n.set(e.subarray(t,r)),n},Ne=function(e,t,r){r<<=7&t;var n=t/8|0;e[n]|=r,e[n+1]|=r>>>8},Te=function(e,t,r){r<<=7&t;var n=t/8|0;e[n]|=r,e[n+1]|=r>>>8,e[n+2]|=r>>>16},De=function(e,t){for(var r=[],n=0;n<e.length;++n)e[n]&&r.push({s:n,f:e[n]});var s=r.length,o=r.slice();if(!s)return[new he(0),0];if(1==s){var i=new he(r[0].s+1);return i[r[0].s]=1,[i,1]}r.sort(function(e,t){return e.f-t.f}),r.push({s:-1,f:25001});var a=r[0],l=r[1],c=0,u=1,h=2;for(r[0]={s:-1,f:a.f+l.f,l:a,r:l};u!=s-1;)a=r[r[c].f<r[h].f?c++:h++],l=r[c!=u&&r[c].f<r[h].f?c++:h++],r[u++]={s:-1,f:a.f+l.f,l:a,r:l};var d=o[0].s;for(n=1;n<s;++n)o[n].s>d&&(d=o[n].s);var p=new de(d+1),f=Le(r[u-1],p,0);if(f>t){n=0;var m=0,g=f-t,y=1<<g;for(o.sort(function(e,t){return p[t.s]-p[e.s]||e.f-t.f});n<s;++n){var v=o[n].s;if(!(p[v]>t))break;m+=y-(1<<f-p[v]),p[v]=t}for(m>>>=g;m>0;){var w=o[n].s;p[w]<t?m-=1<<t-p[w]++-1:++n}for(;n>=0&&m;--n){var b=o[n].s;p[b]==t&&(--p[b],++m)}f=t}return[new he(p),f]},Le=function(e,t,r){return-1==e.s?Math.max(Le(e.l,t,r+1),Le(e.r,t,r+1)):t[e.s]=r},Fe=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new de(++t),n=0,s=e[0],o=1,i=function(e){r[n++]=e},a=1;a<=t;++a)if(e[a]==s&&a!=t)++o;else{if(!s&&o>2){for(;o>138;o-=138)i(32754);o>2&&(i(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(i(s),--o;o>6;o-=6)i(8304);o>2&&(i(o-3<<5|8208),o=0)}for(;o--;)i(s);o=1,s=e[a]}return[r.subarray(0,n),t]},_e=function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},Be=function(e,t,r){var n=r.length,s=Me(t+2);e[s]=255&n,e[s+1]=n>>>8,e[s+2]=255^e[s],e[s+3]=255^e[s+1];for(var o=0;o<n;++o)e[s+o+4]=r[o];return 8*(s+4+n)},Ue=function(e,t,r,n,s,o,i,a,l,c,u){Ne(t,u++,r),++s[256];for(var h=De(s,15),d=h[0],p=h[1],f=De(o,15),m=f[0],g=f[1],y=Fe(d),v=y[0],w=y[1],b=Fe(m),S=b[0],C=b[1],I=new de(19),x=0;x<v.length;++x)I[31&v[x]]++;for(x=0;x<S.length;++x)I[31&S[x]]++;for(var k=De(I,7),O=k[0],E=k[1],R=19;R>4&&!O[ge[R-1]];--R);var A,M,P,N,T=c+5<<3,D=_e(s,Oe)+_e(o,Ee)+i,L=_e(s,d)+_e(o,m)+i+14+3*R+_e(I,O)+(2*I[16]+3*I[17]+7*I[18]);if(T<=D&&T<=L)return Be(t,u,e.subarray(l,l+c));if(Ne(t,u,1+(L<D)),u+=2,L<D){A=ke(d,p,0),M=d,P=ke(m,g,0),N=m;var F=ke(O,E,0);Ne(t,u,w-257),Ne(t,u+5,C-1),Ne(t,u+10,R-4),u+=14;for(x=0;x<R;++x)Ne(t,u+3*x,O[ge[x]]);u+=3*R;for(var _=[v,S],B=0;B<2;++B){var U=_[B];for(x=0;x<U.length;++x){var j=31&U[x];Ne(t,u,F[j]),u+=O[j],j>15&&(Ne(t,u,U[x]>>>5&127),u+=U[x]>>>12)}}}else A=Re,M=Oe,P=Ae,N=Ee;for(x=0;x<a;++x)if(n[x]>255){j=n[x]>>>18&31;Te(t,u,A[j+257]),u+=M[j+257],j>7&&(Ne(t,u,n[x]>>>23&31),u+=fe[j]);var z=31&n[x];Te(t,u,P[z]),u+=N[z],z>3&&(Te(t,u,n[x]>>>5&8191),u+=me[z])}else Te(t,u,A[n[x]]),u+=M[n[x]];return Te(t,u,A[256]),u+M[256]},je=new pe([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),ze=function(e,t,r,n,s){return function(e,t,r,n,s,o){var i=e.length,a=new he(n+i+5*(1+Math.floor(i/7e3))+s),l=a.subarray(n,a.length-s),c=0;if(!t||i<8)for(var u=0;u<=i;u+=65535){var h=u+65535;h<i?c=Be(l,c,e.subarray(u,h)):(l[u]=o,c=Be(l,c,e.subarray(u,i)))}else{for(var d=je[t-1],p=d>>>13,f=8191&d,m=(1<<r)-1,g=new de(32768),y=new de(m+1),v=Math.ceil(r/3),w=2*v,b=function(t){return(e[t]^e[t+1]<<v^e[t+2]<<w)&m},S=new pe(25e3),C=new de(288),I=new de(32),x=0,k=0,O=(u=0,0),E=0,R=0;u<i;++u){var A=b(u),M=32767&u,P=y[A];if(g[M]=P,y[A]=M,E<=u){var N=i-u;if((x>7e3||O>24576)&&N>423){c=Ue(e,l,0,S,C,I,k,O,R,u-R,c),O=x=k=0,R=u;for(var T=0;T<286;++T)C[T]=0;for(T=0;T<30;++T)I[T]=0}var D=2,L=0,F=f,_=M-P&32767;if(N>2&&A==b(u-_))for(var B=Math.min(p,N)-1,U=Math.min(32767,u),j=Math.min(258,N);_<=U&&--F&&M!=P;){if(e[u+D]==e[u+D-_]){for(var z=0;z<j&&e[u+z]==e[u+z-_];++z);if(z>D){if(D=z,L=_,z>B)break;var W=Math.min(_,z-2),V=0;for(T=0;T<W;++T){var G=u-_+T+32768&32767,Z=G-g[G]+32768&32767;Z>V&&(V=Z,P=G)}}}_+=(M=P)-(P=g[M])+32768&32767}if(L){S[O++]=268435456|be[D]<<18|Se[L];var Y=31&be[D],J=31&Se[L];k+=fe[Y]+me[J],++C[257+Y],++I[J],E=u+D,++x}else S[O++]=e[u],++C[e[u]]}}c=Ue(e,l,o,S,C,I,k,O,R,u-R,c)}return Pe(a,0,n+Me(c)+s)}(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,r,n,!s)};function We(e,t){void 0===t&&(t={});var r=function(){var e=1,t=0;return{p:function(r){for(var n=e,s=t,o=r.length,i=0;i!=o;){for(var a=Math.min(i+5552,o);i<a;++i)s+=n+=r[i];n%=65521,s%=65521}e=n,t=s},d:function(){return(e>>>8<<16|(255&t)<<8|t>>>8)+2*((255&e)<<23)}}}();r.p(e);var n,s,o,i=ze(e,t,2,4);return n=i,s=t.level,o=0==s?0:s<6?1:9==s?3:2,n[0]=120,n[1]=o<<6|(o?32-2*o:1),function(e,t,r){for(;r;++t)e[t]=r,r>>>=8}(i,i.length-4,r.d()),i}const Ve=e=>{const t={...e,v:"v1"};return function(e,t){var r="";if(!t&&"undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);for(var n=0;n<e.length;){var s=e[n++];s<128||t?r+=String.fromCharCode(s):s<224?r+=String.fromCharCode((31&s)<<6|63&e[n++]):s<240?r+=String.fromCharCode((15&s)<<12|(63&e[n++])<<6|63&e[n++]):(s=((15&s)<<18|(63&e[n++])<<12|(63&e[n++])<<6|63&e[n++])-65536,r+=String.fromCharCode(55296|s>>10,56320|1023&s))}return r}(We(function(e,t){var r=e.length;if(!t&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var n=new he(e.length+(e.length>>>1)),s=0,o=function(e){n[s++]=e},i=0;i<r;++i){if(s+5>n.length){var a=new he(s+8+(r-i<<1));a.set(n),n=a}var l=e.charCodeAt(i);l<128||t?o(l):l<2048?(o(192|l>>>6),o(128|63&l)):l>55295&&l<57344?(o(240|(l=65536+(1047552&l)|1023&e.charCodeAt(++i))>>>18),o(128|l>>>12&63),o(128|l>>>6&63),o(128|63&l)):(o(224|l>>>12),o(128|l>>>6&63),o(128|63&l))}return Pe(n,0,s)}(JSON.stringify(t))),!0)};var Ge=function(){function e(e,t,r,n){var s,o=this;this.taskQueue=[],this.isProcessing=!1,this.compressEvent=function(e){var t=Ve(e);return JSON.stringify(t)},this.addCompressedEventToManager=function(e,t){o.eventsManager&&o.deviceId&&o.eventsManager.addEvent({event:{type:"replay",data:e},sessionId:t,deviceId:o.deviceId})},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.terminate=function(){var e;null===(e=o.worker)||void 0===e||e.terminate()};var i=g();if(this.canUseIdleCallback=i&&"requestIdleCallback"in i,this.eventsManager=e,this.config=t,this.deviceId=r,this.timeout=(null===(s=t.performanceConfig)||void 0===s?void 0:s.timeout)||2e3,n){t.loggerProvider.log("[Experimental] Enabling web worker for compression");var a=new Worker(URL.createObjectURL(new Blob([n],{type:"application/javascript"})));a.onerror=function(e){t.loggerProvider.error(e)},a.onmessage=function(e){var t=e.data,r=t.compressedEvent,n=t.sessionId;o.addCompressedEventToManager(r,n)},this.worker=a}}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;this.canUseIdleCallback&&(null===(r=this.config.performanceConfig)||void 0===r?void 0:r.enabled)?(this.config.loggerProvider.debug("Enqueuing event for processing during idle time."),this.taskQueue.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){for(var t=this;this.taskQueue.length>0&&(e.timeRemaining()>0||e.didTimeout);){var r=this.taskQueue.shift();if(r){var n=r.event,s=r.sessionId;this.addCompressedEvent(n,s)}}this.taskQueue.length>0?requestIdleCallback(function(e){t.processQueue(e)},{timeout:this.timeout}):this.isProcessing=!1},e}(),Ze="Failed to store session replay events in IndexedDB",Ye="1.29.0",Je=function(){function e(e){var t=e.trackServerUrl,r=e.loggerProvider,n=e.payloadBatcher;this.storageKey="",this.retryTimeout=1e3,this.scheduled=null,this.queue=[],this.loggerProvider=r,this.payloadBatcher=n||function(e){return e},this.trackServerUrl=t}return e.prototype.sendEventsList=function(e){this.addToQueue(o(o({},e),{attempts:0,timeout:0}))},e.prototype.addToQueue=function(){for(var e=this,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];t.filter(function(t){return t.attempts<(t.flushMaxRetries||0)?(t.attempts+=1,!0):(e.completeRequest({context:t,err:"Session replay event batch rejected due to exceeded retry count"}),!1)}).forEach(function(t){e.queue=e.queue.concat(t),0!==t.timeout?setTimeout(function(){t.timeout=0,e.schedule(0)},t.timeout):e.schedule(0)})},e.prototype.schedule=function(e){var t=this;this.scheduled||(this.scheduled=setTimeout(function(){t.flush(!0).then(function(){t.queue.length>0&&t.schedule(e)})},e))},e.prototype.flush=function(e){return void 0===e&&(e=!1),i(this,void 0,void 0,function(){var t,r,n=this;return a(this,function(s){switch(s.label){case 0:return t=[],r=[],this.queue.forEach(function(e){return 0===e.timeout?t.push(e):r.push(e)}),this.queue=r,this.scheduled&&(clearTimeout(this.scheduled),this.scheduled=null),[4,Promise.all(t.map(function(t){return n.send(t,e)}))];case 1:return s.sent(),[2]}})})},e.prototype.send=function(e,t){var r,n;return void 0===t&&(t=!0),i(this,void 0,void 0,function(){var s,o,i,l,c,u,h,d,p,f,m,y,v;return a(this,function(a){switch(a.label){case 0:if(!(s=e.apiKey))return[2,this.completeRequest({context:e,err:"Session replay event batch not sent due to missing api key"})];if(!(o=e.deviceId))return[2,this.completeRequest({context:e,err:"Session replay event batch not sent due to missing device ID"})];if(w=g(),i=(null==w?void 0:w.location)?w.location.href:"",l=Ye,c=e.sampleRate,u=new URLSearchParams({device_id:o,session_id:"".concat(e.sessionId),type:"".concat(e.type)}),h="".concat((null===(r=e.version)||void 0===r?void 0:r.type)||"standalone","/").concat((null===(n=e.version)||void 0===n?void 0:n.version)||l),0===(d=this.payloadBatcher({version:1,events:e.events})).events.length)return this.completeRequest({context:e}),[2];a.label=1;case 1:return a.trys.push([1,3,,4]),p={headers:{"Content-Type":"application/json",Accept:"*/*",Authorization:"Bearer ".concat(s),"X-Client-Version":l,"X-Client-Library":h,"X-Client-Url":i.substring(0,1e3),"X-Client-Sample-Rate":"".concat(c)},body:JSON.stringify(d),method:"POST"},f="".concat(ee(e.serverZone,this.trackServerUrl),"?").concat(u.toString()),[4,fetch(f,p)];case 2:if(null===(m=a.sent()))return this.completeRequest({context:e,err:"Unexpected error occurred"}),[2];if(t)this.handleReponse(m.status,e);else{y="";try{y=JSON.stringify(m.body,null,2)}catch(e){}this.completeRequest({context:e,success:"".concat(m.status,": ").concat(y)})}return[3,4];case 3:return v=a.sent(),this.completeRequest({context:e,err:v}),[3,4];case 4:return[2]}var w})})},e.prototype.handleReponse=function(e,t){switch((new U).buildStatus(e)){case h.Success:this.handleSuccessResponse(t);break;case h.Failed:this.handleOtherResponse(t);break;default:this.completeRequest({context:t,err:"Network error occurred, event batch rejected"})}},e.prototype.handleSuccessResponse=function(e){var t=Math.round(new Blob(e.events).size/1024);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){this.addToQueue(o(o({},e),{timeout:e.attempts*this.retryTimeout}))},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}();const Ke=(e,t)=>t.some(t=>e instanceof t);let $e,qe;const Xe=new WeakMap,He=new WeakMap,Qe=new WeakMap;let et={get(e,t,r){if(e instanceof IDBTransaction){if("done"===t)return Xe.get(e);if("store"===t)return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return st(e[t])},set:(e,t,r)=>(e[t]=r,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function tt(e){et=e(et)}function rt(e){return(qe||(qe=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(ot(this),t),st(this.request)}:function(...t){return st(e.apply(ot(this),t))}}function nt(e){return"function"==typeof e?rt(e):(e instanceof IDBTransaction&&function(e){if(Xe.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)});Xe.set(e,t)}(e),Ke(e,$e||($e=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,et):e)}function st(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(st(e.result)),n()},o=()=>{r(e.error),n()};e.addEventListener("success",s),e.addEventListener("error",o)});return Qe.set(t,e),t}(e);if(He.has(e))return He.get(e);const t=nt(e);return t!==e&&(He.set(e,t),Qe.set(t,e)),t}const ot=e=>Qe.get(e);function it(e,t,{blocked:r,upgrade:n,blocking:s,terminated:o}={}){const i=indexedDB.open(e,t),a=st(i);return n&&i.addEventListener("upgradeneeded",e=>{n(st(i.result),e.oldVersion,e.newVersion,st(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 at=["get","getKey","getAll","getAllKeys","count"],lt=["put","add","delete","clear"],ct=new Map;function ut(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(ct.get(t))return ct.get(t);const r=t.replace(/FromIndex$/,""),n=t!==r,s=lt.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!s&&!at.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 ct.set(t,o),o}tt(e=>({...e,get:(t,r,n)=>ut(t,r)||e.get(t,r,n),has:(t,r)=>!!ut(t,r)||e.has(t,r)}));const ht=["continue","continuePrimaryKey","advance"],dt={},pt=new WeakMap,ft=new WeakMap,mt={get(e,t){if(!ht.includes(t))return e[t];let r=dt[t];return r||(r=dt[t]=function(...e){pt.set(this,ft.get(this)[t](...e))}),r}};async function*gt(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;const r=new Proxy(t,mt);for(ft.set(r,t),Qe.set(r,ot(t));t;)yield r,t=await(pt.get(r)||t.continue()),pt.delete(r)}function yt(e,t){return t===Symbol.asyncIterator&&Ke(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===t&&Ke(e,[IDBIndex,IDBObjectStore])}tt(e=>({...e,get:(t,r,n)=>yt(t,r)?gt:e.get(t,r,n),has:(t,r)=>yt(t,r)||e.has(t,r)}));var vt,wt=function(){function e(e){var t,r,n,s=this;this.minInterval=500,this.maxInterval=1e4,this.maxPersistedEventsSize=1e6,this.interval=this.minInterval,this._timeAtLastSplit=Date.now(),this.shouldSplitEventsList=function(e,t){var r=s.getStringSize(t);return s.getEventsArraySize(e)+r>=s.maxPersistedEventsSize||!!(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}return Object.defineProperty(e.prototype,"timeAtLastSplit",{get:function(){return this._timeAtLastSplit},enumerable:!1,configurable:!0}),e.prototype.getStringSize=function(e){return e.length},e.prototype.getEventsArraySize=function(e){var t,r,n=0;try{for(var s=l(e),o=s.next();!o.done;o=s.next()){var i=o.value;n+=this.getStringSize(i)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}return n+(2+Math.max(0,e.length-1)+2*e.length)},e}();!function(e){e.RECORDING="recording",e.SENT="sent"}(vt||(vt={}));var bt="sessionCurrentSequence",St="sequencesToSend",Ct=function(){var e=g();return new Promise(function(t,r){if(!e)return r(new Error("Global scope not found"));if(!e.indexedDB)return r(new Error("Session Replay: cannot find indexedDB"));try{var n=e.indexedDB.open("keyval-store");n.onupgradeneeded=function(){1===n.result.version&&(n.result.close(),n.transaction&&n.transaction.abort(),e.indexedDB.deleteDatabase("keyval-store"),t())},n.onsuccess=function(){t(n.result)},n.onerror=function(){r(n.error)}}catch(e){r(e)}})},It=function(e){return i(void 0,void 0,void 0,function(){var t;return a(this,function(r){switch(r.label){case 0:return e.length>0?(t=e.splice(0,10),[4,Promise.all(t)]):[3,2];case 1:return r.sent(),[3,0];case 2:return[2]}})})},xt=function(e){var t,r;return e.objectStoreNames.contains(bt)||(r=e.createObjectStore(bt,{keyPath:"sessionId"})),e.objectStoreNames.contains(St)||(t=e.createObjectStore(St,{keyPath:"sequenceId",autoIncrement:!0})).createIndex("sessionId","sessionId"),{sequencesStore:t,currentSequenceStore:r}},kt=function(e){return i(void 0,void 0,void 0,function(){return a(this,function(t){switch(t.label){case 0:return[4,it(e,1,{upgrade:xt})];case 1:return[2,t.sent()]}})})},Ot=function(e){function t(t){var r=e.call(this,t)||this;return r.getSequencesToSend=function(){return i(r,void 0,void 0,function(){var e,t,r,n,s,o;return a(this,function(i){switch(i.label){case 0:return i.trys.push([0,5,,6]),e=[],[4,this.db.transaction("sequencesToSend").store.openCursor()];case 1:t=i.sent(),i.label=2;case 2:return t?(r=t.value,n=r.sessionId,s=r.events,e.push({events:s,sequenceId:t.key,sessionId:n}),[4,t.continue()]):[3,4];case 3:return t=i.sent(),[3,2];case 4:return[2,e];case 5:return o=i.sent(),this.loggerProvider.warn("".concat(Ze,": ").concat(o)),[3,6];case 6:return[2,void 0]}})})},r.storeCurrentSequence=function(e){return i(r,void 0,void 0,function(){var t,r,n;return a(this,function(s){switch(s.label){case 0:return s.trys.push([0,4,,5]),[4,this.db.get(bt,e)];case 1:return(t=s.sent())?[4,this.db.put(St,{sessionId:e,events:t.events})]:[2,void 0];case 2:return r=s.sent(),[4,this.db.put(bt,{sessionId:e,events:[]})];case 3:return s.sent(),[2,o(o({},t),{sessionId:e,sequenceId:r})];case 4:return n=s.sent(),this.loggerProvider.warn("".concat(Ze,": ").concat(n)),[3,5];case 5:return[2,void 0]}})})},r.addEventToCurrentSequence=function(e,t){return i(r,void 0,void 0,function(){var r,n,s,o,i,l;return a(this,function(a){switch(a.label){case 0:return a.trys.push([0,10,,11]),[4,(r=this.db.transaction(bt,"readwrite")).store.get(e)];case 1:return(n=a.sent())?[3,3]:[4,r.store.put({sessionId:e,events:[t]})];case 2:return a.sent(),[2];case 3:return s=void 0,this.shouldSplitEventsList(n.events,t)?(s=n.events,[4,r.store.put({sessionId:e,events:[t]})]):[3,5];case 4:return a.sent(),[3,7];case 5:return o=n.events.concat(t),[4,r.store.put({sessionId:e,events:o})];case 6:a.sent(),a.label=7;case 7:return[4,r.done];case 8:return a.sent(),s?[4,this.storeSendingEvents(e,s)]:[2,void 0];case 9:return(i=a.sent())?[2,{events:s,sessionId:e,sequenceId:i}]:[2,void 0];case 10:return l=a.sent(),this.loggerProvider.warn("".concat(Ze,": ").concat(l)),[3,11];case 11:return[2,void 0]}})})},r.storeSendingEvents=function(e,t){return i(r,void 0,void 0,function(){var r;return a(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.db.put(St,{sessionId:e,events:t})];case 1:return[2,n.sent()];case 2:return r=n.sent(),this.loggerProvider.warn("".concat(Ze,": ").concat(r)),[3,3];case 3:return[2,void 0]}})})},r.cleanUpSessionEventsStore=function(e,t){return i(r,void 0,void 0,function(){var e;return a(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(St,t)];case 2:return r.sent(),[3,4];case 3:return e=r.sent(),this.loggerProvider.warn("".concat(Ze,": ").concat(e)),[3,4];case 4:return[2]}})})},r.transitionFromKeyValStore=function(e){return i(r,void 0,void 0,function(){var t,r,n,s,o,l,h,p,f=this;return a(this,function(m){switch(m.label){case 0:return m.trys.push([0,6,,7]),[4,Ct()];case 1:if(!(t=m.sent()))return[2];r=function(e,t){return i(f,void 0,void 0,function(){var r,n,s=this;return a(this,function(o){switch(o.label){case 0:return r=t.sessionSequences,n=[],Object.keys(r).forEach(function(o){var l=parseInt(o,10),h=r[l];if(l===t.currentSequenceId){var d=h.events.map(function(t){return i(s,void 0,void 0,function(){return a(this,function(r){return[2,this.addEventToCurrentSequence(e,t)]})})});n.push.apply(n,u([],c(d),!1))}else h.status!==vt.SENT&&n.push(s.storeSendingEvents(e,h.events))}),[4,It(n)];case 1:return o.sent(),[2]}})})},n="".concat(d,"_").concat(this.apiKey.substring(0,10)),m.label=2;case 2:return m.trys.push([2,4,,5]),s=t.transaction("keyval").objectStore("keyval").getAll(n),o=new Promise(function(t){s.onsuccess=function(n){return i(f,void 0,void 0,function(){var s,o,i,l=this;return a(this,function(a){switch(a.label){case 0:return s=n&&n.target.result,(o=s&&s[0])?(i=[],Object.keys(o).forEach(function(t){var n=parseInt(t,10),s=o[n];if(e===n)i.push(r(n,s));else{var a=s.sessionSequences;Object.keys(a).forEach(function(e){var t=parseInt(e,10);a[t].status!==vt.SENT&&i.push(l.storeSendingEvents(n,a[t].events))})}}),[4,It(i)]):[3,2];case 1:a.sent(),a.label=2;case 2:return t(),[2]}})})}}),[4,o];case 3:return m.sent(),(l=g())&&l.indexedDB.deleteDatabase("keyval-store"),[3,5];case 4:return h=m.sent(),this.loggerProvider.warn("Failed to transition session replay events from keyval to new store: ".concat(h)),[3,5];case 5:return[3,7];case 6:return p=m.sent(),this.loggerProvider.warn("Failed to access keyval store: ".concat(p,". For more information, visit: https://www.docs.developers.amplitude.com/session-replay/sdks/standalone/#indexeddb-best-practices")),[3,7];case 7:return[2]}})})},r.apiKey=t.apiKey,r.db=t.db,r}return r(t,e),t.new=function(e,r,n){return i(this,void 0,void 0,function(){var s,i,l,c,u;return a(this,function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),s="replay"===e?"":"_".concat(e),i="".concat(r.apiKey.substring(0,10),"_amp_session_replay_events").concat(s),[4,kt(i)];case 1:return l=a.sent(),[4,(c=new t(o(o({},r),{db:l}))).transitionFromKeyValStore(n)];case 2:return a.sent(),[2,c];case 3:return u=a.sent(),r.loggerProvider.warn("".concat(Ze,": ").concat(u)),[3,4];case 4:return[2]}})})},t.prototype.getCurrentSequenceEvents=function(e){return i(this,void 0,void 0,function(){var t,r,n,s,o,i,c;return a(this,function(a){switch(a.label){case 0:return e?[4,this.db.get("sessionCurrentSequence",e)]:[3,2];case 1:return(s=a.sent())?[2,[s]]:[2,void 0];case 2:t=[],a.label=3;case 3:return a.trys.push([3,8,9,10]),[4,this.db.getAll("sessionCurrentSequence")];case 4:r=l.apply(void 0,[a.sent()]),n=r.next(),a.label=5;case 5:if(n.done)return[3,7];s=n.value,t.push(s),a.label=6;case 6:return n=r.next(),[3,5];case 7:return[3,10];case 8:return o=a.sent(),i={error:o},[3,10];case 9:try{n&&!n.done&&(c=r.return)&&c.call(r)}finally{if(i)throw i.error}return[7];case 10:return[2,t]}})})},t}(wt),Et=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.finalizedSequences={},t.sequences={},t.sequenceId=0,t}return r(t,e),t.prototype.resetCurrentSequence=function(e){this.sequences[e]=[]},t.prototype.addSequence=function(e){var t=this.sequenceId++,r=u([],c(this.sequences[e]),!1);return this.finalizedSequences[t]={sessionId:e,events:r},this.resetCurrentSequence(e),{sequenceId:t,events:r,sessionId:e}},t.prototype.getSequencesToSend=function(){return i(this,void 0,void 0,function(){return a(this,function(e){return[2,Object.entries(this.finalizedSequences).map(function(e){var t=c(e,2),r=t[0],n=t[1],s=n.sessionId,o=n.events;return{sequenceId:Number(r),sessionId:s,events:o}})]})})},t.prototype.storeCurrentSequence=function(e){return i(this,void 0,void 0,function(){return a(this,function(t){return this.sequences[e]?[2,this.addSequence(e)]:[2,void 0]})})},t.prototype.addEventToCurrentSequence=function(e,t){return i(this,void 0,void 0,function(){var r;return a(this,function(n){return this.sequences[e]||this.resetCurrentSequence(e),this.shouldSplitEventsList(this.sequences[e],t)&&(r=this.addSequence(e)),this.sequences[e].push(t),[2,r]})})},t.prototype.storeSendingEvents=function(e,t){return i(this,void 0,void 0,function(){return a(this,function(r){return this.finalizedSequences[this.sequenceId]={sessionId:e,events:t},[2,this.sequenceId++]})})},t.prototype.cleanUpSessionEventsStore=function(e,t){return i(this,void 0,void 0,function(){return a(this,function(e){return void 0!==t&&delete this.finalizedSequences[t],[2]})})},t}(wt),Rt=function(e){var t=e.config,r=e.sessionId,n=e.minInterval,s=e.maxInterval,l=e.type,c=e.payloadBatcher,u=e.storeType;return i(void 0,void 0,void 0,function(){function e(e){return void 0===e&&(e=!1),i(this,void 0,void 0,function(){return a(this,function(t){return[2,h.flush(e)]})})}var h,d,p,f,m,g,y,v,w;return a(this,function(b){switch(b.label){case 0:return h=new Je(o(o({},t),{loggerProvider:t.loggerProvider,payloadBatcher:c})),d=function(){return new Et({loggerProvider:t.loggerProvider,maxInterval:s,minInterval:n})},p=function(){return i(void 0,void 0,void 0,function(){var e;return a(this,function(o){switch(o.label){case 0:return[4,Ot.new(l,{loggerProvider:t.loggerProvider,minInterval:n,maxInterval:s,apiKey:t.apiKey},r)];case 1:return e=o.sent(),t.loggerProvider.log("Failed to initialize idb store, falling back to memory store."),[2,null!=e?e:d()]}})})},"idb"!==u?[3,2]:[4,p()];case 1:return m=b.sent(),[3,3];case 2:m=d(),b.label=3;case 3:return f=m,g=function(e){var r=e.events,n=e.sessionId,s=e.deviceId,o=e.sequenceId;t.debugMode&&ne().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(){}),h.sendEventsList({events:r,sessionId:n,flushMaxRetries:t.flushMaxRetries,apiKey:t.apiKey,deviceId:s,sampleRate:t.sampleRate,serverZone:t.serverZone,version:t.version,type:l,onComplete:function(){return i(void 0,void 0,void 0,function(){return a(this,function(e){switch(e.label){case 0:return[4,f.cleanUpSessionEventsStore(n,o)];case 1:return e.sent(),[2]}})})}})},y=function(e){var r=e.sessionId,n=e.deviceId;f.storeCurrentSequence(r).then(function(e){e&&g({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)})},v=function(e){var t=e.deviceId;return i(void 0,void 0,void 0,function(){var e;return a(this,function(r){switch(r.label){case 0:return[4,f.getSequencesToSend()];case 1:return(e=r.sent())&&e.forEach(function(e){g({sequenceId:e.sequenceId,events:e.events,sessionId:e.sessionId,deviceId:t})}),[2]}})})},w=function(e){var r=e.event,n=e.sessionId,s=e.deviceId;f.addEventToCurrentSequence(n,r.data).then(function(e){return e&&g({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:y,addEvent:w,sendStoredEvents:v,flush:e}]}})})},At=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 i(this,void 0,void 0,function(){var t;return a(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 i(this,void 0,void 0,function(){var t;return a(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}();const Mt={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Pt={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Nt={};function Tt(e){if(Nt[e])return Nt[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 Mt?Mt[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 Pt?Pt[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 Nt[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?Nt[e]=o:r}catch{return r}}const Dt={};function Lt(e,t,r){var n;const s=`${e}.${String(r)}`;if(Dt[s])return Dt[s].call(t);const o=Tt(e),i=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return i?(Dt[s]=i,i.call(t)):t[r]}const Ft={};function _t(e,t,r){const n=`${e}.${String(r)}`;if(Ft[n])return Ft[n].bind(t);const s=Tt(e)[r];return"function"!=typeof s?t[r]:(Ft[n]=s,s.bind(t))}const Bt={childNodes:function(e){return Lt("Node",e,"childNodes")},parentNode:function(e){return Lt("Node",e,"parentNode")},parentElement:function(e){return Lt("Node",e,"parentElement")},textContent:function(e){return Lt("Node",e,"textContent")},contains:function(e,t){return _t("Node",e,"contains")(t)},getRootNode:function(e){return _t("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Lt("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Lt("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Lt("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Lt("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return Tt("MutationObserver").constructor}};function Ut(){var e=g();return(null==e?void 0:e.innerHeight)||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight||0}function jt(){var e=g();return(null==e?void 0:e.innerWidth)||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth||0}var zt,Wt,Vt;function Gt(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};zt=o(o({},r),t),Wt=function(e,t){if(e.nodeType===Node.DOCUMENT_NODE)return e;if(e===t.root)return e.ownerDocument;return e}(zt.root,r);var n=Zt(e,"all",function(){return Zt(e,"two",function(){return Zt(e,"one",function(){return Zt(e,"none")})})});if(n){var s=tr(rr(n,e));return s.length>0&&(n=s[0]),Jt(n)}throw new Error("Selector was not found.")}function Zt(e,t,r){for(var n=null,s=[],o=e,i=0,a=function(){var e,a,h=(new Date).getTime()-Vt.getTime();if(void 0!==zt.timeoutMs&&h>zt.timeoutMs)throw new Error("Timeout: Can't find a unique selector after ".concat(h,"ms"));var d=Ht(function(e){var t=e.getAttribute("id");if(t&&zt.idName(t))return{name:"#"+CSS.escape(t),penalty:0};return null}(o))||Ht.apply(void 0,u([],c(function(e){var t=Array.from(e.attributes).filter(function(e){return zt.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))||Ht.apply(void 0,u([],c(function(e){var t=Array.from(e.classList).filter(zt.className);return t.map(function(e){return{name:"."+CSS.escape(e),penalty:1}})}(o)),!1))||Ht(function(e){var t=e.tagName.toLowerCase();if(zt.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&&(d=d.concat(d.filter(Xt).map(function(e){return qt(e,p)})));else if("two"==t)d=d.slice(0,1),p&&(d=d.concat(d.filter(Xt).map(function(e){return qt(e,p)})));else if("one"==t){var f=c(d=d.slice(0,1),1)[0];p&&Xt(f)&&(d=[qt(f,p)])}else"none"==t&&(d=[{name:"*",penalty:3}],p&&(d=[qt(d[0],p)]));try{for(var m=(e=void 0,l(d)),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(d),s.length>=zt.seedMinLength&&(n=Yt(s,r)))return"break";o=o.parentElement,i++};o;){if("break"===a())break}return n||(n=Yt(s,r)),!n&&r?r():n}function Yt(e,t){var r,n,s=tr(er(e));if(s.length>zt.threshold)return t?t():null;try{for(var o=l(s),i=o.next();!i.done;i=o.next()){var a=i.value;if($t(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 Jt(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 Kt(e){return e.map(function(e){return e.penalty}).reduce(function(e,t){return e+t},0)}function $t(e){var t=Jt(e);switch(Wt.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 qt(e,t){return{name:e.name+":nth-child(".concat(t,")"),penalty:e.penalty+1}}function Xt(e){return"html"!==e.name&&!e.name.startsWith("#")}function Ht(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e.filter(Qt);return r.length>0?r:null}function Qt(e){return null!=e}function er(e,t){var r,n,s,o,i,c;return void 0===t&&(t=[]),a(this,function(a){switch(a.label){case 0:if(!(e.length>0))return[3,9];a.label=1;case 1:a.trys.push([1,6,7,8]),r=l(e[0]),n=r.next(),a.label=2;case 2:return n.done?[3,5]:(s=n.value,[5,l(er(e.slice(1,e.length),t.concat(s)))]);case 3:a.sent(),a.label=4;case 4:return n=r.next(),[3,2];case 5:return[3,8];case 6:return o=a.sent(),i={error:o},[3,8];case 7:try{n&&!n.done&&(c=r.return)&&c.call(r)}finally{if(i)throw i.error}return[7];case 8:return[3,11];case 9:return[4,t];case 10:a.sent(),a.label=11;case 11:return[2]}})}function tr(e){return u([],c(e),!1).sort(function(e,t){return Kt(e)-Kt(t)})}function rr(e,t,r){var n,s,o;return void 0===r&&(r={counter:0,visited:new Map}),a(this,function(i){switch(i.label){case 0:if(!(e.length>2&&e.length>zt.optimizedMinLength))return[3,5];n=1,i.label=1;case 1:return n<e.length-1?r.counter>zt.maxNumberOfTries?[2]:(r.counter+=1,(s=u([],c(e),!1)).splice(n,1),o=Jt(s),r.visited.has(o)?[2]:$t(s)&&function(e,t){return Wt.querySelector(Jt(e))===t}(s,t)?[4,s]:[3,4]):[3,5];case 2:return i.sent(),r.visited.set(o,!0),[5,l(rr(s,t,r))];case 3:i.sent(),i.label=4;case 4:return n++,[3,1];case 5:return[2]}})}var nr=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}},sr=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)}},or=function(e,t){var r=t.eventsManager,n=t.sessionId,s=t.deviceIdFn,o=t.mirror,i=t.ugcFilterRules;return function(t){if(t.type===le.Click){var a=g();if(a){var l=a.location,c=a.innerHeight,u=a.innerWidth;if(l){var h=t.x,d=t.y;if(void 0!==h&&void 0!==d){var p,f=o.getNode(t.id);if(f)try{p=Gt(f)}catch(t){e.debug("error resolving selector from finder")}var m=function(e){var t,r,n,s,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=Bt.parentElement(o.body))||void 0===t?void 0:t.scrollLeft)||(null===(r=null==o?void 0:o.body)||void 0===r?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=Bt.parentElement(o.body))||void 0===n?void 0:n.scrollTop)||(null===(s=null==o?void 0:o.body)||void 0===s?void 0:s.scrollTop)||0}}(a),y={x:h+m.left,y:d+m.top,selector:p,viewportHeight:c,viewportWidth:u,pageUrl:re(l.href,i),timestamp:Date.now(),type:"click"},v=s();v&&r.addEvent({sessionId:n,event:{type:"interaction",data:JSON.stringify(y)},deviceId:v})}}}}}},ir=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=ee(t.serverZone,t.trackServerUrl),this.apiKey=t.apiKey,this.context=e}return e.prototype.send=function(e,t){var r=this.context,n=r.sessionId,s=r.type,o=new URLSearchParams({device_id:e,session_id:String(n),type:String(s),api_key:this.apiKey}),i="".concat(this.basePageUrl,"?").concat(o.toString());this.sendBeacon(i,t)||this.sendXhr(i,t)},e}(),ar=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=e(),i=g();i&&o&&r.transport.send(o,{version:1,events:[{maxScrollX:r._maxScrollX,maxScrollY:r._maxScrollY,maxScrollWidth:r._maxScrollWidth,maxScrollHeight:r._maxScrollHeight,viewportHeight:Ut(),viewportWidth:jt(),pageUrl:re(i.location.href,null!==(s=null===(n=r.config.interactionConfig)||void 0===n?void 0:n.ugcFilterRules)&&void 0!==s?s:[]),timestamp:r.timestamp,type:"scroll"}]})}},this._maxScrollX=0,this._maxScrollY=0,this._maxScrollWidth=jt(),this._maxScrollHeight=Ut(),this.config=t,this.transport=e}return e.default=function(t,r){return new e(new ir(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}),e.prototype.update=function(e){var t=Date.now();if(e.x>this._maxScrollX){var r=jt();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=Ut();this._maxScrollY=e.y;var o=e.y+s;o>this._maxScrollHeight&&(this._maxScrollHeight=o),this.timestamp=t}},e}(),lr=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))},cr=function(){var e=this;this.dbs={},this.createStore=function(t){return i(e,void 0,void 0,function(){return a(this,function(e){switch(e.label){case 0:return[4,it(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 i(e,void 0,void 0,function(){var e,r;return a(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 i(e,void 0,void 0,function(){var e,t,o,i;return a(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(),r.warn("Failed to get targeting match for session id ".concat(s,": ").concat(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 i(e,void 0,void 0,function(){var e,t,i;return a(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(),r.warn("Failed to store targeting match for session id ".concat(s,": ").concat(i)),[3,4];case 4:return[2,void 0]}})})},this.clearStoreOfOldSessions=function(t){var r=t.loggerProvider,n=t.apiKey,s=t.currentSessionId;return i(e,void 0,void 0,function(){var e,t,o,i,l,c,u,h;return a(this,function(a){switch(a.label){case 0:return a.trys.push([0,8,,9]),[4,this.openOrCreateDB(n)];case 1:return e=a.sent(),t=String(s),[4,(o=e.transaction("sessionTargetingMatch","readwrite")).store.getAll()];case 2:i=a.sent(),l=0,a.label=3;case 3:return l<i.length?(c=i[l],u=Date.now()-c.lastUpdated,c.sessionId!==t&&u>1728e5?[4,o.store.delete(c.sessionId)]:[3,5]):[3,6];case 4:a.sent(),a.label=5;case 5:return l++,[3,3];case 6:return[4,o.done];case 7:return a.sent(),[3,9];case 8:return h=a.sent(),r.warn("Failed to clear old targeting matches for sessions: ".concat(h)),[3,9];case 9:return[2]}})})}},ur=new cr,hr=function(e){var t=e.sessionId,r=e.targetingConfig,n=e.loggerProvider,s=e.apiKey,l=e.targetingParams;return i(void 0,void 0,void 0,function(){var e,i,c,u;return a(this,function(a){switch(a.label){case 0:return[4,ur.clearStoreOfOldSessions({loggerProvider:n,apiKey:s,currentSessionId:t})];case 1:return a.sent(),[4,ur.getTargetingMatchForSession({loggerProvider:n,apiKey:s,sessionId:t})];case 2:if(!0===a.sent())return[2,!0];e=!0,a.label=3;case 3:return a.trys.push([3,6,,7]),[4,Promise.resolve().then(function(){return yn})];case 4:return[4,(0,a.sent().evaluateTargeting)(o(o({},l),{flag:r,sessionId:t,apiKey:s,loggerProvider:n}))];case 5:return(i=a.sent())&&i.sr_targeting_config&&(e="on"===i.sr_targeting_config.key),ur.storeTargetingMatchForSession({loggerProvider:n,apiKey:s,sessionId:t,targetingMatch:e}),[3,7];case 6:return c=a.sent(),u=c,n.warn(u.message),[3,7];case 7:return[2,e]}})})};function dr(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:1e3,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?re(s,c):s,title:o,viewportHeight:e,viewportWidth:t,type:"url-change-event"}}();t(n)}},g=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=e.apply(this,t);return m(),n}},y=function(){m()};if(u){var v=r.setInterval(function(){m()},h);return m(),function(){v&&r.clearInterval(v)}}if(r.history){var w=r.history.pushState.bind(r.history),b=r.history.replaceState.bind(r.history);return r.history.pushState=g(w),r.history.replaceState=g(b),r.addEventListener("popstate",m),r.addEventListener("hashchange",y),m(),function(){r.history.pushState=w,r.history.replaceState=b,r.removeEventListener("popstate",m),r.removeEventListener("hashchange",y)}}return r.addEventListener("hashchange",y),m(),function(){r.removeEventListener("hashchange",y)}},options:e}}dr();var pr,fr,mr,gr=function(){function e(){var e=this;this.name="@amplitude/session-replay-browser",this.recordCancelCallback=null,this.eventCount=0,this.sessionTargetingMatch=!1,this.pageLeaveFns=[],this.recordFunction=null,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(){e.recordEvents(!1)},this.pageLeaveListener=function(t){e.pageLeaveFns.forEach(function(e){e(t)})},this.evaluateTargetingAndCapture=function(t,r,n){return void 0===r&&(r=!1),void 0===n&&(n=!1),i(e,void 0,void 0,function(){var e,o;return a(this,function(i){switch(i.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,!this.config.targetingConfig||this.sessionTargetingMatch?[3,2]:((e=t.event)&&Object.values(s).includes(e.event_type)&&(e=void 0),o=this,[4,hr({sessionId:this.identifiers.sessionId,targetingConfig:this.config.targetingConfig,loggerProvider:this.loggerProvider,apiKey:this.config.apiKey,targetingParams:{userProperties:t.userProperties,event:e}})]);case 1:o.sessionTargetingMatch=i.sent(),this.loggerProvider.debug(JSON.stringify({name:"targeted replay capture config",sessionTargetingMatch:this.sessionTargetingMatch,event:e,targetingParams:t},null,2)),i.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:i.sent(),i.label=5;case 5:return[2]}})})},this.addCustomRRWebEvent=function(t,r,n){return void 0===r&&(r={}),void 0===n&&(n=!0),i(e,void 0,void 0,function(){var e,s,i,l;return a(this,function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),e=void 0,(s=this.config)&&t!==V.METADATA?(e={config:se(s),version:Ye},n?[4,ne()]:[3,2]):[3,2];case 1:i=a.sent(),e=o(o({},i),e),a.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 l=a.sent(),this.loggerProvider.debug("Error while adding custom replay capture event: ",l),[3,4];case 4:return[2]}})})},this.stopRecordingEvents=function(){var t;try{e.loggerProvider.log("Session Replay capture stopping."),e.recordCancelCallback&&e.recordCancelCallback(),e.recordCancelCallback=null,null===(t=e.networkObservers)||void 0===t||t.stop()}catch(t){var r=t;e.loggerProvider.warn("Error occurred while stopping replay capture: ".concat(r.toString()))}},this.loggerProvider=new q(new S)}return e.prototype.init=function(e,t){return w(this._init(e,t))},e.prototype._init=function(e,t){var r,n,s,o,l,h,d;return i(this,void 0,void 0,function(){var i,p,f,m,y,v,w,b,C,I,x,k,O,E,R,A,M;return a(this,function(a){switch(a.label){case 0:return this.loggerProvider=new q(t.loggerProvider||new S),Object.prototype.hasOwnProperty.call(t,"logLevel")&&this.loggerProvider.enable(t.logLevel),this.identifiers=new lr({sessionId:t.sessionId,deviceId:t.deviceId}),i=this,[4,ue(e,t)];case 1:return i.joinedConfigGenerator=a.sent(),[4,this.joinedConfigGenerator.generateJoinedConfig()];case 2:p=a.sent(),f=p.joinedConfig,m=p.localConfig,y=p.remoteConfig,this.config=f,this.setMetadata(t.sessionId,f,m,y,null===(r=t.version)||void 0===r?void 0:r.version,Ye,null===(n=t.version)||void 0===n?void 0:n.type),t.sessionId&&(null===(s=this.config.interactionConfig)||void 0===s?void 0:s.enabled)&&(v=ar.default({sessionId:t.sessionId,type:"interaction"},this.config),this.pageLeaveFns=[v.send(this.getDeviceId.bind(this)).bind(v)],this.scrollHook=v.hook.bind(v)),w=[],"idb"!==(b=this.config.storeType)||(null===(o=g())||void 0===o?void 0:o.indexedDB)||(b="memory",this.loggerProvider.warn("Could not use preferred indexedDB storage, reverting to in memory option.")),this.loggerProvider.log("Using ".concat(b," for event storage.")),a.label=3;case 3:return a.trys.push([3,5,,6]),[4,Rt({config:this.config,sessionId:this.identifiers.sessionId,type:"replay",storeType:b})];case 4:return C=a.sent(),w.push({name:"replay",manager:C}),[3,6];case 5:return I=a.sent(),E=I,this.loggerProvider.warn("Error occurred while creating replay events manager: ".concat(E.toString())),[3,6];case 6:if(!(null===(l=this.config.interactionConfig)||void 0===l?void 0:l.enabled))return[3,10];x=this.config.interactionConfig.batch?sr:nr,a.label=7;case 7:return a.trys.push([7,9,,10]),[4,Rt({config:this.config,sessionId:this.identifiers.sessionId,type:"interaction",minInterval:null!==(h=this.config.interactionConfig.trackEveryNms)&&void 0!==h?h:3e4,maxInterval:6e4,payloadBatcher:x,storeType:b})];case 8:return k=a.sent(),w.push({name:"interaction",manager:k}),[3,10];case 9:return O=a.sent(),E=O,this.loggerProvider.warn("Error occurred while creating interaction events manager: ".concat(E.toString())),[3,10];case 10:return this.eventsManager=new(At.bind.apply(At,u([void 0],c(w),!1))),this.eventCompressor&&this.eventCompressor.terminate(),R=void 0,A=g(),(null===(d=this.config.experimental)||void 0===d?void 0:d.useWebWorker)&&A&&A.Worker?[4,Promise.resolve().then(function(){return vn})]:[3,12];case 11:M=a.sent().compressionScript,R=M,a.label=12;case 12:return this.eventCompressor=new Ge(this.eventsManager,this.config,this.getDeviceId(),R),[4,this.initializeNetworkObservers()];case 13:return a.sent(),this.loggerProvider.log("Installing @amplitude/session-replay-browser."),this.teardownEventListeners(!1),[4,this.evaluateTargetingAndCapture({userProperties:t.userProperties},!0)];case 14:return a.sent(),[2]}})})},e.prototype.setSessionId=function(e,t){return w(this.asyncSetSessionId(e,t))},e.prototype.asyncSetSessionId=function(e,t,r){var n;return i(this,void 0,void 0,function(){var s,o,i;return a(this,function(a){switch(a.label){case 0:return this.sessionTargetingMatch=!1,this.lastShouldRecordDecision=void 0,(s=this.identifiers&&this.identifiers.sessionId)&&this.sendEvents(s),o=t||this.getDeviceId(),this.identifiers=new lr({sessionId:e,deviceId:o}),this.joinedConfigGenerator&&s?[4,this.joinedConfigGenerator.generateJoinedConfig()]:[3,2];case 1:i=a.sent().joinedConfig,this.config=i,a.label=2;case 2:return(null===(n=this.config)||void 0===n?void 0:n.targetingConfig)?[4,this.evaluateTargetingAndCapture({userProperties:null==r?void 0:r.userProperties},!1,!0)]:[3,4];case 3:return a.sent(),[3,6];case 4:return[4,this.recordEvents()];case 5:a.sent(),a.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={})[Z]=r.sessionReplayId?r.sessionReplayId:null,s=e,t.debugMode&&(s[K]=JSON.stringify({appHash:B(t.apiKey).toString()}))),this.addCustomRRWebEvent(V.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=e||(null===(t=this.identifiers)||void 0===t?void 0:t.sessionId),n=this.getDeviceId();this.eventsManager&&r&&n&&this.eventsManager.sendCurrentSequenceEvents({sessionId:r,deviceId:n})},e.prototype.initialize=function(e){var t;return void 0===e&&(e=!1),i(this,void 0,void 0,function(){var r;return a(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,n;(null===(e=this.config)||void 0===e?void 0:e.instanceName)&&(r=(n=this.config.instanceName,void 0===n&&(n=p),F.getInstance(n)).identityStore.getIdentity().optOut);return void 0!==r?r:null===(t=this.config)||void 0===t?void 0:t.optOut},e.prototype.getShouldRecord=function(){if(!this.identifiers||!this.config||!this.identifiers.sessionId)return this.loggerProvider.warn("Session is not being recorded due to lack of config, please call sessionReplay.init."),!1;if(!this.config.captureEnabled)return this.loggerProvider.log("Session ".concat(this.identifiers.sessionId," not being captured due to capture being disabled for project or because the remote config could not be fetched.")),!1;if(this.shouldOptOut())return this.loggerProvider.log("Opting session ".concat(this.identifiers.sessionId," out of recording due to optOut config.")),!1;var e,t,r,n=!1,s="",o=!1;this.config.targetingConfig?this.sessionTargetingMatch?(s="Capturing replays for session ".concat(this.identifiers.sessionId," due to matching targeting conditions."),this.loggerProvider.log(s),n=!0,o=!0):(s="Not capturing replays for session ".concat(this.identifiers.sessionId," due to not matching targeting conditions."),this.loggerProvider.log(s),n=!1,o=!1):(e=this.identifiers.sessionId,t=this.config.sampleRate,r=B(e.toString()),31*Math.abs(r)%1e6/1e6<t)?(n=!0,o=!0):(s="Opting session ".concat(this.identifiers.sessionId," out of recording due to sample rate."),this.loggerProvider.log(s),n=!1,o=!1);return this.lastShouldRecordDecision!==n&&this.config.targetingConfig&&(this.addCustomRRWebEvent(V.TARGETING_DECISION,{message:s,sessionId:this.identifiers.sessionId,matched:o,targetingParams:this.lastTargetingParams}),this.lastShouldRecordDecision=n),n},e.prototype.getBlockSelectors=function(){var e,t,r,n=null!==(r=null===(t=null===(e=this.config)||void 0===e?void 0:e.privacyConfig)||void 0===t?void 0:t.blockSelector)&&void 0!==r?r:[];if(0!==n.length)return n},e.prototype.getMaskTextSelectors=function(){var e,t,r,n;if("conservative"===(null===(t=null===(e=this.config)||void 0===e?void 0:e.privacyConfig)||void 0===t?void 0:t.defaultMaskLevel))return"*";var s=null===(n=null===(r=this.config)||void 0===r?void 0:r.privacyConfig)||void 0===n?void 0:n.maskSelector;return s||void 0},e.prototype.getRecordingPlugins=function(e){var t,r,n,s,o,l;return i(this,void 0,void 0,function(){var i,c,u,h;return a(this,function(a){switch(a.label){case 0:i=[];try{c=dr({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}),i.push(c)}catch(e){this.loggerProvider.warn("Failed to create URL tracking plugin:",e)}if(!(null===(l=null==e?void 0:e.console)||void 0===l?void 0:l.enabled))return[3,4];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,Promise.resolve().then(function(){return ed})];case 2:return u=a.sent().getRecordConsolePlugin,i.push(u({level:e.console.levels})),[3,4];case 3:return h=a.sent(),this.loggerProvider.warn("Failed to load console plugin:",h),[3,4];case 4:return[2,i.length>0?i:void 0]}})})},e.prototype.getRecordFunction=function(){return i(this,void 0,void 0,function(){var e,t;return a(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 mC})];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){var t,r,n,s,o;return void 0===e&&(e=!0),i(this,void 0,void 0,function(){var i,l,c,u,h,d,p,f,m,g,y,v,w,b=this;return a(this,function(a){switch(a.label){case 0:return i=this.config,l=this.getShouldRecord(),c=null===(t=this.identifiers)||void 0===t?void 0:t.sessionId,l&&c&&i?(this.stopRecordingEvents(),[4,this.getRecordFunction()]):[2];case 1:return(u=a.sent())?[4,this.initializeNetworkObservers()]:[2];case 2:a.sent(),null===(r=this.networkObservers)||void 0===r||r.start(function(e){b.addCustomRRWebEvent(V.FETCH_REQUEST,e)}),h=i.privacyConfig,d=i.interactionConfig,p=i.loggingConfig,f=(null==d?void 0:d.enabled)?{mouseInteraction:this.eventsManager&&or(this.loggerProvider,{eventsManager:this.eventsManager,sessionId:c,deviceIdFn:this.getDeviceId.bind(this),mirror:u.mirror,ugcFilterRules:null!==(n=d.ugcFilterRules)&&void 0!==n?n:[]}),scroll:this.scrollHook}:{},m=(null==d?void 0:d.enabled)&&d.ugcFilterRules?d.ugcFilterRules:[],this.loggerProvider.log("Session Replay capture beginning for ".concat(c,".")),a.label=3;case 3:return a.trys.push([3,5,,6]),g=this,y=u,w={emit:function(e){if(b.shouldOptOut())return b.loggerProvider.log("Opting session ".concat(c," out of recording due to optOut config.")),b.stopRecordingEvents(),void b.sendEvents();e.type===ae.Meta&&(e.data.href=re(e.data.href,m)),b.eventCompressor&&b.eventCompressor.enqueueEvent(e,c)},inlineStylesheet:i.shouldInlineStylesheet,hooks:f,maskAllInputs:!0,maskTextClass:$,blockClass:"amp-block",blockSelector:this.getBlockSelectors(),applyBackgroundColorToBlockedElements:i.applyBackgroundColorToBlockedElements,maskInputFn:Q("input",h),maskTextFn:Q("text",h),maskTextSelector:this.getMaskTextSelectors(),recordCanvas:!1,slimDOMOptions:{script:null===(s=i.omitElementTags)||void 0===s?void 0:s.script,comment:null===(o=i.omitElementTags)||void 0===o?void 0:o.comment},errorHandler:function(e){var t=e;if(t.message.includes("insertRule")&&t.message.includes("CSSStyleSheet"))throw t;if(t._external_)throw t;return b.loggerProvider.warn("Error while capturing replay: ",t.toString()),!0}},[4,this.getRecordingPlugins(p)];case 4:return g.recordCancelCallback=y.apply(void 0,[(w.plugins=a.sent(),w)]),this.addCustomRRWebEvent(V.DEBUG_INFO),e&&this.addCustomRRWebEvent(V.METADATA,this.metadata),[3,6];case 5:return v=a.sent(),this.loggerProvider.warn("Failed to initialize session replay:",v),[3,6];case 6:return[2]}})})},e.prototype.getDeviceId=function(){var e;return null===(e=this.identifiers)||void 0===e?void 0:e.deviceId},e.prototype.getSessionId=function(){var e;return null===(e=this.identifiers)||void 0===e?void 0:e.sessionId},e.prototype.flush=function(e){var t;return void 0===e&&(e=!1),i(this,void 0,void 0,function(){return a(this,function(r){return[2,null===(t=this.eventsManager)||void 0===t?void 0:t.flush(e)]})})},e.prototype.shutdown=function(){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())?B(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 i(this,void 0,void 0,function(){var n,s;return a(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 yC})];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}(),yr=function(e){return function(){var t=e.config||oe();return{logger:t.loggerProvider,logLevel:t.logLevel}}},vr=function(){var e=new gr;return{init:_(e.init.bind(e),"init",yr(e)),evaluateTargetingAndCapture:_(e.evaluateTargetingAndCapture.bind(e),"evaluateTargetingAndRecord",yr(e)),setSessionId:_(e.setSessionId.bind(e),"setSessionId",yr(e)),getSessionId:_(e.getSessionId.bind(e),"getSessionId",yr(e)),getSessionReplayProperties:_(e.getSessionReplayProperties.bind(e),"getSessionReplayProperties",yr(e)),flush:_(e.flush.bind(e),"flush",yr(e)),shutdown:_(e.shutdown.bind(e),"shutdown",yr(e))}}(),wr=vr.init,br=vr.setSessionId,Sr=vr.getSessionId,Cr=vr.getSessionReplayProperties,Ir=vr.flush,xr=vr.shutdown,kr=vr.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"}(pr||(pr={})),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"}(fr||(fr={})),function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"}(mr||(mr={}));const Or=[pr.SET,pr.SET_ONCE,pr.ADD,pr.APPEND,pr.PREPEND,pr.POSTINSERT],Er="1.22.26";class Rr{constructor(e){this.name=Rr.pluginName,this.type="enrichment",this.sessionReplay={flush:Ir,getSessionId:Sr,getSessionReplayProperties:Cr,init:wr,setSessionId:br,shutdown:xr,evaluateTargetingAndCapture:kr},this.options=Object.assign({forceSessionTracking:!1},e),this.srInitOptions=this.options}setup(e,t){var r,n,s,o,a;return i(this,void 0,void 0,function*(){try{null==e||e.loggerProvider.log(`Installing @amplitude/plugin-session-replay, version ${Er}.`),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 i=(t=this.config.instanceName,void 0===t&&(t="$default_instance"),F.getInstance(t)).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,trackServerUrl:this.options.trackServerUrl,sampleRate:this.options.sampleRate,privacyConfig:{blockSelector:null===(n=this.options.privacyConfig)||void 0===n?void 0:n.blockSelector,maskSelector:null===(s=this.options.privacyConfig)||void 0===s?void 0:s.maskSelector,unmaskSelector:null===(o=this.options.privacyConfig)||void 0===o?void 0:o.unmaskSelector,defaultMaskLevel:null===(a=this.options.privacyConfig)||void 0===a?void 0:a.defaultMaskLevel},debugMode:this.options.debugMode,shouldInlineStylesheet:this.options.shouldInlineStylesheet,version:{type:"plugin",version:Er},performanceConfig:this.options.performanceConfig,storeType:this.options.storeType,experimental:this.options.experimental,userProperties:i,omitElementTags:this.options.omitElementTags,applyBackgroundColorToBlockedElements:this.options.applyBackgroundColorToBlockedElements,interactionConfig:this.options.interactionConfig,captureDocumentTitle:this.options.captureDocumentTitle,enableUrlChangePolling:this.options.enableUrlChangePolling,urlChangePollingInterval:this.options.urlChangePollingInterval},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){return i(this,void 0,void 0,function*(){this.config.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){return i(this,void 0,void 0,function*(){this.config.loggerProvider.debug(`optOut is changed to ${String(e)}, calling ${e?"sessionReplay.shutdown()":"sessionReplay.init()"}.`),e?this.sessionReplay.shutdown():yield this.sessionReplay.init(this.config.apiKey,this.srInitOptions).promise})}execute(e){var t;return i(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 t=this.config.sessionId;if(t&&t!==this.sessionReplay.getSessionId()&&(yield this.sessionReplay.setSessionId(t).promise),t&&t===e.session_id){let t;e.event_type===s.IDENTIFY&&(t=(e=>{if(!e.user_properties)return;let t={};return Object.keys(e.user_properties).forEach(r=>{if(Or.includes(r)){const n=e.user_properties&&e.user_properties[r];t=Object.assign(Object.assign({},t),n)}}),t})(e)),yield this.sessionReplay.evaluateTargetingAndCapture({event:e,userProperties:t});const r=this.sessionReplay.getSessionReplayProperties();e.event_properties=Object.assign(Object.assign({},e.event_properties),r)}}return Promise.resolve(e)}catch(r){return null===(t=this.config)||void 0===t||t.loggerProvider.error(`Session Replay: Failed to enrich event due to ${r.message}`),Promise.resolve(e)}})}teardown(){var e;return i(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()}}Rr.pluginName="@amplitude/plugin-session-replay-browser";const Ar=e=>new Rr(e);var Mr=function(e,t){return Mr=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])},Mr(e,t)};var Pr=function(){return Pr=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},Pr.apply(this,arguments)};function Nr(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 Tr="is",Dr="is not",Lr="contains",Fr="does not contain",_r="less",Br="less or equal",Ur="greater",jr="greater or equal",zr="version less",Wr="version less or equal",Vr="version greater",Gr="version greater or equal",Zr="set is",Yr="set is not",Jr="set contains",Kr="set does not contain",$r="set contains any",qr="set does not contain any",Xr="regex match",Hr="regex does not match",Qr=-862048943,en=461845907,tn=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=on(r,i<<2);o=rn(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,Qr),c=sn(c,15),o^=c=Math.imul(c,en);break;case 2:c^=r[l+1]<<8,c^=r[l],c=Math.imul(c,Qr),c=sn(c,15),o^=c=Math.imul(c,en);break;case 1:c^=r[l],c=Math.imul(c,Qr),c=sn(c,15),o^=c=Math.imul(c,en)}return nn(o^=n)>>>0},rn=function(e,t){var r=e,n=t;return r=Math.imul(r,Qr),r=sn(r,15),r=Math.imul(r,en),n=sn(n^=r,13),(n=Math.imul(n,5))+-430675100|0},nn=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},sn=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},on=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 an(r)},an=function(e){return(-16777216&e)>>>24|(16711680&e)>>>8|(65280&e)<<8|(255&e)<<24},ln=function(e,t){var r,n;if(t&&0!==t.length){try{for(var s=Nr(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}},cn="^".concat("(\\d+)\\.(\\d+)","(\\.").concat("(\\d+)").concat("(-(([-\\w]+\\.?)*))?",")?$"),un=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(cn).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}(),hn=function(){function e(){}return e.prototype.evaluate=function(e,t){var r,n,s={},o={context:e,result:s};try{for(var i=Nr(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=Nr(t.segments),i=o.next();!i.done;i=o.next()){var a=i.value;if(s=this.evaluateSegment(e,t,a)){var l=Pr(Pr(Pr({},t.metadata),a.metadata),s.metadata);s=Pr(Pr({},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=Nr(r.conditions),l=a.next();!l.done;l=a.next()){var c,u=l.value,h=!0;try{for(var d=(o=void 0,Nr(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=ln(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 tn(e)},e.prototype.bucket=function(e,t){var r,n,s,o;if(!t.bucket)return t.variant;var i=this.coerceString(ln(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=Nr(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,Nr(p.distributions)),y=g.next();!y.done;y=g.next()){var v=y.value,w=v.range[0],b=v.range[1];if(u>=w&&u<b)return v.variant}}catch(e){s={error:e}}finally{try{y&&!y.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 Tr:case Lr:case _r:case Br:case Ur:case jr:case zr:case Wr:case Vr:case Gr:case Zr:case Jr:case $r:return r;case Dr:case Fr:case Kr:case qr:return!r;default:return!1}},e.prototype.matchSet=function(e,t,r){switch(t){case Zr:return this.setEquals(e,r);case Yr:return!this.setEquals(e,r);case Jr:return this.matchesSetContainsAll(e,r);case Kr:return!this.matchesSetContainsAll(e,r);case $r:return this.matchesSetContainsAny(e,r);case qr:return!this.matchesSetContainsAny(e,r);default:return!1}},e.prototype.matchString=function(e,t,r){var n=this;switch(t){case Tr:return this.matchesIs(e,r);case Dr:return!this.matchesIs(e,r);case Lr:return this.matchesContains(e,r);case Fr:return!this.matchesContains(e,r);case _r:case Br:case Ur:case jr:return this.matchesComparable(e,t,r,function(e){return n.parseNumber(e)},this.comparator);case zr:case Wr:case Vr:case Gr:return this.matchesComparable(e,t,r,function(e){return un.parse(e)},this.versionComparator);case Xr:return this.matchesRegex(e,r);case Hr: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=Nr(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 _r:case zr:return e<r;case Br:case Wr:return e<=r;case Ur:case Vr:return e>r;case jr:case Gr:return e>=r;default:return!1}},e.prototype.versionComparator=function(e,t,r){var n=e.compareTo(r);switch(t){case _r:case zr:return n<0;case Br:case Wr:return n<=0;case Ur:case Vr:return n>0;case jr:case Gr: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 Zr:case Yr:case Jr:case Kr:case $r:case qr: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=Nr(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=Nr(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}Mr(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})(t,e)}(Error);var dn,pn=function(){var e=this;this.dbs={},this.createStore=function(t){return i(e,void 0,void 0,function(){return a(this,function(e){switch(e.label){case 0:return[4,it(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 i(e,void 0,void 0,function(){var e,r;return a(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,l=t.loggerProvider,c=t.tx;return i(e,void 0,void 0,function(){var e,t,i,u,h,d,p,f,m;return a(this,function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),e=String(r),[4,c.store.get(e)];case 1:return t=a.sent(),i=t?t.eventTypes:{},u=i[n]||{},h=o(o({},i),((f={})[n]=o(o({},u),((m={})[s]={event_type:n},m)),f)),d={sessionId:e,eventTypes:h,lastUpdated:Date.now()},[4,c.store.put(d)];case 2:return a.sent(),[2,h];case 3:return p=a.sent(),l.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 i(e,void 0,void 0,function(){var e,t,o,i,l,c;return a(this,function(a){switch(a.label){case 0:return a.trys.push([0,6,,7]),e=String(r),[4,s.store.getAll()];case 1:t=a.sent(),o=0,a.label=2;case 2:return o<t.length?(i=t[o],l=Date.now()-i.lastUpdated,i.sessionId!==e&&l>1728e5?[4,s.store.delete(i.sessionId)]:[3,4]):[3,5];case 3:a.sent(),a.label=4;case 4:return o++,[3,2];case 5:return[3,7];case 6:return c=a.sent(),n.warn("Failed to clear old session event types for targeting: ".concat(c)),[3,7];case 7:return[2]}})})},this.storeEventTypeForSession=function(t){var r=t.loggerProvider,n=t.sessionId,s=t.eventType,o=t.eventTime,l=t.apiKey;return i(e,void 0,void 0,function(){var e,t,i,c;return a(this,function(a){switch(a.label){case 0:return a.trys.push([0,5,,6]),[4,this.openOrCreateDB(l)];case 1:return e=a.sent(),(t=e.transaction("eventTypesForSession","readwrite"))?[4,this.updateEventListForSession({sessionId:n,tx:t,loggerProvider:r,eventType:s,eventTime:o})]:[2];case 2:return i=a.sent(),[4,this.deleteOldSessionEventTypes({currentSessionId:n,tx:t,loggerProvider:r})];case 3:return a.sent(),[4,t.done];case 4:return a.sent(),[2,i];case 5:return c=a.sent(),r.warn("Failed to store events for targeting ".concat(n,": ").concat(c)),[3,6];case 6:return[2,void 0]}})})}},fn=new pn,mn=function(){var e=this;this.evaluateTargeting=function(t){var r=t.apiKey,n=t.loggerProvider,s=t.event,o=t.sessionId,l=t.userProperties,c=t.deviceId,u=t.flag;return i(e,void 0,void 0,function(){var e,t,i,h;return a(this,function(a){switch(a.label){case 0:return s&&s.time?[4,fn.storeEventTypeForSession({loggerProvider:n,apiKey:r,sessionId:o,eventType:s.event_type,eventTime:s.time})]:[3,2];case 1:return t=a.sent(),[3,3];case 2:t=void 0,a.label=3;case 3:return i=(e=t)&&new Set(Object.keys(e)),h={session_id:o,event:s,event_types:i&&Array.from(i),user:{device_id:c,user_properties:l}},[2,this.evaluationEngine.evaluate(h,[u])]}})})},this.evaluationEngine=new hn},gn=function(){var e=new mn;return{evaluateTargeting:e.evaluateTargeting.bind(e)}}().evaluateTargeting,yn=Object.freeze({__proto__:null,evaluateTargeting:gn}),vn=Object.freeze({__proto__:null,compressionScript:'var WebWorker=function(r){"use strict";var n=Uint8Array,e=Uint16Array,f=Uint32Array,t=new n([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),a=new n([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),o=new n([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),i=function(r,n){for(var t=new e(31),a=0;a<31;++a)t[a]=n+=1<<r[a-1];var o=new f(t[30]);for(a=1;a<30;++a)for(var i=t[a];i<t[a+1];++i)o[i]=i-t[a]<<5|a;return[t,o]},v=i(t,2),u=v[0],s=v[1];u[28]=258,s[258]=28;for(var l=i(a,0)[1],c=new e(32768),h=0;h<32768;++h){var g=(43690&h)>>>1|(21845&h)<<1;g=(61680&(g=(52428&g)>>>2|(13107&g)<<2))>>>4|(3855&g)<<4,c[h]=((65280&g)>>>8|(255&g)<<8)>>>1}var w=function(r,n,f){for(var t=r.length,a=0,o=new e(n);a<t;++a)++o[r[a]-1];var i,v=new e(n);for(a=0;a<n;++a)v[a]=v[a-1]+o[a-1]<<1;if(f){i=new e(1<<n);var u=15-n;for(a=0;a<t;++a)if(r[a])for(var s=a<<4|r[a],l=n-r[a],h=v[r[a]-1]++<<l,g=h|(1<<l)-1;h<=g;++h)i[c[h]>>>u]=s}else for(i=new e(t),a=0;a<t;++a)i[a]=c[v[r[a]-1]++]>>>15-r[a];return i},d=new n(288);for(h=0;h<144;++h)d[h]=8;for(h=144;h<256;++h)d[h]=9;for(h=256;h<280;++h)d[h]=7;for(h=280;h<288;++h)d[h]=8;var m=new n(32);for(h=0;h<32;++h)m[h]=5;var y=w(d,9,0),M=w(m,5,0),p=function(r){return(r/8|0)+(7&r&&1)},b=function(r,t,a){(null==a||a>r.length)&&(a=r.length);var o=new(r instanceof e?e:r instanceof f?f:n)(a-t);return o.set(r.subarray(t,a)),o},C=function(r,n,e){e<<=7&n;var f=n/8|0;r[f]|=e,r[f+1]|=e>>>8},S=function(r,n,e){e<<=7&n;var f=n/8|0;r[f]|=e,r[f+1]|=e>>>8,r[f+2]|=e>>>16},x=function(r,f){for(var t=[],a=0;a<r.length;++a)r[a]&&t.push({s:a,f:r[a]});var o=t.length,i=t.slice();if(!o)return[new n(0),0];if(1==o){var v=new n(t[0].s+1);return v[t[0].s]=1,[v,1]}t.sort(function(r,n){return r.f-n.f}),t.push({s:-1,f:25001});var u=t[0],s=t[1],l=0,c=1,h=2;for(t[0]={s:-1,f:u.f+s.f,l:u,r:s};c!=o-1;)u=t[t[l].f<t[h].f?l++:h++],s=t[l!=c&&t[l].f<t[h].f?l++:h++],t[c++]={s:-1,f:u.f+s.f,l:u,r:s};var g=i[0].s;for(a=1;a<o;++a)i[a].s>g&&(g=i[a].s);var w=new e(g+1),d=A(t[c-1],w,0);if(d>f){a=0;var m=0,y=d-f,M=1<<y;for(i.sort(function(r,n){return w[n.s]-w[r.s]||r.f-n.f});a<o;++a){var p=i[a].s;if(!(w[p]>f))break;m+=M-(1<<d-w[p]),w[p]=f}for(m>>>=y;m>0;){var b=i[a].s;w[b]<f?m-=1<<f-w[b]++-1:++a}for(;a>=0&&m;--a){var C=i[a].s;w[C]==f&&(--w[C],++m)}d=f}return[new n(w),d]},A=function(r,n,e){return-1==r.s?Math.max(A(r.l,n,e+1),A(r.r,n,e+1)):n[r.s]=e},O=function(r){for(var n=r.length;n&&!r[--n];);for(var f=new e(++n),t=0,a=r[0],o=1,i=function(r){f[t++]=r},v=1;v<=n;++v)if(r[v]==a&&v!=n)++o;else{if(!a&&o>2){for(;o>138;o-=138)i(32754);o>2&&(i(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(i(a),--o;o>6;o-=6)i(8304);o>2&&(i(o-3<<5|8208),o=0)}for(;o--;)i(a);o=1,a=r[v]}return[f.subarray(0,t),n]},T=function(r,n){for(var e=0,f=0;f<n.length;++f)e+=r[f]*n[f];return e},k=function(r,n,e){var f=e.length,t=p(n+2);r[t]=255&f,r[t+1]=f>>>8,r[t+2]=255^r[t],r[t+3]=255^r[t+1];for(var a=0;a<f;++a)r[t+a+4]=e[a];return 8*(t+4+f)},E=function(r,n,f,i,v,u,s,l,c,h,g){C(n,g++,f),++v[256];for(var p=x(v,15),b=p[0],A=p[1],E=x(u,15),J=E[0],N=E[1],U=O(b),D=U[0],I=U[1],W=O(J),_=W[0],j=W[1],P=new e(19),q=0;q<D.length;++q)P[31&D[q]]++;for(q=0;q<_.length;++q)P[31&_[q]]++;for(var z=x(P,7),B=z[0],F=z[1],G=19;G>4&&!B[o[G-1]];--G);var H,K,L,Q,R=h+5<<3,V=T(v,d)+T(u,m)+s,X=T(v,b)+T(u,J)+s+14+3*G+T(P,B)+(2*P[16]+3*P[17]+7*P[18]);if(R<=V&&R<=X)return k(n,g,r.subarray(c,c+h));if(C(n,g,1+(X<V)),g+=2,X<V){H=w(b,A,0),K=b,L=w(J,N,0),Q=J;var Y=w(B,F,0);C(n,g,I-257),C(n,g+5,j-1),C(n,g+10,G-4),g+=14;for(q=0;q<G;++q)C(n,g+3*q,B[o[q]]);g+=3*G;for(var Z=[D,_],$=0;$<2;++$){var rr=Z[$];for(q=0;q<rr.length;++q){var nr=31&rr[q];C(n,g,Y[nr]),g+=B[nr],nr>15&&(C(n,g,rr[q]>>>5&127),g+=rr[q]>>>12)}}}else H=y,K=d,L=M,Q=m;for(q=0;q<l;++q)if(i[q]>255){nr=i[q]>>>18&31;S(n,g,H[nr+257]),g+=K[nr+257],nr>7&&(C(n,g,i[q]>>>23&31),g+=t[nr]);var er=31&i[q];S(n,g,L[er]),g+=Q[er],er>3&&(S(n,g,i[q]>>>5&8191),g+=a[er])}else S(n,g,H[i[q]]),g+=K[i[q]];return S(n,g,H[256]),g+K[256]},J=new f([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),N=function(r,o,i,v,u){return function(r,o,i,v,u,c){var h=r.length,g=new n(v+h+5*(1+Math.floor(h/7e3))+u),w=g.subarray(v,g.length-u),d=0;if(!o||h<8)for(var m=0;m<=h;m+=65535){var y=m+65535;y<h?d=k(w,d,r.subarray(m,y)):(w[m]=c,d=k(w,d,r.subarray(m,h)))}else{for(var M=J[o-1],C=M>>>13,S=8191&M,x=(1<<i)-1,A=new e(32768),O=new e(x+1),T=Math.ceil(i/3),N=2*T,U=function(n){return(r[n]^r[n+1]<<T^r[n+2]<<N)&x},D=new f(25e3),I=new e(288),W=new e(32),_=0,j=0,P=(m=0,0),q=0,z=0;m<h;++m){var B=U(m),F=32767&m,G=O[B];if(A[F]=G,O[B]=F,q<=m){var H=h-m;if((_>7e3||P>24576)&&H>423){d=E(r,w,0,D,I,W,j,P,z,m-z,d),P=_=j=0,z=m;for(var K=0;K<286;++K)I[K]=0;for(K=0;K<30;++K)W[K]=0}var L=2,Q=0,R=S,V=F-G&32767;if(H>2&&B==U(m-V))for(var X=Math.min(C,H)-1,Y=Math.min(32767,m),Z=Math.min(258,H);V<=Y&&--R&&F!=G;){if(r[m+L]==r[m+L-V]){for(var $=0;$<Z&&r[m+$]==r[m+$-V];++$);if($>L){if(L=$,Q=V,$>X)break;var rr=Math.min(V,$-2),nr=0;for(K=0;K<rr;++K){var er=m-V+K+32768&32767,fr=er-A[er]+32768&32767;fr>nr&&(nr=fr,G=er)}}}V+=(F=G)-(G=A[F])+32768&32767}if(Q){D[P++]=268435456|s[L]<<18|l[Q];var tr=31&s[L],ar=31&l[Q];j+=t[tr]+a[ar],++I[257+tr],++W[ar],q=m+L,++_}else D[P++]=r[m],++I[r[m]]}}d=E(r,w,c,D,I,W,j,P,z,m-z,d)}return b(g,0,v+p(d)+u)}(r,null==o.level?6:o.level,null==o.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(r.length)))):12+o.mem,i,v,!u)};function U(r,n){void 0===n&&(n={});var e=function(){var r=1,n=0;return{p:function(e){for(var f=r,t=n,a=e.length,o=0;o!=a;){for(var i=Math.min(o+5552,a);o<i;++o)t+=f+=e[o];f%=65521,t%=65521}r=f,n=t},d:function(){return(r>>>8<<16|(255&n)<<8|n>>>8)+2*((255&r)<<23)}}}();e.p(r);var f,t,a,o=N(r,n,2,4);return f=o,t=n.level,a=0==t?0:t<6?1:9==t?3:2,f[0]=120,f[1]=a<<6|(a?32-2*a:1),function(r,n,e){for(;e;++n)r[n]=e,e>>>=8}(o,o.length-4,e.d()),o}const D=r=>{const e={...r,v:"v1"};return function(r,n){var e="";if(!n&&"undefined"!=typeof TextDecoder)return(new TextDecoder).decode(r);for(var f=0;f<r.length;){var t=r[f++];t<128||n?e+=String.fromCharCode(t):t<224?e+=String.fromCharCode((31&t)<<6|63&r[f++]):t<240?e+=String.fromCharCode((15&t)<<12|(63&r[f++])<<6|63&r[f++]):(t=((15&t)<<18|(63&r[f++])<<12|(63&r[f++])<<6|63&r[f++])-65536,e+=String.fromCharCode(55296|t>>10,56320|1023&t))}return e}(U(function(r,e){var f=r.length;if(!e&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(r);for(var t=new n(r.length+(r.length>>>1)),a=0,o=function(r){t[a++]=r},i=0;i<f;++i){if(a+5>t.length){var v=new n(a+8+(f-i<<1));v.set(t),t=v}var u=r.charCodeAt(i);u<128||e?o(u):u<2048?(o(192|u>>>6),o(128|63&u)):u>55295&&u<57344?(o(240|(u=65536+(1047552&u)|1023&r.charCodeAt(++i))>>>18),o(128|u>>>12&63),o(128|u>>>6&63),o(128|63&u)):(o(224|u>>>12),o(128|u>>>6&63),o(128|63&u))}return b(t,0,a)}(JSON.stringify(e))),!0)};onmessage=r=>{const{event:n,sessionId:e}="string"==typeof r.data?JSON.parse(r.data):r.data,f=JSON.stringify(D(n));postMessage({compressedEvent:f,sessionId:e})};const I=onmessage;return r.compressionOnMessage=I,Object.defineProperty(r,"__esModule",{value:!0}),r}({});\n'}),wn=Object.defineProperty,bn=(e,t,r)=>((e,t,r)=>t in e?wn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Sn=Object.defineProperty,Cn=(e,t,r)=>((e,t,r)=>t in e?Sn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),In=Object.defineProperty,xn=(e,t,r)=>((e,t,r)=>t in e?In(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);const kn={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},On={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},En={};function Rn(e){if(En[e])return En[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 kn?kn[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 On?On[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 En[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?En[e]=o:r}catch{return r}}const An={};function Mn(e,t,r){var n;const s=`${e}.${String(r)}`;if(An[s])return An[s].call(t);const o=Rn(e),i=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return i?(An[s]=i,i.call(t)):t[r]}const Pn={};function Nn(e,t,r){const n=`${e}.${String(r)}`;if(Pn[n])return Pn[n].bind(t);const s=Rn(e)[r];return"function"!=typeof s?t[r]:(Pn[n]=s,s.bind(t))}const Tn={childNodes:function(e){return Mn("Node",e,"childNodes")},parentNode:function(e){return Mn("Node",e,"parentNode")},parentElement:function(e){return Mn("Node",e,"parentElement")},textContent:function(e){return Mn("Node",e,"textContent")},contains:function(e,t){return Nn("Node",e,"contains")(t)},getRootNode:function(e){return Nn("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Mn("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Mn("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Mn("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Mn("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return Rn("MutationObserver").constructor}};class Dn{constructor(){xn(this,"idNodeMap",new Map),xn(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 Ln(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&Ln(Tn.parentNode(e),t,r);for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!!r&&Ln(Tn.parentNode(e),t,r)}function Fn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function _n(e){if(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 Bn={exports:{}},Un=String,jn=function(){return{isColorSupported:!1,reset:Un,bold:Un,dim:Un,italic:Un,underline:Un,inverse:Un,hidden:Un,strikethrough:Un,black:Un,red:Un,green:Un,yellow:Un,blue:Un,magenta:Un,cyan:Un,white:Un,gray:Un,bgBlack:Un,bgRed:Un,bgGreen:Un,bgYellow:Un,bgBlue:Un,bgMagenta:Un,bgCyan:Un,bgWhite:Un}};Bn.exports=jn(),Bn.exports.createColors=jn;var zn=Bn.exports;const Wn=_n(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let Vn=zn,Gn=Wn,Zn=class e extends Error{constructor(t,r,n,s,o,i){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),s&&(this.source=s),i&&(this.plugin=i),void 0!==r&&void 0!==n&&("number"==typeof r?(this.line=r,this.column=n):(this.line=r.line,this.column=r.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}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(e){if(!this.source)return"";let t=this.source;null==e&&(e=Vn.isColorSupported),Gn&&e&&(t=Gn(t));let r,n,s=t.split(/\r?\n/),o=Math.max(this.line-3,0),i=Math.min(this.line+2,s.length),a=String(i).length;if(e){let{bold:e,gray:t,red:s}=Vn.createColors(!0);r=t=>e(s(t)),n=e=>t(e)}else r=n=e=>e;return s.slice(o,i).map((e,t)=>{let s=o+1+t,i=" "+(" "+s).slice(-a)+" | ";if(s===this.line){let t=n(i.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return r(">")+n(i)+e+"\n "+t+r("^")}return" "+n(i)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};var Yn=Zn;Zn.default=Zn;var Jn={};Jn.isClean=Symbol("isClean"),Jn.my=Symbol("my");const Kn={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let $n=class{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(e,t,r){let n;if(r||(r=t),t&&(n=e.raws[t],void 0!==n))return n;let s=e.parent;if("before"===r){if(!s||"root"===s.type&&s.first===e)return"";if(s&&"document"===s.type)return""}if(!s)return Kn[r];let o=e.root();if(o.rawCache||(o.rawCache={}),void 0!==o.rawCache[r])return o.rawCache[r];if("before"===r||"after"===r)return this.beforeAfter(e,r);{let s="raw"+((i=r)[0].toUpperCase()+i.slice(1));this[s]?n=this[s](o,e):o.walk(e=>{if(n=e.raws[t],void 0!==n)return!1})}var i;return void 0===n&&(n=Kn[r]),o.rawCache[r]=n,n}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)}};var qn=$n;$n.default=$n;let Xn=qn;function Hn(e,t){new Xn(t).stringify(e)}var Qn=Hn;Hn.default=Hn;let{isClean:es,my:ts}=Jn,rs=Yn,ns=qn,ss=Qn;function os(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=>os(e,r)):("object"===o&&null!==s&&(s=os(s)),r[n]=s)}return r}let is=class{constructor(e={}){this.raws={},this[es]=!1,this[ts]=!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=os(this);for(let r in e)t[r]=e[r];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:r,start:n}=this.rangeBy(t);return this.source.input.error(e,{column:n.column,line:n.line},{column:r.column,line:r.line},t)}return new rs(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markDirty(){if(this[es]){this[es]=!1;let e=this;for(;e=e.parent;)e[es]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){let n=(t=this.toString()).indexOf(e.word);-1!==n&&(r=this.positionInside(n,t))}return r}positionInside(e,t){let r=t||this.toString(),n=this.source.start.column,s=this.source.start.line;for(let t=0;t<e;t++)"\n"===r[t]?(n=1,s+=1):n+=1;return{column:n,line:s}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let n=this.toString(),s=n.indexOf(e.word);-1!==s&&(t=this.positionInside(s,n),r=this.positionInside(s+e.word.length,n))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return(new ns).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let n of e)n===this?r=!0:r?(this.parent.insertAfter(t,n),t=n):this.parent.insertBefore(t,n);r||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let r={},n=null==t;t=t||new Map;let 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){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=ss){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){let n={node:this};for(let e in r)n[e]=r[e];return e.warn(t,n)}get proxyOf(){return this}};var as=is;is.default=is;let ls=as,cs=class extends ls{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}};var us=cs;cs.default=cs;var hs={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(r=t)=>{let n="",s=r;for(;s--;)n+=e[Math.random()*e.length|0];return n}};let{SourceMapConsumer:ds,SourceMapGenerator:ps}=Wn,{existsSync:fs,readFileSync:ms}=Wn,{dirname:gs,join:ys}=Wn;let vs=class{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,n=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=gs(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new ds(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t;let r=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+r)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let r=e.lastIndexOf(t.pop()),n=e.indexOf("*/",r);r>-1&&n>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,n)))}loadFile(e){if(this.root=gs(e),fs(e))return this.mapFile=e,ms(e,"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 ds)return ps.fromSourceMap(t).toString();if(t instanceof ps)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=ys(gs(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)}};var ws=vs;vs.default=vs;let{SourceMapConsumer:bs,SourceMapGenerator:Ss}=Wn,{fileURLToPath:Cs,pathToFileURL:Is}=Wn,{isAbsolute:xs,resolve:ks}=Wn,{nanoid:Os}=hs,Es=Wn,Rs=Yn,As=ws,Ms=Symbol("fromOffsetCache"),Ps=Boolean(bs&&Ss),Ns=Boolean(ks&&xs),Ts=class{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!Ns||/^\w+:\/\//.test(t.from)||xs(t.from)?this.file=t.from:this.file=ks(t.from)),Ns&&Ps){let e=new As(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+Os(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let s,o,i;if(t&&"object"==typeof t){let e=t,n=r;if("number"==typeof e.offset){let n=this.fromOffset(e.offset);t=n.line,r=n.col}else t=e.line,r=e.column;if("number"==typeof n.offset){let e=this.fromOffset(n.offset);o=e.line,i=e.col}else o=n.line,i=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let a=this.origin(t,r,o,i);return s=a?new Rs(e,void 0===a.endLine?a.line:{column:a.column,line:a.line},void 0===a.endLine?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,n.plugin):new Rs(e,void 0===o?t:{column:r,line:t},void 0===o?r:{column:i,line:o},this.css,this.file,n.plugin),s.input={column:r,endColumn:i,endLine:o,line:t,source:this.css},this.file&&(Is&&(s.input.url=Is(this.file).toString()),s.input.file=this.file),s}fromOffset(e){let t,r;if(this[Ms])r=this[Ms];else{let e=this.css.split("\n");r=new Array(e.length);let t=0;for(let n=0,s=e.length;n<s;n++)r[n]=t,t+=e[n].length+1;this[Ms]=r}t=r[r.length-1];let n=0;if(e>=t)n=r.length-1;else{let t,s=r.length-2;for(;n<s;)if(t=n+(s-n>>1),e<r[t])s=t-1;else{if(!(e>=r[t+1])){n=t;break}n=t+1}}return{col:e-r[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:ks(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,n){if(!this.map)return!1;let s,o,i=this.map.consumer(),a=i.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof r&&(s=i.originalPositionFor({column:n,line:r})),o=xs(a.source)?Is(a.source):new URL(a.source,this.map.consumer().sourceRoot||Is(this.map.mapFile));let l={column:a.column,endColumn:s&&s.column,endLine:s&&s.line,line:a.line,url:o.toString()};if("file:"===o.protocol){if(!Cs)throw new Error("file: protocol is not available in this PostCSS build");l.file=Cs(o)}let c=i.sourceContentFor(a.source);return c&&(l.source=c),l}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}};var Ds=Ts;Ts.default=Ts,Es&&Es.registerInput&&Es.registerInput(Ts);let{SourceMapConsumer:Ls,SourceMapGenerator:Fs}=Wn,{dirname:_s,relative:Bs,resolve:Us,sep:js}=Wn,{pathToFileURL:zs}=Wn,Ws=Ds,Vs=Boolean(Ls&&Fs),Gs=Boolean(_s&&Us&&Bs&&js);var Zs=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 e of this.previous()){let t,r=this.toUrl(this.path(e.file)),n=e.root||_s(e.file);!1===this.mapOpts.sourcesContent?(t=new Ls(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,r,this.toUrl(this.path(n)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),Gs&&Vs&&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=Fs.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new Fs({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 Fs({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))),e=i.match(/\n/g),e?(r+=e.length,t=i.lastIndexOf("\n"),n=i.length-t):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(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?_s(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=_s(Us(r,this.mapOpts.annotation)));let n=Bs(r,e);return this.memoizedPaths.set(e,n),n}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 Ws(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(zs){let t=zs(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;"\\"===js&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let Ys=as,Js=class extends Ys{constructor(e){super(e),this.type="comment"}};var Ks=Js;Js.default=Js;let $s,qs,Xs,Hs,{isClean:Qs,my:eo}=Jn,to=us,ro=Ks,no=as;function so(e){return e.map(e=>(e.nodes&&(e.nodes=so(e.nodes)),delete e.source,e))}function oo(e){if(e[Qs]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)oo(t)}let io=class e extends no{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(t,r){if("string"==typeof t)t=so($s(t).nodes);else if(void 0===t)t=[];else if(Array.isArray(t)){t=t.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===t.type&&"document"!==this.type){t=t.nodes.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if(t.type)t=[t];else if(t.prop){if(void 0===t.value)throw new Error("Value field is missed in node creation");"string"!=typeof t.value&&(t.value=String(t.value)),t=[new to(t)]}else if(t.selector)t=[new qs(t)];else if(t.name)t=[new Xs(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new ro(t)]}return t.map(t=>(t[eo]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[Qs]&&oo(t),void 0===t.raws.before&&r&&void 0!==r.raws.before&&(t.raws.before=r.raws.before.replace(/\S/g,"")),t.parent=this.proxyOf,t))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls(n=>{t.props&&!t.props.includes(n.prop)||t.fast&&!n.value.includes(t.fast)||(n.value=n.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,r)=>{let n;try{n=e(t,r)}catch(e){throw t.addToError(e)}return!1!==n&&t.walk&&(n=t.walk(e)),n})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("atrule"===r.type&&e.test(r.name))return t(r,n)}):this.walk((r,n)=>{if("atrule"===r.type&&r.name===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("atrule"===e.type)return t(e,r)}))}walkComments(e){return this.walk((t,r)=>{if("comment"===t.type)return e(t,r)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("decl"===r.type&&e.test(r.prop))return t(r,n)}):this.walk((r,n)=>{if("decl"===r.type&&r.prop===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("decl"===e.type)return t(e,r)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("rule"===r.type&&e.test(r.selector))return t(r,n)}):this.walk((r,n)=>{if("rule"===r.type&&r.selector===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("rule"===e.type)return t(e,r)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};io.registerParse=e=>{$s=e},io.registerRule=e=>{qs=e},io.registerAtRule=e=>{Xs=e},io.registerRoot=e=>{Hs=e};var ao=io;io.default=io,io.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,Xs.prototype):"rule"===e.type?Object.setPrototypeOf(e,qs.prototype):"decl"===e.type?Object.setPrototypeOf(e,to.prototype):"comment"===e.type?Object.setPrototypeOf(e,ro.prototype):"root"===e.type&&Object.setPrototypeOf(e,Hs.prototype),e[eo]=!0,e.nodes&&e.nodes.forEach(e=>{io.rebuild(e)})};let lo,co,uo=ao,ho=class extends uo{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new lo(new co,this,e).stringify()}};ho.registerLazyResult=e=>{lo=e},ho.registerProcessor=e=>{co=e};var po=ho;ho.default=ho;let fo={};var mo=function(e){fo[e]||(fo[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let go=class{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}};var yo=go;go.default=go;let vo=yo,wo=class{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let r=new vo(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};var bo=wo;wo.default=wo;const So="'".charCodeAt(0),Co='"'.charCodeAt(0),Io="\\".charCodeAt(0),xo="/".charCodeAt(0),ko="\n".charCodeAt(0),Oo=" ".charCodeAt(0),Eo="\f".charCodeAt(0),Ro="\t".charCodeAt(0),Ao="\r".charCodeAt(0),Mo="[".charCodeAt(0),Po="]".charCodeAt(0),No="(".charCodeAt(0),To=")".charCodeAt(0),Do="{".charCodeAt(0),Lo="}".charCodeAt(0),Fo=";".charCodeAt(0),_o="*".charCodeAt(0),Bo=":".charCodeAt(0),Uo="@".charCodeAt(0),jo=/[\t\n\f\r "#'()/;[\\\]{}]/g,zo=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Wo=/.[\r\n"'(/\\]/,Vo=/[\da-f]/i;let Go=ao,Zo=class extends Go{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)}};var Yo=Zo;Zo.default=Zo,Go.registerAtRule(Zo);let Jo,Ko,$o=ao,qo=class extends $o{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(e={}){return new Jo(new Ko,this,e).stringify()}};qo.registerLazyResult=e=>{Jo=e},qo.registerProcessor=e=>{Ko=e};var Xo=qo;qo.default=qo,$o.registerRoot(qo);let Ho={comma:e=>Ho.split(e,[","],!0),space:e=>Ho.split(e,[" ","\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}};var Qo=Ho;Ho.default=Ho;let ei=ao,ti=Qo,ri=class extends ei{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return ti.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)}};var ni=ri;ri.default=ri,ei.registerRule(ri);let si=us,oi=function(e,t={}){let r,n,s,o,i,a,l,c,u,h,d=e.css.valueOf(),p=t.ignoreErrors,f=d.length,m=0,g=[],y=[];function v(t){throw e.error("Unclosed "+t,m)}return{back:function(e){y.push(e)},endOfFile:function(){return 0===y.length&&m>=f},nextToken:function(e){if(y.length)return y.pop();if(m>=f)return;let t=!!e&&e.ignoreUnclosed;switch(r=d.charCodeAt(m),r){case ko:case Oo:case Ro:case Ao:case Eo:n=m;do{n+=1,r=d.charCodeAt(n)}while(r===Oo||r===ko||r===Ro||r===Ao||r===Eo);h=["space",d.slice(m,n)],m=n-1;break;case Mo:case Po:case Do:case Lo:case Bo:case Fo:case To:{let e=String.fromCharCode(r);h=[e,e,m];break}case No:if(c=g.length?g.pop()[1]:"",u=d.charCodeAt(m+1),"url"===c&&u!==So&&u!==Co&&u!==Oo&&u!==ko&&u!==Ro&&u!==Eo&&u!==Ao){n=m;do{if(a=!1,n=d.indexOf(")",n+1),-1===n){if(p||t){n=m;break}v("bracket")}for(l=n;d.charCodeAt(l-1)===Io;)l-=1,a=!a}while(a);h=["brackets",d.slice(m,n+1),m,n],m=n}else n=d.indexOf(")",m+1),o=d.slice(m,n+1),-1===n||Wo.test(o)?h=["(","(",m]:(h=["brackets",o,m,n],m=n);break;case So:case Co:s=r===So?"'":'"',n=m;do{if(a=!1,n=d.indexOf(s,n+1),-1===n){if(p||t){n=m+1;break}v("string")}for(l=n;d.charCodeAt(l-1)===Io;)l-=1,a=!a}while(a);h=["string",d.slice(m,n+1),m,n],m=n;break;case Uo:jo.lastIndex=m+1,jo.test(d),n=0===jo.lastIndex?d.length-1:jo.lastIndex-2,h=["at-word",d.slice(m,n+1),m,n],m=n;break;case Io:for(n=m,i=!0;d.charCodeAt(n+1)===Io;)n+=1,i=!i;if(r=d.charCodeAt(n+1),i&&r!==xo&&r!==Oo&&r!==ko&&r!==Ro&&r!==Ao&&r!==Eo&&(n+=1,Vo.test(d.charAt(n)))){for(;Vo.test(d.charAt(n+1));)n+=1;d.charCodeAt(n+1)===Oo&&(n+=1)}h=["word",d.slice(m,n+1),m,n],m=n;break;default:r===xo&&d.charCodeAt(m+1)===_o?(n=d.indexOf("*/",m+2)+1,0===n&&(p||t?n=d.length:v("comment")),h=["comment",d.slice(m,n+1),m,n],m=n):(zo.lastIndex=m+1,zo.test(d),n=0===zo.lastIndex?d.length-1:zo.lastIndex-2,h=["word",d.slice(m,n+1),m,n],g.push(h),m=n)}return m++,h},position:function(){return m}}},ii=Ks,ai=Yo,li=Xo,ci=ni;const ui={empty:!0,space:!0};var hi=class{constructor(e){this.input=e,this.root=new li,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,r,n,s=new ai;s.name=e[1].slice(1),""===s.name&&this.unnamedAtrule(s,e),this.init(s,e[2]);let o=!1,i=!1,a=[],l=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?l.push("("===t?")":"]"):"{"===t&&l.length>0?l.push("}"):t===l[l.length-1]&&l.pop(),0===l.length){if(";"===t){s.source.end=this.getPosition(e[2]),s.source.end.offset++,this.semicolon=!0;break}if("{"===t){i=!0;break}if("}"===t){if(a.length>0){for(n=a.length-1,r=a[n];r&&"space"===r[0];)r=a[--n];r&&(s.source.end=this.getPosition(r[3]||r[2]),s.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}s.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(s.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(s,"params",a),o&&(e=a[a.length-1],s.source.end=this.getPosition(e[3]||e[2]),s.source.end.offset++,this.spaces=s.raws.between,s.raws.between="")):(s.raws.afterName="",s.params=""),i&&(s.nodes=[],this.current=s)}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(t=i,r=t[0],"("===r&&(s+=1),")"===r&&(s-=1),0===s&&":"===r){if(n){if("word"===n[0]&&"progid"===n[1])continue;return o}this.doubleColon(t)}n=t}return!1}comment(e){let t=new ii;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text="",t.raws.left=r,t.raws.right="";else{let e=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=oi(this.input)}decl(e,t){let r=new si;this.init(r,e[0][2]);let n,s=e[e.length-1];for(";"===s[0]&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(s[3]||s[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)),r.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),r.raws.before+=e.shift()[1];for(r.source.start=this.getPosition(e[0][2]),r.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;r.prop+=e.shift()[1]}for(r.raws.between="";e.length;){if(n=e.shift(),":"===n[0]){r.raws.between+=n[1];break}"word"===n[0]&&/\w/.test(n[1])&&this.unknownWord([n]),r.raws.between+=n[1]}"_"!==r.prop[0]&&"*"!==r.prop[0]||(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let o,i=[];for(;e.length&&(o=e[0][0],"space"===o||"comment"===o);)i.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(n=e[t],"!important"===n[1].toLowerCase()){r.important=!0;let n=this.stringFrom(e,t);n=this.spacesFromEnd(e)+n," !important"!==n&&(r.raws.important=n);break}if("important"===n[1].toLowerCase()){let n=e.slice(0),s="";for(let e=t;e>0;e--){let t=n[e][0];if(0===s.trim().indexOf("!")&&"space"!==t)break;s=n.pop()[1]+s}0===s.trim().indexOf("!")&&(r.important=!0,r.raws.important=s,e=n)}if("space"!==n[0]&&"comment"!==n[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(r.raws.between+=i.map(e=>e[1]).join(""),i=[]),this.raw(r,"value",i.concat(e),t),r.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 ci;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,r=null,n=!1,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,i,a,l=r.length,c="",u=!0;for(let e=0;e<l;e+=1)s=r[e],o=s[0],"space"!==o||e!==l-1||n?"comment"===o?(a=r[e-1]?r[e-1][0]:"empty",i=r[e+1]?r[e+1][0]:"empty",ui[a]||ui[i]||","===c.slice(-1)?u=!1:c+=s[1]):c+=s[1]:u=!1;if(!u){let n=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:n,value:c}}e[t]=c}rule(e){e.pop();let t=new ci;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let n=t;n<e.length;n++)r+=e[n][1];return e.splice(t,e.length-t),r}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}};let di=ao,pi=hi,fi=Ds;function mi(e,t){let r=new fi(e,t),n=new pi(r);try{n.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&t&&t.from&&(/\.scss$/i.test(t.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(t.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(t.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return n.root}var gi=mi;mi.default=mi,di.registerParse(mi);let{isClean:yi,my:vi}=Jn,wi=Zs,bi=Qn,Si=ao,Ci=po,Ii=mo,xi=bo,ki=gi,Oi=Xo;const Ei={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Ri={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},Ai={Once:!0,postcssPlugin:!0,prepare:!0};function Mi(e){return"object"==typeof e&&"function"==typeof e.then}function Pi(e){let t=!1,r=Ei[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 Ni(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:Pi(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function Ti(e){return e[yi]=!1,e.nodes&&e.nodes.forEach(e=>Ti(e)),e}let Di={},Li=class e{constructor(t,r,n){let s;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof e||r instanceof xi)s=Ti(r.root),r.map&&(void 0===n.map&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=r.map);else{let e=ki;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{s=e(r,n)}catch(e){this.processed=!0,this.error=e}s&&!s[vi]&&Si.rebuild(s)}else s=Ti(r);this.result=new xi(t,s,n),this.helpers={...Di,postcss:Di,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(!Ri[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Ai[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(Mi(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[yi];){e[yi]=!0;let t=[Ni(e)];for(;t.length>0;){let e=this.visitTick(t);if(Mi(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 Mi(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=bi;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new wi(t,this.result.root,this.result.opts).generate();return this.result.css=r[0],this.result.map=r[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(Mi(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[yi];)e[yi]=!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||Ii("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(Mi(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[yi])return n[yi]=!0,void e.push(Ni(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[yi]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[yi]=!0;let t=Pi(e);for(let r of t)if(0===r)e.nodes&&e.each(e=>{e[yi]||this.walkSync(e)});else{let t=this.listeners[r];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};Li.registerPostcss=e=>{Di=e};var Fi=Li;Li.default=Li,Oi.registerLazyResult(Li),Ci.registerLazyResult(Li);let _i=Zs,Bi=Qn,Ui=mo,ji=gi;const zi=bo;let Wi=class{constructor(e,t,r){let n;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;let s=Bi;this.result=new zi(this._processor,n,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let i=new _i(s,n,this._opts,t);if(i.isMap()){let[e,t]=i.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else i.clearAnnotation(),this.result.css=i.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||Ui("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=ji;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}};var Vi=Wi;Wi.default=Wi;let Gi=Vi,Zi=Fi,Yi=po,Ji=Xo,Ki=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new Zi(this,e,t):new Gi(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var $i=Ki;Ki.default=Ki,Ji.registerProcessor(Ki),Yi.registerProcessor(Ki);let qi=us,Xi=ws,Hi=Ks,Qi=Yo,ea=Ds,ta=Xo,ra=ni;function na(e,t){if(Array.isArray(e))return e.map(e=>na(e));let{inputs:r,...n}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:ea.prototype};r.map&&(r.map={...r.map,__proto__:Xi.prototype}),t.push(r)}}if(n.nodes&&(n.nodes=e.nodes.map(e=>na(e,t))),n.source){let{inputId:e,...r}=n.source;n.source=r,null!=e&&(n.source.input=t[e])}if("root"===n.type)return new ta(n);if("decl"===n.type)return new qi(n);if("rule"===n.type)return new ra(n);if("comment"===n.type)return new Hi(n);if("atrule"===n.type)return new Qi(n);throw new Error("Unknown node type: "+e.type)}var sa=na;na.default=na;let oa=Yn,ia=us,aa=Fi,la=ao,ca=$i,ua=Qn,ha=sa,da=po,pa=yo,fa=Ks,ma=Yo,ga=bo,ya=Ds,va=gi,wa=Qo,ba=ni,Sa=Xo,Ca=as;function Ia(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new ca(e)}Ia.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 ca).version,s}return Object.defineProperty(s,"postcss",{get:()=>(r||(r=s()),r)}),s.process=function(e,t,r){return Ia([s(r)]).process(e,t)},s},Ia.stringify=ua,Ia.parse=va,Ia.fromJSON=ha,Ia.list=wa,Ia.comment=e=>new fa(e),Ia.atRule=e=>new ma(e),Ia.decl=e=>new ia(e),Ia.rule=e=>new ba(e),Ia.root=e=>new Sa(e),Ia.document=e=>new da(e),Ia.CssSyntaxError=oa,Ia.Declaration=ia,Ia.Container=la,Ia.Processor=ca,Ia.Document=da,Ia.Comment=fa,Ia.Warning=pa,Ia.AtRule=ma,Ia.Result=ga,Ia.Input=ya,Ia.Rule=ba,Ia.Root=Sa,Ia.Node=Ca,aa.registerPostcss(Ia);var xa=Ia;Ia.default=Ia;const ka=Fn(xa);ka.stringify,ka.fromJSON,ka.plugin,ka.parse,ka.list,ka.document,ka.comment,ka.atRule,ka.rule,ka.decl,ka.root,ka.CssSyntaxError,ka.Declaration,ka.Container,ka.Processor,ka.Document,ka.Comment,ka.Warning,ka.AtRule,ka.Result,ka.Input,ka.Rule,ka.Root,ka.Node;var Oa=Object.defineProperty,Ea=(e,t,r)=>((e,t,r)=>t in e?Oa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);function Ra(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Aa(e){if(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 Ma={exports:{}},Pa=String,Na=function(){return{isColorSupported:!1,reset:Pa,bold:Pa,dim:Pa,italic:Pa,underline:Pa,inverse:Pa,hidden:Pa,strikethrough:Pa,black:Pa,red:Pa,green:Pa,yellow:Pa,blue:Pa,magenta:Pa,cyan:Pa,white:Pa,gray:Pa,bgBlack:Pa,bgRed:Pa,bgGreen:Pa,bgYellow:Pa,bgBlue:Pa,bgMagenta:Pa,bgCyan:Pa,bgWhite:Pa}};Ma.exports=Na(),Ma.exports.createColors=Na;var Ta=Ma.exports;const Da=Aa(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let La=Ta,Fa=Da,_a=class e extends Error{constructor(t,r,n,s,o,i){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),s&&(this.source=s),i&&(this.plugin=i),void 0!==r&&void 0!==n&&("number"==typeof r?(this.line=r,this.column=n):(this.line=r.line,this.column=r.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}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(e){if(!this.source)return"";let t=this.source;null==e&&(e=La.isColorSupported),Fa&&e&&(t=Fa(t));let r,n,s=t.split(/\r?\n/),o=Math.max(this.line-3,0),i=Math.min(this.line+2,s.length),a=String(i).length;if(e){let{bold:e,gray:t,red:s}=La.createColors(!0);r=t=>e(s(t)),n=e=>t(e)}else r=n=e=>e;return s.slice(o,i).map((e,t)=>{let s=o+1+t,i=" "+(" "+s).slice(-a)+" | ";if(s===this.line){let t=n(i.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return r(">")+n(i)+e+"\n "+t+r("^")}return" "+n(i)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};var Ba=_a;_a.default=_a;var Ua={};Ua.isClean=Symbol("isClean"),Ua.my=Symbol("my");const ja={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let za=class{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(e,t,r){let n;if(r||(r=t),t&&(n=e.raws[t],void 0!==n))return n;let s=e.parent;if("before"===r){if(!s||"root"===s.type&&s.first===e)return"";if(s&&"document"===s.type)return""}if(!s)return ja[r];let o=e.root();if(o.rawCache||(o.rawCache={}),void 0!==o.rawCache[r])return o.rawCache[r];if("before"===r||"after"===r)return this.beforeAfter(e,r);{let s="raw"+((i=r)[0].toUpperCase()+i.slice(1));this[s]?n=this[s](o,e):o.walk(e=>{if(n=e.raws[t],void 0!==n)return!1})}var i;return void 0===n&&(n=ja[r]),o.rawCache[r]=n,n}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)}};var Wa=za;za.default=za;let Va=Wa;function Ga(e,t){new Va(t).stringify(e)}var Za=Ga;Ga.default=Ga;let{isClean:Ya,my:Ja}=Ua,Ka=Ba,$a=Wa,qa=Za;function Xa(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=>Xa(e,r)):("object"===o&&null!==s&&(s=Xa(s)),r[n]=s)}return r}let Ha=class{constructor(e={}){this.raws={},this[Ya]=!1,this[Ja]=!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=Xa(this);for(let r in e)t[r]=e[r];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:r,start:n}=this.rangeBy(t);return this.source.input.error(e,{column:n.column,line:n.line},{column:r.column,line:r.line},t)}return new Ka(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markDirty(){if(this[Ya]){this[Ya]=!1;let e=this;for(;e=e.parent;)e[Ya]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){let n=(t=this.toString()).indexOf(e.word);-1!==n&&(r=this.positionInside(n,t))}return r}positionInside(e,t){let r=t||this.toString(),n=this.source.start.column,s=this.source.start.line;for(let t=0;t<e;t++)"\n"===r[t]?(n=1,s+=1):n+=1;return{column:n,line:s}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let n=this.toString(),s=n.indexOf(e.word);-1!==s&&(t=this.positionInside(s,n),r=this.positionInside(s+e.word.length,n))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return(new $a).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let n of e)n===this?r=!0:r?(this.parent.insertAfter(t,n),t=n):this.parent.insertBefore(t,n);r||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let r={},n=null==t;t=t||new Map;let 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){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=qa){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){let n={node:this};for(let e in r)n[e]=r[e];return e.warn(t,n)}get proxyOf(){return this}};var Qa=Ha;Ha.default=Ha;let el=Qa,tl=class extends el{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}};var rl=tl;tl.default=tl;var nl={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(r=t)=>{let n="",s=r;for(;s--;)n+=e[Math.random()*e.length|0];return n}};let{SourceMapConsumer:sl,SourceMapGenerator:ol}=Da,{existsSync:il,readFileSync:al}=Da,{dirname:ll,join:cl}=Da;let ul=class{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,n=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=ll(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new sl(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t;let r=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+r)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let r=e.lastIndexOf(t.pop()),n=e.indexOf("*/",r);r>-1&&n>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,n)))}loadFile(e){if(this.root=ll(e),il(e))return this.mapFile=e,al(e,"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 sl)return ol.fromSourceMap(t).toString();if(t instanceof ol)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=cl(ll(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)}};var hl=ul;ul.default=ul;let{SourceMapConsumer:dl,SourceMapGenerator:pl}=Da,{fileURLToPath:fl,pathToFileURL:ml}=Da,{isAbsolute:gl,resolve:yl}=Da,{nanoid:vl}=nl,wl=Da,bl=Ba,Sl=hl,Cl=Symbol("fromOffsetCache"),Il=Boolean(dl&&pl),xl=Boolean(yl&&gl),kl=class{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!xl||/^\w+:\/\//.test(t.from)||gl(t.from)?this.file=t.from:this.file=yl(t.from)),xl&&Il){let e=new Sl(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+vl(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let s,o,i;if(t&&"object"==typeof t){let e=t,n=r;if("number"==typeof e.offset){let n=this.fromOffset(e.offset);t=n.line,r=n.col}else t=e.line,r=e.column;if("number"==typeof n.offset){let e=this.fromOffset(n.offset);o=e.line,i=e.col}else o=n.line,i=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let a=this.origin(t,r,o,i);return s=a?new bl(e,void 0===a.endLine?a.line:{column:a.column,line:a.line},void 0===a.endLine?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,n.plugin):new bl(e,void 0===o?t:{column:r,line:t},void 0===o?r:{column:i,line:o},this.css,this.file,n.plugin),s.input={column:r,endColumn:i,endLine:o,line:t,source:this.css},this.file&&(ml&&(s.input.url=ml(this.file).toString()),s.input.file=this.file),s}fromOffset(e){let t,r;if(this[Cl])r=this[Cl];else{let e=this.css.split("\n");r=new Array(e.length);let t=0;for(let n=0,s=e.length;n<s;n++)r[n]=t,t+=e[n].length+1;this[Cl]=r}t=r[r.length-1];let n=0;if(e>=t)n=r.length-1;else{let t,s=r.length-2;for(;n<s;)if(t=n+(s-n>>1),e<r[t])s=t-1;else{if(!(e>=r[t+1])){n=t;break}n=t+1}}return{col:e-r[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:yl(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,n){if(!this.map)return!1;let s,o,i=this.map.consumer(),a=i.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof r&&(s=i.originalPositionFor({column:n,line:r})),o=gl(a.source)?ml(a.source):new URL(a.source,this.map.consumer().sourceRoot||ml(this.map.mapFile));let l={column:a.column,endColumn:s&&s.column,endLine:s&&s.line,line:a.line,url:o.toString()};if("file:"===o.protocol){if(!fl)throw new Error("file: protocol is not available in this PostCSS build");l.file=fl(o)}let c=i.sourceContentFor(a.source);return c&&(l.source=c),l}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}};var Ol=kl;kl.default=kl,wl&&wl.registerInput&&wl.registerInput(kl);let{SourceMapConsumer:El,SourceMapGenerator:Rl}=Da,{dirname:Al,relative:Ml,resolve:Pl,sep:Nl}=Da,{pathToFileURL:Tl}=Da,Dl=Ol,Ll=Boolean(El&&Rl),Fl=Boolean(Al&&Pl&&Ml&&Nl);var _l=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 e of this.previous()){let t,r=this.toUrl(this.path(e.file)),n=e.root||Al(e.file);!1===this.mapOpts.sourcesContent?(t=new El(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,r,this.toUrl(this.path(n)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),Fl&&Ll&&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=Rl.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new Rl({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 Rl({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))),e=i.match(/\n/g),e?(r+=e.length,t=i.lastIndexOf("\n"),n=i.length-t):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(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?Al(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=Al(Pl(r,this.mapOpts.annotation)));let n=Ml(r,e);return this.memoizedPaths.set(e,n),n}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 Dl(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(Tl){let t=Tl(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;"\\"===Nl&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let Bl=Qa,Ul=class extends Bl{constructor(e){super(e),this.type="comment"}};var jl=Ul;Ul.default=Ul;let zl,Wl,Vl,Gl,{isClean:Zl,my:Yl}=Ua,Jl=rl,Kl=jl,$l=Qa;function ql(e){return e.map(e=>(e.nodes&&(e.nodes=ql(e.nodes)),delete e.source,e))}function Xl(e){if(e[Zl]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Xl(t)}let Hl=class e extends $l{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,r,n=this.getIterator();for(;this.indexes[n]<this.proxyOf.nodes.length&&(t=this.indexes[n],r=e(this.proxyOf.nodes[t],t),!1!==r);)this.indexes[n]+=1;return delete this.indexes[n],r}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...r)=>e[t](...r.map(e=>"function"==typeof e?(t,r)=>e(t.toProxy(),r):e)):"every"===t||"some"===t?r=>e[t]((e,...t)=>r(e.toProxy(),...t)):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map(e=>e.toProxy()):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let r,n=this.index(e),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(t,r){if("string"==typeof t)t=ql(zl(t).nodes);else if(void 0===t)t=[];else if(Array.isArray(t)){t=t.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===t.type&&"document"!==this.type){t=t.nodes.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if(t.type)t=[t];else if(t.prop){if(void 0===t.value)throw new Error("Value field is missed in node creation");"string"!=typeof t.value&&(t.value=String(t.value)),t=[new Jl(t)]}else if(t.selector)t=[new Wl(t)];else if(t.name)t=[new Vl(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new Kl(t)]}return t.map(t=>(t[Yl]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[Zl]&&Xl(t),void 0===t.raws.before&&r&&void 0!==r.raws.before&&(t.raws.before=r.raws.before.replace(/\S/g,"")),t.parent=this.proxyOf,t))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls(n=>{t.props&&!t.props.includes(n.prop)||t.fast&&!n.value.includes(t.fast)||(n.value=n.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,r)=>{let n;try{n=e(t,r)}catch(e){throw t.addToError(e)}return!1!==n&&t.walk&&(n=t.walk(e)),n})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("atrule"===r.type&&e.test(r.name))return t(r,n)}):this.walk((r,n)=>{if("atrule"===r.type&&r.name===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("atrule"===e.type)return t(e,r)}))}walkComments(e){return this.walk((t,r)=>{if("comment"===t.type)return e(t,r)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("decl"===r.type&&e.test(r.prop))return t(r,n)}):this.walk((r,n)=>{if("decl"===r.type&&r.prop===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("decl"===e.type)return t(e,r)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("rule"===r.type&&e.test(r.selector))return t(r,n)}):this.walk((r,n)=>{if("rule"===r.type&&r.selector===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("rule"===e.type)return t(e,r)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};Hl.registerParse=e=>{zl=e},Hl.registerRule=e=>{Wl=e},Hl.registerAtRule=e=>{Vl=e},Hl.registerRoot=e=>{Gl=e};var Ql=Hl;Hl.default=Hl,Hl.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,Vl.prototype):"rule"===e.type?Object.setPrototypeOf(e,Wl.prototype):"decl"===e.type?Object.setPrototypeOf(e,Jl.prototype):"comment"===e.type?Object.setPrototypeOf(e,Kl.prototype):"root"===e.type&&Object.setPrototypeOf(e,Gl.prototype),e[Yl]=!0,e.nodes&&e.nodes.forEach(e=>{Hl.rebuild(e)})};let ec,tc,rc=Ql,nc=class extends rc{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new ec(new tc,this,e).stringify()}};nc.registerLazyResult=e=>{ec=e},nc.registerProcessor=e=>{tc=e};var sc=nc;nc.default=nc;let oc={};var ic=function(e){oc[e]||(oc[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let ac=class{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}};var lc=ac;ac.default=ac;let cc=lc,uc=class{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let r=new cc(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};var hc=uc;uc.default=uc;const dc="'".charCodeAt(0),pc='"'.charCodeAt(0),fc="\\".charCodeAt(0),mc="/".charCodeAt(0),gc="\n".charCodeAt(0),yc=" ".charCodeAt(0),vc="\f".charCodeAt(0),wc="\t".charCodeAt(0),bc="\r".charCodeAt(0),Sc="[".charCodeAt(0),Cc="]".charCodeAt(0),Ic="(".charCodeAt(0),xc=")".charCodeAt(0),kc="{".charCodeAt(0),Oc="}".charCodeAt(0),Ec=";".charCodeAt(0),Rc="*".charCodeAt(0),Ac=":".charCodeAt(0),Mc="@".charCodeAt(0),Pc=/[\t\n\f\r "#'()/;[\\\]{}]/g,Nc=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Tc=/.[\r\n"'(/\\]/,Dc=/[\da-f]/i;let Lc=Ql,Fc=class extends Lc{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)}};var _c=Fc;Fc.default=Fc,Lc.registerAtRule(Fc);let Bc,Uc,jc=Ql,zc=class extends jc{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(e={}){return new Bc(new Uc,this,e).stringify()}};zc.registerLazyResult=e=>{Bc=e},zc.registerProcessor=e=>{Uc=e};var Wc=zc;zc.default=zc,jc.registerRoot(zc);let Vc={comma:e=>Vc.split(e,[","],!0),space:e=>Vc.split(e,[" ","\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}};var Gc=Vc;Vc.default=Vc;let Zc=Ql,Yc=Gc,Jc=class extends Zc{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Yc.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)}};var Kc=Jc;Jc.default=Jc,Zc.registerRule(Jc);let $c=rl,qc=function(e,t={}){let r,n,s,o,i,a,l,c,u,h,d=e.css.valueOf(),p=t.ignoreErrors,f=d.length,m=0,g=[],y=[];function v(t){throw e.error("Unclosed "+t,m)}return{back:function(e){y.push(e)},endOfFile:function(){return 0===y.length&&m>=f},nextToken:function(e){if(y.length)return y.pop();if(m>=f)return;let t=!!e&&e.ignoreUnclosed;switch(r=d.charCodeAt(m),r){case gc:case yc:case wc:case bc:case vc:n=m;do{n+=1,r=d.charCodeAt(n)}while(r===yc||r===gc||r===wc||r===bc||r===vc);h=["space",d.slice(m,n)],m=n-1;break;case Sc:case Cc:case kc:case Oc:case Ac:case Ec:case xc:{let e=String.fromCharCode(r);h=[e,e,m];break}case Ic:if(c=g.length?g.pop()[1]:"",u=d.charCodeAt(m+1),"url"===c&&u!==dc&&u!==pc&&u!==yc&&u!==gc&&u!==wc&&u!==vc&&u!==bc){n=m;do{if(a=!1,n=d.indexOf(")",n+1),-1===n){if(p||t){n=m;break}v("bracket")}for(l=n;d.charCodeAt(l-1)===fc;)l-=1,a=!a}while(a);h=["brackets",d.slice(m,n+1),m,n],m=n}else n=d.indexOf(")",m+1),o=d.slice(m,n+1),-1===n||Tc.test(o)?h=["(","(",m]:(h=["brackets",o,m,n],m=n);break;case dc:case pc:s=r===dc?"'":'"',n=m;do{if(a=!1,n=d.indexOf(s,n+1),-1===n){if(p||t){n=m+1;break}v("string")}for(l=n;d.charCodeAt(l-1)===fc;)l-=1,a=!a}while(a);h=["string",d.slice(m,n+1),m,n],m=n;break;case Mc:Pc.lastIndex=m+1,Pc.test(d),n=0===Pc.lastIndex?d.length-1:Pc.lastIndex-2,h=["at-word",d.slice(m,n+1),m,n],m=n;break;case fc:for(n=m,i=!0;d.charCodeAt(n+1)===fc;)n+=1,i=!i;if(r=d.charCodeAt(n+1),i&&r!==mc&&r!==yc&&r!==gc&&r!==wc&&r!==bc&&r!==vc&&(n+=1,Dc.test(d.charAt(n)))){for(;Dc.test(d.charAt(n+1));)n+=1;d.charCodeAt(n+1)===yc&&(n+=1)}h=["word",d.slice(m,n+1),m,n],m=n;break;default:r===mc&&d.charCodeAt(m+1)===Rc?(n=d.indexOf("*/",m+2)+1,0===n&&(p||t?n=d.length:v("comment")),h=["comment",d.slice(m,n+1),m,n],m=n):(Nc.lastIndex=m+1,Nc.test(d),n=0===Nc.lastIndex?d.length-1:Nc.lastIndex-2,h=["word",d.slice(m,n+1),m,n],g.push(h),m=n)}return m++,h},position:function(){return m}}},Xc=jl,Hc=_c,Qc=Wc,eu=Kc;const tu={empty:!0,space:!0};var ru=class{constructor(e){this.input=e,this.root=new Qc,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,r,n,s=new Hc;s.name=e[1].slice(1),""===s.name&&this.unnamedAtrule(s,e),this.init(s,e[2]);let o=!1,i=!1,a=[],l=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?l.push("("===t?")":"]"):"{"===t&&l.length>0?l.push("}"):t===l[l.length-1]&&l.pop(),0===l.length){if(";"===t){s.source.end=this.getPosition(e[2]),s.source.end.offset++,this.semicolon=!0;break}if("{"===t){i=!0;break}if("}"===t){if(a.length>0){for(n=a.length-1,r=a[n];r&&"space"===r[0];)r=a[--n];r&&(s.source.end=this.getPosition(r[3]||r[2]),s.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}s.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(s.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(s,"params",a),o&&(e=a[a.length-1],s.source.end=this.getPosition(e[3]||e[2]),s.source.end.offset++,this.spaces=s.raws.between,s.raws.between="")):(s.raws.afterName="",s.params=""),i&&(s.nodes=[],this.current=s)}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(t=i,r=t[0],"("===r&&(s+=1),")"===r&&(s-=1),0===s&&":"===r){if(n){if("word"===n[0]&&"progid"===n[1])continue;return o}this.doubleColon(t)}n=t}return!1}comment(e){let t=new Xc;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text="",t.raws.left=r,t.raws.right="";else{let e=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=qc(this.input)}decl(e,t){let r=new $c;this.init(r,e[0][2]);let n,s=e[e.length-1];for(";"===s[0]&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(s[3]||s[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)),r.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),r.raws.before+=e.shift()[1];for(r.source.start=this.getPosition(e[0][2]),r.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;r.prop+=e.shift()[1]}for(r.raws.between="";e.length;){if(n=e.shift(),":"===n[0]){r.raws.between+=n[1];break}"word"===n[0]&&/\w/.test(n[1])&&this.unknownWord([n]),r.raws.between+=n[1]}"_"!==r.prop[0]&&"*"!==r.prop[0]||(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let o,i=[];for(;e.length&&(o=e[0][0],"space"===o||"comment"===o);)i.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(n=e[t],"!important"===n[1].toLowerCase()){r.important=!0;let n=this.stringFrom(e,t);n=this.spacesFromEnd(e)+n," !important"!==n&&(r.raws.important=n);break}if("important"===n[1].toLowerCase()){let n=e.slice(0),s="";for(let e=t;e>0;e--){let t=n[e][0];if(0===s.trim().indexOf("!")&&"space"!==t)break;s=n.pop()[1]+s}0===s.trim().indexOf("!")&&(r.important=!0,r.raws.important=s,e=n)}if("space"!==n[0]&&"comment"!==n[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(r.raws.between+=i.map(e=>e[1]).join(""),i=[]),this.raw(r,"value",i.concat(e),t),r.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 eu;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,r=null,n=!1,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,i,a,l=r.length,c="",u=!0;for(let e=0;e<l;e+=1)s=r[e],o=s[0],"space"!==o||e!==l-1||n?"comment"===o?(a=r[e-1]?r[e-1][0]:"empty",i=r[e+1]?r[e+1][0]:"empty",tu[a]||tu[i]||","===c.slice(-1)?u=!1:c+=s[1]):c+=s[1]:u=!1;if(!u){let n=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:n,value:c}}e[t]=c}rule(e){e.pop();let t=new eu;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let n=t;n<e.length;n++)r+=e[n][1];return e.splice(t,e.length-t),r}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}};let nu=Ql,su=ru,ou=Ol;function iu(e,t){let r=new ou(e,t),n=new su(r);try{n.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&t&&t.from&&(/\.scss$/i.test(t.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(t.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(t.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return n.root}var au=iu;iu.default=iu,nu.registerParse(iu);let{isClean:lu,my:cu}=Ua,uu=_l,hu=Za,du=Ql,pu=sc,fu=ic,mu=hc,gu=au,yu=Wc;const vu={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},wu={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},bu={Once:!0,postcssPlugin:!0,prepare:!0};function Su(e){return"object"==typeof e&&"function"==typeof e.then}function Cu(e){let t=!1,r=vu[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 Iu(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:Cu(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function xu(e){return e[lu]=!1,e.nodes&&e.nodes.forEach(e=>xu(e)),e}let ku={},Ou=class e{constructor(t,r,n){let s;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof e||r instanceof mu)s=xu(r.root),r.map&&(void 0===n.map&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=r.map);else{let e=gu;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{s=e(r,n)}catch(e){this.processed=!0,this.error=e}s&&!s[cu]&&du.rebuild(s)}else s=xu(r);this.result=new mu(t,s,n),this.helpers={...ku,postcss:ku,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(!wu[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!bu[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(Su(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[lu];){e[lu]=!0;let t=[Iu(e)];for(;t.length>0;){let e=this.visitTick(t);if(Su(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 Su(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=hu;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new uu(t,this.result.root,this.result.opts).generate();return this.result.css=r[0],this.result.map=r[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(Su(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[lu];)e[lu]=!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||fu("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(Su(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[lu])return n[lu]=!0,void e.push(Iu(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[lu]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[lu]=!0;let t=Cu(e);for(let r of t)if(0===r)e.nodes&&e.each(e=>{e[lu]||this.walkSync(e)});else{let t=this.listeners[r];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};Ou.registerPostcss=e=>{ku=e};var Eu=Ou;Ou.default=Ou,yu.registerLazyResult(Ou),pu.registerLazyResult(Ou);let Ru=_l,Au=Za,Mu=ic,Pu=au;const Nu=hc;let Tu=class{constructor(e,t,r){let n;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;let s=Au;this.result=new Nu(this._processor,n,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let i=new Ru(s,n,this._opts,t);if(i.isMap()){let[e,t]=i.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else i.clearAnnotation(),this.result.css=i.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||Mu("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=Pu;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}};var Du=Tu;Tu.default=Tu;let Lu=Du,Fu=Eu,_u=sc,Bu=Wc,Uu=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new Fu(this,e,t):new Lu(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var ju=Uu;Uu.default=Uu,Bu.registerProcessor(Uu),_u.registerProcessor(Uu);let zu=rl,Wu=hl,Vu=jl,Gu=_c,Zu=Ol,Yu=Wc,Ju=Kc;function Ku(e,t){if(Array.isArray(e))return e.map(e=>Ku(e));let{inputs:r,...n}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:Zu.prototype};r.map&&(r.map={...r.map,__proto__:Wu.prototype}),t.push(r)}}if(n.nodes&&(n.nodes=e.nodes.map(e=>Ku(e,t))),n.source){let{inputId:e,...r}=n.source;n.source=r,null!=e&&(n.source.input=t[e])}if("root"===n.type)return new Yu(n);if("decl"===n.type)return new zu(n);if("rule"===n.type)return new Ju(n);if("comment"===n.type)return new Vu(n);if("atrule"===n.type)return new Gu(n);throw new Error("Unknown node type: "+e.type)}var $u=Ku;Ku.default=Ku;let qu=Ba,Xu=rl,Hu=Eu,Qu=Ql,eh=ju,th=Za,rh=$u,nh=sc,sh=lc,oh=jl,ih=_c,ah=hc,lh=Ol,ch=au,uh=Gc,hh=Kc,dh=Wc,ph=Qa;function fh(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new eh(e)}fh.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 eh).version,s}return Object.defineProperty(s,"postcss",{get:()=>(r||(r=s()),r)}),s.process=function(e,t,r){return fh([s(r)]).process(e,t)},s},fh.stringify=th,fh.parse=ch,fh.fromJSON=rh,fh.list=uh,fh.comment=e=>new oh(e),fh.atRule=e=>new ih(e),fh.decl=e=>new Xu(e),fh.rule=e=>new hh(e),fh.root=e=>new dh(e),fh.document=e=>new nh(e),fh.CssSyntaxError=qu,fh.Declaration=Xu,fh.Container=Qu,fh.Processor=eh,fh.Document=nh,fh.Comment=oh,fh.Warning=sh,fh.AtRule=ih,fh.Result=ah,fh.Input=lh,fh.Rule=hh,fh.Root=dh,fh.Node=ph,Hu.registerPostcss(fh);var mh=fh;fh.default=fh;const gh=Ra(mh);gh.stringify,gh.fromJSON,gh.plugin,gh.parse,gh.list,gh.document,gh.comment,gh.atRule,gh.rule,gh.decl,gh.root,gh.CssSyntaxError,gh.Declaration,gh.Container,gh.Processor,gh.Document,gh.Comment,gh.Warning,gh.AtRule,gh.Result,gh.Input,gh.Rule,gh.Root,gh.Node;class yh{constructor(...e){Ea(this,"parentElement",null),Ea(this,"parentNode",null),Ea(this,"ownerDocument"),Ea(this,"firstChild",null),Ea(this,"lastChild",null),Ea(this,"previousSibling",null),Ea(this,"nextSibling",null),Ea(this,"ELEMENT_NODE",1),Ea(this,"TEXT_NODE",3),Ea(this,"nodeType"),Ea(this,"nodeName"),Ea(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 yh))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 vh={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},wh={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},bh={};function Sh(e){if(bh[e])return bh[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 vh?vh[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 wh?wh[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 bh[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?bh[e]=o:r}catch{return r}}const Ch={};function Ih(e,t,r){var n;const s=`${e}.${String(r)}`;if(Ch[s])return Ch[s].call(t);const o=Sh(e),i=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return i?(Ch[s]=i,i.call(t)):t[r]}const xh={};function kh(e,t,r){const n=`${e}.${String(r)}`;if(xh[n])return xh[n].bind(t);const s=Sh(e)[r];return"function"!=typeof s?t[r]:(xh[n]=s,s.bind(t))}const Oh={childNodes:function(e){return Ih("Node",e,"childNodes")},parentNode:function(e){return Ih("Node",e,"parentNode")},parentElement:function(e){return Ih("Node",e,"parentElement")},textContent:function(e){return Ih("Node",e,"textContent")},contains:function(e,t){return kh("Node",e,"contains")(t)},getRootNode:function(e){return kh("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Ih("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Ih("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Ih("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Ih("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return Sh("MutationObserver").constructor}};const Eh="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 Rh={map:{},getId:()=>(console.error(Eh),-1),getNode:()=>(console.error(Eh),null),removeNodeFromMap(){console.error(Eh)},has:()=>(console.error(Eh),!1),reset(){console.error(Eh)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Rh=new Proxy(Rh,{get:(e,t,r)=>("map"===t&&console.error(Eh),Reflect.get(e,t,r))}));let Ah=Date.now;function Mh(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:Oh.parentElement(e)}/[1-9][0-9]{12}/.test(Date.now().toString())||(Ah=()=>(new Date).getTime());function Ph(e){var t;let r=null;return"getRootNode"in e&&(null==(t=Oh.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&Oh.host(Oh.getRootNode(e))&&(r=Oh.host(Oh.getRootNode(e))),r}function Nh(e){let t,r=e;for(;t=Ph(r);)r=t;return r}function Th(e){const t=e.ownerDocument;if(!t)return!1;const r=Nh(e);return Oh.contains(t,r)}const Dh=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){Cn(this,"id",1),Cn(this,"styleIDMap",new WeakMap),Cn(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 Rh},closestElementOfNode:Mh,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:Nh,getShadowHost:Ph,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=Oh.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=Oh.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 yh&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(Oh.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&&(Oh.contains(t,e)||Th(e))},isAncestorRemoved:function e(t,r){if(function(e){const t=e&&"host"in e&&"mode"in e&&Tn.host(e)||null;return Boolean(t&&"shadowRoot"in t&&Tn.shadowRoot(t)===e)}(t))return!1;const n=r.getId(t);if(!r.has(n))return!0;const s=Oh.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=Mh(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(Ln(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 Ah},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:Th,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 Lh="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Fh="undefined"==typeof Uint8Array?[]:new Uint8Array(256),_h=0;_h<64;_h++)Fh[Lh.charCodeAt(_h)]=_h;var Bh,Uh,jh;"undefined"!=typeof window&&window.Blob&&new Blob([(Bh="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Uint8Array.from(atob(Bh),e=>e.charCodeAt(0)))],{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==(dn=e.contentWindow)?void 0:dn.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}new Dn,(jh=Uh||(Uh={}))[jh.NotStarted=0]="NotStarted",jh[jh.Running=1]="Running",jh[jh.Stopped=2]="Stopped";class zh{constructor(e){bn(this,"fileName"),bn(this,"functionName"),bn(this,"lineNumber"),bn(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 Wh=/(^|@)\S+:\d+/,Vh=/^\s*at .*(\S+:\d+|\(native\))/m,Gh=/^(eval@)?(\[native code])?$/,Zh={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(Vh)?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(Vh)},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 zh({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(Gh)},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 zh({functionName:e});{const t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),n=r&&r[1]?r[1]:void 0,s=this.extractLocation(e.replace(t,""));return new zh({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 zh({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 zh({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(Wh)&&!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 zh({functionName:n,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})},this)}};function Yh(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 Jh(e){return"[object Object]"===Object.prototype.toString.call(e)}function Kh(e,t){if(0===t)return!0;const r=Object.keys(e);for(const n of r)if(Jh(e[n])&&Kh(e[n],t-1))return!0;return!1}function $h(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(Jh(e)&&Object.keys(e).length>r.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(Jh(e)&&Kh(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]=Yh(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 qh={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 Xh(e,t,r){const n=r?Object.assign({},qh,r):qh,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=Zh.parse(s).map(e=>e.toString()),i=[$h(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=[$h(`Uncaught (in promise) ${r.name}: ${r.message}`,n.stringifyOptions)]):(r=new Error,s=[$h("Uncaught (in promise)",n.stringifyOptions),$h(t.reason,n.stringifyOptions)]);const o=Zh.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]?Dh.patch(t,r,t=>(...s)=>{if(t.apply(this,s),!("assert"===r&&s[0]||a)){a=!0;try{const t=Zh.parse(new Error).map(e=>e.toString()).splice(1),o=("assert"===r?s.slice(1):s).map(e=>$h(e,n.stringifyOptions));i++,i<n.lengthThreshold?e({level:r,trace:t,payload:o}):i===n.lengthThreshold&&e({level:"warn",trace:[],payload:[$h("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...s)}finally{a=!1}}}):()=>{}}}const Hh="rrweb/console@1";var Qh,ed=Object.freeze({__proto__:null,PLUGIN_NAME:Hh,getRecordConsolePlugin:e=>({name:Hh,observer:Xh,options:e})}),td=Object.defineProperty,rd=(e,t,r)=>((e,t,r)=>t in e?td(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),nd=Object.defineProperty,sd=(e,t,r)=>((e,t,r)=>t in e?nd(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),od=(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))(od||{});const id={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},ad={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},ld={};function cd(e){if(ld[e])return ld[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 id?id[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 ad?ad[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 ld[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?ld[e]=o:r}catch{return r}}const ud={};function hd(e,t,r){var n;const s=`${e}.${String(r)}`;if(ud[s])return ud[s].call(t);const o=cd(e),i=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return i?(ud[s]=i,i.call(t)):t[r]}const dd={};function pd(e,t,r){const n=`${e}.${String(r)}`;if(dd[n])return dd[n].bind(t);const s=cd(e)[r];return"function"!=typeof s?t[r]:(dd[n]=s,s.bind(t))}const fd={childNodes:function(e){return hd("Node",e,"childNodes")},parentNode:function(e){return hd("Node",e,"parentNode")},parentElement:function(e){return hd("Node",e,"parentElement")},textContent:function(e){return hd("Node",e,"textContent")},contains:function(e,t){return pd("Node",e,"contains")(t)},getRootNode:function(e){return pd("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?hd("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?hd("Element",e,"shadowRoot"):null},querySelector:function(e,t){return hd("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return hd("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return cd("MutationObserver").constructor}};function md(e){return e.nodeType===e.ELEMENT_NODE}function gd(e){const t=e&&"host"in e&&"mode"in e&&fd.host(e)||null;return Boolean(t&&"shadowRoot"in t&&fd.shadowRoot(t)===e)}function yd(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function vd(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=>wd(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 wd(e,t){if(function(e){return"styleSheet"in e}(e)){let t;try{t=vd(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?Md(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?Md(r,t):r}}class bd{constructor(){sd(this,"idNodeMap",new Map),sd(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 Sd({element:e,maskInputOptions:t,tagName:r,type:n,value:s,maskInputFn:o}){let i=s||"";const a=n&&Cd(n);return(t[r.toLowerCase()]||a&&t[a])&&(i=o?o(i,e):"*".repeat(i.length)),i}function Cd(e){return e.toLowerCase()}const Id="__rrweb_original__";function xd(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Cd(t):null}function kd(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 Od=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Ed=/^(?:[a-z+]+:)?\/\//i,Rd=/^www\..*/i,Ad=/^(data:)([^,]*),(.*)/i;function Md(e,t){return(e||"").replace(Od,(e,r,n,s,o,i)=>{const a=n||o||i,l=r||s||"";if(!a)return e;if(Ed.test(a)||Rd.test(a))return`url(${l}${a}${l})`;if(Ad.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 Pd(e,t=!1){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function Nd(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=Pd(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=Pd(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=Pd(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=Pd(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 Td="lightgrey";let Dd=1;const Ld=new RegExp("[^a-z0-9-_:]");function Fd(){return Dd++}let _d,Bd;const Ud=/^[^ \t\n\r\u000c]+/,jd=/^[, \t\n\r\u000c]+/;const zd=new WeakMap;function Wd(e,t){return t&&""!==t.trim()?Gd(e,t):t}function Vd(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function Gd(e,t){let r=zd.get(e);if(r||(r=e.createElement("a"),zd.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function Zd(e,t,r,n){return n?"src"===r||"href"===r&&("use"!==t||"#"!==n[0])||"xlink:href"===r&&"#"!==n[0]?Wd(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(jd),!(r>=t.length);){let o=n(Ud);if(","===o.slice(-1))o=Wd(e,o.substring(0,o.length-1)),s.push(o);else{let n="";o=Wd(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?Md(n,Gd(e)):"object"===t&&"data"===r?Wd(e,n):n:Wd(e,n):n}function Yd(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function Jd(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&Jd(fd.parentNode(e),t,r);for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!!r&&Jd(fd.parentNode(e),t,r)}function Kd(e,t,r,n){let s;if(md(e)){if(s=e,!fd.childNodes(s).length)return!1}else{if(null===fd.parentElement(e))return!1;s=fd.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(Jd(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 $d(e,t){const{doc:r,mirror:n,blockClass:s,blockSelector:o,needsMask:i,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:c,maskInputFn:u,dataURLOptions:h={},inlineImages:d,recordCanvas:p,keepIframeSrcFn:f,newlyAddedElement:m=!1,cssCaptured:g=!1,applyBackgroundColorToBlockedElements:y=!1}=t,v=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:od.Document,childNodes:[],compatMode:e.compatMode}:{type:od.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:od.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:v};case e.ELEMENT_NODE:return function(e,t){const{doc:r,blockClass:n,blockSelector:s,inlineStylesheet:o,maskInputOptions:i={},maskInputFn:a,dataURLOptions:l={},inlineImages:c,recordCanvas:u,keepIframeSrcFn:h,newlyAddedElement:d=!1,rootId:p,applyBackgroundColorToBlockedElements:f=!1}=t,m=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),g=function(e){if(e instanceof HTMLFormElement)return"form";const t=Cd(e.tagName);return Ld.test(t)?"div":t}(e);let y={};const v=e.attributes.length;for(let t=0;t<v;t++){const n=e.attributes[t];Yd(g,n.name,n.value)||(y[n.name]=Zd(r,g,Cd(n.name),n.value))}if("link"===g&&o){const t=Array.from(r.styleSheets).find(t=>t.href===e.href);let n=null;t&&(n=vd(t)),n&&(delete y.rel,delete y.href,y._cssText=n)}if("style"===g&&e.sheet){let t=vd(e.sheet);t&&(e.childNodes.length>1&&(t=Nd(t,e)),y._cssText=t)}if("input"===g||"textarea"===g||"select"===g){const t=e.value,r=e.checked;"radio"!==y.type&&"checkbox"!==y.type&&"submit"!==y.type&&"button"!==y.type&&t?y.value=Sd({element:e,type:xd(e),tagName:g,value:t,maskInputOptions:i,maskInputFn:a}):r&&(y.checked=r)}"option"===g&&(e.selected&&!i.select?y.selected=!0:delete y.selected);"dialog"===g&&e.open&&(y.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal");if("canvas"===g&&u)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=Id in s?s[Id]: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(l.type,l.quality));else if(!("__context"in e)){const t=e.toDataURL(l.type,l.quality),n=r.createElement("canvas");n.width=e.width,n.height=e.height;t!==n.toDataURL(l.type,l.quality)&&(y.rr_dataURL=t)}if("img"===g&&c){_d||(_d=r.createElement("canvas"),Bd=_d.getContext("2d"));const t=e,n=t.currentSrc||t.getAttribute("src")||"<unknown-src>",s=t.crossOrigin,o=()=>{t.removeEventListener("load",o);try{_d.width=t.naturalWidth,_d.height=t.naturalHeight,Bd.drawImage(t,0,0),y.rr_dataURL=_d.toDataURL(l.type,l.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"===g||"video"===g){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}d||(e.scrollLeft&&(y.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(y.rr_scrollTop=e.scrollTop));if(m){const{width:t,height:r}=e.getBoundingClientRect();y={class:y.class,rr_width:`${t}px`,rr_height:`${r}px`,...f?{rr_background_color:Td}:{}}}"iframe"!==g||h(y.src)||(e.contentDocument||(y.rr_src=y.src),delete y.src);let w;try{customElements.get(g)&&(w=!0)}catch(e){}return{type:od.Element,tagName:g,attributes:y,childNodes:[],isSVG:Vd(e)||void 0,needBlock:m,rootId:p,isCustom:w}}(e,{doc:r,blockClass:s,blockSelector:o,inlineStylesheet:a,maskInputOptions:l,maskInputFn:u,dataURLOptions:h,inlineImages:d,recordCanvas:p,keepIframeSrcFn:f,newlyAddedElement:m,rootId:v,applyBackgroundColorToBlockedElements:y});case e.TEXT_NODE:return function(e,t){const{needsMask:r,maskTextFn:n,rootId:s,cssCaptured:o}=t,i=fd.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=fd.textContent(e),c&&l&&(l=Md(l,Gd(t.doc))));!c&&!u&&l&&r&&(l=n?n(l,fd.parentElement(e)):l.replace(/[\S]/g,"*"));return{type:od.Text,textContent:l||"",rootId:s}}(e,{doc:r,needsMask:i,maskTextFn:c,rootId:v,cssCaptured:g});case e.CDATA_SECTION_NODE:return{type:od.CDATA,textContent:"",rootId:v};case e.COMMENT_NODE:return{type:od.Comment,textContent:fd.textContent(e)||"",rootId:v};default:return!1}}function qd(e){return null==e?"":e.toLowerCase()}function Xd(e,t){const{doc:r,mirror:n,blockClass:s,blockSelector:o,maskTextClass:i,maskTextSelector:a,skipChild:l=!1,inlineStylesheet:c=!0,maskInputOptions:u={},maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:f={},inlineImages:m=!1,recordCanvas:g=!1,onSerialize:y,onIframeLoad:v,iframeLoadTimeout:w=5e3,onStylesheetLoad:b,stylesheetLoadTimeout:S=5e3,keepIframeSrcFn:C=()=>!1,newlyAddedElement:I=!1,cssCaptured:x=!1,applyBackgroundColorToBlockedElements:k=!1}=t;let{needsMask:O}=t,{preserveWhiteSpace:E=!0}=t;if(!O){O=Kd(e,i,a,void 0===O)}const R=$d(e,{doc:r,mirror:n,blockClass:s,blockSelector:o,needsMask:O,inlineStylesheet:c,maskInputOptions:u,maskTextFn:h,maskInputFn:d,dataURLOptions:f,inlineImages:m,recordCanvas:g,keepIframeSrcFn:C,newlyAddedElement:I,cssCaptured:x,applyBackgroundColorToBlockedElements:k});if(!R)return console.warn(e,"not serialized"),null;let A;A=n.hasNode(e)?n.getId(e):function(e,t){if(t.comment&&e.type===od.Comment)return!0;if(e.type===od.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"===kd(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(qd(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===qd(e.attributes.name)||"icon"===qd(e.attributes.rel)||"apple-touch-icon"===qd(e.attributes.rel)||"shortcut icon"===qd(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&qd(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(qd(e.attributes.property).match(/^(og|twitter|fb):/)||qd(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===qd(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===qd(e.attributes.name)||"googlebot"===qd(e.attributes.name)||"bingbot"===qd(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===qd(e.attributes.name)||"generator"===qd(e.attributes.name)||"framework"===qd(e.attributes.name)||"publisher"===qd(e.attributes.name)||"progid"===qd(e.attributes.name)||qd(e.attributes.property).match(/^article:/)||qd(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===qd(e.attributes.name)||"yandex-verification"===qd(e.attributes.name)||"csrf-token"===qd(e.attributes.name)||"p:domain_verify"===qd(e.attributes.name)||"verify-v1"===qd(e.attributes.name)||"verification"===qd(e.attributes.name)||"shopify-checkout-api-token"===qd(e.attributes.name)))return!0}}return!1}(R,p)||!E&&R.type===od.Text&&!R.textContent.replace(/^\s+|\s+$/gm,"").length?-2:Fd();const M=Object.assign(R,{id:A});if(n.add(e,M),-2===A)return null;y&&y(e);let P=!l;if(M.type===od.Element){P=P&&!M.needBlock,delete M.needBlock;const t=fd.shadowRoot(e);t&&yd(t)&&(M.isShadowHost=!0)}if((M.type===od.Document||M.type===od.Element)&&P){p.headWhitespace&&M.type===od.Element&&"head"===M.tagName&&(E=!1);const t={doc:r,mirror:n,blockClass:s,blockSelector:o,needsMask:O,maskTextClass:i,maskTextSelector:a,skipChild:l,inlineStylesheet:c,maskInputOptions:u,maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:f,inlineImages:m,recordCanvas:g,preserveWhiteSpace:E,onSerialize:y,onIframeLoad:v,iframeLoadTimeout:w,onStylesheetLoad:b,stylesheetLoadTimeout:S,keepIframeSrcFn:C,cssCaptured:!1,applyBackgroundColorToBlockedElements:k};if(M.type===od.Element&&"textarea"===M.tagName&&void 0!==M.attributes.value);else{M.type===od.Element&&void 0!==M.attributes._cssText&&"string"==typeof M.attributes._cssText&&(t.cssCaptured=!0);for(const r of Array.from(fd.childNodes(e))){const e=Xd(r,t);e&&M.childNodes.push(e)}}let I=null;if(md(e)&&(I=fd.shadowRoot(e)))for(const e of Array.from(fd.childNodes(I))){const r=Xd(e,t);r&&(yd(I)&&(r.isShadow=!0),M.childNodes.push(r))}}const N=fd.parentNode(e);return N&&gd(N)&&yd(N)&&(M.isShadow=!0),M.type===od.Element&&"iframe"===M.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&&v){const r=Xd(t,{doc:t,mirror:n,blockClass:s,blockSelector:o,needsMask:O,maskTextClass:i,maskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:f,inlineImages:m,recordCanvas:g,preserveWhiteSpace:E,onSerialize:y,onIframeLoad:v,iframeLoadTimeout:w,onStylesheetLoad:b,stylesheetLoadTimeout:S,keepIframeSrcFn:C});r&&v(e,r)}},w),M.type===od.Element&&"link"===M.tagName&&"string"==typeof M.attributes.rel&&("stylesheet"===M.attributes.rel||"preload"===M.attributes.rel&&"string"==typeof M.attributes.href&&"css"===kd(M.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(b){const t=Xd(e,{doc:r,mirror:n,blockClass:s,blockSelector:o,needsMask:O,maskTextClass:i,maskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:f,inlineImages:m,recordCanvas:g,preserveWhiteSpace:E,onSerialize:y,onIframeLoad:v,iframeLoadTimeout:w,onStylesheetLoad:b,stylesheetLoadTimeout:S,keepIframeSrcFn:C});t&&b(e,t)}},S),M}function Hd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Qd(e){if(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 ep={exports:{}},tp=String,rp=function(){return{isColorSupported:!1,reset:tp,bold:tp,dim:tp,italic:tp,underline:tp,inverse:tp,hidden:tp,strikethrough:tp,black:tp,red:tp,green:tp,yellow:tp,blue:tp,magenta:tp,cyan:tp,white:tp,gray:tp,bgBlack:tp,bgRed:tp,bgGreen:tp,bgYellow:tp,bgBlue:tp,bgMagenta:tp,bgCyan:tp,bgWhite:tp}};ep.exports=rp(),ep.exports.createColors=rp;var np=ep.exports;const sp=Qd(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let op=np,ip=sp,ap=class e extends Error{constructor(t,r,n,s,o,i){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),s&&(this.source=s),i&&(this.plugin=i),void 0!==r&&void 0!==n&&("number"==typeof r?(this.line=r,this.column=n):(this.line=r.line,this.column=r.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}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(e){if(!this.source)return"";let t=this.source;null==e&&(e=op.isColorSupported),ip&&e&&(t=ip(t));let r,n,s=t.split(/\r?\n/),o=Math.max(this.line-3,0),i=Math.min(this.line+2,s.length),a=String(i).length;if(e){let{bold:e,gray:t,red:s}=op.createColors(!0);r=t=>e(s(t)),n=e=>t(e)}else r=n=e=>e;return s.slice(o,i).map((e,t)=>{let s=o+1+t,i=" "+(" "+s).slice(-a)+" | ";if(s===this.line){let t=n(i.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return r(">")+n(i)+e+"\n "+t+r("^")}return" "+n(i)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};var lp=ap;ap.default=ap;var cp={};cp.isClean=Symbol("isClean"),cp.my=Symbol("my");const up={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let hp=class{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(e,t,r){let n;if(r||(r=t),t&&(n=e.raws[t],void 0!==n))return n;let s=e.parent;if("before"===r){if(!s||"root"===s.type&&s.first===e)return"";if(s&&"document"===s.type)return""}if(!s)return up[r];let o=e.root();if(o.rawCache||(o.rawCache={}),void 0!==o.rawCache[r])return o.rawCache[r];if("before"===r||"after"===r)return this.beforeAfter(e,r);{let s="raw"+((i=r)[0].toUpperCase()+i.slice(1));this[s]?n=this[s](o,e):o.walk(e=>{if(n=e.raws[t],void 0!==n)return!1})}var i;return void 0===n&&(n=up[r]),o.rawCache[r]=n,n}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)}};var dp=hp;hp.default=hp;let pp=dp;function fp(e,t){new pp(t).stringify(e)}var mp=fp;fp.default=fp;let{isClean:gp,my:yp}=cp,vp=lp,wp=dp,bp=mp;function Sp(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=>Sp(e,r)):("object"===o&&null!==s&&(s=Sp(s)),r[n]=s)}return r}let Cp=class{constructor(e={}){this.raws={},this[gp]=!1,this[yp]=!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=Sp(this);for(let r in e)t[r]=e[r];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:r,start:n}=this.rangeBy(t);return this.source.input.error(e,{column:n.column,line:n.line},{column:r.column,line:r.line},t)}return new vp(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markDirty(){if(this[gp]){this[gp]=!1;let e=this;for(;e=e.parent;)e[gp]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){let n=(t=this.toString()).indexOf(e.word);-1!==n&&(r=this.positionInside(n,t))}return r}positionInside(e,t){let r=t||this.toString(),n=this.source.start.column,s=this.source.start.line;for(let t=0;t<e;t++)"\n"===r[t]?(n=1,s+=1):n+=1;return{column:n,line:s}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let n=this.toString(),s=n.indexOf(e.word);-1!==s&&(t=this.positionInside(s,n),r=this.positionInside(s+e.word.length,n))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return(new wp).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let n of e)n===this?r=!0:r?(this.parent.insertAfter(t,n),t=n):this.parent.insertBefore(t,n);r||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let r={},n=null==t;t=t||new Map;let 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){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=bp){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){let n={node:this};for(let e in r)n[e]=r[e];return e.warn(t,n)}get proxyOf(){return this}};var Ip=Cp;Cp.default=Cp;let xp=Ip,kp=class extends xp{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}};var Op=kp;kp.default=kp;var Ep={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(r=t)=>{let n="",s=r;for(;s--;)n+=e[Math.random()*e.length|0];return n}};let{SourceMapConsumer:Rp,SourceMapGenerator:Ap}=sp,{existsSync:Mp,readFileSync:Pp}=sp,{dirname:Np,join:Tp}=sp;let Dp=class{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,n=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=Np(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new Rp(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t;let r=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+r)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let r=e.lastIndexOf(t.pop()),n=e.indexOf("*/",r);r>-1&&n>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,n)))}loadFile(e){if(this.root=Np(e),Mp(e))return this.mapFile=e,Pp(e,"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 Rp)return Ap.fromSourceMap(t).toString();if(t instanceof Ap)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=Tp(Np(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)}};var Lp=Dp;Dp.default=Dp;let{SourceMapConsumer:Fp,SourceMapGenerator:_p}=sp,{fileURLToPath:Bp,pathToFileURL:Up}=sp,{isAbsolute:jp,resolve:zp}=sp,{nanoid:Wp}=Ep,Vp=sp,Gp=lp,Zp=Lp,Yp=Symbol("fromOffsetCache"),Jp=Boolean(Fp&&_p),Kp=Boolean(zp&&jp),$p=class{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!Kp||/^\w+:\/\//.test(t.from)||jp(t.from)?this.file=t.from:this.file=zp(t.from)),Kp&&Jp){let e=new Zp(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+Wp(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let s,o,i;if(t&&"object"==typeof t){let e=t,n=r;if("number"==typeof e.offset){let n=this.fromOffset(e.offset);t=n.line,r=n.col}else t=e.line,r=e.column;if("number"==typeof n.offset){let e=this.fromOffset(n.offset);o=e.line,i=e.col}else o=n.line,i=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let a=this.origin(t,r,o,i);return s=a?new Gp(e,void 0===a.endLine?a.line:{column:a.column,line:a.line},void 0===a.endLine?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,n.plugin):new Gp(e,void 0===o?t:{column:r,line:t},void 0===o?r:{column:i,line:o},this.css,this.file,n.plugin),s.input={column:r,endColumn:i,endLine:o,line:t,source:this.css},this.file&&(Up&&(s.input.url=Up(this.file).toString()),s.input.file=this.file),s}fromOffset(e){let t,r;if(this[Yp])r=this[Yp];else{let e=this.css.split("\n");r=new Array(e.length);let t=0;for(let n=0,s=e.length;n<s;n++)r[n]=t,t+=e[n].length+1;this[Yp]=r}t=r[r.length-1];let n=0;if(e>=t)n=r.length-1;else{let t,s=r.length-2;for(;n<s;)if(t=n+(s-n>>1),e<r[t])s=t-1;else{if(!(e>=r[t+1])){n=t;break}n=t+1}}return{col:e-r[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:zp(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,n){if(!this.map)return!1;let s,o,i=this.map.consumer(),a=i.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof r&&(s=i.originalPositionFor({column:n,line:r})),o=jp(a.source)?Up(a.source):new URL(a.source,this.map.consumer().sourceRoot||Up(this.map.mapFile));let l={column:a.column,endColumn:s&&s.column,endLine:s&&s.line,line:a.line,url:o.toString()};if("file:"===o.protocol){if(!Bp)throw new Error("file: protocol is not available in this PostCSS build");l.file=Bp(o)}let c=i.sourceContentFor(a.source);return c&&(l.source=c),l}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}};var qp=$p;$p.default=$p,Vp&&Vp.registerInput&&Vp.registerInput($p);let{SourceMapConsumer:Xp,SourceMapGenerator:Hp}=sp,{dirname:Qp,relative:ef,resolve:tf,sep:rf}=sp,{pathToFileURL:nf}=sp,sf=qp,of=Boolean(Xp&&Hp),af=Boolean(Qp&&tf&&ef&&rf);var lf=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 e of this.previous()){let t,r=this.toUrl(this.path(e.file)),n=e.root||Qp(e.file);!1===this.mapOpts.sourcesContent?(t=new Xp(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,r,this.toUrl(this.path(n)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),af&&of&&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=Hp.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new Hp({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 Hp({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))),e=i.match(/\n/g),e?(r+=e.length,t=i.lastIndexOf("\n"),n=i.length-t):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(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?Qp(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=Qp(tf(r,this.mapOpts.annotation)));let n=ef(r,e);return this.memoizedPaths.set(e,n),n}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 sf(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(nf){let t=nf(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;"\\"===rf&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let cf=Ip,uf=class extends cf{constructor(e){super(e),this.type="comment"}};var hf=uf;uf.default=uf;let df,pf,ff,mf,{isClean:gf,my:yf}=cp,vf=Op,wf=hf,bf=Ip;function Sf(e){return e.map(e=>(e.nodes&&(e.nodes=Sf(e.nodes)),delete e.source,e))}function Cf(e){if(e[gf]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Cf(t)}let If=class e extends bf{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(t,r){if("string"==typeof t)t=Sf(df(t).nodes);else if(void 0===t)t=[];else if(Array.isArray(t)){t=t.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===t.type&&"document"!==this.type){t=t.nodes.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if(t.type)t=[t];else if(t.prop){if(void 0===t.value)throw new Error("Value field is missed in node creation");"string"!=typeof t.value&&(t.value=String(t.value)),t=[new vf(t)]}else if(t.selector)t=[new pf(t)];else if(t.name)t=[new ff(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new wf(t)]}return t.map(t=>(t[yf]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[gf]&&Cf(t),void 0===t.raws.before&&r&&void 0!==r.raws.before&&(t.raws.before=r.raws.before.replace(/\S/g,"")),t.parent=this.proxyOf,t))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls(n=>{t.props&&!t.props.includes(n.prop)||t.fast&&!n.value.includes(t.fast)||(n.value=n.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,r)=>{let n;try{n=e(t,r)}catch(e){throw t.addToError(e)}return!1!==n&&t.walk&&(n=t.walk(e)),n})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("atrule"===r.type&&e.test(r.name))return t(r,n)}):this.walk((r,n)=>{if("atrule"===r.type&&r.name===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("atrule"===e.type)return t(e,r)}))}walkComments(e){return this.walk((t,r)=>{if("comment"===t.type)return e(t,r)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("decl"===r.type&&e.test(r.prop))return t(r,n)}):this.walk((r,n)=>{if("decl"===r.type&&r.prop===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("decl"===e.type)return t(e,r)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("rule"===r.type&&e.test(r.selector))return t(r,n)}):this.walk((r,n)=>{if("rule"===r.type&&r.selector===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("rule"===e.type)return t(e,r)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};If.registerParse=e=>{df=e},If.registerRule=e=>{pf=e},If.registerAtRule=e=>{ff=e},If.registerRoot=e=>{mf=e};var xf=If;If.default=If,If.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,ff.prototype):"rule"===e.type?Object.setPrototypeOf(e,pf.prototype):"decl"===e.type?Object.setPrototypeOf(e,vf.prototype):"comment"===e.type?Object.setPrototypeOf(e,wf.prototype):"root"===e.type&&Object.setPrototypeOf(e,mf.prototype),e[yf]=!0,e.nodes&&e.nodes.forEach(e=>{If.rebuild(e)})};let kf,Of,Ef=xf,Rf=class extends Ef{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new kf(new Of,this,e).stringify()}};Rf.registerLazyResult=e=>{kf=e},Rf.registerProcessor=e=>{Of=e};var Af=Rf;Rf.default=Rf;let Mf={};var Pf=function(e){Mf[e]||(Mf[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let Nf=class{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}};var Tf=Nf;Nf.default=Nf;let Df=Tf,Lf=class{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let r=new Df(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};var Ff=Lf;Lf.default=Lf;const _f="'".charCodeAt(0),Bf='"'.charCodeAt(0),Uf="\\".charCodeAt(0),jf="/".charCodeAt(0),zf="\n".charCodeAt(0),Wf=" ".charCodeAt(0),Vf="\f".charCodeAt(0),Gf="\t".charCodeAt(0),Zf="\r".charCodeAt(0),Yf="[".charCodeAt(0),Jf="]".charCodeAt(0),Kf="(".charCodeAt(0),$f=")".charCodeAt(0),qf="{".charCodeAt(0),Xf="}".charCodeAt(0),Hf=";".charCodeAt(0),Qf="*".charCodeAt(0),em=":".charCodeAt(0),tm="@".charCodeAt(0),rm=/[\t\n\f\r "#'()/;[\\\]{}]/g,nm=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,sm=/.[\r\n"'(/\\]/,om=/[\da-f]/i;let im=xf,am=class extends im{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)}};var lm=am;am.default=am,im.registerAtRule(am);let cm,um,hm=xf,dm=class extends hm{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(e={}){return new cm(new um,this,e).stringify()}};dm.registerLazyResult=e=>{cm=e},dm.registerProcessor=e=>{um=e};var pm=dm;dm.default=dm,hm.registerRoot(dm);let fm={comma:e=>fm.split(e,[","],!0),space:e=>fm.split(e,[" ","\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}};var mm=fm;fm.default=fm;let gm=xf,ym=mm,vm=class extends gm{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return ym.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)}};var wm=vm;vm.default=vm,gm.registerRule(vm);let bm=Op,Sm=function(e,t={}){let r,n,s,o,i,a,l,c,u,h,d=e.css.valueOf(),p=t.ignoreErrors,f=d.length,m=0,g=[],y=[];function v(t){throw e.error("Unclosed "+t,m)}return{back:function(e){y.push(e)},endOfFile:function(){return 0===y.length&&m>=f},nextToken:function(e){if(y.length)return y.pop();if(m>=f)return;let t=!!e&&e.ignoreUnclosed;switch(r=d.charCodeAt(m),r){case zf:case Wf:case Gf:case Zf:case Vf:n=m;do{n+=1,r=d.charCodeAt(n)}while(r===Wf||r===zf||r===Gf||r===Zf||r===Vf);h=["space",d.slice(m,n)],m=n-1;break;case Yf:case Jf:case qf:case Xf:case em:case Hf:case $f:{let e=String.fromCharCode(r);h=[e,e,m];break}case Kf:if(c=g.length?g.pop()[1]:"",u=d.charCodeAt(m+1),"url"===c&&u!==_f&&u!==Bf&&u!==Wf&&u!==zf&&u!==Gf&&u!==Vf&&u!==Zf){n=m;do{if(a=!1,n=d.indexOf(")",n+1),-1===n){if(p||t){n=m;break}v("bracket")}for(l=n;d.charCodeAt(l-1)===Uf;)l-=1,a=!a}while(a);h=["brackets",d.slice(m,n+1),m,n],m=n}else n=d.indexOf(")",m+1),o=d.slice(m,n+1),-1===n||sm.test(o)?h=["(","(",m]:(h=["brackets",o,m,n],m=n);break;case _f:case Bf:s=r===_f?"'":'"',n=m;do{if(a=!1,n=d.indexOf(s,n+1),-1===n){if(p||t){n=m+1;break}v("string")}for(l=n;d.charCodeAt(l-1)===Uf;)l-=1,a=!a}while(a);h=["string",d.slice(m,n+1),m,n],m=n;break;case tm:rm.lastIndex=m+1,rm.test(d),n=0===rm.lastIndex?d.length-1:rm.lastIndex-2,h=["at-word",d.slice(m,n+1),m,n],m=n;break;case Uf:for(n=m,i=!0;d.charCodeAt(n+1)===Uf;)n+=1,i=!i;if(r=d.charCodeAt(n+1),i&&r!==jf&&r!==Wf&&r!==zf&&r!==Gf&&r!==Zf&&r!==Vf&&(n+=1,om.test(d.charAt(n)))){for(;om.test(d.charAt(n+1));)n+=1;d.charCodeAt(n+1)===Wf&&(n+=1)}h=["word",d.slice(m,n+1),m,n],m=n;break;default:r===jf&&d.charCodeAt(m+1)===Qf?(n=d.indexOf("*/",m+2)+1,0===n&&(p||t?n=d.length:v("comment")),h=["comment",d.slice(m,n+1),m,n],m=n):(nm.lastIndex=m+1,nm.test(d),n=0===nm.lastIndex?d.length-1:nm.lastIndex-2,h=["word",d.slice(m,n+1),m,n],g.push(h),m=n)}return m++,h},position:function(){return m}}},Cm=hf,Im=lm,xm=pm,km=wm;const Om={empty:!0,space:!0};var Em=class{constructor(e){this.input=e,this.root=new xm,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,r,n,s=new Im;s.name=e[1].slice(1),""===s.name&&this.unnamedAtrule(s,e),this.init(s,e[2]);let o=!1,i=!1,a=[],l=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?l.push("("===t?")":"]"):"{"===t&&l.length>0?l.push("}"):t===l[l.length-1]&&l.pop(),0===l.length){if(";"===t){s.source.end=this.getPosition(e[2]),s.source.end.offset++,this.semicolon=!0;break}if("{"===t){i=!0;break}if("}"===t){if(a.length>0){for(n=a.length-1,r=a[n];r&&"space"===r[0];)r=a[--n];r&&(s.source.end=this.getPosition(r[3]||r[2]),s.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}s.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(s.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(s,"params",a),o&&(e=a[a.length-1],s.source.end=this.getPosition(e[3]||e[2]),s.source.end.offset++,this.spaces=s.raws.between,s.raws.between="")):(s.raws.afterName="",s.params=""),i&&(s.nodes=[],this.current=s)}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(t=i,r=t[0],"("===r&&(s+=1),")"===r&&(s-=1),0===s&&":"===r){if(n){if("word"===n[0]&&"progid"===n[1])continue;return o}this.doubleColon(t)}n=t}return!1}comment(e){let t=new Cm;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text="",t.raws.left=r,t.raws.right="";else{let e=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=Sm(this.input)}decl(e,t){let r=new bm;this.init(r,e[0][2]);let n,s=e[e.length-1];for(";"===s[0]&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(s[3]||s[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)),r.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),r.raws.before+=e.shift()[1];for(r.source.start=this.getPosition(e[0][2]),r.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;r.prop+=e.shift()[1]}for(r.raws.between="";e.length;){if(n=e.shift(),":"===n[0]){r.raws.between+=n[1];break}"word"===n[0]&&/\w/.test(n[1])&&this.unknownWord([n]),r.raws.between+=n[1]}"_"!==r.prop[0]&&"*"!==r.prop[0]||(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let o,i=[];for(;e.length&&(o=e[0][0],"space"===o||"comment"===o);)i.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(n=e[t],"!important"===n[1].toLowerCase()){r.important=!0;let n=this.stringFrom(e,t);n=this.spacesFromEnd(e)+n," !important"!==n&&(r.raws.important=n);break}if("important"===n[1].toLowerCase()){let n=e.slice(0),s="";for(let e=t;e>0;e--){let t=n[e][0];if(0===s.trim().indexOf("!")&&"space"!==t)break;s=n.pop()[1]+s}0===s.trim().indexOf("!")&&(r.important=!0,r.raws.important=s,e=n)}if("space"!==n[0]&&"comment"!==n[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(r.raws.between+=i.map(e=>e[1]).join(""),i=[]),this.raw(r,"value",i.concat(e),t),r.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 km;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,r=null,n=!1,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,i,a,l=r.length,c="",u=!0;for(let e=0;e<l;e+=1)s=r[e],o=s[0],"space"!==o||e!==l-1||n?"comment"===o?(a=r[e-1]?r[e-1][0]:"empty",i=r[e+1]?r[e+1][0]:"empty",Om[a]||Om[i]||","===c.slice(-1)?u=!1:c+=s[1]):c+=s[1]:u=!1;if(!u){let n=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:n,value:c}}e[t]=c}rule(e){e.pop();let t=new km;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let n=t;n<e.length;n++)r+=e[n][1];return e.splice(t,e.length-t),r}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}};let Rm=xf,Am=Em,Mm=qp;function Pm(e,t){let r=new Mm(e,t),n=new Am(r);try{n.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&t&&t.from&&(/\.scss$/i.test(t.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(t.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(t.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return n.root}var Nm=Pm;Pm.default=Pm,Rm.registerParse(Pm);let{isClean:Tm,my:Dm}=cp,Lm=lf,Fm=mp,_m=xf,Bm=Af,Um=Pf,jm=Ff,zm=Nm,Wm=pm;const Vm={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Gm={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},Zm={Once:!0,postcssPlugin:!0,prepare:!0};function Ym(e){return"object"==typeof e&&"function"==typeof e.then}function Jm(e){let t=!1,r=Vm[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 Km(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:Jm(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function $m(e){return e[Tm]=!1,e.nodes&&e.nodes.forEach(e=>$m(e)),e}let qm={},Xm=class e{constructor(t,r,n){let s;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof e||r instanceof jm)s=$m(r.root),r.map&&(void 0===n.map&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=r.map);else{let e=zm;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{s=e(r,n)}catch(e){this.processed=!0,this.error=e}s&&!s[Dm]&&_m.rebuild(s)}else s=$m(r);this.result=new jm(t,s,n),this.helpers={...qm,postcss:qm,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(!Gm[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Zm[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(Ym(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Tm];){e[Tm]=!0;let t=[Km(e)];for(;t.length>0;){let e=this.visitTick(t);if(Ym(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 Ym(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=Fm;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new Lm(t,this.result.root,this.result.opts).generate();return this.result.css=r[0],this.result.map=r[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(Ym(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Tm];)e[Tm]=!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||Um("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(Ym(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[Tm])return n[Tm]=!0,void e.push(Km(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[Tm]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[Tm]=!0;let t=Jm(e);for(let r of t)if(0===r)e.nodes&&e.each(e=>{e[Tm]||this.walkSync(e)});else{let t=this.listeners[r];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};Xm.registerPostcss=e=>{qm=e};var Hm=Xm;Xm.default=Xm,Wm.registerLazyResult(Xm),Bm.registerLazyResult(Xm);let Qm=lf,eg=mp,tg=Pf,rg=Nm;const ng=Ff;let sg=class{constructor(e,t,r){let n;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;let s=eg;this.result=new ng(this._processor,n,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let i=new Qm(s,n,this._opts,t);if(i.isMap()){let[e,t]=i.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else i.clearAnnotation(),this.result.css=i.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||tg("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=rg;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}};var og=sg;sg.default=sg;let ig=og,ag=Hm,lg=Af,cg=pm,ug=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new ag(this,e,t):new ig(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var hg=ug;ug.default=ug,cg.registerProcessor(ug),lg.registerProcessor(ug);let dg=Op,pg=Lp,fg=hf,mg=lm,gg=qp,yg=pm,vg=wm;function wg(e,t){if(Array.isArray(e))return e.map(e=>wg(e));let{inputs:r,...n}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:gg.prototype};r.map&&(r.map={...r.map,__proto__:pg.prototype}),t.push(r)}}if(n.nodes&&(n.nodes=e.nodes.map(e=>wg(e,t))),n.source){let{inputId:e,...r}=n.source;n.source=r,null!=e&&(n.source.input=t[e])}if("root"===n.type)return new yg(n);if("decl"===n.type)return new dg(n);if("rule"===n.type)return new vg(n);if("comment"===n.type)return new fg(n);if("atrule"===n.type)return new mg(n);throw new Error("Unknown node type: "+e.type)}var bg=wg;wg.default=wg;let Sg=lp,Cg=Op,Ig=Hm,xg=xf,kg=hg,Og=mp,Eg=bg,Rg=Af,Ag=Tf,Mg=hf,Pg=lm,Ng=Ff,Tg=qp,Dg=Nm,Lg=mm,Fg=wm,_g=pm,Bg=Ip;function Ug(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new kg(e)}Ug.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 kg).version,s}return Object.defineProperty(s,"postcss",{get:()=>(r||(r=s()),r)}),s.process=function(e,t,r){return Ug([s(r)]).process(e,t)},s},Ug.stringify=Og,Ug.parse=Dg,Ug.fromJSON=Eg,Ug.list=Lg,Ug.comment=e=>new Mg(e),Ug.atRule=e=>new Pg(e),Ug.decl=e=>new Cg(e),Ug.rule=e=>new Fg(e),Ug.root=e=>new _g(e),Ug.document=e=>new Rg(e),Ug.CssSyntaxError=Sg,Ug.Declaration=Cg,Ug.Container=xg,Ug.Processor=kg,Ug.Document=Rg,Ug.Comment=Mg,Ug.Warning=Ag,Ug.AtRule=Pg,Ug.Result=Ng,Ug.Input=Tg,Ug.Rule=Fg,Ug.Root=_g,Ug.Node=Bg,Ig.registerPostcss(Ug);var jg=Ug;Ug.default=Ug;const zg=Hd(jg);zg.stringify,zg.fromJSON,zg.plugin,zg.parse,zg.list,zg.document,zg.comment,zg.atRule,zg.rule,zg.decl,zg.root,zg.CssSyntaxError,zg.Declaration,zg.Container,zg.Processor,zg.Document,zg.Comment,zg.Warning,zg.AtRule,zg.Result,zg.Input,zg.Rule,zg.Root,zg.Node;var Wg=Object.defineProperty,Vg=(e,t,r)=>((e,t,r)=>t in e?Wg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);function Gg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Zg(e){if(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 Yg={exports:{}},Jg=String,Kg=function(){return{isColorSupported:!1,reset:Jg,bold:Jg,dim:Jg,italic:Jg,underline:Jg,inverse:Jg,hidden:Jg,strikethrough:Jg,black:Jg,red:Jg,green:Jg,yellow:Jg,blue:Jg,magenta:Jg,cyan:Jg,white:Jg,gray:Jg,bgBlack:Jg,bgRed:Jg,bgGreen:Jg,bgYellow:Jg,bgBlue:Jg,bgMagenta:Jg,bgCyan:Jg,bgWhite:Jg}};Yg.exports=Kg(),Yg.exports.createColors=Kg;var $g=Yg.exports;const qg=Zg(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let Xg=$g,Hg=qg,Qg=class e extends Error{constructor(t,r,n,s,o,i){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),s&&(this.source=s),i&&(this.plugin=i),void 0!==r&&void 0!==n&&("number"==typeof r?(this.line=r,this.column=n):(this.line=r.line,this.column=r.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}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(e){if(!this.source)return"";let t=this.source;null==e&&(e=Xg.isColorSupported),Hg&&e&&(t=Hg(t));let r,n,s=t.split(/\r?\n/),o=Math.max(this.line-3,0),i=Math.min(this.line+2,s.length),a=String(i).length;if(e){let{bold:e,gray:t,red:s}=Xg.createColors(!0);r=t=>e(s(t)),n=e=>t(e)}else r=n=e=>e;return s.slice(o,i).map((e,t)=>{let s=o+1+t,i=" "+(" "+s).slice(-a)+" | ";if(s===this.line){let t=n(i.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return r(">")+n(i)+e+"\n "+t+r("^")}return" "+n(i)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};var ey=Qg;Qg.default=Qg;var ty={};ty.isClean=Symbol("isClean"),ty.my=Symbol("my");const ry={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let ny=class{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(e,t,r){let n;if(r||(r=t),t&&(n=e.raws[t],void 0!==n))return n;let s=e.parent;if("before"===r){if(!s||"root"===s.type&&s.first===e)return"";if(s&&"document"===s.type)return""}if(!s)return ry[r];let o=e.root();if(o.rawCache||(o.rawCache={}),void 0!==o.rawCache[r])return o.rawCache[r];if("before"===r||"after"===r)return this.beforeAfter(e,r);{let s="raw"+((i=r)[0].toUpperCase()+i.slice(1));this[s]?n=this[s](o,e):o.walk(e=>{if(n=e.raws[t],void 0!==n)return!1})}var i;return void 0===n&&(n=ry[r]),o.rawCache[r]=n,n}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)}};var sy=ny;ny.default=ny;let oy=sy;function iy(e,t){new oy(t).stringify(e)}var ay=iy;iy.default=iy;let{isClean:ly,my:cy}=ty,uy=ey,hy=sy,dy=ay;function py(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=>py(e,r)):("object"===o&&null!==s&&(s=py(s)),r[n]=s)}return r}let fy=class{constructor(e={}){this.raws={},this[ly]=!1,this[cy]=!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=py(this);for(let r in e)t[r]=e[r];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:r,start:n}=this.rangeBy(t);return this.source.input.error(e,{column:n.column,line:n.line},{column:r.column,line:r.line},t)}return new uy(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markDirty(){if(this[ly]){this[ly]=!1;let e=this;for(;e=e.parent;)e[ly]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){let n=(t=this.toString()).indexOf(e.word);-1!==n&&(r=this.positionInside(n,t))}return r}positionInside(e,t){let r=t||this.toString(),n=this.source.start.column,s=this.source.start.line;for(let t=0;t<e;t++)"\n"===r[t]?(n=1,s+=1):n+=1;return{column:n,line:s}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let n=this.toString(),s=n.indexOf(e.word);-1!==s&&(t=this.positionInside(s,n),r=this.positionInside(s+e.word.length,n))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return(new hy).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let n of e)n===this?r=!0:r?(this.parent.insertAfter(t,n),t=n):this.parent.insertBefore(t,n);r||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let r={},n=null==t;t=t||new Map;let 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){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=dy){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){let n={node:this};for(let e in r)n[e]=r[e];return e.warn(t,n)}get proxyOf(){return this}};var my=fy;fy.default=fy;let gy=my,yy=class extends gy{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}};var vy=yy;yy.default=yy;var wy={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(r=t)=>{let n="",s=r;for(;s--;)n+=e[Math.random()*e.length|0];return n}};let{SourceMapConsumer:by,SourceMapGenerator:Sy}=qg,{existsSync:Cy,readFileSync:Iy}=qg,{dirname:xy,join:ky}=qg;let Oy=class{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,n=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=xy(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new by(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t;let r=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+r)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let r=e.lastIndexOf(t.pop()),n=e.indexOf("*/",r);r>-1&&n>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,n)))}loadFile(e){if(this.root=xy(e),Cy(e))return this.mapFile=e,Iy(e,"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 by)return Sy.fromSourceMap(t).toString();if(t instanceof Sy)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=ky(xy(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)}};var Ey=Oy;Oy.default=Oy;let{SourceMapConsumer:Ry,SourceMapGenerator:Ay}=qg,{fileURLToPath:My,pathToFileURL:Py}=qg,{isAbsolute:Ny,resolve:Ty}=qg,{nanoid:Dy}=wy,Ly=qg,Fy=ey,_y=Ey,By=Symbol("fromOffsetCache"),Uy=Boolean(Ry&&Ay),jy=Boolean(Ty&&Ny),zy=class{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!jy||/^\w+:\/\//.test(t.from)||Ny(t.from)?this.file=t.from:this.file=Ty(t.from)),jy&&Uy){let e=new _y(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+Dy(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let s,o,i;if(t&&"object"==typeof t){let e=t,n=r;if("number"==typeof e.offset){let n=this.fromOffset(e.offset);t=n.line,r=n.col}else t=e.line,r=e.column;if("number"==typeof n.offset){let e=this.fromOffset(n.offset);o=e.line,i=e.col}else o=n.line,i=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let a=this.origin(t,r,o,i);return s=a?new Fy(e,void 0===a.endLine?a.line:{column:a.column,line:a.line},void 0===a.endLine?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,n.plugin):new Fy(e,void 0===o?t:{column:r,line:t},void 0===o?r:{column:i,line:o},this.css,this.file,n.plugin),s.input={column:r,endColumn:i,endLine:o,line:t,source:this.css},this.file&&(Py&&(s.input.url=Py(this.file).toString()),s.input.file=this.file),s}fromOffset(e){let t,r;if(this[By])r=this[By];else{let e=this.css.split("\n");r=new Array(e.length);let t=0;for(let n=0,s=e.length;n<s;n++)r[n]=t,t+=e[n].length+1;this[By]=r}t=r[r.length-1];let n=0;if(e>=t)n=r.length-1;else{let t,s=r.length-2;for(;n<s;)if(t=n+(s-n>>1),e<r[t])s=t-1;else{if(!(e>=r[t+1])){n=t;break}n=t+1}}return{col:e-r[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:Ty(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,n){if(!this.map)return!1;let s,o,i=this.map.consumer(),a=i.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof r&&(s=i.originalPositionFor({column:n,line:r})),o=Ny(a.source)?Py(a.source):new URL(a.source,this.map.consumer().sourceRoot||Py(this.map.mapFile));let l={column:a.column,endColumn:s&&s.column,endLine:s&&s.line,line:a.line,url:o.toString()};if("file:"===o.protocol){if(!My)throw new Error("file: protocol is not available in this PostCSS build");l.file=My(o)}let c=i.sourceContentFor(a.source);return c&&(l.source=c),l}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}};var Wy=zy;zy.default=zy,Ly&&Ly.registerInput&&Ly.registerInput(zy);let{SourceMapConsumer:Vy,SourceMapGenerator:Gy}=qg,{dirname:Zy,relative:Yy,resolve:Jy,sep:Ky}=qg,{pathToFileURL:$y}=qg,qy=Wy,Xy=Boolean(Vy&&Gy),Hy=Boolean(Zy&&Jy&&Yy&&Ky);var Qy=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 e of this.previous()){let t,r=this.toUrl(this.path(e.file)),n=e.root||Zy(e.file);!1===this.mapOpts.sourcesContent?(t=new Vy(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,r,this.toUrl(this.path(n)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),Hy&&Xy&&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=Gy.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new Gy({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 Gy({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))),e=i.match(/\n/g),e?(r+=e.length,t=i.lastIndexOf("\n"),n=i.length-t):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(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?Zy(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=Zy(Jy(r,this.mapOpts.annotation)));let n=Yy(r,e);return this.memoizedPaths.set(e,n),n}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 qy(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($y){let t=$y(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;"\\"===Ky&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let ev=my,tv=class extends ev{constructor(e){super(e),this.type="comment"}};var rv=tv;tv.default=tv;let nv,sv,ov,iv,{isClean:av,my:lv}=ty,cv=vy,uv=rv,hv=my;function dv(e){return e.map(e=>(e.nodes&&(e.nodes=dv(e.nodes)),delete e.source,e))}function pv(e){if(e[av]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)pv(t)}let fv=class e extends hv{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(t,r){if("string"==typeof t)t=dv(nv(t).nodes);else if(void 0===t)t=[];else if(Array.isArray(t)){t=t.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===t.type&&"document"!==this.type){t=t.nodes.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if(t.type)t=[t];else if(t.prop){if(void 0===t.value)throw new Error("Value field is missed in node creation");"string"!=typeof t.value&&(t.value=String(t.value)),t=[new cv(t)]}else if(t.selector)t=[new sv(t)];else if(t.name)t=[new ov(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new uv(t)]}return t.map(t=>(t[lv]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[av]&&pv(t),void 0===t.raws.before&&r&&void 0!==r.raws.before&&(t.raws.before=r.raws.before.replace(/\S/g,"")),t.parent=this.proxyOf,t))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls(n=>{t.props&&!t.props.includes(n.prop)||t.fast&&!n.value.includes(t.fast)||(n.value=n.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,r)=>{let n;try{n=e(t,r)}catch(e){throw t.addToError(e)}return!1!==n&&t.walk&&(n=t.walk(e)),n})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("atrule"===r.type&&e.test(r.name))return t(r,n)}):this.walk((r,n)=>{if("atrule"===r.type&&r.name===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("atrule"===e.type)return t(e,r)}))}walkComments(e){return this.walk((t,r)=>{if("comment"===t.type)return e(t,r)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("decl"===r.type&&e.test(r.prop))return t(r,n)}):this.walk((r,n)=>{if("decl"===r.type&&r.prop===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("decl"===e.type)return t(e,r)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("rule"===r.type&&e.test(r.selector))return t(r,n)}):this.walk((r,n)=>{if("rule"===r.type&&r.selector===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("rule"===e.type)return t(e,r)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};fv.registerParse=e=>{nv=e},fv.registerRule=e=>{sv=e},fv.registerAtRule=e=>{ov=e},fv.registerRoot=e=>{iv=e};var mv=fv;fv.default=fv,fv.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,ov.prototype):"rule"===e.type?Object.setPrototypeOf(e,sv.prototype):"decl"===e.type?Object.setPrototypeOf(e,cv.prototype):"comment"===e.type?Object.setPrototypeOf(e,uv.prototype):"root"===e.type&&Object.setPrototypeOf(e,iv.prototype),e[lv]=!0,e.nodes&&e.nodes.forEach(e=>{fv.rebuild(e)})};let gv,yv,vv=mv,wv=class extends vv{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new gv(new yv,this,e).stringify()}};wv.registerLazyResult=e=>{gv=e},wv.registerProcessor=e=>{yv=e};var bv=wv;wv.default=wv;let Sv={};var Cv=function(e){Sv[e]||(Sv[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let Iv=class{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}};var xv=Iv;Iv.default=Iv;let kv=xv,Ov=class{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let r=new kv(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};var Ev=Ov;Ov.default=Ov;const Rv="'".charCodeAt(0),Av='"'.charCodeAt(0),Mv="\\".charCodeAt(0),Pv="/".charCodeAt(0),Nv="\n".charCodeAt(0),Tv=" ".charCodeAt(0),Dv="\f".charCodeAt(0),Lv="\t".charCodeAt(0),Fv="\r".charCodeAt(0),_v="[".charCodeAt(0),Bv="]".charCodeAt(0),Uv="(".charCodeAt(0),jv=")".charCodeAt(0),zv="{".charCodeAt(0),Wv="}".charCodeAt(0),Vv=";".charCodeAt(0),Gv="*".charCodeAt(0),Zv=":".charCodeAt(0),Yv="@".charCodeAt(0),Jv=/[\t\n\f\r "#'()/;[\\\]{}]/g,Kv=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,$v=/.[\r\n"'(/\\]/,qv=/[\da-f]/i;let Xv=mv,Hv=class extends Xv{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)}};var Qv=Hv;Hv.default=Hv,Xv.registerAtRule(Hv);let ew,tw,rw=mv,nw=class extends rw{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(e={}){return new ew(new tw,this,e).stringify()}};nw.registerLazyResult=e=>{ew=e},nw.registerProcessor=e=>{tw=e};var sw=nw;nw.default=nw,rw.registerRoot(nw);let ow={comma:e=>ow.split(e,[","],!0),space:e=>ow.split(e,[" ","\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}};var iw=ow;ow.default=ow;let aw=mv,lw=iw,cw=class extends aw{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return lw.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)}};var uw=cw;cw.default=cw,aw.registerRule(cw);let hw=vy,dw=function(e,t={}){let r,n,s,o,i,a,l,c,u,h,d=e.css.valueOf(),p=t.ignoreErrors,f=d.length,m=0,g=[],y=[];function v(t){throw e.error("Unclosed "+t,m)}return{back:function(e){y.push(e)},endOfFile:function(){return 0===y.length&&m>=f},nextToken:function(e){if(y.length)return y.pop();if(m>=f)return;let t=!!e&&e.ignoreUnclosed;switch(r=d.charCodeAt(m),r){case Nv:case Tv:case Lv:case Fv:case Dv:n=m;do{n+=1,r=d.charCodeAt(n)}while(r===Tv||r===Nv||r===Lv||r===Fv||r===Dv);h=["space",d.slice(m,n)],m=n-1;break;case _v:case Bv:case zv:case Wv:case Zv:case Vv:case jv:{let e=String.fromCharCode(r);h=[e,e,m];break}case Uv:if(c=g.length?g.pop()[1]:"",u=d.charCodeAt(m+1),"url"===c&&u!==Rv&&u!==Av&&u!==Tv&&u!==Nv&&u!==Lv&&u!==Dv&&u!==Fv){n=m;do{if(a=!1,n=d.indexOf(")",n+1),-1===n){if(p||t){n=m;break}v("bracket")}for(l=n;d.charCodeAt(l-1)===Mv;)l-=1,a=!a}while(a);h=["brackets",d.slice(m,n+1),m,n],m=n}else n=d.indexOf(")",m+1),o=d.slice(m,n+1),-1===n||$v.test(o)?h=["(","(",m]:(h=["brackets",o,m,n],m=n);break;case Rv:case Av:s=r===Rv?"'":'"',n=m;do{if(a=!1,n=d.indexOf(s,n+1),-1===n){if(p||t){n=m+1;break}v("string")}for(l=n;d.charCodeAt(l-1)===Mv;)l-=1,a=!a}while(a);h=["string",d.slice(m,n+1),m,n],m=n;break;case Yv:Jv.lastIndex=m+1,Jv.test(d),n=0===Jv.lastIndex?d.length-1:Jv.lastIndex-2,h=["at-word",d.slice(m,n+1),m,n],m=n;break;case Mv:for(n=m,i=!0;d.charCodeAt(n+1)===Mv;)n+=1,i=!i;if(r=d.charCodeAt(n+1),i&&r!==Pv&&r!==Tv&&r!==Nv&&r!==Lv&&r!==Fv&&r!==Dv&&(n+=1,qv.test(d.charAt(n)))){for(;qv.test(d.charAt(n+1));)n+=1;d.charCodeAt(n+1)===Tv&&(n+=1)}h=["word",d.slice(m,n+1),m,n],m=n;break;default:r===Pv&&d.charCodeAt(m+1)===Gv?(n=d.indexOf("*/",m+2)+1,0===n&&(p||t?n=d.length:v("comment")),h=["comment",d.slice(m,n+1),m,n],m=n):(Kv.lastIndex=m+1,Kv.test(d),n=0===Kv.lastIndex?d.length-1:Kv.lastIndex-2,h=["word",d.slice(m,n+1),m,n],g.push(h),m=n)}return m++,h},position:function(){return m}}},pw=rv,fw=Qv,mw=sw,gw=uw;const yw={empty:!0,space:!0};var vw=class{constructor(e){this.input=e,this.root=new mw,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,r,n,s=new fw;s.name=e[1].slice(1),""===s.name&&this.unnamedAtrule(s,e),this.init(s,e[2]);let o=!1,i=!1,a=[],l=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?l.push("("===t?")":"]"):"{"===t&&l.length>0?l.push("}"):t===l[l.length-1]&&l.pop(),0===l.length){if(";"===t){s.source.end=this.getPosition(e[2]),s.source.end.offset++,this.semicolon=!0;break}if("{"===t){i=!0;break}if("}"===t){if(a.length>0){for(n=a.length-1,r=a[n];r&&"space"===r[0];)r=a[--n];r&&(s.source.end=this.getPosition(r[3]||r[2]),s.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}s.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(s.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(s,"params",a),o&&(e=a[a.length-1],s.source.end=this.getPosition(e[3]||e[2]),s.source.end.offset++,this.spaces=s.raws.between,s.raws.between="")):(s.raws.afterName="",s.params=""),i&&(s.nodes=[],this.current=s)}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(t=i,r=t[0],"("===r&&(s+=1),")"===r&&(s-=1),0===s&&":"===r){if(n){if("word"===n[0]&&"progid"===n[1])continue;return o}this.doubleColon(t)}n=t}return!1}comment(e){let t=new pw;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text="",t.raws.left=r,t.raws.right="";else{let e=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=dw(this.input)}decl(e,t){let r=new hw;this.init(r,e[0][2]);let n,s=e[e.length-1];for(";"===s[0]&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(s[3]||s[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)),r.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),r.raws.before+=e.shift()[1];for(r.source.start=this.getPosition(e[0][2]),r.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;r.prop+=e.shift()[1]}for(r.raws.between="";e.length;){if(n=e.shift(),":"===n[0]){r.raws.between+=n[1];break}"word"===n[0]&&/\w/.test(n[1])&&this.unknownWord([n]),r.raws.between+=n[1]}"_"!==r.prop[0]&&"*"!==r.prop[0]||(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let o,i=[];for(;e.length&&(o=e[0][0],"space"===o||"comment"===o);)i.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(n=e[t],"!important"===n[1].toLowerCase()){r.important=!0;let n=this.stringFrom(e,t);n=this.spacesFromEnd(e)+n," !important"!==n&&(r.raws.important=n);break}if("important"===n[1].toLowerCase()){let n=e.slice(0),s="";for(let e=t;e>0;e--){let t=n[e][0];if(0===s.trim().indexOf("!")&&"space"!==t)break;s=n.pop()[1]+s}0===s.trim().indexOf("!")&&(r.important=!0,r.raws.important=s,e=n)}if("space"!==n[0]&&"comment"!==n[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(r.raws.between+=i.map(e=>e[1]).join(""),i=[]),this.raw(r,"value",i.concat(e),t),r.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 gw;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,r=null,n=!1,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,i,a,l=r.length,c="",u=!0;for(let e=0;e<l;e+=1)s=r[e],o=s[0],"space"!==o||e!==l-1||n?"comment"===o?(a=r[e-1]?r[e-1][0]:"empty",i=r[e+1]?r[e+1][0]:"empty",yw[a]||yw[i]||","===c.slice(-1)?u=!1:c+=s[1]):c+=s[1]:u=!1;if(!u){let n=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:n,value:c}}e[t]=c}rule(e){e.pop();let t=new gw;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let n=t;n<e.length;n++)r+=e[n][1];return e.splice(t,e.length-t),r}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}};let ww=mv,bw=vw,Sw=Wy;function Cw(e,t){let r=new Sw(e,t),n=new bw(r);try{n.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&t&&t.from&&(/\.scss$/i.test(t.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(t.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(t.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return n.root}var Iw=Cw;Cw.default=Cw,ww.registerParse(Cw);let{isClean:xw,my:kw}=ty,Ow=Qy,Ew=ay,Rw=mv,Aw=bv,Mw=Cv,Pw=Ev,Nw=Iw,Tw=sw;const Dw={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Lw={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},Fw={Once:!0,postcssPlugin:!0,prepare:!0};function _w(e){return"object"==typeof e&&"function"==typeof e.then}function Bw(e){let t=!1,r=Dw[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 Uw(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:Bw(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function jw(e){return e[xw]=!1,e.nodes&&e.nodes.forEach(e=>jw(e)),e}let zw={},Ww=class e{constructor(t,r,n){let s;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof e||r instanceof Pw)s=jw(r.root),r.map&&(void 0===n.map&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=r.map);else{let e=Nw;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{s=e(r,n)}catch(e){this.processed=!0,this.error=e}s&&!s[kw]&&Rw.rebuild(s)}else s=jw(r);this.result=new Pw(t,s,n),this.helpers={...zw,postcss:zw,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(!Lw[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Fw[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(_w(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[xw];){e[xw]=!0;let t=[Uw(e)];for(;t.length>0;){let e=this.visitTick(t);if(_w(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 _w(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=Ew;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new Ow(t,this.result.root,this.result.opts).generate();return this.result.css=r[0],this.result.map=r[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(_w(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[xw];)e[xw]=!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||Mw("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(_w(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[xw])return n[xw]=!0,void e.push(Uw(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[xw]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[xw]=!0;let t=Bw(e);for(let r of t)if(0===r)e.nodes&&e.each(e=>{e[xw]||this.walkSync(e)});else{let t=this.listeners[r];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};Ww.registerPostcss=e=>{zw=e};var Vw=Ww;Ww.default=Ww,Tw.registerLazyResult(Ww),Aw.registerLazyResult(Ww);let Gw=Qy,Zw=ay,Yw=Cv,Jw=Iw;const Kw=Ev;let $w=class{constructor(e,t,r){let n;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;let s=Zw;this.result=new Kw(this._processor,n,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let i=new Gw(s,n,this._opts,t);if(i.isMap()){let[e,t]=i.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else i.clearAnnotation(),this.result.css=i.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||Yw("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=Jw;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}};var qw=$w;$w.default=$w;let Xw=qw,Hw=Vw,Qw=bv,eb=sw,tb=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new Hw(this,e,t):new Xw(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var rb=tb;tb.default=tb,eb.registerProcessor(tb),Qw.registerProcessor(tb);let nb=vy,sb=Ey,ob=rv,ib=Qv,ab=Wy,lb=sw,cb=uw;function ub(e,t){if(Array.isArray(e))return e.map(e=>ub(e));let{inputs:r,...n}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:ab.prototype};r.map&&(r.map={...r.map,__proto__:sb.prototype}),t.push(r)}}if(n.nodes&&(n.nodes=e.nodes.map(e=>ub(e,t))),n.source){let{inputId:e,...r}=n.source;n.source=r,null!=e&&(n.source.input=t[e])}if("root"===n.type)return new lb(n);if("decl"===n.type)return new nb(n);if("rule"===n.type)return new cb(n);if("comment"===n.type)return new ob(n);if("atrule"===n.type)return new ib(n);throw new Error("Unknown node type: "+e.type)}var hb=ub;ub.default=ub;let db=ey,pb=vy,fb=Vw,mb=mv,gb=rb,yb=ay,vb=hb,wb=bv,bb=xv,Sb=rv,Cb=Qv,Ib=Ev,xb=Wy,kb=Iw,Ob=iw,Eb=uw,Rb=sw,Ab=my;function Mb(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new gb(e)}Mb.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 gb).version,s}return Object.defineProperty(s,"postcss",{get:()=>(r||(r=s()),r)}),s.process=function(e,t,r){return Mb([s(r)]).process(e,t)},s},Mb.stringify=yb,Mb.parse=kb,Mb.fromJSON=vb,Mb.list=Ob,Mb.comment=e=>new Sb(e),Mb.atRule=e=>new Cb(e),Mb.decl=e=>new pb(e),Mb.rule=e=>new Eb(e),Mb.root=e=>new Rb(e),Mb.document=e=>new wb(e),Mb.CssSyntaxError=db,Mb.Declaration=pb,Mb.Container=mb,Mb.Processor=gb,Mb.Document=wb,Mb.Comment=Sb,Mb.Warning=bb,Mb.AtRule=Cb,Mb.Result=Ib,Mb.Input=xb,Mb.Rule=Eb,Mb.Root=Rb,Mb.Node=Ab,fb.registerPostcss(Mb);var Pb=Mb;Mb.default=Mb;const Nb=Gg(Pb);Nb.stringify,Nb.fromJSON,Nb.plugin,Nb.parse,Nb.list,Nb.document,Nb.comment,Nb.atRule,Nb.rule,Nb.decl,Nb.root,Nb.CssSyntaxError,Nb.Declaration,Nb.Container,Nb.Processor,Nb.Document,Nb.Comment,Nb.Warning,Nb.AtRule,Nb.Result,Nb.Input,Nb.Rule,Nb.Root,Nb.Node;class Tb{constructor(...e){Vg(this,"parentElement",null),Vg(this,"parentNode",null),Vg(this,"ownerDocument"),Vg(this,"firstChild",null),Vg(this,"lastChild",null),Vg(this,"previousSibling",null),Vg(this,"nextSibling",null),Vg(this,"ELEMENT_NODE",1),Vg(this,"TEXT_NODE",3),Vg(this,"nodeType"),Vg(this,"nodeName"),Vg(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 Tb))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 Db={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Lb={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Fb={};function _b(e){if(Fb[e])return Fb[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 Db?Db[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 Lb?Lb[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 Fb[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?Fb[e]=o:r}catch{return r}}const Bb={};function Ub(e,t,r){var n;const s=`${e}.${String(r)}`;if(Bb[s])return Bb[s].call(t);const o=_b(e),i=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return i?(Bb[s]=i,i.call(t)):t[r]}const jb={};function zb(e,t,r){const n=`${e}.${String(r)}`;if(jb[n])return jb[n].bind(t);const s=_b(e)[r];return"function"!=typeof s?t[r]:(jb[n]=s,s.bind(t))}function Wb(){return _b("MutationObserver").constructor}const Vb={childNodes:function(e){return Ub("Node",e,"childNodes")},parentNode:function(e){return Ub("Node",e,"parentNode")},parentElement:function(e){return Ub("Node",e,"parentElement")},textContent:function(e){return Ub("Node",e,"textContent")},contains:function(e,t){return zb("Node",e,"contains")(t)},getRootNode:function(e){return zb("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Ub("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Ub("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Ub("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Ub("Element",e,"querySelectorAll")(t)},mutationObserver:Wb};function Gb(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}const Zb="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 Yb={map:{},getId:()=>(console.error(Zb),-1),getNode:()=>(console.error(Zb),null),removeNodeFromMap(){console.error(Zb)},has:()=>(console.error(Zb),!1),reset(){console.error(Zb)}};function Jb(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 Kb(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)}}),()=>Kb(e,t,o||{},!0)}function $b(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&&(Yb=new Proxy(Yb,{get:(e,t,r)=>("map"===t&&console.error(Zb),Reflect.get(e,t,r))}));let qb=Date.now;function Xb(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=Vb.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=Vb.parentElement(o.body))?void 0:n.scrollTop)||(null==(s=null==o?void 0:o.body)?void 0:s.scrollTop)||0}}function Hb(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Qb(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function eS(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:Vb.parentElement(e)}function tS(e,t,r,n){if(!e)return!1;const s=eS(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(Jd(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 rS(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||-2===t.getId(e)}function nS(e,t){if(gd(e))return!1;const r=t.getId(e);if(!t.has(r))return!0;const n=Vb.parentNode(e);return(!n||n.nodeType!==e.DOCUMENT_NODE)&&(!n||nS(n,t))}function sS(e){return Boolean(e.changedTouches)}function oS(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function iS(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function aS(e){return!!e&&(e instanceof Tb&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(Vb.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(qb=()=>(new Date).getTime());class lS{constructor(){rd(this,"id",1),rd(this,"styleIDMap",new WeakMap),rd(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 cS(e){var t;let r=null;return"getRootNode"in e&&(null==(t=Vb.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&Vb.host(Vb.getRootNode(e))&&(r=Vb.host(Vb.getRootNode(e))),r}function uS(e){const t=e.ownerDocument;if(!t)return!1;const r=function(e){let t,r=e;for(;t=cS(r);)r=t;return r}(e);return Vb.contains(t,r)}function hS(e){const t=e.ownerDocument;return!!t&&(Vb.contains(t,e)||uS(e))}var dS=(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))(dS||{}),pS=(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))(pS||{}),fS=(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))(fS||{}),mS=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(mS||{}),gS=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(gS||{}),yS=(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))(yS||{}),vS=(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))(vS||{});function wS(e){return"__ln"in e}class bS{constructor(){rd(this,"length",0),rd(this,"head",null),rd(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let r=0;r<e;r++)t=(null==t?void 0:t.next)||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&wS(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&&wS(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 SS=(e,t)=>`${e}@${t}`;class CS{constructor(){rd(this,"frozen",!1),rd(this,"locked",!1),rd(this,"texts",[]),rd(this,"attributes",[]),rd(this,"attributeMap",new WeakMap),rd(this,"removes",[]),rd(this,"mapRemoves",[]),rd(this,"movedMap",{}),rd(this,"addedSet",new Set),rd(this,"movedSet",new Set),rd(this,"droppedSet",new Set),rd(this,"removesSubTreeCache",new Set),rd(this,"mutationCb"),rd(this,"blockClass"),rd(this,"blockSelector"),rd(this,"maskTextClass"),rd(this,"maskTextSelector"),rd(this,"inlineStylesheet"),rd(this,"maskInputOptions"),rd(this,"maskTextFn"),rd(this,"maskInputFn"),rd(this,"keepIframeSrcFn"),rd(this,"recordCanvas"),rd(this,"inlineImages"),rd(this,"slimDOMOptions"),rd(this,"dataURLOptions"),rd(this,"doc"),rd(this,"mirror"),rd(this,"iframeManager"),rd(this,"stylesheetManager"),rd(this,"shadowDomManager"),rd(this,"canvasManager"),rd(this,"processedNodeManager"),rd(this,"unattachedDoc"),rd(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),rd(this,"emit",()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,r=new bS,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=Vb.parentNode(s);if(!o||!hS(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=gd(o)?this.mirror.getId(cS(s)):this.mirror.getId(o),l=n(s);if(-1===a||-1===l)return r.addNode(s);const c=Xd(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=>{oS(e,this.mirror)&&this.iframeManager.addIframe(e),iS(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),aS(s)&&this.shadowDomManager.addShadowRoot(Vb.shadowRoot(s),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)},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)xS(this.removesSubTreeCache,e,this.mirror)&&!this.movedSet.has(Vb.parentNode(e))||s(e);for(const e of this.addedSet)kS(this.droppedSet,e)||xS(this.removesSubTreeCache,e,this.mirror)?kS(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(Vb.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(Vb.parentNode(r.value));if(-1===n(r.value))continue;if(-1!==t){e=r;break}{const t=r.value,n=Vb.parentNode(t);if(n&&n.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const t=Vb.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=Vb.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))}),rd(this,"genTextAreaValueMutation",e=>{let t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t));const r=Array.from(Vb.childNodes(e),e=>Vb.textContent(e)||"").join("");t.attributes.value=Sd({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:xd(e),value:r,maskInputFn:this.maskInputFn})}),rd(this,"processMutation",e=>{if(!rS(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=Vb.textContent(e.target);tS(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:Kd(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,eS(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=xd(t);n=Sd({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:e,value:n,maskInputFn:this.maskInputFn})}if(tS(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"),!Yd(t.tagName,r))if(s.attributes[r]=Zd(this.doc,Cd(t.tagName),Cd(r),n),"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(tS(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=gd(e.target)?this.mirror.getId(Vb.host(e.target)):this.mirror.getId(e.target);tS(e.target,this.blockClass,this.blockSelector,!1)||rS(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(IS(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||nS(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[SS(r,n)]?IS(this.movedSet,t):(this.removes.push({parentId:n,id:r,isShadow:!(!gd(e.target)||!yd(e.target))||void 0}),function(e,t){const r=[e];for(;r.length;){const e=r.pop();t.has(e)||(t.add(e),Vb.childNodes(e).forEach(e=>r.push(e)))}}(t,this.removesSubTreeCache))),this.mapRemoves.push(t))})}}),rd(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(rS(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[SS(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);tS(e,this.blockClass,this.blockSelector,!1)||(Vb.childNodes(e).forEach(e=>this.genAdds(e)),aS(e)&&Vb.childNodes(Vb.shadowRoot(e)).forEach(t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)}))}})}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(t=>{this[t]=e[t]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function IS(e,t){e.delete(t),Vb.childNodes(t).forEach(t=>IS(e,t))}function xS(e,t,r){return 0!==e.size&&function(e,t){const r=Vb.parentNode(t);return!!r&&e.has(r)}(e,t)}function kS(e,t){return 0!==e.size&&OS(e,t)}function OS(e,t){const r=Vb.parentNode(t);return!!r&&(!!e.has(r)||OS(e,r))}let ES;const RS=e=>{if(!ES)return e;return(...t)=>{try{return e(...t)}catch(e){if(ES&&!0===ES(e))return;throw e}}};function AS(e){return(...t)=>{try{return e(...t)}catch(e){try{e._external_=!0}catch{}throw e}}}const MS=[];function PS(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 NS(e,t){const r=new CS;MS.push(r),r.init(e);const n=new(Wb())(RS(r.processMutations.bind(r)));return n.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),n}function TS({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(fS).filter(e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==i[e]).forEach(o=>{let i=Cd(o);const c=(t=>o=>{const i=PS(o);if(tS(i,n,s,!0))return;let a=null,c=t;if("pointerType"in o){switch(o.pointerType){case"mouse":a=mS.Mouse;break;case"touch":a=mS.Touch;break;case"pen":a=mS.Pen}a===mS.Touch?fS[t]===fS.MouseDown?c="TouchStart":fS[t]===fS.MouseUp&&(c="TouchEnd"):mS.Pen}else sS(o)&&(a=mS.Touch);null!==a?(l=a,(c.startsWith("Touch")&&a===mS.Touch||c.startsWith("Mouse")&&a===mS.Mouse)&&(a=null)):fS[t]===fS.Click&&(a=l,l=null);const u=sS(o)?o.changedTouches[0]:o;if(!u)return;const h=r.getId(i),{clientX:d,clientY:p}=u;RS(e)({type:fS[c],id:h,x:d,y:p,...null!==a&&{pointerType:a}})})(o);if(window.PointerEvent)switch(fS[o]){case fS.MouseDown:case fS.MouseUp:i=i.replace("mouse","pointer");break;case fS.TouchStart:case fS.TouchEnd:return}a.push(Gb(i,c,t))}),RS(()=>{a.forEach(e=>e())})}function DS({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:s,sampling:o}){const i=RS(Jb(RS(o=>{const i=PS(o);if(!i||tS(i,n,s,!0))return;const a=r.getId(i);if(i===t&&t.defaultView){const r=Xb(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 Gb("scroll",i,t)}const LS=["INPUT","TEXTAREA","SELECT"],FS=new WeakMap;function _S(e){return function(e,t){if(zS("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||zS("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||zS("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||zS("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 BS(e,t,r){let n,s;return e?(e.ownerNode?n=t.getId(e.ownerNode):s=r.getId(e),{styleId:s,id:n}):{}}function US({mirror:e,stylesheetManager:t},r){var n,s,o;let i=null;i="#document"===r.nodeName?e.getId(r):e.getId(Vb.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}}),RS(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})})):()=>{}}function jS(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)},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=NS(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=Jb(RS(t=>{const r=Date.now()-i;e(a.map(e=>(e.timeOffset-=r,e)),t),a=[],i=null}),o),c=RS(Jb(RS(e=>{const t=PS(e),{clientX:r,clientY:s}=sS(e)?e.changedTouches[0]:e;i||(i=qb()),a.push({x:r,y:s,id:n.getId(t),timeOffset:qb()-i}),l("undefined"!=typeof DragEvent&&e instanceof DragEvent?pS.Drag:e instanceof MouseEvent?pS.MouseMove:pS.TouchMove)}),s,{trailing:!1})),u=[Gb("mousemove",c,r),Gb("touchmove",c,r),Gb("drag",c,r)];return RS(()=>{u.forEach(e=>e())})}(e),o=TS(e),i=DS(e),a=function({viewportResizeCb:e},{win:t}){let r=-1,n=-1;return Gb("resize",RS(Jb(RS(()=>{const t=Hb(),s=Qb();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=PS(e);const c=e.isTrusted,h=r&&r.tagName;if(r&&"OPTION"===h&&(r=Vb.parentElement(r)),!r||!h||LS.indexOf(h)<0||tS(r,n,s,!0))return;if(r.classList.contains(o)||i&&r.matches(i))return;let p=r.value,f=!1;const m=xd(r)||"";"radio"===m||"checkbox"===m?f=r.checked:(a[h.toLowerCase()]||a[m])&&(p=Sd({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=FS.get(t);if(!s||s.text!==n.text||s.isChecked!==n.isChecked){FS.set(t,n);const s=r.getId(t);RS(e)({...n,id:s})}}const p=("last"===c.input?["change"]:["input","change"]).map(e=>Gb(e,RS(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=>Kb(e[0],e[1],{set(){RS(h)({target:this,isTrusted:!1})}},!1,f))),RS(()=>{p.forEach(e=>e())})}(e),c=function({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:s,doc:o}){const i=RS(o=>Jb(RS(s=>{const i=PS(s);if(!i||tS(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=[Gb("play",i(yS.Play),o),Gb("pause",i(yS.Pause),o),Gb("seeked",i(yS.Seeked),o),Gb("volumechange",i(yS.VolumeChange),o),Gb("ratechange",i(yS.RateChange),o)];return RS(()=>{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:RS((n,s,o)=>{const[i,a]=o,{id:l,styleId:c}=BS(s,t,r.styleMirror);return(l&&-1!==l||c&&-1!==c)&&e({id:l,styleId:c,adds:[{rule:i,index:a}]}),AS(()=>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:RS((n,s,o)=>{const[i]=o,{id:a,styleId:l}=BS(s,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:i}]}),AS(()=>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:RS((n,s,o)=>{const[i]=o,{id:a,styleId:l}=BS(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:RS((n,s,o)=>{const[i]=o,{id:a,styleId:l}=BS(s,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,replaceSync:i}),n.apply(s,o)})}));const l={};WS("CSSGroupingRule")?l.CSSGroupingRule=n.CSSGroupingRule:(WS("CSSMediaRule")&&(l.CSSMediaRule=n.CSSMediaRule),WS("CSSConditionRule")&&(l.CSSConditionRule=n.CSSConditionRule),WS("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:RS((n,s,o)=>{const[i,a]=o,{id:l,styleId:c}=BS(s.parentStyleSheet,t,r.styleMirror);return(l&&-1!==l||c&&-1!==c)&&e({id:l,styleId:c,adds:[{rule:i,index:[..._S(s),a||0]}]}),n.apply(s,o)})}),s.prototype.deleteRule=new Proxy(c[n].deleteRule,{apply:RS((n,s,o)=>{const[i]=o,{id:a,styleId:l}=BS(s.parentStyleSheet,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:[..._S(s),i]}]}),n.apply(s,o)})})}),RS(()=>{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=US(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:RS((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}=BS(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:_S(i.parentRule)}),s.apply(i,a)})});const i=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(i,{apply:RS((s,o,a)=>{var l;const[c]=a;if(r.has(c))return i.apply(o,[c]);const{id:u,styleId:h}=BS(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:_S(o.parentRule)}),s.apply(o,a)})}),RS(()=>{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=$b(t.fonts,"add",function(t){return function(r){return setTimeout(RS(()=>{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),RS(()=>{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=RS(()=>{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;tS(i,n,s,!0)||tS(c,n,s,!0)||a.push({start:r.getId(i),startOffset:l,end:r.getId(c),endOffset:u})}o({ranges:a})});return a(),Gb("selectionchange",a)}(e),m=function({doc:e,customElementCb:t}){const r=e.defaultView;return r&&r.customElements?$b(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 RS(()=>{MS.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 zS(e){return void 0!==window[e]}function WS(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class VS{constructor(e){rd(this,"iframeIdToRemoteIdMap",new WeakMap),rd(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 GS{constructor(e){rd(this,"iframes",new WeakMap),rd(this,"crossOriginIframeMap",new WeakMap),rd(this,"crossOriginIframeMirror",new VS(Fd)),rd(this,"crossOriginIframeStyleMirror"),rd(this,"crossOriginIframeRootIdMap",new WeakMap),rd(this,"mirror"),rd(this,"mutationCb"),rd(this,"wrappedEmit"),rd(this,"loadListener"),rd(this,"stylesheetManager"),rd(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new VS(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 dS.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:dS.IncrementalSnapshot,data:{source:pS.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case dS.Meta:case dS.Load:case dS.DomContentLoaded:return!1;case dS.Plugin:return t;case dS.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case dS.IncrementalSnapshot:switch(t.data.source){case pS.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 pS.Drag:case pS.TouchMove:case pS.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case pS.ViewportResize:return!1;case pS.MediaInteraction:case pS.MouseInteraction:case pS.Scroll:case pS.CanvasMutation:case pS.Input:return this.replaceIds(t.data,e,["id"]),t;case pS.StyleSheetRule:case pS.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case pS.Font:return t;case pS.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,["start","end"])}),t;case pS.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===vS.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(e=>{this.patchRootIdOnNode(e,t)})}}class ZS{constructor(e){rd(this,"shadowDoms",new WeakSet),rd(this,"mutationCb"),rd(this,"scrollCb"),rd(this,"bypassOptions"),rd(this,"mirror"),rd(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(!yd(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const r=NS({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(DS({...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(Vb.host(e))),this.restoreHandlers.push(US({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($b(e.prototype,"attachShadow",function(e){return function(n){const s=e.call(this,n),o=Vb.shadowRoot(this);return o&&hS(this)&&r.addShadowRoot(o,t),s}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch(e){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var YS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",JS="undefined"==typeof Uint8Array?[]:new Uint8Array(256),KS=0;KS<64;KS++)JS[YS.charCodeAt(KS)]=KS;const $S=new Map;const qS=(e,t,r)=>{if(!e||!QS(e,t)&&"object"!=typeof e)return;const n=function(e,t){let r=$S.get(e);return r||(r=new Map,$S.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 XS(e,t,r){if(e instanceof Array)return e.map(e=>XS(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+=YS[r[t]>>2],s+=YS[(3&r[t])<<4|r[t+1]>>4],s+=YS[(15&r[t+1])<<2|r[t+2]>>6],s+=YS[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:[XS(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:[XS(e.data,t,r),e.width,e.height]}}if(QS(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:qS(e,t,r)}}return e}const HS=(e,t,r)=>e.map(e=>XS(e,t,r)),QS=(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 eC(e,t,r,n){const s=[];try{const o=$b(e.HTMLCanvasElement.prototype,"getContext",function(e){return function(s,...o){if(!tS(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 tC(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=$b(e,l,function(e){return function(...i){const a=e.apply(this,i);if(qS(a,o,this),"tagName"in this.canvas&&!tS(this.canvas,n,s,!0)){const e=HS(i,o,this),n={type:t,property:l,args:e};r(this.canvas,n)}return a}});i.push(a)}catch{const n=Kb(e,l,{set(e){r(this.canvas,{type:t,property:l,args:[e],setter:!0})}});i.push(n)}return i}const rC="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",nC="undefined"!=typeof window&&window.Blob&&new Blob([(e=>Uint8Array.from(atob(e),e=>e.charCodeAt(0)))(rC)],{type:"text/javascript;charset=utf-8"});function sC(e){let t;try{if(t=nC&&(window.URL||window.webkitURL).createObjectURL(nC),!t)throw"";const r=new Worker(t,{name:null==e?void 0:e.name});return r.addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(t)}),r}catch(t){return new Worker("data:text/javascript;base64,"+rC,{name:null==e?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}class oC{constructor(e){rd(this,"pendingCanvasMutations",new Map),rd(this,"rafStamps",{latestId:0,invokeId:null}),rd(this,"mirror"),rd(this,"mutationCb"),rd(this,"resetObservers"),rd(this,"frozen",!1),rd(this,"locked",!1),rd(this,"processMutation",(e,t)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)});const{sampling:t="all",win:r,blockClass:n,blockSelector: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=eC(t,r,n,!0),i=new Map,a=new sC;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:gS["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=>{tS(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=eC(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=$b(t.CanvasRenderingContext2D.prototype,i,function(s){return function(...o){return tS(this.canvas,r,n,!0)||setTimeout(()=>{const r=HS(o,t,this);e(this.canvas,{type:gS["2D"],property:i,args:r})},0),s.apply(this,o)}});s.push(o)}catch{const r=Kb(t.CanvasRenderingContext2D.prototype,i,{set(t){e(this.canvas,{type:gS["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(...tC(t.WebGLRenderingContext.prototype,gS.WebGL,e,r,n,t)),void 0!==t.WebGL2RenderingContext&&s.push(...tC(t.WebGL2RenderingContext.prototype,gS.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 iC{constructor(e){rd(this,"trackedLinkElements",new WeakSet),rd(this,"mutationCb"),rd(this,"adoptedStyleSheetCb"),rd(this,"styleMirror",new lS),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(0===e.length)return;const r={id:t,styleIds:[]},n=[];for(const t of e){let e;this.styleMirror.has(t)?e=this.styleMirror.getId(t):(e=this.styleMirror.add(t),n.push({styleId:e,rules:Array.from(t.rules||CSSRule,(e,r)=>({rule:wd(e,t.href),index:r}))})),r.styleIds.push(e)}n.length>0&&(r.styles=n),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class aC{constructor(){rd(this,"nodeMap",new WeakMap),rd(this,"active",!1)}inOtherBuffer(e,t){const r=this.nodeMap.get(e);return r&&Array.from(r).some(e=>e!==t)}add(e,t){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}}let lC,cC,uC,hC=!1;try{if(2!==Array.from([1],e=>2*e)[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(Qh=e.contentWindow)?void 0:Qh.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}const dC=new bd;function pC(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,hooks:g,packFn:y,sampling:v={},dataURLOptions:w={},mousemoveWait:b,recordDOM:S=!0,recordCanvas:C=!1,recordCrossOriginIframes:I=!1,recordAfter:x=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:k=!1,collectFonts:O=!1,inlineImages:E=!1,plugins:R,keepIframeSrcFn:A=()=>!1,ignoreCSSAttributes:M=new Set([]),errorHandler:P,applyBackgroundColorToBlockedElements:N=!1}=e;ES=P;const T=!I||window.parent===window;let D=!1;if(!T)try{window.parent.document&&(D=!1)}catch(e){D=!0}if(T&&!t)throw new Error("emit function is required");if(!T&&!D)return()=>{};void 0!==b&&void 0===v.mousemove&&(v.mousemove=b),dC.reset();const L=!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},F=!0===p||"all"===p?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===p,headMetaDescKeywords:"all"===p,headTitleMutations:"all"===p}:p||{};let _;!function(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}();let B=0;const U=e=>{for(const t of R||[])t.eventProcessor&&(e=t.eventProcessor(e));return y&&!D&&(e=y(e)),e};lC=(e,s)=>{var o;const i=e;if(i.timestamp=qb(),!(null==(o=MS[0])?void 0:o.isFrozen())||i.type===dS.FullSnapshot||i.type===dS.IncrementalSnapshot&&i.data.source===pS.Mutation||MS.forEach(e=>e.unfreeze()),T)null==t||t(U(i),s);else if(D){const e={type:"rrweb",event:U(i),origin:window.location.origin,isCheckout:s};window.parent.postMessage(e,"*")}if(i.type===dS.FullSnapshot)_=i,B=0;else if(i.type===dS.IncrementalSnapshot){if(i.data.source===pS.Mutation&&i.data.isAttachIframe)return;B++;const e=n&&B>=n,t=r&&i.timestamp-_.timestamp>r;(e||t)&&cC(!0)}};const j=e=>{lC({type:dS.IncrementalSnapshot,data:{source:pS.Mutation,...e}})},z=e=>lC({type:dS.IncrementalSnapshot,data:{source:pS.Scroll,...e}}),W=e=>lC({type:dS.IncrementalSnapshot,data:{source:pS.CanvasMutation,...e}}),V=new iC({mutationCb:j,adoptedStyleSheetCb:e=>lC({type:dS.IncrementalSnapshot,data:{source:pS.AdoptedStyleSheet,...e}})}),G=new GS({mirror:dC,mutationCb:j,stylesheetManager:V,recordCrossOriginIframes:I,wrappedEmit:lC});for(const e of R||[])e.getMirror&&e.getMirror({nodeMirror:dC,crossOriginIframeMirror:G.crossOriginIframeMirror,crossOriginIframeStyleMirror:G.crossOriginIframeStyleMirror});const Z=new aC;uC=new oC({recordCanvas:C,mutationCb:W,win:window,blockClass:s,blockSelector:o,mirror:dC,sampling:v.canvas,dataURLOptions:w});const Y=new ZS({mutationCb:j,scrollCb:z,bypassOptions:{blockClass:s,blockSelector:o,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskInputOptions:L,dataURLOptions:w,maskTextFn:m,maskInputFn:f,recordCanvas:C,inlineImages:E,sampling:v,slimDOMOptions:F,iframeManager:G,stylesheetManager:V,canvasManager:uC,keepIframeSrcFn:A,processedNodeManager:Z},mirror:dC});cC=(e=!1)=>{if(!S)return;lC({type:dS.Meta,data:{href:window.location.href,width:Qb(),height:Hb()}},e),V.reset(),Y.init(),MS.forEach(e=>e.lock());const t=function(e,t){const{mirror:r=new bd,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,slimDOM:p=!1,dataURLOptions:f,preserveWhiteSpace:m,onSerialize:g,onIframeLoad:y,iframeLoadTimeout:v,onStylesheetLoad:w,stylesheetLoadTimeout:b,keepIframeSrcFn:S=()=>!1,applyBackgroundColorToBlockedElements:C=!1}=t||{};return Xd(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,slimDOMOptions:!0===p||"all"===p?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===p,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===p?{}:p,dataURLOptions:f,inlineImages:l,recordCanvas:c,preserveWhiteSpace:m,onSerialize:g,onIframeLoad:y,iframeLoadTimeout:v,onStylesheetLoad:w,stylesheetLoadTimeout:b,keepIframeSrcFn:S,newlyAddedElement:!1,applyBackgroundColorToBlockedElements:C})}(document,{mirror:dC,blockClass:s,blockSelector:o,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskAllInputs:L,maskTextFn:m,maskInputFn:f,slimDOM:F,dataURLOptions:w,recordCanvas:C,inlineImages:E,applyBackgroundColorToBlockedElements:N,onSerialize:e=>{oS(e,dC)&&G.addIframe(e),iS(e,dC)&&V.trackLinkElement(e),aS(e)&&Y.addShadowRoot(Vb.shadowRoot(e),document)},onIframeLoad:(e,t)=>{G.attachIframe(e,t),Y.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{V.attachLinkElement(e,t)},keepIframeSrcFn:A});if(!t)return console.warn("Failed to snapshot the document");lC({type:dS.FullSnapshot,data:{node:t,initialOffset:Xb(window)}},e),MS.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&V.adoptStyleSheets(document.adoptedStyleSheets,dC.getId(document))};try{const e=[],t=e=>{var t;return RS(jS)({mutationCb:j,mousemoveCb:(e,t)=>lC({type:dS.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>lC({type:dS.IncrementalSnapshot,data:{source:pS.MouseInteraction,...e}}),scrollCb:z,viewportResizeCb:e=>lC({type:dS.IncrementalSnapshot,data:{source:pS.ViewportResize,...e}}),inputCb:e=>lC({type:dS.IncrementalSnapshot,data:{source:pS.Input,...e}}),mediaInteractionCb:e=>lC({type:dS.IncrementalSnapshot,data:{source:pS.MediaInteraction,...e}}),styleSheetRuleCb:e=>lC({type:dS.IncrementalSnapshot,data:{source:pS.StyleSheetRule,...e}}),styleDeclarationCb:e=>lC({type:dS.IncrementalSnapshot,data:{source:pS.StyleDeclaration,...e}}),canvasMutationCb:W,fontCb:e=>lC({type:dS.IncrementalSnapshot,data:{source:pS.Font,...e}}),selectionCb:e=>{lC({type:dS.IncrementalSnapshot,data:{source:pS.Selection,...e}})},customElementCb:e=>{lC({type:dS.IncrementalSnapshot,data:{source:pS.CustomElement,...e}})},blockClass:s,ignoreClass:i,ignoreSelector:a,maskTextClass:l,maskTextSelector:c,maskInputOptions:L,inlineStylesheet:u,sampling:v,recordDOM:S,recordCanvas:C,inlineImages:E,userTriggeredOnInput:k,collectFonts:O,doc:e,maskInputFn:f,maskTextFn:m,keepIframeSrcFn:A,blockSelector:o,slimDOMOptions:F,dataURLOptions:w,mirror:dC,iframeManager:G,stylesheetManager:V,shadowDomManager:Y,processedNodeManager:Z,canvasManager:uC,ignoreCSSAttributes:M,plugins:(null==(t=null==R?void 0:R.filter(e=>e.observer))?void 0:t.map(e=>({observer:e.observer,options:e.options,callback:t=>lC({type:dS.Plugin,data:{plugin:e.name,payload:t}})})))||[]},g)};G.addLoadListener(r=>{try{e.push(t(r.contentDocument))}catch(e){console.warn(e)}});const r=()=>{cC(),e.push(t(document)),hC=!0};return"interactive"===document.readyState||"complete"===document.readyState?r():(e.push(Gb("DOMContentLoaded",()=>{lC({type:dS.DomContentLoaded,data:{}}),"DOMContentLoaded"===x&&r()})),e.push(Gb("load",()=>{lC({type:dS.Load,data:{}}),"load"===x&&r()},window))),()=>{e.forEach(e=>e()),Z.destroy(),hC=!1,ES=void 0}}catch(e){console.warn(e)}}var fC;pC.addCustomEvent=(e,t)=>{if(!hC)throw new Error("please add custom event after start recording");lC({type:dS.Custom,data:{tag:e,payload:t}})},pC.freezePage=()=>{MS.forEach(e=>e.freeze())},pC.takeFullSnapshot=e=>{if(!hC)throw new Error("please take full snapshot after start recording");cC(e)},pC.mirror=dC,function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(fC||(fC={}));var mC=Object.freeze({__proto__:null,record:pC}),gC=function(){function e(){this.fetchObserver=null}return e.prototype.start=function(e){this.eventCallback=e,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},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 i(e,void 0,void 0,function(){var e,s,o,i,l,c,u;return a(this,function(a){switch(a.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},a.label=1;case 1:return a.trys.push([1,3,,4]),[4,r(t,n)];case 2:return o=a.sent(),c=Date.now(),s.status=o.status,s.duration=c-e,i={},o.headers.forEach(function(e,t){i[t]=e}),s.responseHeaders=i,this.notifyEvent(s),[2,o];case 3:throw l=a.sent(),c=Date.now(),s.duration=c-e,u=l,s.error={name:u.name||"UnknownError",message:u.message||"An unknown error occurred"},this.notifyEvent(s),l;case 4:return[2]}})})},this.fetchObserver=function(){t.fetch=r})}},e}(),yC=Object.freeze({__proto__:null,NetworkObservers:gC});return e.SessionReplayPlugin=Rr,e.plugin=Ar,e.sessionReplayPlugin=Ar,Object.defineProperty(e,"__esModule",{value:!0}),e}({});
2
2
  //# sourceMappingURL=plugin-session-replay-browser-min.js.map