@amplitude/plugin-session-replay-browser 1.13.2-beta.0 → 1.13.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/version.d.ts +1 -1
- package/lib/cjs/version.d.ts.map +1 -1
- package/lib/cjs/version.js +1 -1
- package/lib/cjs/version.js.map +1 -1
- package/lib/esm/version.d.ts +1 -1
- package/lib/esm/version.d.ts.map +1 -1
- package/lib/esm/version.js +1 -1
- package/lib/esm/version.js.map +1 -1
- package/lib/scripts/amplitude-min.js +1 -1
- package/lib/scripts/amplitude-min.js.gz +0 -0
- package/lib/scripts/amplitude-min.umd.js +1 -1
- package/lib/scripts/amplitude-min.umd.js.gz +0 -0
- package/lib/scripts/version.d.ts +1 -1
- package/lib/scripts/version.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
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,i=function(){return i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var s in t=arguments[r])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},i.apply(this,arguments)};function a(e,t,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 l(e,t){var r,n,s,o,i={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(l){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(i=0)),i;)try{if(r=1,n&&(s=2&a[0]?n.return:a[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,a[1])).done)return s;switch(n=0,s&&(a=[2&a[0],s.value]),a[0]){case 0:case 1:s=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(s=i.trys,(s=s.length>0&&s[s.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!s||a[1]>s[0]&&a[1]<s[3])){i.label=a[1];break}if(6===a[0]&&i.label<s[1]){i.label=s[1],s=a;break}if(s&&i.label<s[2]){i.label=s[2],i.ops.push(a);break}s[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],n=0}finally{r=s=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}function c(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 u(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 h(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){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"}(n||(n={})),function(e){e.US="US",e.EU="EU",e.STAGING="STAGING"}(s||(s={})),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"}(o||(o={}));var d="".concat("AMP","_unsent"),p="https://api2.amplitude.com/2/httpapi",f=function(e){return{promise:e||Promise.resolve()}},m="Amplitude Logger ",g=function(){function e(){this.logLevel=n.None}return e.prototype.disable=function(){this.logLevel=n.None},e.prototype.enable=function(e){void 0===e&&(e=n.Warn),this.logLevel=e},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<n.Verbose||console.log("".concat(m,"[Log]: ").concat(e.join(" ")))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<n.Warn||console.warn("".concat(m,"[Warn]: ").concat(e.join(" ")))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<n.Error||console.error("".concat(m,"[Error]: ").concat(e.join(" ")))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<n.Debug||console.log("".concat(m,"[Debug]: ").concat(e.join(" ")))},e}(),y=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,instanceName:"$default_instance",logLevel:n.Warn,loggerProvider:new g,optOut:!1,serverUrl:p,serverZone:s.US,useBatch:!1}},v=function(){function e(e){var t,r,n,s;this._optOut=!1;var o=y();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.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=b(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}(),w=function(e,t){return e===s.EU?t?"https://api.eu.amplitude.com/batch":"https://api.eu.amplitude.com/2/httpapi":t?"https://api2.amplitude.com/batch":p},b=function(e,t,r){if(void 0===e&&(e=""),void 0===t&&(t=y().serverZone),void 0===r&&(r=y().useBatch),e)return{serverUrl:e,serverZone:void 0};var n=["US","EU"].includes(t)?t:y().serverZone;return{serverZone:n,serverUrl:w(n,r)}},S=function(e){return void 0===e&&(e=0),((new Error).stack||"").split("\n").slice(2+e).map((function(e){return e.trim()}))},C=function(e,t,r,s,o){return void 0===o&&(o=null),function(){for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];var l=r(),c=l.logger,u=l.logLevel;if(u&&u<n.Debug||!u||!c)return e.apply(o,i);var h={type:"invoke public method",name:t,args:i,stacktrace:S(1),time:{start:(new Date).toISOString()},states:{}};s&&h.states&&(h.states.before=s());var d=e.apply(o,i);return d&&d.promise?d.promise.then((function(){s&&h.states&&(h.states.after=s()),h.time&&(h.time.end=(new Date).toISOString()),c.debug(JSON.stringify(h,null,2))})):(s&&h.states&&(h.states.after=s()),h.time&&(h.time.end=(new Date).toISOString()),c.debug(JSON.stringify(h,null,2))),d}},I=function(){function e(){}return e.prototype.send=function(e,t){return Promise.resolve(null)},e.prototype.buildResponse=function(e){var t,r,n,s,i,a,l,c,u,h,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 o.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 o.Invalid:return{status:k,statusCode:x,body:{error:null!==(s=e.error)&&void 0!==s?s:"",missingField:null!==(i=e.missing_field)&&void 0!==i?i:"",eventsWithInvalidFields:null!==(a=e.events_with_invalid_fields)&&void 0!==a?a:{},eventsWithMissingFields:null!==(l=e.events_with_missing_fields)&&void 0!==l?l:{},eventsWithInvalidIdLengths:null!==(c=e.events_with_invalid_id_lengths)&&void 0!==c?c:{},epsThreshold:null!==(u=e.eps_threshold)&&void 0!==u?u:0,exceededDailyQuotaDevices:null!==(h=e.exceeded_daily_quota_devices)&&void 0!==h?h:{},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 o.PayloadTooLarge:return{status:k,statusCode:x,body:{error:null!==(g=e.error)&&void 0!==g?g:""}};case o.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 o.Timeout:default:return{status:k,statusCode:x}}},e.prototype.buildStatus=function(e){return e>=200&&e<300?o.Success:429===e?o.RateLimit:413===e?o.PayloadTooLarge:408===e?o.Timeout:e>=400&&e<500?o.Invalid:e>=500?o.Failed:o.Unknown},e}(),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}(),M=function(){return M=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},M.apply(this,arguments)},E=function(e,t){var r=typeof e;if(r!==typeof t)return!1;for(var n=0,s=["string","number","boolean","undefined"];n<s.length;n++){if(s[n]===r)return e===t}if(null==e&&null==t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;var o=Array.isArray(e),i=Array.isArray(t);if(o!==i)return!1;if(!o||!i){var a=Object.keys(e).sort(),l=Object.keys(t).sort();if(!E(a,l))return!1;var c=!0;return Object.keys(e).forEach((function(r){E(e[r],t[r])||(c=!1)})),c}for(var u=0;u<e.length;u++)if(!E(e[u],t[u]))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 R,A=function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var e=this,t=M({},this.identity.userProperties),r=M(M({},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){for(var t=r.userProperties||{},n=0,s=Object.entries(e);n<s.length;n++){var o=s[n],i=o[0],a=o[1];switch(i){case"$set":for(var l=0,c=Object.entries(a);l<c.length;l++){var u=c[l],h=u[0],d=u[1];t[h]=d}break;case"$unset":for(var p=0,f=Object.keys(a);p<f.length;p++){delete t[h=f[p]]}break;case"$clearAll":t={}}}return r.userProperties=t,this},commit:function(){return e.setIdentity(r),this}}},e.prototype.getIdentity=function(){return M({},this.identity)},e.prototype.setIdentity=function(e){var t=M({},this.identity);this.identity=M({},e),E(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}(),P="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:self,T=function(){function e(){this.identityStore=new A,this.eventBridge=new O,this.applicationContextProvider=new x}return e.getInstance=function(t){return P.analyticsConnectorInstances||(P.analyticsConnectorInstances={}),P.analyticsConnectorInstances[t]||(P.analyticsConnectorInstances[t]=new e),P.analyticsConnectorInstances[t]},e}(),N=function(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:void 0},L=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.send=function(e,t){return a(this,void 0,void 0,(function(){var r,n,s;return l(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}(I),D="[Amplitude]",_="".concat(D," Session Replay ID"),F=s.US,U="".concat(D," Session Replay Debug"),B="amp-mask";!function(e){e.GET_SR_PROPS="get-sr-props",e.DEBUG_INFO="debug-info"}(R||(R={}));var j,z=function(){return{flushMaxRetries:2,logLevel:n.Warn,loggerProvider:new g,transportProvider:new L}},W=function(e){function t(t,r){var n,s=this,o=z();return(s=e.call(this,i(i({transportProvider:o.transportProvider},r),{apiKey:t}))||this).flushMaxRetries=void 0!==r.flushMaxRetries&&r.flushMaxRetries<=o.flushMaxRetries?r.flushMaxRetries:o.flushMaxRetries,s.apiKey=t,s.sampleRate=r.sampleRate||0,s.serverZone=r.serverZone||F,s.configServerUrl=r.configServerUrl,s.trackServerUrl=r.trackServerUrl,s.shouldInlineStylesheet=r.shouldInlineStylesheet,s.version=r.version,s.performanceConfig=r.performanceConfig,s.storeType=null!==(n=r.storeType)&&void 0!==n?n:"idb",r.privacyConfig&&(s.privacyConfig=r.privacyConfig),r.debugMode&&(s.debugMode=r.debugMode),r.experimental&&(s.experimental=r.experimental),s}return r(t,e),t}(v),V=Object.defineProperty,q=(e,t,r)=>((e,t,r)=>t in e?V(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),G=Object.defineProperty,Z=(e,t,r)=>((e,t,r)=>t in e?G(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),J=(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))(J||{});const Y={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},K={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},H={};function $(e){if(H[e])return H[e];const t=globalThis[e],r=t.prototype,n=e in Y?Y[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 K?K[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&&!globalThis.Zone)return H[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?H[e]=o:r}catch{return r}}const X={};function Q(e,t,r){var n;const s=`${e}.${String(r)}`;if(X[s])return X[s].call(t);const o=$(e),i=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return i?(X[s]=i,i.call(t)):t[r]}const ee={};function te(e,t,r){const n=`${e}.${String(r)}`;if(ee[n])return ee[n].bind(t);const s=$(e)[r];return"function"!=typeof s?t[r]:(ee[n]=s,s.bind(t))}const re={childNodes:function(e){return Q("Node",e,"childNodes")},parentNode:function(e){return Q("Node",e,"parentNode")},parentElement:function(e){return Q("Node",e,"parentElement")},textContent:function(e){return Q("Node",e,"textContent")},contains:function(e,t){return te("Node",e,"contains")(t)},getRootNode:function(e){return te("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Q("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Q("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Q("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Q("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return $("MutationObserver").constructor}};function ne(e){return e.nodeType===e.ELEMENT_NODE}function se(e){const t=e&&"host"in e&&"mode"in e&&re.host(e)||null;return Boolean(t&&"shadowRoot"in t&&re.shadowRoot(t)===e)}function oe(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function ie(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=>ae(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 ae(e,t){if(function(e){return"styleSheet"in e}(e)){let t;try{t=ie(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?ve(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?ve(r,t):r}}class le{constructor(){Z(this,"idNodeMap",new Map),Z(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 ce({element:e,maskInputOptions:t,tagName:r,type:n,value:s,maskInputFn:o}){let i=s||"";const a=n&&ue(n);return(t[r.toLowerCase()]||a&&t[a])&&(i=o?o(i,e):"*".repeat(i.length)),i}function ue(e){return e.toLowerCase()}const he="__rrweb_original__";function de(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?ue(t):null}function pe(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 fe=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,me=/^(?:[a-z+]+:)?\/\//i,ge=/^www\..*/i,ye=/^(data:)([^,]*),(.*)/i;function ve(e,t){return(e||"").replace(fe,((e,r,n,s,o,i)=>{const a=n||o||i,l=r||s||"";if(!a)return e;if(me.test(a)||ge.test(a))return`url(${l}${a}${l})`;if(ye.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 we(e){return e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"")}function be(e,t){return function(e,t){const r=Array.from(t.childNodes),n=[];if(r.length>1&&e&&"string"==typeof e){const t=we(e);for(let s=1;s<r.length;s++)if(r[s].textContent&&"string"==typeof r[s].textContent){const o=we(r[s].textContent);for(let r=3;r<o.length;r++){const s=o.substring(0,r);if(2===t.split(s).length){const r=t.indexOf(s);for(let t=r;t<e.length;t++)if(we(e.substring(0,t)).length===r){n.push(e.substring(0,t)),e=e.substring(t);break}break}}}}return n.push(e),n}(e,t).join("/* rr_split */")}let Se=1;const Ce=new RegExp("[^a-z0-9-_:]");function Ie(){return Se++}let xe,ke;const Oe=/^[^ \t\n\r\u000c]+/,Me=/^[, \t\n\r\u000c]+/;const Ee=new WeakMap;function Re(e,t){return t&&""!==t.trim()?Pe(e,t):t}function Ae(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function Pe(e,t){let r=Ee.get(e);if(r||(r=e.createElement("a"),Ee.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function Te(e,t,r,n){return n?"src"===r||"href"===r&&("use"!==t||"#"!==n[0])||"xlink:href"===r&&"#"!==n[0]?Re(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(Me),!(r>=t.length);){let o=n(Oe);if(","===o.slice(-1))o=Re(e,o.substring(0,o.length-1)),s.push(o);else{let n="";o=Re(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?ve(n,Pe(e)):"object"===t&&"data"===r?Re(e,n):n:Re(e,n):n}function Ne(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function Le(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&Le(re.parentNode(e),t,r);for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!!r&&Le(re.parentNode(e),t,r)}function De(e,t,r,n){let s;if(ne(e)){if(s=e,!re.childNodes(s).length)return!1}else{if(null===re.parentElement(e))return!1;s=re.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(Le(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 _e(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}=t,y=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:J.Document,childNodes:[],compatMode:e.compatMode}:{type:J.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:J.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:y};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}=t,f=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),m=function(e){if(e instanceof HTMLFormElement)return"form";const t=ue(e.tagName);return Ce.test(t)?"div":t}(e);let g={};const y=e.attributes.length;for(let t=0;t<y;t++){const n=e.attributes[t];Ne(m,n.name,n.value)||(g[n.name]=Te(r,m,ue(n.name),n.value))}if("link"===m&&o){const t=Array.from(r.styleSheets).find((t=>t.href===e.href));let n=null;t&&(n=ie(t)),n&&(delete g.rel,delete g.href,g._cssText=n)}if("style"===m&&e.sheet){let t=ie(e.sheet);t&&(e.childNodes.length>1&&(t=be(t,e)),g._cssText=t)}if("input"===m||"textarea"===m||"select"===m){const t=e.value,r=e.checked;"radio"!==g.type&&"checkbox"!==g.type&&"submit"!==g.type&&"button"!==g.type&&t?g.value=ce({element:e,type:de(e),tagName:m,value:t,maskInputOptions:i,maskInputFn:a}):r&&(g.checked=r)}"option"===m&&(e.selected&&!i.select?g.selected=!0:delete g.selected);"dialog"===m&&e.open&&(g.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal");if("canvas"===m&&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=he in s?s[he]: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)||(g.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)&&(g.rr_dataURL=t)}if("img"===m&&c){xe||(xe=r.createElement("canvas"),ke=xe.getContext("2d"));const t=e,n=t.currentSrc||t.getAttribute("src")||"<unknown-src>",s=t.crossOrigin,o=()=>{t.removeEventListener("load",o);try{xe.width=t.naturalWidth,xe.height=t.naturalHeight,ke.drawImage(t,0,0),g.rr_dataURL=xe.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?g.crossOrigin=s:t.removeAttribute("crossorigin"))};t.complete&&0!==t.naturalWidth?o():t.addEventListener("load",o)}if("audio"===m||"video"===m){const t=g;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&&(g.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(g.rr_scrollTop=e.scrollTop));if(f){const{width:t,height:r}=e.getBoundingClientRect();g={class:g.class,rr_width:`${t}px`,rr_height:`${r}px`}}"iframe"!==m||h(g.src)||(e.contentDocument||(g.rr_src=g.src),delete g.src);let v;try{customElements.get(m)&&(v=!0)}catch(e){}return{type:J.Element,tagName:m,attributes:g,childNodes:[],isSVG:Ae(e)||void 0,needBlock:f,rootId:p,isCustom:v}}(e,{doc:r,blockClass:s,blockSelector:o,inlineStylesheet:a,maskInputOptions:l,maskInputFn:u,dataURLOptions:h,inlineImages:d,recordCanvas:p,keepIframeSrcFn:f,newlyAddedElement:m,rootId:y});case e.TEXT_NODE:return function(e,t){const{needsMask:r,maskTextFn:n,rootId:s,cssCaptured:o}=t,i=re.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=re.textContent(e),c&&l&&(l=ve(l,Pe(t.doc))));!c&&!u&&l&&r&&(l=n?n(l,re.parentElement(e)):l.replace(/[\S]/g,"*"));return{type:J.Text,textContent:l||"",rootId:s}}(e,{doc:r,needsMask:i,maskTextFn:c,rootId:y,cssCaptured:g});case e.CDATA_SECTION_NODE:return{type:J.CDATA,textContent:"",rootId:y};case e.COMMENT_NODE:return{type:J.Comment,textContent:re.textContent(e)||"",rootId:y};default:return!1}}function Fe(e){return null==e?"":e.toLowerCase()}function Ue(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}=t;let{needsMask:k}=t,{preserveWhiteSpace:O=!0}=t;if(!k){k=De(e,i,a,void 0===k)}const M=_e(e,{doc:r,mirror:n,blockClass:s,blockSelector:o,needsMask:k,inlineStylesheet:c,maskInputOptions:u,maskTextFn:h,maskInputFn:d,dataURLOptions:f,inlineImages:m,recordCanvas:g,keepIframeSrcFn:C,newlyAddedElement:I,cssCaptured:x});if(!M)return console.warn(e,"not serialized"),null;let E;E=n.hasNode(e)?n.getId(e):function(e,t){if(t.comment&&e.type===J.Comment)return!0;if(e.type===J.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"===pe(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(Fe(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Fe(e.attributes.name)||"icon"===Fe(e.attributes.rel)||"apple-touch-icon"===Fe(e.attributes.rel)||"shortcut icon"===Fe(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&Fe(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Fe(e.attributes.property).match(/^(og|twitter|fb):/)||Fe(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===Fe(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===Fe(e.attributes.name)||"googlebot"===Fe(e.attributes.name)||"bingbot"===Fe(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===Fe(e.attributes.name)||"generator"===Fe(e.attributes.name)||"framework"===Fe(e.attributes.name)||"publisher"===Fe(e.attributes.name)||"progid"===Fe(e.attributes.name)||Fe(e.attributes.property).match(/^article:/)||Fe(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===Fe(e.attributes.name)||"yandex-verification"===Fe(e.attributes.name)||"csrf-token"===Fe(e.attributes.name)||"p:domain_verify"===Fe(e.attributes.name)||"verify-v1"===Fe(e.attributes.name)||"verification"===Fe(e.attributes.name)||"shopify-checkout-api-token"===Fe(e.attributes.name)))return!0}}return!1}(M,p)||!O&&M.type===J.Text&&!M.textContent.replace(/^\s+|\s+$/gm,"").length?-2:Ie();const R=Object.assign(M,{id:E});if(n.add(e,R),-2===E)return null;y&&y(e);let A=!l;if(R.type===J.Element){A=A&&!R.needBlock,delete R.needBlock;const t=re.shadowRoot(e);t&&oe(t)&&(R.isShadowHost=!0)}if((R.type===J.Document||R.type===J.Element)&&A){p.headWhitespace&&R.type===J.Element&&"head"===R.tagName&&(O=!1);const t={doc:r,mirror:n,blockClass:s,blockSelector:o,needsMask:k,maskTextClass:i,maskTextSelector:a,skipChild:l,inlineStylesheet:c,maskInputOptions:u,maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:f,inlineImages:m,recordCanvas:g,preserveWhiteSpace:O,onSerialize:y,onIframeLoad:v,iframeLoadTimeout:w,onStylesheetLoad:b,stylesheetLoadTimeout:S,keepIframeSrcFn:C,cssCaptured:!1};if(R.type===J.Element&&"textarea"===R.tagName&&void 0!==R.attributes.value);else{R.type===J.Element&&void 0!==R.attributes._cssText&&"string"==typeof R.attributes._cssText&&(t.cssCaptured=!0);for(const r of Array.from(re.childNodes(e))){const e=Ue(r,t);e&&R.childNodes.push(e)}}let I=null;if(ne(e)&&(I=re.shadowRoot(e)))for(const e of Array.from(re.childNodes(I))){const r=Ue(e,t);r&&(oe(I)&&(r.isShadow=!0),R.childNodes.push(r))}}const P=re.parentNode(e);return P&&se(P)&&oe(P)&&(R.isShadow=!0),R.type===J.Element&&"iframe"===R.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=Ue(t,{doc:t,mirror:n,blockClass:s,blockSelector:o,needsMask:k,maskTextClass:i,maskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:f,inlineImages:m,recordCanvas:g,preserveWhiteSpace:O,onSerialize:y,onIframeLoad:v,iframeLoadTimeout:w,onStylesheetLoad:b,stylesheetLoadTimeout:S,keepIframeSrcFn:C});r&&v(e,r)}}),w),R.type===J.Element&&"link"===R.tagName&&"string"==typeof R.attributes.rel&&("stylesheet"===R.attributes.rel||"preload"===R.attributes.rel&&"string"==typeof R.attributes.href&&"css"===pe(R.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=Ue(e,{doc:r,mirror:n,blockClass:s,blockSelector:o,needsMask:k,maskTextClass:i,maskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:f,inlineImages:m,recordCanvas:g,preserveWhiteSpace:O,onSerialize:y,onIframeLoad:v,iframeLoadTimeout:w,onStylesheetLoad:b,stylesheetLoadTimeout:S,keepIframeSrcFn:C});t&&b(e,t)}}),S),R}function Be(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function je(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 ze={exports:{}},We=String,Ve=function(){return{isColorSupported:!1,reset:We,bold:We,dim:We,italic:We,underline:We,inverse:We,hidden:We,strikethrough:We,black:We,red:We,green:We,yellow:We,blue:We,magenta:We,cyan:We,white:We,gray:We,bgBlack:We,bgRed:We,bgGreen:We,bgYellow:We,bgBlue:We,bgMagenta:We,bgCyan:We,bgWhite:We}};ze.exports=Ve(),ze.exports.createColors=Ve;var qe=ze.exports;const Ge=je(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let Ze=qe,Je=Ge,Ye=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=Ze.isColorSupported),Je&&e&&(t=Je(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}=Ze.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 Ke=Ye;Ye.default=Ye;var He={};He.isClean=Symbol("isClean"),He.my=Symbol("my");const $e={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let Xe=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 $e[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=$e[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 Qe=Xe;Xe.default=Xe;let et=Qe;function tt(e,t){new et(t).stringify(e)}var rt=tt;tt.default=tt;let{isClean:nt,my:st}=He,ot=Ke,it=Qe,at=rt;function lt(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=>lt(e,r))):("object"===o&&null!==s&&(s=lt(s)),r[n]=s)}return r}let ct=class{constructor(e={}){this.raws={},this[nt]=!1,this[st]=!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=lt(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 ot(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[nt]){this[nt]=!1;let e=this;for(;e=e.parent;)e[nt]=!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 it).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=at){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 ut=ct;ct.default=ct;let ht=ut,dt=class extends ht{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 pt=dt;dt.default=dt;var ft={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:mt,SourceMapGenerator:gt}=Ge,{existsSync:yt,readFileSync:vt}=Ge,{dirname:wt,join:bt}=Ge;let St=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=wt(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new mt(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=wt(e),yt(e))return this.mapFile=e,vt(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 mt)return gt.fromSourceMap(t).toString();if(t instanceof gt)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=bt(wt(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 Ct=St;St.default=St;let{SourceMapConsumer:It,SourceMapGenerator:xt}=Ge,{fileURLToPath:kt,pathToFileURL:Ot}=Ge,{isAbsolute:Mt,resolve:Et}=Ge,{nanoid:Rt}=ft,At=Ge,Pt=Ke,Tt=Ct,Nt=Symbol("fromOffsetCache"),Lt=Boolean(It&&xt),Dt=Boolean(Et&&Mt),_t=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&&(!Dt||/^\w+:\/\//.test(t.from)||Mt(t.from)?this.file=t.from:this.file=Et(t.from)),Dt&&Lt){let e=new Tt(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 "+Rt(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 Pt(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 Pt(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&&(Ot&&(s.input.url=Ot(this.file).toString()),s.input.file=this.file),s}fromOffset(e){let t,r;if(this[Nt])r=this[Nt];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[Nt]=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:Et(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=Mt(a.source)?Ot(a.source):new URL(a.source,this.map.consumer().sourceRoot||Ot(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(!kt)throw new Error("file: protocol is not available in this PostCSS build");l.file=kt(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 Ft=_t;_t.default=_t,At&&At.registerInput&&At.registerInput(_t);let{SourceMapConsumer:Ut,SourceMapGenerator:Bt}=Ge,{dirname:jt,relative:zt,resolve:Wt,sep:Vt}=Ge,{pathToFileURL:qt}=Ge,Gt=Ft,Zt=Boolean(Ut&&Bt),Jt=Boolean(jt&&Wt&&zt&&Vt);var Yt=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||jt(e.file);!1===this.mapOpts.sourcesContent?(t=new Ut(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(),Jt&&Zt&&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=Bt.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new Bt({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 Bt({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?jt(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=jt(Wt(r,this.mapOpts.annotation)));let n=zt(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 Gt(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(qt){let t=qt(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;"\\"===Vt&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let Kt=ut,Ht=class extends Kt{constructor(e){super(e),this.type="comment"}};var $t=Ht;Ht.default=Ht;let Xt,Qt,er,tr,{isClean:rr,my:nr}=He,sr=pt,or=$t,ir=ut;function ar(e){return e.map((e=>(e.nodes&&(e.nodes=ar(e.nodes)),delete e.source,e)))}function lr(e){if(e[rr]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)lr(t)}let cr=class e extends ir{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=ar(Xt(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 sr(t)]}else if(t.selector)t=[new Qt(t)];else if(t.name)t=[new er(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new or(t)]}return t.map((t=>(t[nr]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[rr]&&lr(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]}};cr.registerParse=e=>{Xt=e},cr.registerRule=e=>{Qt=e},cr.registerAtRule=e=>{er=e},cr.registerRoot=e=>{tr=e};var ur=cr;cr.default=cr,cr.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,er.prototype):"rule"===e.type?Object.setPrototypeOf(e,Qt.prototype):"decl"===e.type?Object.setPrototypeOf(e,sr.prototype):"comment"===e.type?Object.setPrototypeOf(e,or.prototype):"root"===e.type&&Object.setPrototypeOf(e,tr.prototype),e[nr]=!0,e.nodes&&e.nodes.forEach((e=>{cr.rebuild(e)}))};let hr,dr,pr=ur,fr=class extends pr{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new hr(new dr,this,e).stringify()}};fr.registerLazyResult=e=>{hr=e},fr.registerProcessor=e=>{dr=e};var mr=fr;fr.default=fr;let gr={};var yr=function(e){gr[e]||(gr[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let vr=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 wr=vr;vr.default=vr;let br=wr,Sr=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 br(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter((e=>"warning"===e.type))}get content(){return this.css}};var Cr=Sr;Sr.default=Sr;const Ir="'".charCodeAt(0),xr='"'.charCodeAt(0),kr="\\".charCodeAt(0),Or="/".charCodeAt(0),Mr="\n".charCodeAt(0),Er=" ".charCodeAt(0),Rr="\f".charCodeAt(0),Ar="\t".charCodeAt(0),Pr="\r".charCodeAt(0),Tr="[".charCodeAt(0),Nr="]".charCodeAt(0),Lr="(".charCodeAt(0),Dr=")".charCodeAt(0),_r="{".charCodeAt(0),Fr="}".charCodeAt(0),Ur=";".charCodeAt(0),Br="*".charCodeAt(0),jr=":".charCodeAt(0),zr="@".charCodeAt(0),Wr=/[\t\n\f\r "#'()/;[\\\]{}]/g,Vr=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,qr=/.[\r\n"'(/\\]/,Gr=/[\da-f]/i;let Zr=ur,Jr=class extends Zr{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 Yr=Jr;Jr.default=Jr,Zr.registerAtRule(Jr);let Kr,Hr,$r=ur,Xr=class extends $r{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){let n=super.normalize(e);if(t)if("prepend"===r)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of n)e.raws.before=t.raws.before;return n}removeChild(e,t){let r=this.index(e);return!t&&0===r&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(e={}){return new Kr(new Hr,this,e).stringify()}};Xr.registerLazyResult=e=>{Kr=e},Xr.registerProcessor=e=>{Hr=e};var Qr=Xr;Xr.default=Xr,$r.registerRoot(Xr);let en={comma:e=>en.split(e,[","],!0),space:e=>en.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 tn=en;en.default=en;let rn=ur,nn=tn,sn=class extends rn{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return nn.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 on=sn;sn.default=sn,rn.registerRule(sn);let an=pt,ln=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 Mr:case Er:case Ar:case Pr:case Rr:n=m;do{n+=1,r=d.charCodeAt(n)}while(r===Er||r===Mr||r===Ar||r===Pr||r===Rr);h=["space",d.slice(m,n)],m=n-1;break;case Tr:case Nr:case _r:case Fr:case jr:case Ur:case Dr:{let e=String.fromCharCode(r);h=[e,e,m];break}case Lr:if(c=g.length?g.pop()[1]:"",u=d.charCodeAt(m+1),"url"===c&&u!==Ir&&u!==xr&&u!==Er&&u!==Mr&&u!==Ar&&u!==Rr&&u!==Pr){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)===kr;)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||qr.test(o)?h=["(","(",m]:(h=["brackets",o,m,n],m=n);break;case Ir:case xr:s=r===Ir?"'":'"',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)===kr;)l-=1,a=!a}while(a);h=["string",d.slice(m,n+1),m,n],m=n;break;case zr:Wr.lastIndex=m+1,Wr.test(d),n=0===Wr.lastIndex?d.length-1:Wr.lastIndex-2,h=["at-word",d.slice(m,n+1),m,n],m=n;break;case kr:for(n=m,i=!0;d.charCodeAt(n+1)===kr;)n+=1,i=!i;if(r=d.charCodeAt(n+1),i&&r!==Or&&r!==Er&&r!==Mr&&r!==Ar&&r!==Pr&&r!==Rr&&(n+=1,Gr.test(d.charAt(n)))){for(;Gr.test(d.charAt(n+1));)n+=1;d.charCodeAt(n+1)===Er&&(n+=1)}h=["word",d.slice(m,n+1),m,n],m=n;break;default:r===Or&&d.charCodeAt(m+1)===Br?(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):(Vr.lastIndex=m+1,Vr.test(d),n=0===Vr.lastIndex?d.length-1:Vr.lastIndex-2,h=["word",d.slice(m,n+1),m,n],g.push(h),m=n)}return m++,h},position:function(){return m}}},cn=$t,un=Yr,hn=Qr,dn=on;const pn={empty:!0,space:!0};var fn=class{constructor(e){this.input=e,this.root=new hn,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 un;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 cn;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=ln(this.input)}decl(e,t){let r=new an;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 dn;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",pn[a]||pn[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 dn;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 mn=ur,gn=fn,yn=Ft;function vn(e,t){let r=new yn(e,t),n=new gn(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 wn=vn;vn.default=vn,mn.registerParse(vn);let{isClean:bn,my:Sn}=He,Cn=Yt,In=rt,xn=ur,kn=mr,On=yr,Mn=Cr,En=wn,Rn=Qr;const An={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Pn={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},Tn={Once:!0,postcssPlugin:!0,prepare:!0};function Nn(e){return"object"==typeof e&&"function"==typeof e.then}function Ln(e){let t=!1,r=An[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 Dn(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:Ln(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function _n(e){return e[bn]=!1,e.nodes&&e.nodes.forEach((e=>_n(e))),e}let Fn={},Un=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 Mn)s=_n(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=En;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[Sn]&&xn.rebuild(s)}else s=_n(r);this.result=new Mn(t,s,n),this.helpers={...Fn,postcss:Fn,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(!Pn[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Tn[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(Nn(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[bn];){e[bn]=!0;let t=[Dn(e)];for(;t.length>0;){let e=this.visitTick(t);if(Nn(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 Nn(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=In;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new Cn(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(Nn(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[bn];)e[bn]=!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||On("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(Nn(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[bn])return n[bn]=!0,void e.push(Dn(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[bn]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[bn]=!0;let t=Ln(e);for(let r of t)if(0===r)e.nodes&&e.each((e=>{e[bn]||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"}};Un.registerPostcss=e=>{Fn=e};var Bn=Un;Un.default=Un,Rn.registerLazyResult(Un),kn.registerLazyResult(Un);let jn=Yt,zn=rt,Wn=yr,Vn=wn;const qn=Cr;let Gn=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=zn;this.result=new qn(this._processor,n,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let i=new jn(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||Wn("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=Vn;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 Zn=Gn;Gn.default=Gn;let Jn=Zn,Yn=Bn,Kn=mr,Hn=Qr,$n=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 Yn(this,e,t):new Jn(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var Xn=$n;$n.default=$n,Hn.registerProcessor($n),Kn.registerProcessor($n);let Qn=pt,es=Ct,ts=$t,rs=Yr,ns=Ft,ss=Qr,os=on;function is(e,t){if(Array.isArray(e))return e.map((e=>is(e)));let{inputs:r,...n}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:ns.prototype};r.map&&(r.map={...r.map,__proto__:es.prototype}),t.push(r)}}if(n.nodes&&(n.nodes=e.nodes.map((e=>is(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 ss(n);if("decl"===n.type)return new Qn(n);if("rule"===n.type)return new os(n);if("comment"===n.type)return new ts(n);if("atrule"===n.type)return new rs(n);throw new Error("Unknown node type: "+e.type)}var as=is;is.default=is;let ls=Ke,cs=pt,us=Bn,hs=ur,ds=Xn,ps=rt,fs=as,ms=mr,gs=wr,ys=$t,vs=Yr,ws=Cr,bs=Ft,Ss=wn,Cs=tn,Is=on,xs=Qr,ks=ut;function Os(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new ds(e)}Os.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 ds).version,s}return Object.defineProperty(s,"postcss",{get:()=>(r||(r=s()),r)}),s.process=function(e,t,r){return Os([s(r)]).process(e,t)},s},Os.stringify=ps,Os.parse=Ss,Os.fromJSON=fs,Os.list=Cs,Os.comment=e=>new ys(e),Os.atRule=e=>new vs(e),Os.decl=e=>new cs(e),Os.rule=e=>new Is(e),Os.root=e=>new xs(e),Os.document=e=>new ms(e),Os.CssSyntaxError=ls,Os.Declaration=cs,Os.Container=hs,Os.Processor=ds,Os.Document=ms,Os.Comment=ys,Os.Warning=gs,Os.AtRule=vs,Os.Result=ws,Os.Input=bs,Os.Rule=Is,Os.Root=xs,Os.Node=ks,us.registerPostcss(Os);var Ms=Os;Os.default=Os;const Es=Be(Ms);Es.stringify,Es.fromJSON,Es.plugin,Es.parse,Es.list,Es.document,Es.comment,Es.atRule,Es.rule,Es.decl,Es.root,Es.CssSyntaxError,Es.Declaration,Es.Container,Es.Processor,Es.Document,Es.Comment,Es.Warning,Es.AtRule,Es.Result,Es.Input,Es.Rule,Es.Root,Es.Node;var Rs=Object.defineProperty,As=(e,t,r)=>((e,t,r)=>t in e?Rs(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);function Ps(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Ts(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 Ns={exports:{}},Ls=String,Ds=function(){return{isColorSupported:!1,reset:Ls,bold:Ls,dim:Ls,italic:Ls,underline:Ls,inverse:Ls,hidden:Ls,strikethrough:Ls,black:Ls,red:Ls,green:Ls,yellow:Ls,blue:Ls,magenta:Ls,cyan:Ls,white:Ls,gray:Ls,bgBlack:Ls,bgRed:Ls,bgGreen:Ls,bgYellow:Ls,bgBlue:Ls,bgMagenta:Ls,bgCyan:Ls,bgWhite:Ls}};Ns.exports=Ds(),Ns.exports.createColors=Ds;var _s=Ns.exports;const Fs=Ts(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let Us=_s,Bs=Fs,js=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=Us.isColorSupported),Bs&&e&&(t=Bs(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}=Us.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 zs=js;js.default=js;var Ws={};Ws.isClean=Symbol("isClean"),Ws.my=Symbol("my");const Vs={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let qs=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 Vs[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=Vs[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 Gs=qs;qs.default=qs;let Zs=Gs;function Js(e,t){new Zs(t).stringify(e)}var Ys=Js;Js.default=Js;let{isClean:Ks,my:Hs}=Ws,$s=zs,Xs=Gs,Qs=Ys;function eo(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=>eo(e,r))):("object"===o&&null!==s&&(s=eo(s)),r[n]=s)}return r}let to=class{constructor(e={}){this.raws={},this[Ks]=!1,this[Hs]=!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=eo(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 $s(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[Ks]){this[Ks]=!1;let e=this;for(;e=e.parent;)e[Ks]=!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 Xs).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=Qs){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 ro=to;to.default=to;let no=ro,so=class extends no{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 oo=so;so.default=so;var io={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:ao,SourceMapGenerator:lo}=Fs,{existsSync:co,readFileSync:uo}=Fs,{dirname:ho,join:po}=Fs;let fo=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=ho(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new ao(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=ho(e),co(e))return this.mapFile=e,uo(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 ao)return lo.fromSourceMap(t).toString();if(t instanceof lo)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=po(ho(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 mo=fo;fo.default=fo;let{SourceMapConsumer:go,SourceMapGenerator:yo}=Fs,{fileURLToPath:vo,pathToFileURL:wo}=Fs,{isAbsolute:bo,resolve:So}=Fs,{nanoid:Co}=io,Io=Fs,xo=zs,ko=mo,Oo=Symbol("fromOffsetCache"),Mo=Boolean(go&&yo),Eo=Boolean(So&&bo),Ro=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&&(!Eo||/^\w+:\/\//.test(t.from)||bo(t.from)?this.file=t.from:this.file=So(t.from)),Eo&&Mo){let e=new ko(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 "+Co(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 xo(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 xo(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&&(wo&&(s.input.url=wo(this.file).toString()),s.input.file=this.file),s}fromOffset(e){let t,r;if(this[Oo])r=this[Oo];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[Oo]=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:So(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=bo(a.source)?wo(a.source):new URL(a.source,this.map.consumer().sourceRoot||wo(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(!vo)throw new Error("file: protocol is not available in this PostCSS build");l.file=vo(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 Ao=Ro;Ro.default=Ro,Io&&Io.registerInput&&Io.registerInput(Ro);let{SourceMapConsumer:Po,SourceMapGenerator:To}=Fs,{dirname:No,relative:Lo,resolve:Do,sep:_o}=Fs,{pathToFileURL:Fo}=Fs,Uo=Ao,Bo=Boolean(Po&&To),jo=Boolean(No&&Do&&Lo&&_o);var zo=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||No(e.file);!1===this.mapOpts.sourcesContent?(t=new Po(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(),jo&&Bo&&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=To.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new To({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 To({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?No(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=No(Do(r,this.mapOpts.annotation)));let n=Lo(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 Uo(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(Fo){let t=Fo(e).toString();return this.memoizedFileURLs.set(e,t),t}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;"\\"===_o&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let Wo=ro,Vo=class extends Wo{constructor(e){super(e),this.type="comment"}};var qo=Vo;Vo.default=Vo;let Go,Zo,Jo,Yo,{isClean:Ko,my:Ho}=Ws,$o=oo,Xo=qo,Qo=ro;function ei(e){return e.map((e=>(e.nodes&&(e.nodes=ei(e.nodes)),delete e.source,e)))}function ti(e){if(e[Ko]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)ti(t)}let ri=class e extends Qo{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=ei(Go(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 $o(t)]}else if(t.selector)t=[new Zo(t)];else if(t.name)t=[new Jo(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new Xo(t)]}return t.map((t=>(t[Ho]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[Ko]&&ti(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]}};ri.registerParse=e=>{Go=e},ri.registerRule=e=>{Zo=e},ri.registerAtRule=e=>{Jo=e},ri.registerRoot=e=>{Yo=e};var ni=ri;ri.default=ri,ri.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,Jo.prototype):"rule"===e.type?Object.setPrototypeOf(e,Zo.prototype):"decl"===e.type?Object.setPrototypeOf(e,$o.prototype):"comment"===e.type?Object.setPrototypeOf(e,Xo.prototype):"root"===e.type&&Object.setPrototypeOf(e,Yo.prototype),e[Ho]=!0,e.nodes&&e.nodes.forEach((e=>{ri.rebuild(e)}))};let si,oi,ii=ni,ai=class extends ii{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new si(new oi,this,e).stringify()}};ai.registerLazyResult=e=>{si=e},ai.registerProcessor=e=>{oi=e};var li=ai;ai.default=ai;let ci={};var ui=function(e){ci[e]||(ci[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let hi=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 di=hi;hi.default=hi;let pi=di,fi=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 pi(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter((e=>"warning"===e.type))}get content(){return this.css}};var mi=fi;fi.default=fi;const gi="'".charCodeAt(0),yi='"'.charCodeAt(0),vi="\\".charCodeAt(0),wi="/".charCodeAt(0),bi="\n".charCodeAt(0),Si=" ".charCodeAt(0),Ci="\f".charCodeAt(0),Ii="\t".charCodeAt(0),xi="\r".charCodeAt(0),ki="[".charCodeAt(0),Oi="]".charCodeAt(0),Mi="(".charCodeAt(0),Ei=")".charCodeAt(0),Ri="{".charCodeAt(0),Ai="}".charCodeAt(0),Pi=";".charCodeAt(0),Ti="*".charCodeAt(0),Ni=":".charCodeAt(0),Li="@".charCodeAt(0),Di=/[\t\n\f\r "#'()/;[\\\]{}]/g,_i=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Fi=/.[\r\n"'(/\\]/,Ui=/[\da-f]/i;let Bi=ni,ji=class extends Bi{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 zi=ji;ji.default=ji,Bi.registerAtRule(ji);let Wi,Vi,qi=ni,Gi=class extends qi{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 Wi(new Vi,this,e).stringify()}};Gi.registerLazyResult=e=>{Wi=e},Gi.registerProcessor=e=>{Vi=e};var Zi=Gi;Gi.default=Gi,qi.registerRoot(Gi);let Ji={comma:e=>Ji.split(e,[","],!0),space:e=>Ji.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 Yi=Ji;Ji.default=Ji;let Ki=ni,Hi=Yi,$i=class extends Ki{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Hi.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 Xi=$i;$i.default=$i,Ki.registerRule($i);let Qi=oo,ea=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 bi:case Si:case Ii:case xi:case Ci:n=m;do{n+=1,r=d.charCodeAt(n)}while(r===Si||r===bi||r===Ii||r===xi||r===Ci);h=["space",d.slice(m,n)],m=n-1;break;case ki:case Oi:case Ri:case Ai:case Ni:case Pi:case Ei:{let e=String.fromCharCode(r);h=[e,e,m];break}case Mi:if(c=g.length?g.pop()[1]:"",u=d.charCodeAt(m+1),"url"===c&&u!==gi&&u!==yi&&u!==Si&&u!==bi&&u!==Ii&&u!==Ci&&u!==xi){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)===vi;)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||Fi.test(o)?h=["(","(",m]:(h=["brackets",o,m,n],m=n);break;case gi:case yi:s=r===gi?"'":'"',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)===vi;)l-=1,a=!a}while(a);h=["string",d.slice(m,n+1),m,n],m=n;break;case Li:Di.lastIndex=m+1,Di.test(d),n=0===Di.lastIndex?d.length-1:Di.lastIndex-2,h=["at-word",d.slice(m,n+1),m,n],m=n;break;case vi:for(n=m,i=!0;d.charCodeAt(n+1)===vi;)n+=1,i=!i;if(r=d.charCodeAt(n+1),i&&r!==wi&&r!==Si&&r!==bi&&r!==Ii&&r!==xi&&r!==Ci&&(n+=1,Ui.test(d.charAt(n)))){for(;Ui.test(d.charAt(n+1));)n+=1;d.charCodeAt(n+1)===Si&&(n+=1)}h=["word",d.slice(m,n+1),m,n],m=n;break;default:r===wi&&d.charCodeAt(m+1)===Ti?(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):(_i.lastIndex=m+1,_i.test(d),n=0===_i.lastIndex?d.length-1:_i.lastIndex-2,h=["word",d.slice(m,n+1),m,n],g.push(h),m=n)}return m++,h},position:function(){return m}}},ta=qo,ra=zi,na=Zi,sa=Xi;const oa={empty:!0,space:!0};var ia=class{constructor(e){this.input=e,this.root=new na,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 ra;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 ta;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=ea(this.input)}decl(e,t){let r=new Qi;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 sa;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",oa[a]||oa[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 sa;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 aa=ni,la=ia,ca=Ao;function ua(e,t){let r=new ca(e,t),n=new la(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 ha=ua;ua.default=ua,aa.registerParse(ua);let{isClean:da,my:pa}=Ws,fa=zo,ma=Ys,ga=ni,ya=li,va=ui,wa=mi,ba=ha,Sa=Zi;const Ca={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Ia={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},xa={Once:!0,postcssPlugin:!0,prepare:!0};function ka(e){return"object"==typeof e&&"function"==typeof e.then}function Oa(e){let t=!1,r=Ca[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 Ma(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:Oa(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function Ea(e){return e[da]=!1,e.nodes&&e.nodes.forEach((e=>Ea(e))),e}let Ra={},Aa=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 wa)s=Ea(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=ba;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[pa]&&ga.rebuild(s)}else s=Ea(r);this.result=new wa(t,s,n),this.helpers={...Ra,postcss:Ra,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(!Ia[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!xa[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(ka(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[da];){e[da]=!0;let t=[Ma(e)];for(;t.length>0;){let e=this.visitTick(t);if(ka(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 ka(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=ma;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new fa(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(ka(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[da];)e[da]=!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||va("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(ka(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[da])return n[da]=!0,void e.push(Ma(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[da]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[da]=!0;let t=Oa(e);for(let r of t)if(0===r)e.nodes&&e.each((e=>{e[da]||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"}};Aa.registerPostcss=e=>{Ra=e};var Pa=Aa;Aa.default=Aa,Sa.registerLazyResult(Aa),ya.registerLazyResult(Aa);let Ta=zo,Na=Ys,La=ui,Da=ha;const _a=mi;let Fa=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=Na;this.result=new _a(this._processor,n,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let i=new Ta(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||La("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=Da;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 Ua=Fa;Fa.default=Fa;let Ba=Ua,ja=Pa,za=li,Wa=Zi,Va=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 ja(this,e,t):new Ba(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var qa=Va;Va.default=Va,Wa.registerProcessor(Va),za.registerProcessor(Va);let Ga=oo,Za=mo,Ja=qo,Ya=zi,Ka=Ao,Ha=Zi,$a=Xi;function Xa(e,t){if(Array.isArray(e))return e.map((e=>Xa(e)));let{inputs:r,...n}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:Ka.prototype};r.map&&(r.map={...r.map,__proto__:Za.prototype}),t.push(r)}}if(n.nodes&&(n.nodes=e.nodes.map((e=>Xa(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 Ha(n);if("decl"===n.type)return new Ga(n);if("rule"===n.type)return new $a(n);if("comment"===n.type)return new Ja(n);if("atrule"===n.type)return new Ya(n);throw new Error("Unknown node type: "+e.type)}var Qa=Xa;Xa.default=Xa;let el=zs,tl=oo,rl=Pa,nl=ni,sl=qa,ol=Ys,il=Qa,al=li,ll=di,cl=qo,ul=zi,hl=mi,dl=Ao,pl=ha,fl=Yi,ml=Xi,gl=Zi,yl=ro;function vl(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new sl(e)}vl.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 sl).version,s}return Object.defineProperty(s,"postcss",{get:()=>(r||(r=s()),r)}),s.process=function(e,t,r){return vl([s(r)]).process(e,t)},s},vl.stringify=ol,vl.parse=pl,vl.fromJSON=il,vl.list=fl,vl.comment=e=>new cl(e),vl.atRule=e=>new ul(e),vl.decl=e=>new tl(e),vl.rule=e=>new ml(e),vl.root=e=>new gl(e),vl.document=e=>new al(e),vl.CssSyntaxError=el,vl.Declaration=tl,vl.Container=nl,vl.Processor=sl,vl.Document=al,vl.Comment=cl,vl.Warning=ll,vl.AtRule=ul,vl.Result=hl,vl.Input=dl,vl.Rule=ml,vl.Root=gl,vl.Node=yl,rl.registerPostcss(vl);var wl=vl;vl.default=vl;const bl=Ps(wl);bl.stringify,bl.fromJSON,bl.plugin,bl.parse,bl.list,bl.document,bl.comment,bl.atRule,bl.rule,bl.decl,bl.root,bl.CssSyntaxError,bl.Declaration,bl.Container,bl.Processor,bl.Document,bl.Comment,bl.Warning,bl.AtRule,bl.Result,bl.Input,bl.Rule,bl.Root,bl.Node;class Sl{constructor(...e){As(this,"parentElement",null),As(this,"parentNode",null),As(this,"ownerDocument"),As(this,"firstChild",null),As(this,"lastChild",null),As(this,"previousSibling",null),As(this,"nextSibling",null),As(this,"ELEMENT_NODE",1),As(this,"TEXT_NODE",3),As(this,"nodeType"),As(this,"nodeName"),As(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 Sl))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 Cl={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Il={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},xl={};function kl(e){if(xl[e])return xl[e];const t=globalThis[e],r=t.prototype,n=e in Cl?Cl[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 Il?Il[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&&!globalThis.Zone)return xl[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?xl[e]=o:r}catch{return r}}const Ol={};function Ml(e,t,r){var n;const s=`${e}.${String(r)}`;if(Ol[s])return Ol[s].call(t);const o=kl(e),i=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return i?(Ol[s]=i,i.call(t)):t[r]}const El={};function Rl(e,t,r){const n=`${e}.${String(r)}`;if(El[n])return El[n].bind(t);const s=kl(e)[r];return"function"!=typeof s?t[r]:(El[n]=s,s.bind(t))}function Al(){return kl("MutationObserver").constructor}const Pl={childNodes:function(e){return Ml("Node",e,"childNodes")},parentNode:function(e){return Ml("Node",e,"parentNode")},parentElement:function(e){return Ml("Node",e,"parentElement")},textContent:function(e){return Ml("Node",e,"textContent")},contains:function(e,t){return Rl("Node",e,"contains")(t)},getRootNode:function(e){return Rl("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Ml("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Ml("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Ml("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Ml("Element",e,"querySelectorAll")(t)},mutationObserver:Al};function Tl(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}const Nl="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 Ll={map:{},getId:()=>(console.error(Nl),-1),getNode:()=>(console.error(Nl),null),removeNodeFromMap(){console.error(Nl)},has:()=>(console.error(Nl),!1),reset(){console.error(Nl)}};function Dl(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 _l(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)}}),()=>_l(e,t,o||{},!0)}function Fl(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&&(Ll=new Proxy(Ll,{get:(e,t,r)=>("map"===t&&console.error(Nl),Reflect.get(e,t,r))}));let Ul=Date.now;function Bl(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=Pl.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=Pl.parentElement(o.body))?void 0:n.scrollTop)||(null==(s=null==o?void 0:o.body)?void 0:s.scrollTop)||0}}function jl(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function zl(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Wl(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:Pl.parentElement(e)}function Vl(e,t,r,n){if(!e)return!1;const s=Wl(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(Le(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 ql(e,t){return-1!==t.getId(e)}function Gl(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||-2===t.getId(e)}function Zl(e,t){if(se(e))return!1;const r=t.getId(e);if(!t.has(r))return!0;const n=Pl.parentNode(e);return(!n||n.nodeType!==e.DOCUMENT_NODE)&&(!n||Zl(n,t))}function Jl(e){return Boolean(e.changedTouches)}function Yl(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}function Kl(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Hl(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function $l(e){return!!e&&(e instanceof Sl&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(Pl.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(Ul=()=>(new Date).getTime());class Xl{constructor(){q(this,"id",1),q(this,"styleIDMap",new WeakMap),q(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 Ql(e){var t;let r=null;return"getRootNode"in e&&(null==(t=Pl.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&Pl.host(Pl.getRootNode(e))&&(r=Pl.host(Pl.getRootNode(e))),r}function ec(e){let t,r=e;for(;t=Ql(r);)r=t;return r}function tc(e){const t=e.ownerDocument;if(!t)return!1;const r=ec(e);return Pl.contains(t,r)}function rc(e){const t=e.ownerDocument;return!!t&&(Pl.contains(t,e)||tc(e))}const nc=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:Xl,get _mirror(){return Ll},closestElementOfNode:Wl,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:ec,getShadowHost:Ql,getWindowHeight:jl,getWindowScroll:Bl,getWindowWidth:zl,hasShadowRoot:$l,hookSetter:_l,inDom:rc,isAncestorRemoved:Zl,isBlocked:Vl,isIgnored:Gl,isSerialized:ql,isSerializedIframe:Kl,isSerializedStylesheet:Hl,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:Jl,get nowTimestamp(){return Ul},on:Tl,patch:Fl,polyfill:Yl,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))}}else if(o in t){const e=t[o];e.children.push(r(s,e))}else n.push(r(s,null))}return n},shadowHostInDom:tc,throttle:Dl,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"}));var sc=(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))(sc||{}),oc=(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))(oc||{}),ic=(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))(ic||{}),ac=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(ac||{}),lc=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(lc||{}),cc=(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))(cc||{}),uc=(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))(uc||{});function hc(e){return"__ln"in e}class dc{constructor(){q(this,"length",0),q(this,"head",null),q(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&&hc(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&&hc(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 pc=(e,t)=>`${e}@${t}`;class fc{constructor(){q(this,"frozen",!1),q(this,"locked",!1),q(this,"texts",[]),q(this,"attributes",[]),q(this,"attributeMap",new WeakMap),q(this,"removes",[]),q(this,"mapRemoves",[]),q(this,"movedMap",{}),q(this,"addedSet",new Set),q(this,"movedSet",new Set),q(this,"droppedSet",new Set),q(this,"removesSubTreeCache",new Set),q(this,"mutationCb"),q(this,"blockClass"),q(this,"blockSelector"),q(this,"maskTextClass"),q(this,"maskTextSelector"),q(this,"inlineStylesheet"),q(this,"maskInputOptions"),q(this,"maskTextFn"),q(this,"maskInputFn"),q(this,"keepIframeSrcFn"),q(this,"recordCanvas"),q(this,"inlineImages"),q(this,"slimDOMOptions"),q(this,"dataURLOptions"),q(this,"doc"),q(this,"mirror"),q(this,"iframeManager"),q(this,"stylesheetManager"),q(this,"shadowDomManager"),q(this,"canvasManager"),q(this,"processedNodeManager"),q(this,"unattachedDoc"),q(this,"processMutations",(e=>{e.forEach(this.processMutation),this.emit()})),q(this,"emit",(()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,r=new dc,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=Pl.parentNode(s);if(!o||!rc(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=se(o)?this.mirror.getId(Ql(s)):this.mirror.getId(o),l=n(s);if(-1===a||-1===l)return r.addNode(s);const c=Ue(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=>{Kl(e,this.mirror)&&this.iframeManager.addIframe(e),Hl(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),$l(s)&&this.shadowDomManager.addShadowRoot(Pl.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)gc(this.removesSubTreeCache,e,this.mirror)&&!this.movedSet.has(Pl.parentNode(e))||s(e);for(const e of this.addedSet)yc(this.droppedSet,e)||gc(this.removesSubTreeCache,e,this.mirror)?yc(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(Pl.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(Pl.parentNode(r.value));if(-1===n(r.value))continue;if(-1!==t){e=r;break}{const t=r.value,n=Pl.parentNode(t);if(n&&n.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const t=Pl.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=Pl.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))})),q(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)),t.attributes.value=Array.from(Pl.childNodes(e),(e=>Pl.textContent(e)||"")).join("")})),q(this,"processMutation",(e=>{if(!Gl(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=Pl.textContent(e.target);Vl(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:De(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,Wl(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=de(t);n=ce({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:e,value:n,maskInputFn:this.maskInputFn})}if(Vl(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"),!Ne(t.tagName,r))if(s.attributes[r]=Te(this.doc,ue(t.tagName),ue(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(Vl(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=se(e.target)?this.mirror.getId(Pl.host(e.target)):this.mirror.getId(e.target);Vl(e.target,this.blockClass,this.blockSelector,!1)||Gl(t,this.mirror,this.slimDOMOptions)||!ql(t,this.mirror)||(this.addedSet.has(t)?(mc(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||Zl(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[pc(r,n)]?mc(this.movedSet,t):(this.removes.push({parentId:n,id:r,isShadow:!(!se(e.target)||!oe(e.target))||void 0}),function(e,t){const r=[e];for(;r.length;){const e=r.pop();t.has(e)||(t.add(e),Pl.childNodes(e).forEach((e=>r.push(e))))}}(t,this.removesSubTreeCache))),this.mapRemoves.push(t))}))}})),q(this,"genAdds",((e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(Gl(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[pc(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Vl(e,this.blockClass,this.blockSelector,!1)||(Pl.childNodes(e).forEach((e=>this.genAdds(e))),$l(e)&&Pl.childNodes(Pl.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 mc(e,t){e.delete(t),Pl.childNodes(t).forEach((t=>mc(e,t)))}function gc(e,t,r){return 0!==e.size&&function(e,t,r){const n=Pl.parentNode(t);return!!n&&e.has(n)}(e,t)}function yc(e,t){return 0!==e.size&&vc(e,t)}function vc(e,t){const r=Pl.parentNode(t);return!!r&&(!!e.has(r)||vc(e,r))}let wc;const bc=e=>{if(!wc)return e;return(...t)=>{try{return e(...t)}catch(e){if(wc&&!0===wc(e))return;throw e}}};function Sc(e){return(...t)=>{try{return e(...t)}catch(e){try{e._external_=!0}catch{}throw e}}}const Cc=[];function Ic(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 xc(e,t){const r=new fc;Cc.push(r),r.init(e);const n=new(Al())(bc(r.processMutations.bind(r)));return n.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),n}function kc({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(ic).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==i[e])).forEach((o=>{let i=ue(o);const c=(t=>o=>{const i=Ic(o);if(Vl(i,n,s,!0))return;let a=null,c=t;if("pointerType"in o){switch(o.pointerType){case"mouse":a=ac.Mouse;break;case"touch":a=ac.Touch;break;case"pen":a=ac.Pen}a===ac.Touch?ic[t]===ic.MouseDown?c="TouchStart":ic[t]===ic.MouseUp&&(c="TouchEnd"):ac.Pen}else Jl(o)&&(a=ac.Touch);null!==a?(l=a,(c.startsWith("Touch")&&a===ac.Touch||c.startsWith("Mouse")&&a===ac.Mouse)&&(a=null)):ic[t]===ic.Click&&(a=l,l=null);const u=Jl(o)?o.changedTouches[0]:o;if(!u)return;const h=r.getId(i),{clientX:d,clientY:p}=u;bc(e)({type:ic[c],id:h,x:d,y:p,...null!==a&&{pointerType:a}})})(o);if(window.PointerEvent)switch(ic[o]){case ic.MouseDown:case ic.MouseUp:i=i.replace("mouse","pointer");break;case ic.TouchStart:case ic.TouchEnd:return}a.push(Tl(i,c,t))})),bc((()=>{a.forEach((e=>e()))}))}function Oc({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:s,sampling:o}){const i=bc(Dl(bc((o=>{const i=Ic(o);if(!i||Vl(i,n,s,!0))return;const a=r.getId(i);if(i===t&&t.defaultView){const r=Bl(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 Tl("scroll",i,t)}const Mc=["INPUT","TEXTAREA","SELECT"],Ec=new WeakMap;function Rc(e){return function(e,t){if(Nc("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||Nc("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||Nc("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||Nc("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 Ac(e,t,r){let n,s;return e?(e.ownerNode?n=t.getId(e.ownerNode):s=r.getId(e),{styleId:s,id:n}):{}}function Pc({mirror:e,stylesheetManager:t},r){var n,s,o;let i=null;i="#document"===r.nodeName?e.getId(r):e.getId(Pl.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}}),bc((()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))):()=>{}}function Tc(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=xc(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=Dl(bc((t=>{const r=Date.now()-i;e(a.map((e=>(e.timeOffset-=r,e))),t),a=[],i=null})),o),c=bc(Dl(bc((e=>{const t=Ic(e),{clientX:r,clientY:s}=Jl(e)?e.changedTouches[0]:e;i||(i=Ul()),a.push({x:r,y:s,id:n.getId(t),timeOffset:Ul()-i}),l("undefined"!=typeof DragEvent&&e instanceof DragEvent?oc.Drag:e instanceof MouseEvent?oc.MouseMove:oc.TouchMove)})),s,{trailing:!1})),u=[Tl("mousemove",c,r),Tl("touchmove",c,r),Tl("drag",c,r)];return bc((()=>{u.forEach((e=>e()))}))}(e),o=kc(e),i=Oc(e),a=function({viewportResizeCb:e},{win:t}){let r=-1,n=-1;return Tl("resize",bc(Dl(bc((()=>{const t=jl(),s=zl();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=Ic(e);const c=e.isTrusted,h=r&&r.tagName;if(r&&"OPTION"===h&&(r=Pl.parentElement(r)),!r||!h||Mc.indexOf(h)<0||Vl(r,n,s,!0))return;if(r.classList.contains(o)||i&&r.matches(i))return;let p=r.value,f=!1;const m=de(r)||"";"radio"===m||"checkbox"===m?f=r.checked:(a[h.toLowerCase()]||a[m])&&(p=ce({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=Ec.get(t);if(!s||s.text!==n.text||s.isChecked!==n.isChecked){Ec.set(t,n);const s=r.getId(t);bc(e)({...n,id:s})}}const p=("last"===c.input?["change"]:["input","change"]).map((e=>Tl(e,bc(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=>_l(e[0],e[1],{set(){bc(h)({target:this,isTrusted:!1})}},!1,f)))),bc((()=>{p.forEach((e=>e()))}))}(e),c=function({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:s,doc:o}){const i=bc((o=>Dl(bc((s=>{const i=Ic(s);if(!i||Vl(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=[Tl("play",i(cc.Play),o),Tl("pause",i(cc.Pause),o),Tl("seeked",i(cc.Seeked),o),Tl("volumechange",i(cc.VolumeChange),o),Tl("ratechange",i(cc.RateChange),o)];return bc((()=>{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:bc(((n,s,o)=>{const[i,a]=o,{id:l,styleId:c}=Ac(s,t,r.styleMirror);return(l&&-1!==l||c&&-1!==c)&&e({id:l,styleId:c,adds:[{rule:i,index:a}]}),Sc((()=>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:bc(((n,s,o)=>{const[i]=o,{id:a,styleId:l}=Ac(s,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:i}]}),Sc((()=>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:bc(((n,s,o)=>{const[i]=o,{id:a,styleId:l}=Ac(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:bc(((n,s,o)=>{const[i]=o,{id:a,styleId:l}=Ac(s,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,replaceSync:i}),n.apply(s,o)}))}));const l={};Lc("CSSGroupingRule")?l.CSSGroupingRule=n.CSSGroupingRule:(Lc("CSSMediaRule")&&(l.CSSMediaRule=n.CSSMediaRule),Lc("CSSConditionRule")&&(l.CSSConditionRule=n.CSSConditionRule),Lc("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:bc(((n,s,o)=>{const[i,a]=o,{id:l,styleId:c}=Ac(s.parentStyleSheet,t,r.styleMirror);return(l&&-1!==l||c&&-1!==c)&&e({id:l,styleId:c,adds:[{rule:i,index:[...Rc(s),a||0]}]}),n.apply(s,o)}))}),s.prototype.deleteRule=new Proxy(c[n].deleteRule,{apply:bc(((n,s,o)=>{const[i]=o,{id:a,styleId:l}=Ac(s.parentStyleSheet,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:[...Rc(s),i]}]}),n.apply(s,o)}))})})),bc((()=>{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=Pc(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:bc(((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}=Ac(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:Rc(i.parentRule)}),s.apply(i,a)}))});const i=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(i,{apply:bc(((s,o,a)=>{var l;const[c]=a;if(r.has(c))return i.apply(o,[c]);const{id:u,styleId:h}=Ac(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:Rc(o.parentRule)}),s.apply(o,a)}))}),bc((()=>{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=Fl(t.fonts,"add",(function(t){return function(r){return setTimeout(bc((()=>{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),bc((()=>{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=bc((()=>{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;Vl(i,n,s,!0)||Vl(c,n,s,!0)||a.push({start:r.getId(i),startOffset:l,end:r.getId(c),endOffset:u})}o({ranges:a})}));return a(),Tl("selectionchange",a)}(e),m=function({doc:e,customElementCb:t}){const r=e.defaultView;return r&&r.customElements?Fl(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 bc((()=>{Cc.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 Nc(e){return void 0!==window[e]}function Lc(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class Dc{constructor(e){q(this,"iframeIdToRemoteIdMap",new WeakMap),q(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 _c{constructor(e){q(this,"iframes",new WeakMap),q(this,"crossOriginIframeMap",new WeakMap),q(this,"crossOriginIframeMirror",new Dc(Ie)),q(this,"crossOriginIframeStyleMirror"),q(this,"crossOriginIframeRootIdMap",new WeakMap),q(this,"mirror"),q(this,"mutationCb"),q(this,"wrappedEmit"),q(this,"loadListener"),q(this,"stylesheetManager"),q(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Dc(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 sc.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:sc.IncrementalSnapshot,data:{source:oc.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case sc.Meta:case sc.Load:case sc.DomContentLoaded:return!1;case sc.Plugin:return t;case sc.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case sc.IncrementalSnapshot:switch(t.data.source){case oc.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 oc.Drag:case oc.TouchMove:case oc.MouseMove:return t.data.positions.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case oc.ViewportResize:return!1;case oc.MediaInteraction:case oc.MouseInteraction:case oc.Scroll:case oc.CanvasMutation:case oc.Input:return this.replaceIds(t.data,e,["id"]),t;case oc.StyleSheetRule:case oc.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case oc.Font:return t;case oc.Selection:return t.data.ranges.forEach((t=>{this.replaceIds(t,e,["start","end"])})),t;case oc.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===uc.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach((e=>{this.patchRootIdOnNode(e,t)}))}}class Fc{constructor(e){q(this,"shadowDoms",new WeakSet),q(this,"mutationCb"),q(this,"scrollCb"),q(this,"bypassOptions"),q(this,"mirror"),q(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(!oe(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const r=xc({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push((()=>r.disconnect())),this.restoreHandlers.push(Oc({...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(Pl.host(e))),this.restoreHandlers.push(Pc({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(Fl(e.prototype,"attachShadow",(function(e){return function(n){const s=e.call(this,n),o=Pl.shadowRoot(this);return o&&rc(this)&&r.addShadowRoot(o,t),s}})))}reset(){this.restoreHandlers.forEach((e=>{try{e()}catch(e){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var Uc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Bc="undefined"==typeof Uint8Array?[]:new Uint8Array(256),jc=0;jc<Uc.length;jc++)Bc[Uc.charCodeAt(jc)]=jc;const zc=new Map;const Wc=(e,t,r)=>{if(!e||!Gc(e,t)&&"object"!=typeof e)return;const n=function(e,t){let r=zc.get(e);return r||(r=new Map,zc.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 Vc(e,t,r){if(e instanceof Array)return e.map((e=>Vc(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+=Uc[r[t]>>2],s+=Uc[(3&r[t])<<4|r[t+1]>>4],s+=Uc[(15&r[t+1])<<2|r[t+2]>>6],s+=Uc[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:[Vc(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:[Vc(e.data,t,r),e.width,e.height]}}if(Gc(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:Wc(e,t,r)}}return e}const qc=(e,t,r)=>e.map((e=>Vc(e,t,r))),Gc=(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 Zc(e,t,r,n){const s=[];try{const o=Fl(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(s,...o){if(!Vl(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 Jc(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=Fl(e,l,(function(e){return function(...i){const a=e.apply(this,i);if(Wc(a,o,this),"tagName"in this.canvas&&!Vl(this.canvas,n,s,!0)){const e=qc(i,o,this),n={type:t,property:l,args:e};r(this.canvas,n)}return a}}));i.push(a)}catch{const n=_l(e,l,{set(e){r(this.canvas,{type:t,property:l,args:[e],setter:!0})}});i.push(n)}return i}const Yc="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Kc="undefined"!=typeof window&&window.Blob&&new Blob([(Hc=Yc,Uint8Array.from(atob(Hc),(e=>e.charCodeAt(0))))],{type:"text/javascript;charset=utf-8"});var Hc;function $c(e){let t;try{if(t=Kc&&(window.URL||window.webkitURL).createObjectURL(Kc),!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,"+Yc,{name:null==e?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}class Xc{constructor(e){q(this,"pendingCanvasMutations",new Map),q(this,"rafStamps",{latestId:0,invokeId:null}),q(this,"mirror"),q(this,"mutationCb"),q(this,"resetObservers"),q(this,"frozen",!1),q(this,"locked",!1),q(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=Zc(t,r,n,!0),i=new Map,a=new $c;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:lc["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=>{Vl(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=Zc(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=Fl(t.CanvasRenderingContext2D.prototype,i,(function(s){return function(...o){return Vl(this.canvas,r,n,!0)||setTimeout((()=>{const r=qc(o,t,this);e(this.canvas,{type:lc["2D"],property:i,args:r})}),0),s.apply(this,o)}}));s.push(o)}catch{const r=_l(t.CanvasRenderingContext2D.prototype,i,{set(t){e(this.canvas,{type:lc["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(...Jc(t.WebGLRenderingContext.prototype,lc.WebGL,e,r,n,t)),void 0!==t.WebGL2RenderingContext&&s.push(...Jc(t.WebGL2RenderingContext.prototype,lc.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 Qc{constructor(e){q(this,"trackedLinkElements",new WeakSet),q(this,"mutationCb"),q(this,"adoptedStyleSheetCb"),q(this,"styleMirror",new Xl),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:ae(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 eu{constructor(){q(this,"nodeMap",new WeakMap),q(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 tu,ru,nu,su=!1;try{if(2!==Array.from([1],(e=>2*e))[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(j=e.contentWindow)?void 0:j.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}const ou=new le;function iu(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:M=!1,plugins:E,keepIframeSrcFn:R=(()=>!1),ignoreCSSAttributes:A=new Set([]),errorHandler:P}=e;wc=P;const T=!I||window.parent===window;let N=!1;if(!T)try{window.parent.document&&(N=!1)}catch(e){N=!0}if(T&&!t)throw new Error("emit function is required");if(!T&&!N)return()=>{};void 0!==b&&void 0===v.mousemove&&(v.mousemove=b),ou.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},D=!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 _;Yl();let F=0;const U=e=>{for(const t of E||[])t.eventProcessor&&(e=t.eventProcessor(e));return y&&!N&&(e=y(e)),e};tu=(e,s)=>{var o;const i=e;if(i.timestamp=Ul(),!(null==(o=Cc[0])?void 0:o.isFrozen())||i.type===sc.FullSnapshot||i.type===sc.IncrementalSnapshot&&i.data.source===oc.Mutation||Cc.forEach((e=>e.unfreeze())),T)null==t||t(U(i),s);else if(N){const e={type:"rrweb",event:U(i),origin:window.location.origin,isCheckout:s};window.parent.postMessage(e,"*")}if(i.type===sc.FullSnapshot)_=i,F=0;else if(i.type===sc.IncrementalSnapshot){if(i.data.source===oc.Mutation&&i.data.isAttachIframe)return;F++;const e=n&&F>=n,t=r&&i.timestamp-_.timestamp>r;(e||t)&&ru(!0)}};const B=e=>{tu({type:sc.IncrementalSnapshot,data:{source:oc.Mutation,...e}})},j=e=>tu({type:sc.IncrementalSnapshot,data:{source:oc.Scroll,...e}}),z=e=>tu({type:sc.IncrementalSnapshot,data:{source:oc.CanvasMutation,...e}}),W=new Qc({mutationCb:B,adoptedStyleSheetCb:e=>tu({type:sc.IncrementalSnapshot,data:{source:oc.AdoptedStyleSheet,...e}})}),V=new _c({mirror:ou,mutationCb:B,stylesheetManager:W,recordCrossOriginIframes:I,wrappedEmit:tu});for(const e of E||[])e.getMirror&&e.getMirror({nodeMirror:ou,crossOriginIframeMirror:V.crossOriginIframeMirror,crossOriginIframeStyleMirror:V.crossOriginIframeStyleMirror});const q=new eu;nu=new Xc({recordCanvas:C,mutationCb:z,win:window,blockClass:s,blockSelector:o,mirror:ou,sampling:v.canvas,dataURLOptions:w});const G=new Fc({mutationCb:B,scrollCb:j,bypassOptions:{blockClass:s,blockSelector:o,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskInputOptions:L,dataURLOptions:w,maskTextFn:m,maskInputFn:f,recordCanvas:C,inlineImages:M,sampling:v,slimDOMOptions:D,iframeManager:V,stylesheetManager:W,canvasManager:nu,keepIframeSrcFn:R,processedNodeManager:q},mirror:ou});ru=(e=!1)=>{if(!S)return;tu({type:sc.Meta,data:{href:window.location.href,width:zl(),height:jl()}},e),W.reset(),G.init(),Cc.forEach((e=>e.lock()));const t=function(e,t){const{mirror:r=new le,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)}=t||{};return Ue(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})}(document,{mirror:ou,blockClass:s,blockSelector:o,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskAllInputs:L,maskTextFn:m,maskInputFn:f,slimDOM:D,dataURLOptions:w,recordCanvas:C,inlineImages:M,onSerialize:e=>{Kl(e,ou)&&V.addIframe(e),Hl(e,ou)&&W.trackLinkElement(e),$l(e)&&G.addShadowRoot(Pl.shadowRoot(e),document)},onIframeLoad:(e,t)=>{V.attachIframe(e,t),G.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{W.attachLinkElement(e,t)},keepIframeSrcFn:R});if(!t)return console.warn("Failed to snapshot the document");tu({type:sc.FullSnapshot,data:{node:t,initialOffset:Bl(window)}},e),Cc.forEach((e=>e.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&W.adoptStyleSheets(document.adoptedStyleSheets,ou.getId(document))};try{const e=[],t=e=>{var t;return bc(Tc)({mutationCb:B,mousemoveCb:(e,t)=>tu({type:sc.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>tu({type:sc.IncrementalSnapshot,data:{source:oc.MouseInteraction,...e}}),scrollCb:j,viewportResizeCb:e=>tu({type:sc.IncrementalSnapshot,data:{source:oc.ViewportResize,...e}}),inputCb:e=>tu({type:sc.IncrementalSnapshot,data:{source:oc.Input,...e}}),mediaInteractionCb:e=>tu({type:sc.IncrementalSnapshot,data:{source:oc.MediaInteraction,...e}}),styleSheetRuleCb:e=>tu({type:sc.IncrementalSnapshot,data:{source:oc.StyleSheetRule,...e}}),styleDeclarationCb:e=>tu({type:sc.IncrementalSnapshot,data:{source:oc.StyleDeclaration,...e}}),canvasMutationCb:z,fontCb:e=>tu({type:sc.IncrementalSnapshot,data:{source:oc.Font,...e}}),selectionCb:e=>{tu({type:sc.IncrementalSnapshot,data:{source:oc.Selection,...e}})},customElementCb:e=>{tu({type:sc.IncrementalSnapshot,data:{source:oc.CustomElement,...e}})},blockClass:s,ignoreClass:i,ignoreSelector:a,maskTextClass:l,maskTextSelector:c,maskInputOptions:L,inlineStylesheet:u,sampling:v,recordDOM:S,recordCanvas:C,inlineImages:M,userTriggeredOnInput:k,collectFonts:O,doc:e,maskInputFn:f,maskTextFn:m,keepIframeSrcFn:R,blockSelector:o,slimDOMOptions:D,dataURLOptions:w,mirror:ou,iframeManager:V,stylesheetManager:W,shadowDomManager:G,processedNodeManager:q,canvasManager:nu,ignoreCSSAttributes:A,plugins:(null==(t=null==E?void 0:E.filter((e=>e.observer)))?void 0:t.map((e=>({observer:e.observer,options:e.options,callback:t=>tu({type:sc.Plugin,data:{plugin:e.name,payload:t}})}))))||[]},g)};V.addLoadListener((r=>{try{e.push(t(r.contentDocument))}catch(e){console.warn(e)}}));const r=()=>{ru(),e.push(t(document)),su=!0};return"interactive"===document.readyState||"complete"===document.readyState?r():(e.push(Tl("DOMContentLoaded",(()=>{tu({type:sc.DomContentLoaded,data:{}}),"DOMContentLoaded"===x&&r()}))),e.push(Tl("load",(()=>{tu({type:sc.Load,data:{}}),"load"===x&&r()}),window))),()=>{e.forEach((e=>e())),q.destroy(),su=!1,wc=void 0}}catch(e){console.warn(e)}}var au,lu;iu.addCustomEvent=(e,t)=>{if(!su)throw new Error("please add custom event after start recording");tu({type:sc.Custom,data:{tag:e,payload:t}})},iu.freezePage=()=>{Cc.forEach((e=>e.freeze()))},iu.takeFullSnapshot=e=>{if(!su)throw new Error("please take full snapshot after start recording");ru(e)},iu.mirror=ou,(lu=au||(au={}))[lu.NotStarted=0]="NotStarted",lu[lu.Running=1]="Running",lu[lu.Stopped=2]="Stopped";var cu="Remote config fetch rejected due to timeout after 5 seconds",uu="Unexpected error occurred",hu=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.getRemoteConfig=function(e,t,r){return a(n,void 0,void 0,(function(){var n,s,o;return l(this,(function(i){switch(i.label){case 0:return n=Date.now(),[4,this.fetchWithTimeout(r)];case 1:return(s=i.sent())&&(o=s.configs&&s.configs[e])?(this.metrics.fetchTimeAPISuccess=Date.now()-n,[2,o[t]]):(this.metrics.fetchTimeAPIFail=Date.now()-n,[2,void 0])}}))}))},this.fetchWithTimeout=function(e){return a(n,void 0,void 0,(function(){var t,r,n;return l(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 a(n,void 0,void 0,(function(){var r,n,s,a,u,h,d,p,f,m,g,y;return l(this,(function(l){switch(l.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:cu})];t!==this.lastFetchedSessionId&&(this.lastFetchedSessionId=t,this.attempts=0),l.label=1;case 1:l.trys.push([1,3,,4]),r=new URLSearchParams({api_key:this.localConfig.apiKey});try{for(n=c(this.configKeys),s=n.next();!s.done;s=n.next())a=s.value,r.append("config_keys",a)}catch(e){m={error:e}}finally{try{s&&!s.done&&(g=n.return)&&g.call(n)}finally{if(m)throw m.error}}return t&&r.set("session_id",String(t)),u={headers:{Accept:"*/*"},method:"GET"},h="".concat(this.getServerUrl(),"?").concat(r.toString()),this.attempts+=1,[4,fetch(h,i(i({},u),{signal:e}))];case 2:if(null===(d=l.sent()))return[2,this.completeRequest({err:uu})];switch((new I).buildStatus(d.status)){case o.Success:return this.attempts=0,[2,this.parseAndStoreConfig(d)];case o.Failed:return[2,this.retryFetch(e,t)];default:return[2,this.completeRequest({err:"Network error occurred, remote config fetch failed"})]}case 3:return p=l.sent(),f=p,e.aborted?[2,this.completeRequest({err:cu})]:[2,this.completeRequest({err:null!==(y=f.message)&&void 0!==y?y:uu})];case 4:return[2]}}))}))},this.retryFetch=function(e,t){return a(n,void 0,void 0,(function(){var r=this;return l(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 a(n,void 0,void 0,(function(){var t;return l(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===s.STAGING?"https://sr-client-cfg.stag2.amplitude.com/config":this.localConfig.serverZone===s.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}(),du=function(e){var t=e.localConfig,r=e.configKeys;return a(void 0,void 0,void 0,(function(){return l(this,(function(e){return[2,new hu({localConfig:t,configKeys:r})]}))}))};function pu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function fu(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 mu={exports:{}},gu=String,yu=function(){return{isColorSupported:!1,reset:gu,bold:gu,dim:gu,italic:gu,underline:gu,inverse:gu,hidden:gu,strikethrough:gu,black:gu,red:gu,green:gu,yellow:gu,blue:gu,magenta:gu,cyan:gu,white:gu,gray:gu,bgBlack:gu,bgRed:gu,bgGreen:gu,bgYellow:gu,bgBlue:gu,bgMagenta:gu,bgCyan:gu,bgWhite:gu}};mu.exports=yu(),mu.exports.createColors=yu;var vu=mu.exports;const wu=fu(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let bu=vu,Su=wu,Cu=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=bu.isColorSupported),Su&&e&&(t=Su(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}=bu.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 Iu=Cu;Cu.default=Cu;var xu={};xu.isClean=Symbol("isClean"),xu.my=Symbol("my");const ku={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let Ou=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 ku[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=ku[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 Mu=Ou;Ou.default=Ou;let Eu=Mu;function Ru(e,t){new Eu(t).stringify(e)}var Au=Ru;Ru.default=Ru;let{isClean:Pu,my:Tu}=xu,Nu=Iu,Lu=Mu,Du=Au;function _u(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=>_u(e,r))):("object"===o&&null!==s&&(s=_u(s)),r[n]=s)}return r}let Fu=class{constructor(e={}){this.raws={},this[Pu]=!1,this[Tu]=!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=_u(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 Nu(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[Pu]){this[Pu]=!1;let e=this;for(;e=e.parent;)e[Pu]=!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 Lu).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=Du){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 Uu=Fu;Fu.default=Fu;let Bu=Uu,ju=class extends Bu{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 zu=ju;ju.default=ju;var Wu={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:Vu,SourceMapGenerator:qu}=wu,{existsSync:Gu,readFileSync:Zu}=wu,{dirname:Ju,join:Yu}=wu;let Ku=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=Ju(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new Vu(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=Ju(e),Gu(e))return this.mapFile=e,Zu(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 Vu)return qu.fromSourceMap(t).toString();if(t instanceof qu)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=Yu(Ju(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 Hu=Ku;Ku.default=Ku;let{SourceMapConsumer:$u,SourceMapGenerator:Xu}=wu,{fileURLToPath:Qu,pathToFileURL:eh}=wu,{isAbsolute:th,resolve:rh}=wu,{nanoid:nh}=Wu,sh=wu,oh=Iu,ih=Hu,ah=Symbol("fromOffsetCache"),lh=Boolean($u&&Xu),ch=Boolean(rh&&th),uh=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&&(!ch||/^\w+:\/\//.test(t.from)||th(t.from)?this.file=t.from:this.file=rh(t.from)),ch&&lh){let e=new ih(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 "+nh(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 oh(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 oh(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&&(eh&&(s.input.url=eh(this.file).toString()),s.input.file=this.file),s}fromOffset(e){let t,r;if(this[ah])r=this[ah];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[ah]=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:rh(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=th(a.source)?eh(a.source):new URL(a.source,this.map.consumer().sourceRoot||eh(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(!Qu)throw new Error("file: protocol is not available in this PostCSS build");l.file=Qu(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 hh=uh;uh.default=uh,sh&&sh.registerInput&&sh.registerInput(uh);let{SourceMapConsumer:dh,SourceMapGenerator:ph}=wu,{dirname:fh,relative:mh,resolve:gh,sep:yh}=wu,{pathToFileURL:vh}=wu,wh=hh,bh=Boolean(dh&&ph),Sh=Boolean(fh&&gh&&mh&&yh);var Ch=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||fh(e.file);!1===this.mapOpts.sourcesContent?(t=new dh(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(),Sh&&bh&&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=ph.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new ph({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 ph({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?fh(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=fh(gh(r,this.mapOpts.annotation)));let n=mh(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 wh(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(vh){let t=vh(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;"\\"===yh&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let Ih=Uu,xh=class extends Ih{constructor(e){super(e),this.type="comment"}};var kh=xh;xh.default=xh;let Oh,Mh,Eh,Rh,{isClean:Ah,my:Ph}=xu,Th=zu,Nh=kh,Lh=Uu;function Dh(e){return e.map((e=>(e.nodes&&(e.nodes=Dh(e.nodes)),delete e.source,e)))}function _h(e){if(e[Ah]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)_h(t)}let Fh=class e extends Lh{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=Dh(Oh(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 Th(t)]}else if(t.selector)t=[new Mh(t)];else if(t.name)t=[new Eh(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new Nh(t)]}let n=t.map((t=>(t[Ph]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[Ah]&&_h(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)));return n}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]}};Fh.registerParse=e=>{Oh=e},Fh.registerRule=e=>{Mh=e},Fh.registerAtRule=e=>{Eh=e},Fh.registerRoot=e=>{Rh=e};var Uh=Fh;Fh.default=Fh,Fh.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,Eh.prototype):"rule"===e.type?Object.setPrototypeOf(e,Mh.prototype):"decl"===e.type?Object.setPrototypeOf(e,Th.prototype):"comment"===e.type?Object.setPrototypeOf(e,Nh.prototype):"root"===e.type&&Object.setPrototypeOf(e,Rh.prototype),e[Ph]=!0,e.nodes&&e.nodes.forEach((e=>{Fh.rebuild(e)}))};let Bh,jh,zh=Uh,Wh=class extends zh{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new Bh(new jh,this,e).stringify()}};Wh.registerLazyResult=e=>{Bh=e},Wh.registerProcessor=e=>{jh=e};var Vh=Wh;Wh.default=Wh;let qh={};var Gh=function(e){qh[e]||(qh[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let Zh=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 Jh=Zh;Zh.default=Zh;let Yh=Jh,Kh=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 Yh(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter((e=>"warning"===e.type))}get content(){return this.css}};var Hh=Kh;Kh.default=Kh;const $h="'".charCodeAt(0),Xh='"'.charCodeAt(0),Qh="\\".charCodeAt(0),ed="/".charCodeAt(0),td="\n".charCodeAt(0),rd=" ".charCodeAt(0),nd="\f".charCodeAt(0),sd="\t".charCodeAt(0),od="\r".charCodeAt(0),id="[".charCodeAt(0),ad="]".charCodeAt(0),ld="(".charCodeAt(0),cd=")".charCodeAt(0),ud="{".charCodeAt(0),hd="}".charCodeAt(0),dd=";".charCodeAt(0),pd="*".charCodeAt(0),fd=":".charCodeAt(0),md="@".charCodeAt(0),gd=/[\t\n\f\r "#'()/;[\\\]{}]/g,yd=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,vd=/.[\r\n"'(/\\]/,wd=/[\da-f]/i;let bd=Uh,Sd=class extends bd{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 Cd=Sd;Sd.default=Sd,bd.registerAtRule(Sd);let Id,xd,kd=Uh,Od=class extends kd{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 Id(new xd,this,e).stringify()}};Od.registerLazyResult=e=>{Id=e},Od.registerProcessor=e=>{xd=e};var Md=Od;Od.default=Od,kd.registerRoot(Od);let Ed={comma:e=>Ed.split(e,[","],!0),space:e=>Ed.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 Rd=Ed;Ed.default=Ed;let Ad=Uh,Pd=Rd,Td=class extends Ad{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Pd.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 Nd=Td;Td.default=Td,Ad.registerRule(Td);let Ld=zu,Dd=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 td:case rd:case sd:case od:case nd:n=m;do{n+=1,r=d.charCodeAt(n)}while(r===rd||r===td||r===sd||r===od||r===nd);h=["space",d.slice(m,n)],m=n-1;break;case id:case ad:case ud:case hd:case fd:case dd:case cd:{let e=String.fromCharCode(r);h=[e,e,m];break}case ld:if(c=g.length?g.pop()[1]:"",u=d.charCodeAt(m+1),"url"===c&&u!==$h&&u!==Xh&&u!==rd&&u!==td&&u!==sd&&u!==nd&&u!==od){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)===Qh;)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||vd.test(o)?h=["(","(",m]:(h=["brackets",o,m,n],m=n);break;case $h:case Xh:s=r===$h?"'":'"',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)===Qh;)l-=1,a=!a}while(a);h=["string",d.slice(m,n+1),m,n],m=n;break;case md:gd.lastIndex=m+1,gd.test(d),n=0===gd.lastIndex?d.length-1:gd.lastIndex-2,h=["at-word",d.slice(m,n+1),m,n],m=n;break;case Qh:for(n=m,i=!0;d.charCodeAt(n+1)===Qh;)n+=1,i=!i;if(r=d.charCodeAt(n+1),i&&r!==ed&&r!==rd&&r!==td&&r!==sd&&r!==od&&r!==nd&&(n+=1,wd.test(d.charAt(n)))){for(;wd.test(d.charAt(n+1));)n+=1;d.charCodeAt(n+1)===rd&&(n+=1)}h=["word",d.slice(m,n+1),m,n],m=n;break;default:r===ed&&d.charCodeAt(m+1)===pd?(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):(yd.lastIndex=m+1,yd.test(d),n=0===yd.lastIndex?d.length-1:yd.lastIndex-2,h=["word",d.slice(m,n+1),m,n],g.push(h),m=n)}return m++,h},position:function(){return m}}},_d=kh,Fd=Cd,Ud=Md,Bd=Nd;const jd={empty:!0,space:!0};var zd=class{constructor(e){this.input=e,this.root=new Ud,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 Fd;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 _d;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=Dd(this.input)}decl(e,t){let r=new Ld;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}let a=e.some((e=>"space"!==e[0]&&"comment"!==e[0]));a&&(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 Bd;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",jd[a]||jd[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 Bd;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 Wd=Uh,Vd=zd,qd=hh;function Gd(e,t){let r=new qd(e,t),n=new Vd(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 Zd=Gd;Gd.default=Gd,Wd.registerParse(Gd);let{isClean:Jd,my:Yd}=xu,Kd=Ch,Hd=Au,$d=Uh,Xd=Vh,Qd=Gh,ep=Hh,tp=Zd,rp=Md;const np={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},sp={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},op={Once:!0,postcssPlugin:!0,prepare:!0};function ip(e){return"object"==typeof e&&"function"==typeof e.then}function ap(e){let t=!1,r=np[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 lp(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:ap(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function cp(e){return e[Jd]=!1,e.nodes&&e.nodes.forEach((e=>cp(e))),e}let up={},hp=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 ep)s=cp(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=tp;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[Yd]&&$d.rebuild(s)}else s=cp(r);this.result=new ep(t,s,n),this.helpers={...up,postcss:up,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(!sp[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!op[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(ip(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Jd];){e[Jd]=!0;let t=[lp(e)];for(;t.length>0;){let e=this.visitTick(t);if(ip(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 ip(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=Hd;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new Kd(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(ip(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Jd];)e[Jd]=!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||Qd("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(ip(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[Jd])return n[Jd]=!0,void e.push(lp(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[Jd]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[Jd]=!0;let t=ap(e);for(let r of t)if(0===r)e.nodes&&e.each((e=>{e[Jd]||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"}};hp.registerPostcss=e=>{up=e};var dp=hp;hp.default=hp,rp.registerLazyResult(hp),Xd.registerLazyResult(hp);let pp=Ch,fp=Au,mp=Gh,gp=Zd;const yp=Hh;let vp=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=fp;this.result=new yp(this._processor,n,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let i=new pp(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||mp("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=gp;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 wp=vp;vp.default=vp;let bp=wp,Sp=dp,Cp=Vh,Ip=Md,xp=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 Sp(this,e,t):new bp(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var kp=xp;xp.default=xp,Ip.registerProcessor(xp),Cp.registerProcessor(xp);let Op=zu,Mp=Hu,Ep=kh,Rp=Cd,Ap=hh,Pp=Md,Tp=Nd;function Np(e,t){if(Array.isArray(e))return e.map((e=>Np(e)));let{inputs:r,...n}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:Ap.prototype};r.map&&(r.map={...r.map,__proto__:Mp.prototype}),t.push(r)}}if(n.nodes&&(n.nodes=e.nodes.map((e=>Np(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 Pp(n);if("decl"===n.type)return new Op(n);if("rule"===n.type)return new Tp(n);if("comment"===n.type)return new Ep(n);if("atrule"===n.type)return new Rp(n);throw new Error("Unknown node type: "+e.type)}var Lp=Np;Np.default=Np;let Dp=Iu,_p=zu,Fp=dp,Up=Uh,Bp=kp,jp=Au,zp=Lp,Wp=Vh,Vp=Jh,qp=kh,Gp=Cd,Zp=Hh,Jp=hh,Yp=Zd,Kp=Rd,Hp=Nd,$p=Md,Xp=Uu;function Qp(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new Bp(e)}Qp.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 Bp).version,s}return Object.defineProperty(s,"postcss",{get:()=>(r||(r=s()),r)}),s.process=function(e,t,r){return Qp([s(r)]).process(e,t)},s},Qp.stringify=jp,Qp.parse=Yp,Qp.fromJSON=zp,Qp.list=Kp,Qp.comment=e=>new qp(e),Qp.atRule=e=>new Gp(e),Qp.decl=e=>new _p(e),Qp.rule=e=>new Hp(e),Qp.root=e=>new $p(e),Qp.document=e=>new Wp(e),Qp.CssSyntaxError=Dp,Qp.Declaration=_p,Qp.Container=Up,Qp.Processor=Bp,Qp.Document=Wp,Qp.Comment=qp,Qp.Warning=Vp,Qp.AtRule=Gp,Qp.Result=Zp,Qp.Input=Jp,Qp.Rule=Hp,Qp.Root=$p,Qp.Node=Xp,Fp.registerPostcss(Qp);var ef=Qp;Qp.default=Qp;const tf=pu(ef);tf.stringify,tf.fromJSON,tf.plugin,tf.parse,tf.list,tf.document,tf.comment,tf.atRule,tf.rule,tf.decl,tf.root,tf.CssSyntaxError,tf.Declaration,tf.Container,tf.Processor,tf.Document,tf.Comment,tf.Warning,tf.AtRule,tf.Result,tf.Input,tf.Rule,tf.Root,tf.Node;var rf="medium",nf=function(e,t,r){switch(t){case"light":if("input"!==e)return!0;var n=r?function(e){const 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 nf(e,rf,r)}},sf=function(e,t){return function(r,n){return function(e,t,r){var n,s,o;if(void 0===t&&(t={defaultMaskLevel:rf}),r){if(r.closest("."+B))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 nf(e,null!==(o=t.defaultMaskLevel)&&void 0!==o?o:rf,r)}(e,t,n)?r.replace(/[^\s]/g,"*"):r}},of=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},af=function(e,t){return t||(e===s.STAGING?"https://api-sr.stag2.amplitude.com/sessions/v2/track":e===s.EU?"https://api-sr.eu.amplitude.com/sessions/v2/track":"https://api-sr.amplitude.com/sessions/v2/track")},lf=function(){return a(void 0,void 0,void 0,(function(){var e,t,r,n,s,o,i;return l(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),(e=N())?[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:""}]}}))}))},cf=function(e){var t=i({},e),r=t.apiKey;return t.apiKey="****".concat(r.substring(r.length-4)),t},uf=function(){function e(e,t){this.localConfig=t,this.remoteConfigFetch=e}return e.prototype.generateJoinedConfig=function(e){var t,r,n;return a(this,void 0,void 0,(function(){var s,o,a,h,d,p,f,m,g,y,v,w,b,S,C,I,x,k,O,M;return l(this,(function(l){switch(l.label){case 0:(s=i({},this.localConfig)).optOut=this.localConfig.optOut,s.captureEnabled=!0,l.label=1;case 1:return l.trys.push([1,5,,6]),[4,this.remoteConfigFetch.getRemoteConfig("sessionReplay","sr_sampling_config",e)];case 2:return a=l.sent(),[4,this.remoteConfigFetch.getRemoteConfig("sessionReplay","sr_privacy_config",e)];case 3:return h=l.sent(),d=s,[4,this.remoteConfigFetch.getRemoteConfig("sessionReplay","sr_interaction_config",e)];case 4:return d.interactionConfig=l.sent(),(a||h)&&(o={},a&&(o.sr_sampling_config=a),h&&(o.sr_privacy_config=h)),[3,6];case 5:return p=l.sent(),f=p,this.localConfig.loggerProvider.warn(f.message),s.captureEnabled=!1,[3,6];case 6:if(!o)return[2,s];if(m=o.sr_sampling_config,g=o.sr_privacy_config,m&&Object.keys(m).length>0?(Object.prototype.hasOwnProperty.call(m,"capture_enabled")?s.captureEnabled=m.capture_enabled:s.captureEnabled=!1,Object.prototype.hasOwnProperty.call(m,"sample_rate")&&(s.sampleRate=m.sample_rate)):(s.captureEnabled=!0,this.localConfig.loggerProvider.debug("Remote config successfully fetched, but no values set for project, Session Replay capture enabled.")),g){y=null!==(t=s.privacyConfig)&&void 0!==t?t:{},v={defaultMaskLevel:null!==(n=null!==(r=g.defaultMaskLevel)&&void 0!==r?r:y.defaultMaskLevel)&&void 0!==n?n:"medium",blockSelector:[],maskSelector:[],unmaskSelector:[]},w=function(e){var t,r,n,s,o,i,a,l,u,h={};"string"==typeof e.blockSelector&&(e.blockSelector=[e.blockSelector]);try{for(var d=c(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=c(null!==(l=e.maskSelector)&&void 0!==l?l:[]),m=f.next();!m.done;m=f.next()){h[m.value]="mask"}}catch(e){n={error:e}}finally{try{m&&!m.done&&(s=f.return)&&s.call(f)}finally{if(n)throw n.error}}try{for(var g=c(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},b=i(i({},w(y)),w(g));try{for(S=c(Object.entries(b)),C=S.next();!C.done;C=S.next())I=u(C.value,2),x=I[0],"mask"===(k=I[1])?v.maskSelector.push(x):"block"===k?v.blockSelector.push(x):"unmask"===k&&v.unmaskSelector.push(x)}catch(e){O={error:e}}finally{try{C&&!C.done&&(M=S.return)&&M.call(S)}finally{if(O)throw O.error}}s.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}(v,this.localConfig.loggerProvider)}return this.localConfig.loggerProvider.debug(JSON.stringify({name:"session replay joined config",config:cf(s)},null,2)),[2,s]}}))}))},e}(),hf=function(e,t){return a(void 0,void 0,void 0,(function(){var r,n;return l(this,(function(s){switch(s.label){case 0:return r=new W(e,t),[4,du({localConfig:r,configKeys:["sessionReplay"]})];case 1:return n=s.sent(),[2,new uf(n,r)]}}))}))},df="Session replay event batch rejected due to exceeded retry count",pf="Failed to store session replay events in IndexedDB",ff="1.19.1-beta.0",mf=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(i(i({},e),{attempts:0,timeout:0}))},e.prototype.addToQueue=function(){for(var e=this,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=t.filter((function(t){return t.attempts<(t.flushMaxRetries||0)?(t.attempts+=1,!0):(e.completeRequest({context:t,err:df}),!1)}));n.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),a(this,void 0,void 0,(function(){var t,r,n=this;return l(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),a(this,void 0,void 0,(function(){var s,o,i,a,c,u,h,d,p,f,m,g,y;return l(this,(function(l){switch(l.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(v=N(),i=(null==v?void 0:v.location)?v.location.href:"",a=ff,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)||a),0===(d=this.payloadBatcher({version:1,events:e.events})).events.length)return this.completeRequest({context:e}),[2];l.label=1;case 1:return l.trys.push([1,3,,4]),p={headers:{"Content-Type":"application/json",Accept:"*/*",Authorization:"Bearer ".concat(s),"X-Client-Version":a,"X-Client-Library":h,"X-Client-Url":i,"X-Client-Sample-Rate":"".concat(c)},body:JSON.stringify(d),method:"POST"},f="".concat(af(e.serverZone,this.trackServerUrl),"?").concat(u.toString()),[4,fetch(f,p)];case 2:if(null===(m=l.sent()))return this.completeRequest({context:e,err:"Unexpected error occurred"}),[2];if(t)this.handleReponse(m.status,e);else{g="";try{g=JSON.stringify(m.body,null,2)}catch(e){}this.completeRequest({context:e,success:"".concat(m.status,": ").concat(g)})}return[3,4];case 3:return y=l.sent(),this.completeRequest({context:e,err:y}),[3,4];case 4:return[2]}var v}))}))},e.prototype.handleReponse=function(e,t){switch((new I).buildStatus(e)){case o.Success:this.handleSuccessResponse(t);break;case o.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(i(i({},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 gf=(e,t)=>t.some((t=>e instanceof t));let yf,vf;const wf=new WeakMap,bf=new WeakMap,Sf=new WeakMap;let Cf={get(e,t,r){if(e instanceof IDBTransaction){if("done"===t)return wf.get(e);if("store"===t)return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return Of(e[t])},set:(e,t,r)=>(e[t]=r,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function If(e){Cf=e(Cf)}function xf(e){return(vf||(vf=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(Mf(this),t),Of(this.request)}:function(...t){return Of(e.apply(Mf(this),t))}}function kf(e){return"function"==typeof e?xf(e):(e instanceof IDBTransaction&&function(e){if(wf.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)}));wf.set(e,t)}(e),gf(e,yf||(yf=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,Cf):e)}function Of(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(Of(e.result)),n()},o=()=>{r(e.error),n()};e.addEventListener("success",s),e.addEventListener("error",o)}));return Sf.set(t,e),t}(e);if(bf.has(e))return bf.get(e);const t=kf(e);return t!==e&&(bf.set(e,t),Sf.set(t,e)),t}const Mf=e=>Sf.get(e);function Ef(e,t,{blocked:r,upgrade:n,blocking:s,terminated:o}={}){const i=indexedDB.open(e,t),a=Of(i);return n&&i.addEventListener("upgradeneeded",(e=>{n(Of(i.result),e.oldVersion,e.newVersion,Of(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 Rf=["get","getKey","getAll","getAllKeys","count"],Af=["put","add","delete","clear"],Pf=new Map;function Tf(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(Pf.get(t))return Pf.get(t);const r=t.replace(/FromIndex$/,""),n=t!==r,s=Af.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!s&&!Rf.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 Pf.set(t,o),o}If((e=>({...e,get:(t,r,n)=>Tf(t,r)||e.get(t,r,n),has:(t,r)=>!!Tf(t,r)||e.has(t,r)})));const Nf=["continue","continuePrimaryKey","advance"],Lf={},Df=new WeakMap,_f=new WeakMap,Ff={get(e,t){if(!Nf.includes(t))return e[t];let r=Lf[t];return r||(r=Lf[t]=function(...e){Df.set(this,_f.get(this)[t](...e))}),r}};async function*Uf(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;const r=new Proxy(t,Ff);for(_f.set(r,t),Sf.set(r,Mf(t));t;)yield r,t=await(Df.get(r)||t.continue()),Df.delete(r)}function Bf(e,t){return t===Symbol.asyncIterator&&gf(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===t&&gf(e,[IDBIndex,IDBObjectStore])}If((e=>({...e,get:(t,r,n)=>Bf(t,r)?Uf:e.get(t,r,n),has:(t,r)=>Bf(t,r)||e.has(t,r)})));var jf,zf=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=new Blob([t]).size;return new Blob(e).size+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}();!function(e){e.RECORDING="recording",e.SENT="sent"}(jf||(jf={}));var Wf,Vf,qf,Gf="sessionCurrentSequence",Zf="sequencesToSend",Jf=function(){var e=N();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)}}catch(e){r(e)}}))},Yf=function(e){return a(void 0,void 0,void 0,(function(){var t;return l(this,(function(r){switch(r.label){case 0:return e.length>0?(10,t=e.splice(0,10),[4,Promise.all(t)]):[3,2];case 1:return r.sent(),[3,0];case 2:return[2]}}))}))},Kf=function(e){var t,r;return e.objectStoreNames.contains(Gf)||(r=e.createObjectStore(Gf,{keyPath:"sessionId"})),e.objectStoreNames.contains(Zf)||(t=e.createObjectStore(Zf,{keyPath:"sequenceId",autoIncrement:!0})).createIndex("sessionId","sessionId"),{sequencesStore:t,currentSequenceStore:r}},Hf=function(e){return a(void 0,void 0,void 0,(function(){return l(this,(function(t){switch(t.label){case 0:return[4,Ef(e,1,{upgrade:Kf})];case 1:return[2,t.sent()]}}))}))},$f=function(e){function t(t){var r=e.call(this,t)||this;return r.getSequencesToSend=function(){return a(r,void 0,void 0,(function(){var e,t,r,n,s,o;return l(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(pf,": ").concat(o)),[3,6];case 6:return[2,void 0]}}))}))},r.storeCurrentSequence=function(e){return a(r,void 0,void 0,(function(){var t,r,n;return l(this,(function(s){switch(s.label){case 0:return s.trys.push([0,4,,5]),[4,this.db.get(Gf,e)];case 1:return(t=s.sent())?[4,this.db.put(Zf,{sessionId:e,events:t.events})]:[2,void 0];case 2:return r=s.sent(),[4,this.db.put(Gf,{sessionId:e,events:[]})];case 3:return s.sent(),[2,i(i({},t),{sessionId:e,sequenceId:r})];case 4:return n=s.sent(),this.loggerProvider.warn("".concat(pf,": ").concat(n)),[3,5];case 5:return[2,void 0]}}))}))},r.addEventToCurrentSequence=function(e,t){return a(r,void 0,void 0,(function(){var r,n,s,o,i,a;return l(this,(function(l){switch(l.label){case 0:return l.trys.push([0,10,,11]),[4,(r=this.db.transaction(Gf,"readwrite")).store.get(e)];case 1:return(n=l.sent())?[3,3]:[4,r.store.put({sessionId:e,events:[t]})];case 2:return l.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 l.sent(),[3,7];case 5:return o=n.events.concat(t),[4,r.store.put({sessionId:e,events:o})];case 6:l.sent(),l.label=7;case 7:return[4,r.done];case 8:return l.sent(),s?[4,this.storeSendingEvents(e,s)]:[2,void 0];case 9:return(i=l.sent())?[2,{events:s,sessionId:e,sequenceId:i}]:[2,void 0];case 10:return a=l.sent(),this.loggerProvider.warn("".concat(pf,": ").concat(a)),[3,11];case 11:return[2,void 0]}}))}))},r.storeSendingEvents=function(e,t){return a(r,void 0,void 0,(function(){var r;return l(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.db.put(Zf,{sessionId:e,events:t})];case 1:return[2,n.sent()];case 2:return r=n.sent(),this.loggerProvider.warn("".concat(pf,": ").concat(r)),[3,3];case 3:return[2,void 0]}}))}))},r.cleanUpSessionEventsStore=function(e,t){return a(r,void 0,void 0,(function(){var e;return l(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(Zf,t)];case 2:return r.sent(),[3,4];case 3:return e=r.sent(),this.loggerProvider.warn("".concat(pf,": ").concat(e)),[3,4];case 4:return[2]}}))}))},r.transitionFromKeyValStore=function(e){return a(r,void 0,void 0,(function(){var t,r,n,s,o,i,c,u,h=this;return l(this,(function(p){switch(p.label){case 0:return p.trys.push([0,6,,7]),[4,Jf()];case 1:if(!(t=p.sent()))return[2];r=function(e,t){return a(h,void 0,void 0,(function(){var r,n,s=this;return l(this,(function(o){switch(o.label){case 0:return r=t.sessionSequences,n=[],Object.keys(r).forEach((function(o){var i=parseInt(o,10),c=r[i];if(i===t.currentSequenceId){var u=c.events.map((function(t){return a(s,void 0,void 0,(function(){return l(this,(function(r){return[2,this.addEventToCurrentSequence(e,t)]}))}))}));n.concat(u)}else c.status!==jf.SENT&&n.push(s.storeSendingEvents(e,c.events))})),[4,Yf(n)];case 1:return o.sent(),[2]}}))}))},n="".concat(d,"_").concat(this.apiKey.substring(0,10)),p.label=2;case 2:return p.trys.push([2,4,,5]),s=t.transaction("keyval").objectStore("keyval").getAll(n),o=new Promise((function(t){s.onsuccess=function(n){return a(h,void 0,void 0,(function(){var s,o,i,a=this;return l(this,(function(l){switch(l.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 l=s.sessionSequences;Object.keys(l).forEach((function(e){var t=parseInt(e,10);l[t].status!==jf.SENT&&i.push(a.storeSendingEvents(n,l[t].events))}))}})),[4,Yf(i)]):[3,2];case 1:l.sent(),l.label=2;case 2:return t(),[2]}}))}))}})),[4,o];case 3:return p.sent(),(i=N())&&i.indexedDB.deleteDatabase("keyval-store"),[3,5];case 4:return c=p.sent(),this.loggerProvider.warn("Failed to transition session replay events from keyval to new store: ".concat(c)),[3,5];case 5:return[3,7];case 6:return u=p.sent(),this.loggerProvider.warn("Failed to access keyval store: ".concat(u,". 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 a(this,void 0,void 0,(function(){var s,o,a,c,u;return l(this,(function(l){switch(l.label){case 0:return l.trys.push([0,3,,4]),s="replay"===e?"":"_".concat(e),o="".concat(r.apiKey.substring(0,10),"_amp_session_replay_events").concat(s),[4,Hf(o)];case 1:return a=l.sent(),[4,(c=new t(i(i({},r),{db:a}))).transitionFromKeyValStore(n)];case 2:return l.sent(),[2,c];case 3:return u=l.sent(),r.loggerProvider.warn("".concat(pf,": ").concat(u)),[3,4];case 4:return[2]}}))}))},t.prototype.getCurrentSequenceEvents=function(e){return a(this,void 0,void 0,(function(){var t,r,n,s,o,i,a;return l(this,(function(l){switch(l.label){case 0:return e?[4,this.db.get("sessionCurrentSequence",e)]:[3,2];case 1:return(s=l.sent())?[2,[s]]:[2,void 0];case 2:t=[],l.label=3;case 3:return l.trys.push([3,8,9,10]),[4,this.db.getAll("sessionCurrentSequence")];case 4:r=c.apply(void 0,[l.sent()]),n=r.next(),l.label=5;case 5:if(n.done)return[3,7];s=n.value,t.push(s),l.label=6;case 6:return n=r.next(),[3,5];case 7:return[3,10];case 8:return o=l.sent(),i={error:o},[3,10];case 9:try{n&&!n.done&&(a=r.return)&&a.call(r)}finally{if(i)throw i.error}return[7];case 10:return[2,t]}}))}))},t}(zf),Xf=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=h([],u(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 a(this,void 0,void 0,(function(){return l(this,(function(e){return[2,Object.entries(this.finalizedSequences).map((function(e){var t=u(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 a(this,void 0,void 0,(function(){return l(this,(function(t){return this.sequences[e]?[2,this.addSequence(e)]:[2,void 0]}))}))},t.prototype.addEventToCurrentSequence=function(e,t){return a(this,void 0,void 0,(function(){var r;return l(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 a(this,void 0,void 0,(function(){return l(this,(function(r){return this.finalizedSequences[this.sequenceId]={sessionId:e,events:t},[2,this.sequenceId++]}))}))},t.prototype.cleanUpSessionEventsStore=function(e,t){return a(this,void 0,void 0,(function(){return l(this,(function(e){return void 0!==t&&delete this.finalizedSequences[t],[2]}))}))},t}(zf),Qf=function(e){var t=e.config,r=e.sessionId,n=e.minInterval,s=e.maxInterval,o=e.type,c=e.payloadBatcher,u=e.storeType;return a(void 0,void 0,void 0,(function(){function e(e){return void 0===e&&(e=!1),a(this,void 0,void 0,(function(){return l(this,(function(t){return[2,h.flush(e)]}))}))}var h,d,p,f,m,g,y,v,w;return l(this,(function(b){switch(b.label){case 0:return h=new mf(i(i({},t),{loggerProvider:t.loggerProvider,payloadBatcher:c})),d=function(){return new Xf({loggerProvider:t.loggerProvider,maxInterval:s,minInterval:n})},p=function(){return a(void 0,void 0,void 0,(function(){var e;return l(this,(function(i){switch(i.label){case 0:return[4,$f.new(o,{loggerProvider:t.loggerProvider,minInterval:n,maxInterval:s,apiKey:t.apiKey},r)];case 1:return e=i.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,i=e.sequenceId;t.debugMode&&lf().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:o,onComplete:function(){return a(void 0,void 0,void 0,(function(){return l(this,(function(e){switch(e.label){case 0:return[4,f.cleanUpSessionEventsStore(n,i)];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 a(void 0,void 0,void 0,(function(){var e;return l(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}]}}))}))},em=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 a(this,void 0,void 0,(function(){var t;return l(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 a(this,void 0,void 0,(function(){var t;return l(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}(),tm=(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))(tm||{});function rm(e,t){if(qf=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};Wf=i(i({},r),t),Vf=function(e,t){if(e.nodeType===Node.DOCUMENT_NODE)return e;if(e===t.root)return e.ownerDocument;return e}(Wf.root,r);var n=nm(e,"all",(function(){return nm(e,"two",(function(){return nm(e,"one",(function(){return nm(e,"none")}))}))}));if(n){var s=pm(fm(n,e));return s.length>0&&(n=s[0]),om(n)}throw new Error("Selector was not found.")}function nm(e,t,r){for(var n=null,s=[],o=e,i=0,a=function(){var e,a,l=(new Date).getTime()-qf.getTime();if(void 0!==Wf.timeoutMs&&l>Wf.timeoutMs)throw new Error("Timeout: Can't find a unique selector after ".concat(l,"ms"));var d=um(function(e){var t=e.getAttribute("id");if(t&&Wf.idName(t))return{name:"#"+CSS.escape(t),penalty:0};return null}(o))||um.apply(void 0,h([],u(function(e){var t=Array.from(e.attributes).filter((function(e){return Wf.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))||um.apply(void 0,h([],u(function(e){var t=Array.from(e.classList).filter(Wf.className);return t.map((function(e){return{name:"."+CSS.escape(e),penalty:1}}))}(o)),!1))||um(function(e){var t=e.tagName.toLowerCase();if(Wf.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(cm).map((function(e){return lm(e,p)}))));else if("two"==t)d=d.slice(0,1),p&&(d=d.concat(d.filter(cm).map((function(e){return lm(e,p)}))));else if("one"==t){var f=u(d=d.slice(0,1),1)[0];p&&cm(f)&&(d=[lm(f,p)])}else"none"==t&&(d=[{name:"*",penalty:3}],p&&(d=[lm(d[0],p)]));try{for(var m=(e=void 0,c(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>=Wf.seedMinLength&&(n=sm(s,r)))return"break";o=o.parentElement,i++};o;){if("break"===a())break}return n||(n=sm(s,r)),!n&&r?r():n}function sm(e,t){var r,n,s=pm(dm(e));if(s.length>Wf.threshold)return t?t():null;try{for(var o=c(s),i=o.next();!i.done;i=o.next()){var a=i.value;if(am(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 om(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 im(e){return e.map((function(e){return e.penalty})).reduce((function(e,t){return e+t}),0)}function am(e){var t=om(e);switch(Vf.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 lm(e,t){return{name:e.name+":nth-child(".concat(t,")"),penalty:e.penalty+1}}function cm(e){return"html"!==e.name&&!e.name.startsWith("#")}function um(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e.filter(hm);return r.length>0?r:null}function hm(e){return null!=e}function dm(e,t){var r,n,s,o,i,a;return void 0===t&&(t=[]),l(this,(function(l){switch(l.label){case 0:if(!(e.length>0))return[3,9];l.label=1;case 1:l.trys.push([1,6,7,8]),r=c(e[0]),n=r.next(),l.label=2;case 2:return n.done?[3,5]:(s=n.value,[5,c(dm(e.slice(1,e.length),t.concat(s)))]);case 3:l.sent(),l.label=4;case 4:return n=r.next(),[3,2];case 5:return[3,8];case 6:return o=l.sent(),i={error:o},[3,8];case 7:try{n&&!n.done&&(a=r.return)&&a.call(r)}finally{if(i)throw i.error}return[7];case 8:return[3,11];case 9:return[4,t];case 10:l.sent(),l.label=11;case 11:return[2]}}))}function pm(e){return h([],u(e),!1).sort((function(e,t){return im(e)-im(t)}))}function fm(e,t,r){var n,s,o;return void 0===r&&(r={counter:0,visited:new Map}),l(this,(function(i){switch(i.label){case 0:if(!(e.length>2&&e.length>Wf.optimizedMinLength))return[3,5];n=1,i.label=1;case 1:return n<e.length-1?r.counter>Wf.maxNumberOfTries?[2]:(r.counter+=1,(s=h([],u(e),!1)).splice(n,1),o=om(s),r.visited.has(o)?[2]:am(s)&&function(e,t){return Vf.querySelector(om(e))===t}(s,t)?[4,s]:[3,4]):[3,5];case 2:return i.sent(),r.visited.set(o,!0),[5,c(fm(s,t,r))];case 3:i.sent(),i.label=4;case 4:return n++,[3,1];case 5:return[2]}}))}var mm=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}},gm=function(e){var t=e.version,r=e.events,n=[];r.forEach((function(e){var t=JSON.parse(e);"click"===t.type&&n.push(t)}));var s=n.reduce((function(e,t){var r=t.x,n=t.y,s=t.selector,o=t.timestamp,a=o-o%36e5,l="".concat(r,":").concat(n,":").concat(null!=s?s:"",":").concat(a);return e[l]?e[l].count+=1:e[l]=i(i({},t),{timestamp:a,count:1}),e}),{});return{version:t,events:Object.values(s)}},ym=function(e,t){var r=t.eventsManager,n=t.sessionId,s=t.deviceIdFn;return function(t){if(t.type===tm.Click){var o=N();if(o){var i=o.location,a=o.innerHeight,l=o.innerWidth;if(i){var c=t.x,u=t.y;if(void 0!==c&&void 0!==u){var h,d=iu.mirror.getNode(t.id);if(d)try{h=rm(d)}catch(t){e.debug("error resolving selector from finder")}var p=nc.getWindowScroll(o),f={x:c+p.left,y:u+p.top,selector:h,viewportHeight:a,viewportWidth:l,pageUrl:i.href,timestamp:Date.now(),type:"click"},m=s();m&&r.addEvent({sessionId:n,event:{type:"interaction",data:JSON.stringify(f)},deviceId:m})}}}}}},vm=function(){function e(e,t){var r=N();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=af(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}(),wm=nc.getWindowHeight,bm=nc.getWindowWidth,Sm=function(){function e(e){var t=this;this.timestamp=Date.now(),this.hook=function(e){t.update(e)},this.send=function(e){return function(r){var n=e(),s=N();s&&n&&t.transport.send(n,{version:1,events:[{maxScrollX:t._maxScrollX,maxScrollY:t._maxScrollY,maxScrollWidth:t._maxScrollWidth,maxScrollHeight:t._maxScrollHeight,viewportHeight:wm(),viewportWidth:bm(),pageUrl:s.location.href,timestamp:t.timestamp,type:"scroll"}]})}},this._maxScrollX=0,this._maxScrollY=0,this._maxScrollWidth=bm(),this._maxScrollHeight=wm(),this.transport=e}return e.default=function(t,r){return new e(new vm(t,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=bm();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=wm();this._maxScrollY=e.y;var o=e.y+s;o>this._maxScrollHeight&&(this._maxScrollHeight=o),this.timestamp=t}},e}(),Cm=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))},Im=Uint8Array,xm=Uint16Array,km=Uint32Array,Om=new Im([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]),Mm=new Im([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]),Em=new Im([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Rm=function(e,t){for(var r=new xm(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];var s=new km(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]},Am=Rm(Om,2),Pm=Am[0],Tm=Am[1];Pm[28]=258,Tm[258]=28;for(var Nm=Rm(Mm,0)[1],Lm=new xm(32768),Dm=0;Dm<32768;++Dm){var _m=(43690&Dm)>>>1|(21845&Dm)<<1;_m=(61680&(_m=(52428&_m)>>>2|(13107&_m)<<2))>>>4|(3855&_m)<<4,Lm[Dm]=((65280&_m)>>>8|(255&_m)<<8)>>>1}var Fm=function(e,t,r){for(var n=e.length,s=0,o=new xm(t);s<n;++s)++o[e[s]-1];var i,a=new xm(t);for(s=0;s<t;++s)a[s]=a[s-1]+o[s-1]<<1;if(r){i=new xm(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[Lm[h]>>>l]=c}else for(i=new xm(n),s=0;s<n;++s)i[s]=Lm[a[e[s]-1]++]>>>15-e[s];return i},Um=new Im(288);for(Dm=0;Dm<144;++Dm)Um[Dm]=8;for(Dm=144;Dm<256;++Dm)Um[Dm]=9;for(Dm=256;Dm<280;++Dm)Um[Dm]=7;for(Dm=280;Dm<288;++Dm)Um[Dm]=8;var Bm=new Im(32);for(Dm=0;Dm<32;++Dm)Bm[Dm]=5;var jm=Fm(Um,9,0),zm=Fm(Bm,5,0),Wm=function(e){return(e/8>>0)+(7&e&&1)},Vm=function(e,t,r){(null==r||r>e.length)&&(r=e.length);var n=new(e instanceof xm?xm:e instanceof km?km:Im)(r-t);return n.set(e.subarray(t,r)),n},qm=function(e,t,r){r<<=7&t;var n=t/8>>0;e[n]|=r,e[n+1]|=r>>>8},Gm=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},Zm=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 Im(0),0];if(1==s){var i=new Im(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 xm(d+1),f=Jm(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 Im(p),f]},Jm=function(e,t,r){return-1==e.s?Math.max(Jm(e.l,t,r+1),Jm(e.r,t,r+1)):t[e.s]=r},Ym=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new xm(++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]},Km=function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},Hm=function(e,t,r){var n=r.length,s=Wm(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)},$m=function(e,t,r,n,s,o,i,a,l,c,u){qm(t,u++,r),++s[256];for(var h=Zm(s,15),d=h[0],p=h[1],f=Zm(o,15),m=f[0],g=f[1],y=Ym(d),v=y[0],w=y[1],b=Ym(m),S=b[0],C=b[1],I=new xm(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=Zm(I,7),O=k[0],M=k[1],E=19;E>4&&!O[Em[E-1]];--E);var R,A,P,T,N=c+5<<3,L=Km(s,Um)+Km(o,Bm)+i,D=Km(s,d)+Km(o,m)+i+14+3*E+Km(I,O)+(2*I[16]+3*I[17]+7*I[18]);if(N<=L&&N<=D)return Hm(t,u,e.subarray(l,l+c));if(qm(t,u,1+(D<L)),u+=2,D<L){R=Fm(d,p,0),A=d,P=Fm(m,g,0),T=m;var _=Fm(O,M,0);qm(t,u,w-257),qm(t,u+5,C-1),qm(t,u+10,E-4),u+=14;for(x=0;x<E;++x)qm(t,u+3*x,O[Em[x]]);u+=3*E;for(var F=[v,S],U=0;U<2;++U){var B=F[U];for(x=0;x<B.length;++x){var j=31&B[x];qm(t,u,_[j]),u+=O[j],j>15&&(qm(t,u,B[x]>>>5&127),u+=B[x]>>>12)}}}else R=jm,A=Um,P=zm,T=Bm;for(x=0;x<a;++x)if(n[x]>255){j=n[x]>>>18&31;Gm(t,u,R[j+257]),u+=A[j+257],j>7&&(qm(t,u,n[x]>>>23&31),u+=Om[j]);var z=31&n[x];Gm(t,u,P[z]),u+=T[z],z>3&&(Gm(t,u,n[x]>>>5&8191),u+=Mm[z])}else Gm(t,u,R[n[x]]),u+=A[n[x]];return Gm(t,u,R[256]),u+A[256]},Xm=new km([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Qm=function(e,t,r,n,s){return function(e,t,r,n,s,o){var i=e.length,a=new Im(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=Hm(l,c,e.subarray(u,h)):(l[u]=o,c=Hm(l,c,e.subarray(u,i)))}else{for(var d=Xm[t-1],p=d>>>13,f=8191&d,m=(1<<r)-1,g=new xm(32768),y=new xm(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 km(25e3),C=new xm(288),I=new xm(32),x=0,k=0,O=(u=0,0),M=0,E=0;u<i;++u){var R=b(u),A=32767&u,P=y[R];if(g[A]=P,y[R]=A,M<=u){var T=i-u;if((x>7e3||O>24576)&&T>423){c=$m(e,l,0,S,C,I,k,O,E,u-E,c),O=x=k=0,E=u;for(var N=0;N<286;++N)C[N]=0;for(N=0;N<30;++N)I[N]=0}var L=2,D=0,_=f,F=A-P&32767;if(T>2&&R==b(u-F))for(var U=Math.min(p,T)-1,B=Math.min(32767,u),j=Math.min(258,T);F<=B&&--_&&A!=P;){if(e[u+L]==e[u+L-F]){for(var z=0;z<j&&e[u+z]==e[u+z-F];++z);if(z>L){if(L=z,D=F,z>U)break;var W=Math.min(F,z-2),V=0;for(N=0;N<W;++N){var q=u-F+N+32768&32767,G=q-g[q]+32768&32767;G>V&&(V=G,P=q)}}}F+=(A=P)-(P=g[A])+32768&32767}if(D){S[O++]=268435456|Tm[L]<<18|Nm[D];var Z=31&Tm[L],J=31&Nm[D];k+=Om[Z]+Mm[J],++C[257+Z],++I[J],M=u+L,++x}else S[O++]=e[u],++C[e[u]]}}c=$m(e,l,o,S,C,I,k,O,E,u-E,c)}return Vm(a,0,n+Wm(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 eg(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=Qm(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 tg=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}(eg(function(e,t){var r=e.length;if(!t&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var n=new Im(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 Im(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 Vm(n,0,s)}(JSON.stringify(t))),!0)};var rg=function(){function e(e,t,r,n){var s,o,i,a=this;this.taskQueue=[],this.isProcessing=!1,this.compressEvent=function(e){var t=tg(e);return JSON.stringify(t)},this.addCompressedEventToManager=function(e,t){a.eventsManager&&a.deviceId&&a.eventsManager.addEvent({event:{type:"replay",data:e},sessionId:t,deviceId:a.deviceId})},this.addCompressedEvent=function(e,t){if(a.worker)a.worker.postMessage({event:e,sessionId:t});else{var r=a.compressEvent(e);a.addCompressedEventToManager(r,t)}},this.terminate=function(){var e;null===(e=a.worker)||void 0===e||e.terminate()};var l=N();this.canUseIdleCallback=l&&"requestIdleCallback"in l,this.eventsManager=e,this.config=t,this.deviceId=r,this.timeout=(null===(s=t.performanceConfig)||void 0===s?void 0:s.timeout)||2e3;var c=null!==(o='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]),o=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]),a=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),o=0;o<31;++o)t[o]=n+=1<<r[o-1];var a=new f(t[30]);for(o=1;o<30;++o)for(var i=t[o];i<t[o+1];++i)a[i]=i-t[o]<<5|o;return[t,a]},v=i(t,2),u=v[0],s=v[1];u[28]=258,s[258]=28;for(var l=i(o,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,o=0,a=new e(n);o<t;++o)++a[r[o]-1];var i,v=new e(n);for(o=0;o<n;++o)v[o]=v[o-1]+a[o-1]<<1;if(f){i=new e(1<<n);var u=15-n;for(o=0;o<t;++o)if(r[o])for(var s=o<<4|r[o],l=n-r[o],h=v[r[o]-1]++<<l,g=h|(1<<l)-1;h<=g;++h)i[c[h]>>>u]=s}else for(i=new e(t),o=0;o<t;++o)i[o]=c[v[r[o]-1]++]>>>15-r[o];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 M=w(d,9,0),y=w(m,5,0),b=function(r){return(r/8>>0)+(7&r&&1)},p=function(r,t,o){(null==o||o>r.length)&&(o=r.length);var a=new(r instanceof e?e:r instanceof f?f:n)(o-t);return a.set(r.subarray(t,o)),a},C=function(r,n,e){e<<=7&n;var f=n/8>>0;r[f]|=e,r[f+1]|=e>>>8},x=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},S=function(r,f){for(var t=[],o=0;o<r.length;++o)r[o]&&t.push({s:o,f:r[o]});var a=t.length,i=t.slice();if(!a)return[new n(0),0];if(1==a){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!=a-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(o=1;o<a;++o)i[o].s>g&&(g=i[o].s);var w=new e(g+1),d=A(t[c-1],w,0);if(d>f){o=0;var m=0,M=d-f,y=1<<M;for(i.sort((function(r,n){return w[n.s]-w[r.s]||r.f-n.f}));o<a;++o){var b=i[o].s;if(!(w[b]>f))break;m+=y-(1<<d-w[b]),w[b]=f}for(m>>>=M;m>0;){var p=i[o].s;w[p]<f?m-=1<<f-w[p]++-1:++o}for(;o>=0&&m;--o){var C=i[o].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,o=r[0],a=1,i=function(r){f[t++]=r},v=1;v<=n;++v)if(r[v]==o&&v!=n)++a;else{if(!o&&a>2){for(;a>138;a-=138)i(32754);a>2&&(i(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(i(o),--a;a>6;a-=6)i(8304);a>2&&(i(a-3<<5|8208),a=0)}for(;a--;)i(o);a=1,o=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=b(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 o=0;o<f;++o)r[t+o+4]=e[o];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 b=S(v,15),p=b[0],A=b[1],E=S(u,15),U=E[0],D=E[1],I=O(p),J=I[0],N=I[1],W=O(U),_=W[0],j=W[1],P=new e(19),q=0;q<J.length;++q)P[31&J[q]]++;for(q=0;q<_.length;++q)P[31&_[q]]++;for(var z=S(P,7),B=z[0],F=z[1],G=19;G>4&&!B[a[G-1]];--G);var H,K,L,Q,R=h+5<<3,V=T(v,d)+T(u,m)+s,X=T(v,p)+T(u,U)+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(p,A,0),K=p,L=w(U,D,0),Q=U;var Y=w(B,F,0);C(n,g,N-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[a[q]]);g+=3*G;for(var Z=[J,_],$=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=M,K=d,L=y,Q=m;for(q=0;q<l;++q)if(i[q]>255){nr=i[q]>>>18&31;x(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];x(n,g,L[er]),g+=Q[er],er>3&&(x(n,g,i[q]>>>5&8191),g+=o[er])}else x(n,g,H[i[q]]),g+=K[i[q]];return x(n,g,H[256]),g+K[256]},U=new f([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),D=function(r,a,i,v,u){return function(r,a,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(!a||h<8)for(var m=0;m<=h;m+=65535){var M=m+65535;M<h?d=k(w,d,r.subarray(m,M)):(w[m]=c,d=k(w,d,r.subarray(m,h)))}else{for(var y=U[a-1],C=y>>>13,x=8191&y,S=(1<<i)-1,A=new e(32768),O=new e(S+1),T=Math.ceil(i/3),D=2*T,I=function(n){return(r[n]^r[n+1]<<T^r[n+2]<<D)&S},J=new f(25e3),N=new e(288),W=new e(32),_=0,j=0,P=(m=0,0),q=0,z=0;m<h;++m){var B=I(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,J,N,W,j,P,z,m-z,d),P=_=j=0,z=m;for(var K=0;K<286;++K)N[K]=0;for(K=0;K<30;++K)W[K]=0}var L=2,Q=0,R=x,V=F-G&32767;if(H>2&&B==I(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){J[P++]=268435456|s[L]<<18|l[Q];var tr=31&s[L],or=31&l[Q];j+=t[tr]+o[or],++N[257+tr],++W[or],q=m+L,++_}else J[P++]=r[m],++N[r[m]]}}d=E(r,w,c,J,N,W,j,P,z,m-z,d)}return p(g,0,v+b(d)+u)}(r,null==a.level?6:a.level,null==a.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(r.length)))):12+a.mem,i,v,!u)};function I(r,n){void 0===n&&(n={});var e=function(){var r=1,n=0;return{p:function(e){for(var f=r,t=n,o=e.length,a=0;a!=o;){for(var i=Math.min(a+5552,o);a<i;++a)t+=f+=e[a];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,o,a=D(r,n,2,4);return f=a,t=n.level,o=0==t?0:t<6?1:9==t?3:2,f[0]=120,f[1]=o<<6|(o?32-2*o:1),function(r,n,e){for(;e;++n)r[n]=e,e>>>=8}(a,a.length-4,e.d()),a}const J=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}(I(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)),o=0,a=function(r){t[o++]=r},i=0;i<f;++i){if(o+5>t.length){var v=new n(o+8+(f-i<<1));v.set(t),t=v}var u=r.charCodeAt(i);u<128||e?a(u):u<2048?(a(192|u>>>6),a(128|63&u)):u>55295&&u<57344?(a(240|(u=65536+(1047552&u)|1023&r.charCodeAt(++i))>>>18),a(128|u>>>12&63),a(128|u>>>6&63),a(128|63&u)):(a(224|u>>>12),a(128|u>>>6&63),a(128|63&u))}return p(t,0,o)}(JSON.stringify(e))),!0)};onmessage=r=>{const{event:n,sessionId:e}=r.data,f=JSON.stringify(J(n));postMessage({compressedEvent:f,sessionId:e})};const N=onmessage;return r.compressionOnMessage=N,Object.defineProperty(r,"__esModule",{value:!0}),r}({});\n')?o:n;if((null===(i=this.config.experimental)||void 0===i?void 0:i.useWebWorker)&&l&&l.Worker&&c){t.loggerProvider.log("[Experimental] Enabling web worker for compression");var u=new Worker(URL.createObjectURL(new Blob([c],{type:"application/javascript"})));u.onerror=function(e){t.loggerProvider.error(e)},u.onmessage=function(e){var t=e.data,r=t.compressedEvent,n=t.sessionId;a.addCompressedEventToManager(r,n)},this.worker=u}}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}(),ng=function(){function e(){var e=this;this.name="@amplitude/session-replay-browser",this.recordCancelCallback=null,this.eventCount=0,this.pageLeaveFns=[],this.teardownEventListeners=function(t){var r=N();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()},this.pageLeaveListener=function(t){e.pageLeaveFns.forEach((function(e){e(t)}))},this.addCustomRRWebEvent=function(t,r,n){return void 0===r&&(r={}),void 0===n&&(n=!0),a(e,void 0,void 0,(function(){var e,s,o,a;return l(this,(function(l){switch(l.label){case 0:return l.trys.push([0,3,,4]),e=void 0,(s=this.config)?(e={config:cf(s),version:ff},n?[4,lf()]:[3,2]):[3,2];case 1:o=l.sent(),e=i(i({},o),e),l.label=2;case 2:return this.recordCancelCallback?iu.addCustomEvent(t,i(i({},r),e)):this.loggerProvider.debug("Not able to add custom replay capture event ".concat(t," due to no ongoing recording.")),[3,4];case 3:return a=l.sent(),this.loggerProvider.debug("Error while adding custom replay capture event: ",a),[3,4];case 4:return[2]}}))}))},this.stopRecordingEvents=function(){try{e.loggerProvider.log("Session Replay capture stopping."),e.recordCancelCallback&&e.recordCancelCallback(),e.recordCancelCallback=null}catch(r){var t=r;e.loggerProvider.warn("Error occurred while stopping replay capture: ".concat(t.toString()))}},this.loggerProvider=new g}return e.prototype.init=function(e,t){return f(this._init(e,t))},e.prototype._init=function(e,t){var r,n,s,o;return a(this,void 0,void 0,(function(){var i,a,c,d,p,f,m,y,v,w,b;return l(this,(function(l){switch(l.label){case 0:return this.loggerProvider=t.loggerProvider||new g,Object.prototype.hasOwnProperty.call(t,"logLevel")&&this.loggerProvider.enable(t.logLevel),this.identifiers=new Cm({sessionId:t.sessionId,deviceId:t.deviceId}),i=this,[4,hf(e,t)];case 1:return i.joinedConfigGenerator=l.sent(),a=this,[4,this.joinedConfigGenerator.generateJoinedConfig(this.identifiers.sessionId)];case 2:a.config=l.sent(),t.sessionId&&(null===(r=this.config.interactionConfig)||void 0===r?void 0:r.enabled)&&(c=Sm.default({sessionId:t.sessionId,type:"interaction"},this.config),this.pageLeaveFns=[c.send(this.getDeviceId.bind(this)).bind(c)],this.scrollHook=c.hook.bind(c)),d=[],"idb"!==(p=this.config.storeType)||(null===(n=N())||void 0===n?void 0:n.indexedDB)||(p="memory",this.loggerProvider.warn("Could not use preferred indexedDB storage, reverting to in memory option.")),this.loggerProvider.log("Using ".concat(p," for event storage.")),l.label=3;case 3:return l.trys.push([3,5,,6]),[4,Qf({config:this.config,sessionId:this.identifiers.sessionId,type:"replay",storeType:p})];case 4:return f=l.sent(),d.push({name:"replay",manager:f}),[3,6];case 5:return m=l.sent(),b=m,this.loggerProvider.warn("Error occurred while creating replay events manager: ".concat(b.toString())),[3,6];case 6:if(!(null===(s=this.config.interactionConfig)||void 0===s?void 0:s.enabled))return[3,10];y=this.config.interactionConfig.batch?gm:mm,l.label=7;case 7:return l.trys.push([7,9,,10]),[4,Qf({config:this.config,sessionId:this.identifiers.sessionId,type:"interaction",minInterval:null!==(o=this.config.interactionConfig.trackEveryNms)&&void 0!==o?o:3e4,maxInterval:6e4,payloadBatcher:y,storeType:p})];case 8:return v=l.sent(),d.push({name:"interaction",manager:v}),[3,10];case 9:return w=l.sent(),b=w,this.loggerProvider.warn("Error occurred while creating interaction events manager: ".concat(b.toString())),[3,10];case 10:return this.eventsManager=new(em.bind.apply(em,h([void 0],u(d),!1))),this.eventCompressor&&this.eventCompressor.terminate(),this.eventCompressor=new rg(this.eventsManager,this.config,this.getDeviceId()),this.loggerProvider.log("Installing @amplitude/session-replay-browser."),this.teardownEventListeners(!1),this.initialize(!0),[2]}}))}))},e.prototype.setSessionId=function(e,t){return f(this.asyncSetSessionId(e,t))},e.prototype.asyncSetSessionId=function(e,t){return a(this,void 0,void 0,(function(){var r,n,s;return l(this,(function(o){switch(o.label){case 0:return(r=this.identifiers&&this.identifiers.sessionId)&&this.sendEvents(r),n=t||this.getDeviceId(),this.identifiers=new Cm({sessionId:e,deviceId:n}),this.joinedConfigGenerator&&r?(s=this,[4,this.joinedConfigGenerator.generateJoinedConfig(this.identifiers.sessionId)]):[3,2];case 1:s.config=o.sent(),o.label=2;case 2:return this.recordEvents(),[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={})[_]=r.sessionReplayId?r.sessionReplayId:null,s=e,t.debugMode&&(s[U]=JSON.stringify({appHash:of(t.apiKey).toString()}))),this.addCustomRRWebEvent(R.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;if(void 0===e&&(e=!1),null===(t=this.identifiers)||void 0===t?void 0:t.sessionId){var r=this.getDeviceId();r?(this.eventsManager&&e&&this.eventsManager.sendStoredEvents({deviceId:r}),this.recordEvents()):this.loggerProvider.log("Session is not being recorded due to lack of device id.")}else this.loggerProvider.log("Session is not being recorded due to lack of session id.")},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="$default_instance"),T.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=(e=this.identifiers.sessionId,t=this.config.sampleRate,r=of(e.toString()),31*Math.abs(r)%1e6/1e6<t);return n||this.loggerProvider.log("Opting session ".concat(this.identifiers.sessionId," out of recording due to sample rate.")),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.recordEvents=function(){var e,t=this,r=this.config,n=this.getShouldRecord(),s=null===(e=this.identifiers)||void 0===e?void 0:e.sessionId;if(n&&s&&r){this.stopRecordingEvents();var o=r.privacyConfig,i=r.interactionConfig,a=(null==i?void 0:i.enabled)?{mouseInteraction:this.eventsManager&&ym(this.loggerProvider,{eventsManager:this.eventsManager,sessionId:s,deviceIdFn:this.getDeviceId.bind(this)}),scroll:this.scrollHook}:{};this.loggerProvider.log("Session Replay capture beginning for ".concat(s,".")),this.recordCancelCallback=iu({emit:function(e){if(t.shouldOptOut())return t.loggerProvider.log("Opting session ".concat(s," out of recording due to optOut config.")),t.stopRecordingEvents(),void t.sendEvents();t.eventCompressor&&t.eventCompressor.enqueueEvent(e,s)},inlineStylesheet:r.shouldInlineStylesheet,hooks:a,maskAllInputs:!0,maskTextClass:B,blockClass:"amp-block",blockSelector:this.getBlockSelectors(),maskInputFn:sf("input",o),maskTextFn:sf("text",o),maskTextSelector:this.getMaskTextSelectors(),recordCanvas:!1,errorHandler:function(e){var r=e;if(r.message.includes("insertRule")&&r.message.includes("CSSStyleSheet"))throw r;if(r._external_)throw r;return t.loggerProvider.warn("Error while capturing replay: ",r.toString()),!0}}),this.addCustomRRWebEvent(R.DEBUG_INFO)}},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),a(this,void 0,void 0,(function(){return l(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}(),sg=function(e){return function(){var t=e.config||z();return{logger:t.loggerProvider,logLevel:t.logLevel}}},og=function(){var e=new ng;return{init:C(e.init.bind(e),"init",sg(e)),setSessionId:C(e.setSessionId.bind(e),"setSessionId",sg(e)),getSessionId:C(e.getSessionId.bind(e),"getSessionId",sg(e)),getSessionReplayProperties:C(e.getSessionReplayProperties.bind(e),"getSessionReplayProperties",sg(e)),flush:C(e.flush.bind(e),"flush",sg(e)),shutdown:C(e.shutdown.bind(e),"shutdown",sg(e))}}(),ig=og.init,ag=og.setSessionId,lg=og.getSessionId,cg=og.getSessionReplayProperties;og.flush;var ug=og.shutdown,hg="1.13.2-beta.0",dg=function(){function e(e){this.name="@amplitude/plugin-session-replay-browser",this.type="enrichment",this.options=i({forceSessionTracking:!1},e)}return e.prototype.setup=function(e){var t,r,n,s,o;return a(this,void 0,void 0,(function(){var a;return l(this,(function(l){switch(l.label){case 0:return l.trys.push([0,2,,3]),null==e||e.loggerProvider.log("Installing @amplitude/plugin-session-replay, version ".concat(hg,".")),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=i(i({},e.defaultTracking),{sessions:!0})),[4,ig(e.apiKey,{instanceName:this.config.instanceName,deviceId:null!==(t=this.options.deviceId)&&void 0!==t?t: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===(r=this.options.privacyConfig)||void 0===r?void 0:r.blockSelector,maskSelector:null===(n=this.options.privacyConfig)||void 0===n?void 0:n.maskSelector,unmaskSelector:null===(s=this.options.privacyConfig)||void 0===s?void 0:s.unmaskSelector,defaultMaskLevel:null===(o=this.options.privacyConfig)||void 0===o?void 0:o.defaultMaskLevel},debugMode:this.options.debugMode,shouldInlineStylesheet:this.options.shouldInlineStylesheet,version:{type:"plugin",version:hg},performanceConfig:this.options.performanceConfig,storeType:this.options.storeType,experimental:this.options.experimental}).promise];case 1:return l.sent(),[3,3];case 2:return a=l.sent(),null==e||e.loggerProvider.error("Session Replay: Failed to initialize due to ".concat(a.message)),[3,3];case 3:return[2]}}))}))},e.prototype.execute=function(e){var t;return a(this,void 0,void 0,(function(){var r,n,s;return l(this,(function(o){switch(o.label){case 0:return o.trys.push([0,8,,9]),this.options.customSessionId?(r=this.options.customSessionId(e))?r===lg()?[3,2]:[4,ag(r).promise]:[3,3]:[3,4];case 1:o.sent(),o.label=2;case 2:n=cg(),e.event_properties=i(i({},e.event_properties),n),o.label=3;case 3:return[3,7];case 4:return(r=this.config.sessionId)&&r!==lg()?[4,ag(r).promise]:[3,6];case 5:o.sent(),o.label=6;case 6:r&&r===e.session_id&&(n=cg(),e.event_properties=i(i({},e.event_properties),n)),o.label=7;case 7:return[2,Promise.resolve(e)];case 8:return s=o.sent(),null===(t=this.config)||void 0===t||t.loggerProvider.error("Session Replay: Failed to enrich event due to ".concat(s.message)),[2,Promise.resolve(e)];case 9:return[2]}}))}))},e.prototype.teardown=function(){var e;return a(this,void 0,void 0,(function(){return l(this,(function(t){try{ug(),this.config=null}catch(t){null===(e=this.config)||void 0===e||e.loggerProvider.error("Session Replay: teardown failed due to ".concat(t.message))}return[2]}))}))},e.prototype.getSessionReplayProperties=function(){return cg()},e}(),pg=function(e){return new dg(e)};return e.plugin=pg,e.sessionReplayPlugin=pg,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,i=function(){return i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var s in t=arguments[r])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},i.apply(this,arguments)};function a(e,t,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 l(e,t){var r,n,s,o,i={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(l){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(i=0)),i;)try{if(r=1,n&&(s=2&a[0]?n.return:a[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,a[1])).done)return s;switch(n=0,s&&(a=[2&a[0],s.value]),a[0]){case 0:case 1:s=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(s=i.trys,(s=s.length>0&&s[s.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!s||a[1]>s[0]&&a[1]<s[3])){i.label=a[1];break}if(6===a[0]&&i.label<s[1]){i.label=s[1],s=a;break}if(s&&i.label<s[2]){i.label=s[2],i.ops.push(a);break}s[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],n=0}finally{r=s=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}function c(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 u(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 h(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){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"}(n||(n={})),function(e){e.US="US",e.EU="EU",e.STAGING="STAGING"}(s||(s={})),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"}(o||(o={}));var d="".concat("AMP","_unsent"),p="https://api2.amplitude.com/2/httpapi",f=function(e){return{promise:e||Promise.resolve()}},m="Amplitude Logger ",g=function(){function e(){this.logLevel=n.None}return e.prototype.disable=function(){this.logLevel=n.None},e.prototype.enable=function(e){void 0===e&&(e=n.Warn),this.logLevel=e},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<n.Verbose||console.log("".concat(m,"[Log]: ").concat(e.join(" ")))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<n.Warn||console.warn("".concat(m,"[Warn]: ").concat(e.join(" ")))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<n.Error||console.error("".concat(m,"[Error]: ").concat(e.join(" ")))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<n.Debug||console.log("".concat(m,"[Debug]: ").concat(e.join(" ")))},e}(),y=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,instanceName:"$default_instance",logLevel:n.Warn,loggerProvider:new g,optOut:!1,serverUrl:p,serverZone:s.US,useBatch:!1}},v=function(){function e(e){var t,r,n,s;this._optOut=!1;var o=y();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.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=b(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}(),w=function(e,t){return e===s.EU?t?"https://api.eu.amplitude.com/batch":"https://api.eu.amplitude.com/2/httpapi":t?"https://api2.amplitude.com/batch":p},b=function(e,t,r){if(void 0===e&&(e=""),void 0===t&&(t=y().serverZone),void 0===r&&(r=y().useBatch),e)return{serverUrl:e,serverZone:void 0};var n=["US","EU"].includes(t)?t:y().serverZone;return{serverZone:n,serverUrl:w(n,r)}},S=function(e){return void 0===e&&(e=0),((new Error).stack||"").split("\n").slice(2+e).map((function(e){return e.trim()}))},C=function(e,t,r,s,o){return void 0===o&&(o=null),function(){for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];var l=r(),c=l.logger,u=l.logLevel;if(u&&u<n.Debug||!u||!c)return e.apply(o,i);var h={type:"invoke public method",name:t,args:i,stacktrace:S(1),time:{start:(new Date).toISOString()},states:{}};s&&h.states&&(h.states.before=s());var d=e.apply(o,i);return d&&d.promise?d.promise.then((function(){s&&h.states&&(h.states.after=s()),h.time&&(h.time.end=(new Date).toISOString()),c.debug(JSON.stringify(h,null,2))})):(s&&h.states&&(h.states.after=s()),h.time&&(h.time.end=(new Date).toISOString()),c.debug(JSON.stringify(h,null,2))),d}},I=function(){function e(){}return e.prototype.send=function(e,t){return Promise.resolve(null)},e.prototype.buildResponse=function(e){var t,r,n,s,i,a,l,c,u,h,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 o.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 o.Invalid:return{status:k,statusCode:x,body:{error:null!==(s=e.error)&&void 0!==s?s:"",missingField:null!==(i=e.missing_field)&&void 0!==i?i:"",eventsWithInvalidFields:null!==(a=e.events_with_invalid_fields)&&void 0!==a?a:{},eventsWithMissingFields:null!==(l=e.events_with_missing_fields)&&void 0!==l?l:{},eventsWithInvalidIdLengths:null!==(c=e.events_with_invalid_id_lengths)&&void 0!==c?c:{},epsThreshold:null!==(u=e.eps_threshold)&&void 0!==u?u:0,exceededDailyQuotaDevices:null!==(h=e.exceeded_daily_quota_devices)&&void 0!==h?h:{},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 o.PayloadTooLarge:return{status:k,statusCode:x,body:{error:null!==(g=e.error)&&void 0!==g?g:""}};case o.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 o.Timeout:default:return{status:k,statusCode:x}}},e.prototype.buildStatus=function(e){return e>=200&&e<300?o.Success:429===e?o.RateLimit:413===e?o.PayloadTooLarge:408===e?o.Timeout:e>=400&&e<500?o.Invalid:e>=500?o.Failed:o.Unknown},e}(),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}(),M=function(){return M=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},M.apply(this,arguments)},E=function(e,t){var r=typeof e;if(r!==typeof t)return!1;for(var n=0,s=["string","number","boolean","undefined"];n<s.length;n++){if(s[n]===r)return e===t}if(null==e&&null==t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;var o=Array.isArray(e),i=Array.isArray(t);if(o!==i)return!1;if(!o||!i){var a=Object.keys(e).sort(),l=Object.keys(t).sort();if(!E(a,l))return!1;var c=!0;return Object.keys(e).forEach((function(r){E(e[r],t[r])||(c=!1)})),c}for(var u=0;u<e.length;u++)if(!E(e[u],t[u]))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 R,A=function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var e=this,t=M({},this.identity.userProperties),r=M(M({},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){for(var t=r.userProperties||{},n=0,s=Object.entries(e);n<s.length;n++){var o=s[n],i=o[0],a=o[1];switch(i){case"$set":for(var l=0,c=Object.entries(a);l<c.length;l++){var u=c[l],h=u[0],d=u[1];t[h]=d}break;case"$unset":for(var p=0,f=Object.keys(a);p<f.length;p++){delete t[h=f[p]]}break;case"$clearAll":t={}}}return r.userProperties=t,this},commit:function(){return e.setIdentity(r),this}}},e.prototype.getIdentity=function(){return M({},this.identity)},e.prototype.setIdentity=function(e){var t=M({},this.identity);this.identity=M({},e),E(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}(),P="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:self,T=function(){function e(){this.identityStore=new A,this.eventBridge=new O,this.applicationContextProvider=new x}return e.getInstance=function(t){return P.analyticsConnectorInstances||(P.analyticsConnectorInstances={}),P.analyticsConnectorInstances[t]||(P.analyticsConnectorInstances[t]=new e),P.analyticsConnectorInstances[t]},e}(),N=function(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:void 0},L=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.send=function(e,t){return a(this,void 0,void 0,(function(){var r,n,s;return l(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}(I),D="[Amplitude]",_="".concat(D," Session Replay ID"),F=s.US,U="".concat(D," Session Replay Debug"),B="amp-mask";!function(e){e.GET_SR_PROPS="get-sr-props",e.DEBUG_INFO="debug-info"}(R||(R={}));var j,z=function(){return{flushMaxRetries:2,logLevel:n.Warn,loggerProvider:new g,transportProvider:new L}},W=function(e){function t(t,r){var n,s=this,o=z();return(s=e.call(this,i(i({transportProvider:o.transportProvider},r),{apiKey:t}))||this).flushMaxRetries=void 0!==r.flushMaxRetries&&r.flushMaxRetries<=o.flushMaxRetries?r.flushMaxRetries:o.flushMaxRetries,s.apiKey=t,s.sampleRate=r.sampleRate||0,s.serverZone=r.serverZone||F,s.configServerUrl=r.configServerUrl,s.trackServerUrl=r.trackServerUrl,s.shouldInlineStylesheet=r.shouldInlineStylesheet,s.version=r.version,s.performanceConfig=r.performanceConfig,s.storeType=null!==(n=r.storeType)&&void 0!==n?n:"idb",r.privacyConfig&&(s.privacyConfig=r.privacyConfig),r.debugMode&&(s.debugMode=r.debugMode),r.experimental&&(s.experimental=r.experimental),s}return r(t,e),t}(v),V=Object.defineProperty,q=(e,t,r)=>((e,t,r)=>t in e?V(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),G=Object.defineProperty,Z=(e,t,r)=>((e,t,r)=>t in e?G(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),J=(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))(J||{});const Y={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},K={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},H={};function $(e){if(H[e])return H[e];const t=globalThis[e],r=t.prototype,n=e in Y?Y[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 K?K[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&&!globalThis.Zone)return H[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?H[e]=o:r}catch{return r}}const X={};function Q(e,t,r){var n;const s=`${e}.${String(r)}`;if(X[s])return X[s].call(t);const o=$(e),i=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return i?(X[s]=i,i.call(t)):t[r]}const ee={};function te(e,t,r){const n=`${e}.${String(r)}`;if(ee[n])return ee[n].bind(t);const s=$(e)[r];return"function"!=typeof s?t[r]:(ee[n]=s,s.bind(t))}const re={childNodes:function(e){return Q("Node",e,"childNodes")},parentNode:function(e){return Q("Node",e,"parentNode")},parentElement:function(e){return Q("Node",e,"parentElement")},textContent:function(e){return Q("Node",e,"textContent")},contains:function(e,t){return te("Node",e,"contains")(t)},getRootNode:function(e){return te("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Q("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Q("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Q("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Q("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return $("MutationObserver").constructor}};function ne(e){return e.nodeType===e.ELEMENT_NODE}function se(e){const t=e&&"host"in e&&"mode"in e&&re.host(e)||null;return Boolean(t&&"shadowRoot"in t&&re.shadowRoot(t)===e)}function oe(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function ie(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=>ae(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 ae(e,t){if(function(e){return"styleSheet"in e}(e)){let t;try{t=ie(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?ve(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?ve(r,t):r}}class le{constructor(){Z(this,"idNodeMap",new Map),Z(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 ce({element:e,maskInputOptions:t,tagName:r,type:n,value:s,maskInputFn:o}){let i=s||"";const a=n&&ue(n);return(t[r.toLowerCase()]||a&&t[a])&&(i=o?o(i,e):"*".repeat(i.length)),i}function ue(e){return e.toLowerCase()}const he="__rrweb_original__";function de(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?ue(t):null}function pe(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 fe=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,me=/^(?:[a-z+]+:)?\/\//i,ge=/^www\..*/i,ye=/^(data:)([^,]*),(.*)/i;function ve(e,t){return(e||"").replace(fe,((e,r,n,s,o,i)=>{const a=n||o||i,l=r||s||"";if(!a)return e;if(me.test(a)||ge.test(a))return`url(${l}${a}${l})`;if(ye.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 we(e){return e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"")}function be(e,t){return function(e,t){const r=Array.from(t.childNodes),n=[];if(r.length>1&&e&&"string"==typeof e){const t=we(e);for(let s=1;s<r.length;s++)if(r[s].textContent&&"string"==typeof r[s].textContent){const o=we(r[s].textContent);for(let r=3;r<o.length;r++){const s=o.substring(0,r);if(2===t.split(s).length){const r=t.indexOf(s);for(let t=r;t<e.length;t++)if(we(e.substring(0,t)).length===r){n.push(e.substring(0,t)),e=e.substring(t);break}break}}}}return n.push(e),n}(e,t).join("/* rr_split */")}let Se=1;const Ce=new RegExp("[^a-z0-9-_:]");function Ie(){return Se++}let xe,ke;const Oe=/^[^ \t\n\r\u000c]+/,Me=/^[, \t\n\r\u000c]+/;const Ee=new WeakMap;function Re(e,t){return t&&""!==t.trim()?Pe(e,t):t}function Ae(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function Pe(e,t){let r=Ee.get(e);if(r||(r=e.createElement("a"),Ee.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function Te(e,t,r,n){return n?"src"===r||"href"===r&&("use"!==t||"#"!==n[0])||"xlink:href"===r&&"#"!==n[0]?Re(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(Me),!(r>=t.length);){let o=n(Oe);if(","===o.slice(-1))o=Re(e,o.substring(0,o.length-1)),s.push(o);else{let n="";o=Re(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?ve(n,Pe(e)):"object"===t&&"data"===r?Re(e,n):n:Re(e,n):n}function Ne(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function Le(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&Le(re.parentNode(e),t,r);for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!!r&&Le(re.parentNode(e),t,r)}function De(e,t,r,n){let s;if(ne(e)){if(s=e,!re.childNodes(s).length)return!1}else{if(null===re.parentElement(e))return!1;s=re.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(Le(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 _e(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}=t,y=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:J.Document,childNodes:[],compatMode:e.compatMode}:{type:J.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:J.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:y};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}=t,f=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),m=function(e){if(e instanceof HTMLFormElement)return"form";const t=ue(e.tagName);return Ce.test(t)?"div":t}(e);let g={};const y=e.attributes.length;for(let t=0;t<y;t++){const n=e.attributes[t];Ne(m,n.name,n.value)||(g[n.name]=Te(r,m,ue(n.name),n.value))}if("link"===m&&o){const t=Array.from(r.styleSheets).find((t=>t.href===e.href));let n=null;t&&(n=ie(t)),n&&(delete g.rel,delete g.href,g._cssText=n)}if("style"===m&&e.sheet){let t=ie(e.sheet);t&&(e.childNodes.length>1&&(t=be(t,e)),g._cssText=t)}if("input"===m||"textarea"===m||"select"===m){const t=e.value,r=e.checked;"radio"!==g.type&&"checkbox"!==g.type&&"submit"!==g.type&&"button"!==g.type&&t?g.value=ce({element:e,type:de(e),tagName:m,value:t,maskInputOptions:i,maskInputFn:a}):r&&(g.checked=r)}"option"===m&&(e.selected&&!i.select?g.selected=!0:delete g.selected);"dialog"===m&&e.open&&(g.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal");if("canvas"===m&&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=he in s?s[he]: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)||(g.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)&&(g.rr_dataURL=t)}if("img"===m&&c){xe||(xe=r.createElement("canvas"),ke=xe.getContext("2d"));const t=e,n=t.currentSrc||t.getAttribute("src")||"<unknown-src>",s=t.crossOrigin,o=()=>{t.removeEventListener("load",o);try{xe.width=t.naturalWidth,xe.height=t.naturalHeight,ke.drawImage(t,0,0),g.rr_dataURL=xe.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?g.crossOrigin=s:t.removeAttribute("crossorigin"))};t.complete&&0!==t.naturalWidth?o():t.addEventListener("load",o)}if("audio"===m||"video"===m){const t=g;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&&(g.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(g.rr_scrollTop=e.scrollTop));if(f){const{width:t,height:r}=e.getBoundingClientRect();g={class:g.class,rr_width:`${t}px`,rr_height:`${r}px`}}"iframe"!==m||h(g.src)||(e.contentDocument||(g.rr_src=g.src),delete g.src);let v;try{customElements.get(m)&&(v=!0)}catch(e){}return{type:J.Element,tagName:m,attributes:g,childNodes:[],isSVG:Ae(e)||void 0,needBlock:f,rootId:p,isCustom:v}}(e,{doc:r,blockClass:s,blockSelector:o,inlineStylesheet:a,maskInputOptions:l,maskInputFn:u,dataURLOptions:h,inlineImages:d,recordCanvas:p,keepIframeSrcFn:f,newlyAddedElement:m,rootId:y});case e.TEXT_NODE:return function(e,t){const{needsMask:r,maskTextFn:n,rootId:s,cssCaptured:o}=t,i=re.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=re.textContent(e),c&&l&&(l=ve(l,Pe(t.doc))));!c&&!u&&l&&r&&(l=n?n(l,re.parentElement(e)):l.replace(/[\S]/g,"*"));return{type:J.Text,textContent:l||"",rootId:s}}(e,{doc:r,needsMask:i,maskTextFn:c,rootId:y,cssCaptured:g});case e.CDATA_SECTION_NODE:return{type:J.CDATA,textContent:"",rootId:y};case e.COMMENT_NODE:return{type:J.Comment,textContent:re.textContent(e)||"",rootId:y};default:return!1}}function Fe(e){return null==e?"":e.toLowerCase()}function Ue(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}=t;let{needsMask:k}=t,{preserveWhiteSpace:O=!0}=t;if(!k){k=De(e,i,a,void 0===k)}const M=_e(e,{doc:r,mirror:n,blockClass:s,blockSelector:o,needsMask:k,inlineStylesheet:c,maskInputOptions:u,maskTextFn:h,maskInputFn:d,dataURLOptions:f,inlineImages:m,recordCanvas:g,keepIframeSrcFn:C,newlyAddedElement:I,cssCaptured:x});if(!M)return console.warn(e,"not serialized"),null;let E;E=n.hasNode(e)?n.getId(e):function(e,t){if(t.comment&&e.type===J.Comment)return!0;if(e.type===J.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"===pe(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(Fe(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Fe(e.attributes.name)||"icon"===Fe(e.attributes.rel)||"apple-touch-icon"===Fe(e.attributes.rel)||"shortcut icon"===Fe(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&Fe(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Fe(e.attributes.property).match(/^(og|twitter|fb):/)||Fe(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===Fe(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===Fe(e.attributes.name)||"googlebot"===Fe(e.attributes.name)||"bingbot"===Fe(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===Fe(e.attributes.name)||"generator"===Fe(e.attributes.name)||"framework"===Fe(e.attributes.name)||"publisher"===Fe(e.attributes.name)||"progid"===Fe(e.attributes.name)||Fe(e.attributes.property).match(/^article:/)||Fe(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===Fe(e.attributes.name)||"yandex-verification"===Fe(e.attributes.name)||"csrf-token"===Fe(e.attributes.name)||"p:domain_verify"===Fe(e.attributes.name)||"verify-v1"===Fe(e.attributes.name)||"verification"===Fe(e.attributes.name)||"shopify-checkout-api-token"===Fe(e.attributes.name)))return!0}}return!1}(M,p)||!O&&M.type===J.Text&&!M.textContent.replace(/^\s+|\s+$/gm,"").length?-2:Ie();const R=Object.assign(M,{id:E});if(n.add(e,R),-2===E)return null;y&&y(e);let A=!l;if(R.type===J.Element){A=A&&!R.needBlock,delete R.needBlock;const t=re.shadowRoot(e);t&&oe(t)&&(R.isShadowHost=!0)}if((R.type===J.Document||R.type===J.Element)&&A){p.headWhitespace&&R.type===J.Element&&"head"===R.tagName&&(O=!1);const t={doc:r,mirror:n,blockClass:s,blockSelector:o,needsMask:k,maskTextClass:i,maskTextSelector:a,skipChild:l,inlineStylesheet:c,maskInputOptions:u,maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:f,inlineImages:m,recordCanvas:g,preserveWhiteSpace:O,onSerialize:y,onIframeLoad:v,iframeLoadTimeout:w,onStylesheetLoad:b,stylesheetLoadTimeout:S,keepIframeSrcFn:C,cssCaptured:!1};if(R.type===J.Element&&"textarea"===R.tagName&&void 0!==R.attributes.value);else{R.type===J.Element&&void 0!==R.attributes._cssText&&"string"==typeof R.attributes._cssText&&(t.cssCaptured=!0);for(const r of Array.from(re.childNodes(e))){const e=Ue(r,t);e&&R.childNodes.push(e)}}let I=null;if(ne(e)&&(I=re.shadowRoot(e)))for(const e of Array.from(re.childNodes(I))){const r=Ue(e,t);r&&(oe(I)&&(r.isShadow=!0),R.childNodes.push(r))}}const P=re.parentNode(e);return P&&se(P)&&oe(P)&&(R.isShadow=!0),R.type===J.Element&&"iframe"===R.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=Ue(t,{doc:t,mirror:n,blockClass:s,blockSelector:o,needsMask:k,maskTextClass:i,maskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:f,inlineImages:m,recordCanvas:g,preserveWhiteSpace:O,onSerialize:y,onIframeLoad:v,iframeLoadTimeout:w,onStylesheetLoad:b,stylesheetLoadTimeout:S,keepIframeSrcFn:C});r&&v(e,r)}}),w),R.type===J.Element&&"link"===R.tagName&&"string"==typeof R.attributes.rel&&("stylesheet"===R.attributes.rel||"preload"===R.attributes.rel&&"string"==typeof R.attributes.href&&"css"===pe(R.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=Ue(e,{doc:r,mirror:n,blockClass:s,blockSelector:o,needsMask:k,maskTextClass:i,maskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:f,inlineImages:m,recordCanvas:g,preserveWhiteSpace:O,onSerialize:y,onIframeLoad:v,iframeLoadTimeout:w,onStylesheetLoad:b,stylesheetLoadTimeout:S,keepIframeSrcFn:C});t&&b(e,t)}}),S),R}function Be(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function je(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 ze={exports:{}},We=String,Ve=function(){return{isColorSupported:!1,reset:We,bold:We,dim:We,italic:We,underline:We,inverse:We,hidden:We,strikethrough:We,black:We,red:We,green:We,yellow:We,blue:We,magenta:We,cyan:We,white:We,gray:We,bgBlack:We,bgRed:We,bgGreen:We,bgYellow:We,bgBlue:We,bgMagenta:We,bgCyan:We,bgWhite:We}};ze.exports=Ve(),ze.exports.createColors=Ve;var qe=ze.exports;const Ge=je(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let Ze=qe,Je=Ge,Ye=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=Ze.isColorSupported),Je&&e&&(t=Je(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}=Ze.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 Ke=Ye;Ye.default=Ye;var He={};He.isClean=Symbol("isClean"),He.my=Symbol("my");const $e={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let Xe=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 $e[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=$e[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 Qe=Xe;Xe.default=Xe;let et=Qe;function tt(e,t){new et(t).stringify(e)}var rt=tt;tt.default=tt;let{isClean:nt,my:st}=He,ot=Ke,it=Qe,at=rt;function lt(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=>lt(e,r))):("object"===o&&null!==s&&(s=lt(s)),r[n]=s)}return r}let ct=class{constructor(e={}){this.raws={},this[nt]=!1,this[st]=!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=lt(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 ot(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[nt]){this[nt]=!1;let e=this;for(;e=e.parent;)e[nt]=!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 it).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=at){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 ut=ct;ct.default=ct;let ht=ut,dt=class extends ht{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 pt=dt;dt.default=dt;var ft={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:mt,SourceMapGenerator:gt}=Ge,{existsSync:yt,readFileSync:vt}=Ge,{dirname:wt,join:bt}=Ge;let St=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=wt(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new mt(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=wt(e),yt(e))return this.mapFile=e,vt(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 mt)return gt.fromSourceMap(t).toString();if(t instanceof gt)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=bt(wt(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 Ct=St;St.default=St;let{SourceMapConsumer:It,SourceMapGenerator:xt}=Ge,{fileURLToPath:kt,pathToFileURL:Ot}=Ge,{isAbsolute:Mt,resolve:Et}=Ge,{nanoid:Rt}=ft,At=Ge,Pt=Ke,Tt=Ct,Nt=Symbol("fromOffsetCache"),Lt=Boolean(It&&xt),Dt=Boolean(Et&&Mt),_t=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&&(!Dt||/^\w+:\/\//.test(t.from)||Mt(t.from)?this.file=t.from:this.file=Et(t.from)),Dt&&Lt){let e=new Tt(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 "+Rt(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 Pt(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 Pt(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&&(Ot&&(s.input.url=Ot(this.file).toString()),s.input.file=this.file),s}fromOffset(e){let t,r;if(this[Nt])r=this[Nt];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[Nt]=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:Et(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=Mt(a.source)?Ot(a.source):new URL(a.source,this.map.consumer().sourceRoot||Ot(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(!kt)throw new Error("file: protocol is not available in this PostCSS build");l.file=kt(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 Ft=_t;_t.default=_t,At&&At.registerInput&&At.registerInput(_t);let{SourceMapConsumer:Ut,SourceMapGenerator:Bt}=Ge,{dirname:jt,relative:zt,resolve:Wt,sep:Vt}=Ge,{pathToFileURL:qt}=Ge,Gt=Ft,Zt=Boolean(Ut&&Bt),Jt=Boolean(jt&&Wt&&zt&&Vt);var Yt=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||jt(e.file);!1===this.mapOpts.sourcesContent?(t=new Ut(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(),Jt&&Zt&&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=Bt.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new Bt({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 Bt({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?jt(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=jt(Wt(r,this.mapOpts.annotation)));let n=zt(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 Gt(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(qt){let t=qt(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;"\\"===Vt&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let Kt=ut,Ht=class extends Kt{constructor(e){super(e),this.type="comment"}};var $t=Ht;Ht.default=Ht;let Xt,Qt,er,tr,{isClean:rr,my:nr}=He,sr=pt,or=$t,ir=ut;function ar(e){return e.map((e=>(e.nodes&&(e.nodes=ar(e.nodes)),delete e.source,e)))}function lr(e){if(e[rr]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)lr(t)}let cr=class e extends ir{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=ar(Xt(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 sr(t)]}else if(t.selector)t=[new Qt(t)];else if(t.name)t=[new er(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new or(t)]}return t.map((t=>(t[nr]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[rr]&&lr(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]}};cr.registerParse=e=>{Xt=e},cr.registerRule=e=>{Qt=e},cr.registerAtRule=e=>{er=e},cr.registerRoot=e=>{tr=e};var ur=cr;cr.default=cr,cr.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,er.prototype):"rule"===e.type?Object.setPrototypeOf(e,Qt.prototype):"decl"===e.type?Object.setPrototypeOf(e,sr.prototype):"comment"===e.type?Object.setPrototypeOf(e,or.prototype):"root"===e.type&&Object.setPrototypeOf(e,tr.prototype),e[nr]=!0,e.nodes&&e.nodes.forEach((e=>{cr.rebuild(e)}))};let hr,dr,pr=ur,fr=class extends pr{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new hr(new dr,this,e).stringify()}};fr.registerLazyResult=e=>{hr=e},fr.registerProcessor=e=>{dr=e};var mr=fr;fr.default=fr;let gr={};var yr=function(e){gr[e]||(gr[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let vr=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 wr=vr;vr.default=vr;let br=wr,Sr=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 br(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter((e=>"warning"===e.type))}get content(){return this.css}};var Cr=Sr;Sr.default=Sr;const Ir="'".charCodeAt(0),xr='"'.charCodeAt(0),kr="\\".charCodeAt(0),Or="/".charCodeAt(0),Mr="\n".charCodeAt(0),Er=" ".charCodeAt(0),Rr="\f".charCodeAt(0),Ar="\t".charCodeAt(0),Pr="\r".charCodeAt(0),Tr="[".charCodeAt(0),Nr="]".charCodeAt(0),Lr="(".charCodeAt(0),Dr=")".charCodeAt(0),_r="{".charCodeAt(0),Fr="}".charCodeAt(0),Ur=";".charCodeAt(0),Br="*".charCodeAt(0),jr=":".charCodeAt(0),zr="@".charCodeAt(0),Wr=/[\t\n\f\r "#'()/;[\\\]{}]/g,Vr=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,qr=/.[\r\n"'(/\\]/,Gr=/[\da-f]/i;let Zr=ur,Jr=class extends Zr{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 Yr=Jr;Jr.default=Jr,Zr.registerAtRule(Jr);let Kr,Hr,$r=ur,Xr=class extends $r{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){let n=super.normalize(e);if(t)if("prepend"===r)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of n)e.raws.before=t.raws.before;return n}removeChild(e,t){let r=this.index(e);return!t&&0===r&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(e={}){return new Kr(new Hr,this,e).stringify()}};Xr.registerLazyResult=e=>{Kr=e},Xr.registerProcessor=e=>{Hr=e};var Qr=Xr;Xr.default=Xr,$r.registerRoot(Xr);let en={comma:e=>en.split(e,[","],!0),space:e=>en.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 tn=en;en.default=en;let rn=ur,nn=tn,sn=class extends rn{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return nn.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 on=sn;sn.default=sn,rn.registerRule(sn);let an=pt,ln=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 Mr:case Er:case Ar:case Pr:case Rr:n=m;do{n+=1,r=d.charCodeAt(n)}while(r===Er||r===Mr||r===Ar||r===Pr||r===Rr);h=["space",d.slice(m,n)],m=n-1;break;case Tr:case Nr:case _r:case Fr:case jr:case Ur:case Dr:{let e=String.fromCharCode(r);h=[e,e,m];break}case Lr:if(c=g.length?g.pop()[1]:"",u=d.charCodeAt(m+1),"url"===c&&u!==Ir&&u!==xr&&u!==Er&&u!==Mr&&u!==Ar&&u!==Rr&&u!==Pr){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)===kr;)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||qr.test(o)?h=["(","(",m]:(h=["brackets",o,m,n],m=n);break;case Ir:case xr:s=r===Ir?"'":'"',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)===kr;)l-=1,a=!a}while(a);h=["string",d.slice(m,n+1),m,n],m=n;break;case zr:Wr.lastIndex=m+1,Wr.test(d),n=0===Wr.lastIndex?d.length-1:Wr.lastIndex-2,h=["at-word",d.slice(m,n+1),m,n],m=n;break;case kr:for(n=m,i=!0;d.charCodeAt(n+1)===kr;)n+=1,i=!i;if(r=d.charCodeAt(n+1),i&&r!==Or&&r!==Er&&r!==Mr&&r!==Ar&&r!==Pr&&r!==Rr&&(n+=1,Gr.test(d.charAt(n)))){for(;Gr.test(d.charAt(n+1));)n+=1;d.charCodeAt(n+1)===Er&&(n+=1)}h=["word",d.slice(m,n+1),m,n],m=n;break;default:r===Or&&d.charCodeAt(m+1)===Br?(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):(Vr.lastIndex=m+1,Vr.test(d),n=0===Vr.lastIndex?d.length-1:Vr.lastIndex-2,h=["word",d.slice(m,n+1),m,n],g.push(h),m=n)}return m++,h},position:function(){return m}}},cn=$t,un=Yr,hn=Qr,dn=on;const pn={empty:!0,space:!0};var fn=class{constructor(e){this.input=e,this.root=new hn,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 un;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 cn;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=ln(this.input)}decl(e,t){let r=new an;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 dn;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",pn[a]||pn[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 dn;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 mn=ur,gn=fn,yn=Ft;function vn(e,t){let r=new yn(e,t),n=new gn(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 wn=vn;vn.default=vn,mn.registerParse(vn);let{isClean:bn,my:Sn}=He,Cn=Yt,In=rt,xn=ur,kn=mr,On=yr,Mn=Cr,En=wn,Rn=Qr;const An={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Pn={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},Tn={Once:!0,postcssPlugin:!0,prepare:!0};function Nn(e){return"object"==typeof e&&"function"==typeof e.then}function Ln(e){let t=!1,r=An[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 Dn(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:Ln(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function _n(e){return e[bn]=!1,e.nodes&&e.nodes.forEach((e=>_n(e))),e}let Fn={},Un=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 Mn)s=_n(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=En;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[Sn]&&xn.rebuild(s)}else s=_n(r);this.result=new Mn(t,s,n),this.helpers={...Fn,postcss:Fn,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(!Pn[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Tn[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(Nn(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[bn];){e[bn]=!0;let t=[Dn(e)];for(;t.length>0;){let e=this.visitTick(t);if(Nn(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 Nn(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=In;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new Cn(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(Nn(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[bn];)e[bn]=!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||On("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(Nn(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[bn])return n[bn]=!0,void e.push(Dn(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[bn]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[bn]=!0;let t=Ln(e);for(let r of t)if(0===r)e.nodes&&e.each((e=>{e[bn]||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"}};Un.registerPostcss=e=>{Fn=e};var Bn=Un;Un.default=Un,Rn.registerLazyResult(Un),kn.registerLazyResult(Un);let jn=Yt,zn=rt,Wn=yr,Vn=wn;const qn=Cr;let Gn=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=zn;this.result=new qn(this._processor,n,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let i=new jn(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||Wn("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=Vn;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 Zn=Gn;Gn.default=Gn;let Jn=Zn,Yn=Bn,Kn=mr,Hn=Qr,$n=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 Yn(this,e,t):new Jn(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var Xn=$n;$n.default=$n,Hn.registerProcessor($n),Kn.registerProcessor($n);let Qn=pt,es=Ct,ts=$t,rs=Yr,ns=Ft,ss=Qr,os=on;function is(e,t){if(Array.isArray(e))return e.map((e=>is(e)));let{inputs:r,...n}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:ns.prototype};r.map&&(r.map={...r.map,__proto__:es.prototype}),t.push(r)}}if(n.nodes&&(n.nodes=e.nodes.map((e=>is(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 ss(n);if("decl"===n.type)return new Qn(n);if("rule"===n.type)return new os(n);if("comment"===n.type)return new ts(n);if("atrule"===n.type)return new rs(n);throw new Error("Unknown node type: "+e.type)}var as=is;is.default=is;let ls=Ke,cs=pt,us=Bn,hs=ur,ds=Xn,ps=rt,fs=as,ms=mr,gs=wr,ys=$t,vs=Yr,ws=Cr,bs=Ft,Ss=wn,Cs=tn,Is=on,xs=Qr,ks=ut;function Os(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new ds(e)}Os.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 ds).version,s}return Object.defineProperty(s,"postcss",{get:()=>(r||(r=s()),r)}),s.process=function(e,t,r){return Os([s(r)]).process(e,t)},s},Os.stringify=ps,Os.parse=Ss,Os.fromJSON=fs,Os.list=Cs,Os.comment=e=>new ys(e),Os.atRule=e=>new vs(e),Os.decl=e=>new cs(e),Os.rule=e=>new Is(e),Os.root=e=>new xs(e),Os.document=e=>new ms(e),Os.CssSyntaxError=ls,Os.Declaration=cs,Os.Container=hs,Os.Processor=ds,Os.Document=ms,Os.Comment=ys,Os.Warning=gs,Os.AtRule=vs,Os.Result=ws,Os.Input=bs,Os.Rule=Is,Os.Root=xs,Os.Node=ks,us.registerPostcss(Os);var Ms=Os;Os.default=Os;const Es=Be(Ms);Es.stringify,Es.fromJSON,Es.plugin,Es.parse,Es.list,Es.document,Es.comment,Es.atRule,Es.rule,Es.decl,Es.root,Es.CssSyntaxError,Es.Declaration,Es.Container,Es.Processor,Es.Document,Es.Comment,Es.Warning,Es.AtRule,Es.Result,Es.Input,Es.Rule,Es.Root,Es.Node;var Rs=Object.defineProperty,As=(e,t,r)=>((e,t,r)=>t in e?Rs(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);function Ps(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Ts(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 Ns={exports:{}},Ls=String,Ds=function(){return{isColorSupported:!1,reset:Ls,bold:Ls,dim:Ls,italic:Ls,underline:Ls,inverse:Ls,hidden:Ls,strikethrough:Ls,black:Ls,red:Ls,green:Ls,yellow:Ls,blue:Ls,magenta:Ls,cyan:Ls,white:Ls,gray:Ls,bgBlack:Ls,bgRed:Ls,bgGreen:Ls,bgYellow:Ls,bgBlue:Ls,bgMagenta:Ls,bgCyan:Ls,bgWhite:Ls}};Ns.exports=Ds(),Ns.exports.createColors=Ds;var _s=Ns.exports;const Fs=Ts(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let Us=_s,Bs=Fs,js=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=Us.isColorSupported),Bs&&e&&(t=Bs(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}=Us.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 zs=js;js.default=js;var Ws={};Ws.isClean=Symbol("isClean"),Ws.my=Symbol("my");const Vs={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let qs=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 Vs[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=Vs[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 Gs=qs;qs.default=qs;let Zs=Gs;function Js(e,t){new Zs(t).stringify(e)}var Ys=Js;Js.default=Js;let{isClean:Ks,my:Hs}=Ws,$s=zs,Xs=Gs,Qs=Ys;function eo(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=>eo(e,r))):("object"===o&&null!==s&&(s=eo(s)),r[n]=s)}return r}let to=class{constructor(e={}){this.raws={},this[Ks]=!1,this[Hs]=!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=eo(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 $s(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[Ks]){this[Ks]=!1;let e=this;for(;e=e.parent;)e[Ks]=!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 Xs).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=Qs){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 ro=to;to.default=to;let no=ro,so=class extends no{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 oo=so;so.default=so;var io={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:ao,SourceMapGenerator:lo}=Fs,{existsSync:co,readFileSync:uo}=Fs,{dirname:ho,join:po}=Fs;let fo=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=ho(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new ao(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=ho(e),co(e))return this.mapFile=e,uo(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 ao)return lo.fromSourceMap(t).toString();if(t instanceof lo)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=po(ho(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 mo=fo;fo.default=fo;let{SourceMapConsumer:go,SourceMapGenerator:yo}=Fs,{fileURLToPath:vo,pathToFileURL:wo}=Fs,{isAbsolute:bo,resolve:So}=Fs,{nanoid:Co}=io,Io=Fs,xo=zs,ko=mo,Oo=Symbol("fromOffsetCache"),Mo=Boolean(go&&yo),Eo=Boolean(So&&bo),Ro=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&&(!Eo||/^\w+:\/\//.test(t.from)||bo(t.from)?this.file=t.from:this.file=So(t.from)),Eo&&Mo){let e=new ko(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 "+Co(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 xo(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 xo(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&&(wo&&(s.input.url=wo(this.file).toString()),s.input.file=this.file),s}fromOffset(e){let t,r;if(this[Oo])r=this[Oo];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[Oo]=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:So(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=bo(a.source)?wo(a.source):new URL(a.source,this.map.consumer().sourceRoot||wo(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(!vo)throw new Error("file: protocol is not available in this PostCSS build");l.file=vo(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 Ao=Ro;Ro.default=Ro,Io&&Io.registerInput&&Io.registerInput(Ro);let{SourceMapConsumer:Po,SourceMapGenerator:To}=Fs,{dirname:No,relative:Lo,resolve:Do,sep:_o}=Fs,{pathToFileURL:Fo}=Fs,Uo=Ao,Bo=Boolean(Po&&To),jo=Boolean(No&&Do&&Lo&&_o);var zo=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||No(e.file);!1===this.mapOpts.sourcesContent?(t=new Po(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(),jo&&Bo&&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=To.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new To({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 To({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?No(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=No(Do(r,this.mapOpts.annotation)));let n=Lo(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 Uo(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(Fo){let t=Fo(e).toString();return this.memoizedFileURLs.set(e,t),t}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;"\\"===_o&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let Wo=ro,Vo=class extends Wo{constructor(e){super(e),this.type="comment"}};var qo=Vo;Vo.default=Vo;let Go,Zo,Jo,Yo,{isClean:Ko,my:Ho}=Ws,$o=oo,Xo=qo,Qo=ro;function ei(e){return e.map((e=>(e.nodes&&(e.nodes=ei(e.nodes)),delete e.source,e)))}function ti(e){if(e[Ko]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)ti(t)}let ri=class e extends Qo{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=ei(Go(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 $o(t)]}else if(t.selector)t=[new Zo(t)];else if(t.name)t=[new Jo(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new Xo(t)]}return t.map((t=>(t[Ho]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[Ko]&&ti(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]}};ri.registerParse=e=>{Go=e},ri.registerRule=e=>{Zo=e},ri.registerAtRule=e=>{Jo=e},ri.registerRoot=e=>{Yo=e};var ni=ri;ri.default=ri,ri.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,Jo.prototype):"rule"===e.type?Object.setPrototypeOf(e,Zo.prototype):"decl"===e.type?Object.setPrototypeOf(e,$o.prototype):"comment"===e.type?Object.setPrototypeOf(e,Xo.prototype):"root"===e.type&&Object.setPrototypeOf(e,Yo.prototype),e[Ho]=!0,e.nodes&&e.nodes.forEach((e=>{ri.rebuild(e)}))};let si,oi,ii=ni,ai=class extends ii{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new si(new oi,this,e).stringify()}};ai.registerLazyResult=e=>{si=e},ai.registerProcessor=e=>{oi=e};var li=ai;ai.default=ai;let ci={};var ui=function(e){ci[e]||(ci[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let hi=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 di=hi;hi.default=hi;let pi=di,fi=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 pi(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter((e=>"warning"===e.type))}get content(){return this.css}};var mi=fi;fi.default=fi;const gi="'".charCodeAt(0),yi='"'.charCodeAt(0),vi="\\".charCodeAt(0),wi="/".charCodeAt(0),bi="\n".charCodeAt(0),Si=" ".charCodeAt(0),Ci="\f".charCodeAt(0),Ii="\t".charCodeAt(0),xi="\r".charCodeAt(0),ki="[".charCodeAt(0),Oi="]".charCodeAt(0),Mi="(".charCodeAt(0),Ei=")".charCodeAt(0),Ri="{".charCodeAt(0),Ai="}".charCodeAt(0),Pi=";".charCodeAt(0),Ti="*".charCodeAt(0),Ni=":".charCodeAt(0),Li="@".charCodeAt(0),Di=/[\t\n\f\r "#'()/;[\\\]{}]/g,_i=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Fi=/.[\r\n"'(/\\]/,Ui=/[\da-f]/i;let Bi=ni,ji=class extends Bi{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 zi=ji;ji.default=ji,Bi.registerAtRule(ji);let Wi,Vi,qi=ni,Gi=class extends qi{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 Wi(new Vi,this,e).stringify()}};Gi.registerLazyResult=e=>{Wi=e},Gi.registerProcessor=e=>{Vi=e};var Zi=Gi;Gi.default=Gi,qi.registerRoot(Gi);let Ji={comma:e=>Ji.split(e,[","],!0),space:e=>Ji.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 Yi=Ji;Ji.default=Ji;let Ki=ni,Hi=Yi,$i=class extends Ki{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Hi.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 Xi=$i;$i.default=$i,Ki.registerRule($i);let Qi=oo,ea=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 bi:case Si:case Ii:case xi:case Ci:n=m;do{n+=1,r=d.charCodeAt(n)}while(r===Si||r===bi||r===Ii||r===xi||r===Ci);h=["space",d.slice(m,n)],m=n-1;break;case ki:case Oi:case Ri:case Ai:case Ni:case Pi:case Ei:{let e=String.fromCharCode(r);h=[e,e,m];break}case Mi:if(c=g.length?g.pop()[1]:"",u=d.charCodeAt(m+1),"url"===c&&u!==gi&&u!==yi&&u!==Si&&u!==bi&&u!==Ii&&u!==Ci&&u!==xi){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)===vi;)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||Fi.test(o)?h=["(","(",m]:(h=["brackets",o,m,n],m=n);break;case gi:case yi:s=r===gi?"'":'"',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)===vi;)l-=1,a=!a}while(a);h=["string",d.slice(m,n+1),m,n],m=n;break;case Li:Di.lastIndex=m+1,Di.test(d),n=0===Di.lastIndex?d.length-1:Di.lastIndex-2,h=["at-word",d.slice(m,n+1),m,n],m=n;break;case vi:for(n=m,i=!0;d.charCodeAt(n+1)===vi;)n+=1,i=!i;if(r=d.charCodeAt(n+1),i&&r!==wi&&r!==Si&&r!==bi&&r!==Ii&&r!==xi&&r!==Ci&&(n+=1,Ui.test(d.charAt(n)))){for(;Ui.test(d.charAt(n+1));)n+=1;d.charCodeAt(n+1)===Si&&(n+=1)}h=["word",d.slice(m,n+1),m,n],m=n;break;default:r===wi&&d.charCodeAt(m+1)===Ti?(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):(_i.lastIndex=m+1,_i.test(d),n=0===_i.lastIndex?d.length-1:_i.lastIndex-2,h=["word",d.slice(m,n+1),m,n],g.push(h),m=n)}return m++,h},position:function(){return m}}},ta=qo,ra=zi,na=Zi,sa=Xi;const oa={empty:!0,space:!0};var ia=class{constructor(e){this.input=e,this.root=new na,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 ra;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 ta;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=ea(this.input)}decl(e,t){let r=new Qi;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 sa;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",oa[a]||oa[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 sa;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 aa=ni,la=ia,ca=Ao;function ua(e,t){let r=new ca(e,t),n=new la(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 ha=ua;ua.default=ua,aa.registerParse(ua);let{isClean:da,my:pa}=Ws,fa=zo,ma=Ys,ga=ni,ya=li,va=ui,wa=mi,ba=ha,Sa=Zi;const Ca={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Ia={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},xa={Once:!0,postcssPlugin:!0,prepare:!0};function ka(e){return"object"==typeof e&&"function"==typeof e.then}function Oa(e){let t=!1,r=Ca[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 Ma(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:Oa(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function Ea(e){return e[da]=!1,e.nodes&&e.nodes.forEach((e=>Ea(e))),e}let Ra={},Aa=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 wa)s=Ea(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=ba;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[pa]&&ga.rebuild(s)}else s=Ea(r);this.result=new wa(t,s,n),this.helpers={...Ra,postcss:Ra,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(!Ia[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!xa[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(ka(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[da];){e[da]=!0;let t=[Ma(e)];for(;t.length>0;){let e=this.visitTick(t);if(ka(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 ka(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=ma;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new fa(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(ka(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[da];)e[da]=!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||va("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(ka(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[da])return n[da]=!0,void e.push(Ma(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[da]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[da]=!0;let t=Oa(e);for(let r of t)if(0===r)e.nodes&&e.each((e=>{e[da]||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"}};Aa.registerPostcss=e=>{Ra=e};var Pa=Aa;Aa.default=Aa,Sa.registerLazyResult(Aa),ya.registerLazyResult(Aa);let Ta=zo,Na=Ys,La=ui,Da=ha;const _a=mi;let Fa=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=Na;this.result=new _a(this._processor,n,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let i=new Ta(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||La("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=Da;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 Ua=Fa;Fa.default=Fa;let Ba=Ua,ja=Pa,za=li,Wa=Zi,Va=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 ja(this,e,t):new Ba(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var qa=Va;Va.default=Va,Wa.registerProcessor(Va),za.registerProcessor(Va);let Ga=oo,Za=mo,Ja=qo,Ya=zi,Ka=Ao,Ha=Zi,$a=Xi;function Xa(e,t){if(Array.isArray(e))return e.map((e=>Xa(e)));let{inputs:r,...n}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:Ka.prototype};r.map&&(r.map={...r.map,__proto__:Za.prototype}),t.push(r)}}if(n.nodes&&(n.nodes=e.nodes.map((e=>Xa(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 Ha(n);if("decl"===n.type)return new Ga(n);if("rule"===n.type)return new $a(n);if("comment"===n.type)return new Ja(n);if("atrule"===n.type)return new Ya(n);throw new Error("Unknown node type: "+e.type)}var Qa=Xa;Xa.default=Xa;let el=zs,tl=oo,rl=Pa,nl=ni,sl=qa,ol=Ys,il=Qa,al=li,ll=di,cl=qo,ul=zi,hl=mi,dl=Ao,pl=ha,fl=Yi,ml=Xi,gl=Zi,yl=ro;function vl(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new sl(e)}vl.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 sl).version,s}return Object.defineProperty(s,"postcss",{get:()=>(r||(r=s()),r)}),s.process=function(e,t,r){return vl([s(r)]).process(e,t)},s},vl.stringify=ol,vl.parse=pl,vl.fromJSON=il,vl.list=fl,vl.comment=e=>new cl(e),vl.atRule=e=>new ul(e),vl.decl=e=>new tl(e),vl.rule=e=>new ml(e),vl.root=e=>new gl(e),vl.document=e=>new al(e),vl.CssSyntaxError=el,vl.Declaration=tl,vl.Container=nl,vl.Processor=sl,vl.Document=al,vl.Comment=cl,vl.Warning=ll,vl.AtRule=ul,vl.Result=hl,vl.Input=dl,vl.Rule=ml,vl.Root=gl,vl.Node=yl,rl.registerPostcss(vl);var wl=vl;vl.default=vl;const bl=Ps(wl);bl.stringify,bl.fromJSON,bl.plugin,bl.parse,bl.list,bl.document,bl.comment,bl.atRule,bl.rule,bl.decl,bl.root,bl.CssSyntaxError,bl.Declaration,bl.Container,bl.Processor,bl.Document,bl.Comment,bl.Warning,bl.AtRule,bl.Result,bl.Input,bl.Rule,bl.Root,bl.Node;class Sl{constructor(...e){As(this,"parentElement",null),As(this,"parentNode",null),As(this,"ownerDocument"),As(this,"firstChild",null),As(this,"lastChild",null),As(this,"previousSibling",null),As(this,"nextSibling",null),As(this,"ELEMENT_NODE",1),As(this,"TEXT_NODE",3),As(this,"nodeType"),As(this,"nodeName"),As(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 Sl))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 Cl={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Il={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},xl={};function kl(e){if(xl[e])return xl[e];const t=globalThis[e],r=t.prototype,n=e in Cl?Cl[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 Il?Il[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&&!globalThis.Zone)return xl[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?xl[e]=o:r}catch{return r}}const Ol={};function Ml(e,t,r){var n;const s=`${e}.${String(r)}`;if(Ol[s])return Ol[s].call(t);const o=kl(e),i=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return i?(Ol[s]=i,i.call(t)):t[r]}const El={};function Rl(e,t,r){const n=`${e}.${String(r)}`;if(El[n])return El[n].bind(t);const s=kl(e)[r];return"function"!=typeof s?t[r]:(El[n]=s,s.bind(t))}function Al(){return kl("MutationObserver").constructor}const Pl={childNodes:function(e){return Ml("Node",e,"childNodes")},parentNode:function(e){return Ml("Node",e,"parentNode")},parentElement:function(e){return Ml("Node",e,"parentElement")},textContent:function(e){return Ml("Node",e,"textContent")},contains:function(e,t){return Rl("Node",e,"contains")(t)},getRootNode:function(e){return Rl("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Ml("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Ml("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Ml("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Ml("Element",e,"querySelectorAll")(t)},mutationObserver:Al};function Tl(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}const Nl="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 Ll={map:{},getId:()=>(console.error(Nl),-1),getNode:()=>(console.error(Nl),null),removeNodeFromMap(){console.error(Nl)},has:()=>(console.error(Nl),!1),reset(){console.error(Nl)}};function Dl(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 _l(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)}}),()=>_l(e,t,o||{},!0)}function Fl(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&&(Ll=new Proxy(Ll,{get:(e,t,r)=>("map"===t&&console.error(Nl),Reflect.get(e,t,r))}));let Ul=Date.now;function Bl(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=Pl.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=Pl.parentElement(o.body))?void 0:n.scrollTop)||(null==(s=null==o?void 0:o.body)?void 0:s.scrollTop)||0}}function jl(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function zl(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Wl(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:Pl.parentElement(e)}function Vl(e,t,r,n){if(!e)return!1;const s=Wl(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(Le(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 ql(e,t){return-1!==t.getId(e)}function Gl(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||-2===t.getId(e)}function Zl(e,t){if(se(e))return!1;const r=t.getId(e);if(!t.has(r))return!0;const n=Pl.parentNode(e);return(!n||n.nodeType!==e.DOCUMENT_NODE)&&(!n||Zl(n,t))}function Jl(e){return Boolean(e.changedTouches)}function Yl(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}function Kl(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Hl(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function $l(e){return!!e&&(e instanceof Sl&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(Pl.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(Ul=()=>(new Date).getTime());class Xl{constructor(){q(this,"id",1),q(this,"styleIDMap",new WeakMap),q(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 Ql(e){var t;let r=null;return"getRootNode"in e&&(null==(t=Pl.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&Pl.host(Pl.getRootNode(e))&&(r=Pl.host(Pl.getRootNode(e))),r}function ec(e){let t,r=e;for(;t=Ql(r);)r=t;return r}function tc(e){const t=e.ownerDocument;if(!t)return!1;const r=ec(e);return Pl.contains(t,r)}function rc(e){const t=e.ownerDocument;return!!t&&(Pl.contains(t,e)||tc(e))}const nc=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:Xl,get _mirror(){return Ll},closestElementOfNode:Wl,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:ec,getShadowHost:Ql,getWindowHeight:jl,getWindowScroll:Bl,getWindowWidth:zl,hasShadowRoot:$l,hookSetter:_l,inDom:rc,isAncestorRemoved:Zl,isBlocked:Vl,isIgnored:Gl,isSerialized:ql,isSerializedIframe:Kl,isSerializedStylesheet:Hl,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:Jl,get nowTimestamp(){return Ul},on:Tl,patch:Fl,polyfill:Yl,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))}}else if(o in t){const e=t[o];e.children.push(r(s,e))}else n.push(r(s,null))}return n},shadowHostInDom:tc,throttle:Dl,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"}));var sc=(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))(sc||{}),oc=(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))(oc||{}),ic=(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))(ic||{}),ac=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(ac||{}),lc=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(lc||{}),cc=(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))(cc||{}),uc=(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))(uc||{});function hc(e){return"__ln"in e}class dc{constructor(){q(this,"length",0),q(this,"head",null),q(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&&hc(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&&hc(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 pc=(e,t)=>`${e}@${t}`;class fc{constructor(){q(this,"frozen",!1),q(this,"locked",!1),q(this,"texts",[]),q(this,"attributes",[]),q(this,"attributeMap",new WeakMap),q(this,"removes",[]),q(this,"mapRemoves",[]),q(this,"movedMap",{}),q(this,"addedSet",new Set),q(this,"movedSet",new Set),q(this,"droppedSet",new Set),q(this,"removesSubTreeCache",new Set),q(this,"mutationCb"),q(this,"blockClass"),q(this,"blockSelector"),q(this,"maskTextClass"),q(this,"maskTextSelector"),q(this,"inlineStylesheet"),q(this,"maskInputOptions"),q(this,"maskTextFn"),q(this,"maskInputFn"),q(this,"keepIframeSrcFn"),q(this,"recordCanvas"),q(this,"inlineImages"),q(this,"slimDOMOptions"),q(this,"dataURLOptions"),q(this,"doc"),q(this,"mirror"),q(this,"iframeManager"),q(this,"stylesheetManager"),q(this,"shadowDomManager"),q(this,"canvasManager"),q(this,"processedNodeManager"),q(this,"unattachedDoc"),q(this,"processMutations",(e=>{e.forEach(this.processMutation),this.emit()})),q(this,"emit",(()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,r=new dc,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=Pl.parentNode(s);if(!o||!rc(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=se(o)?this.mirror.getId(Ql(s)):this.mirror.getId(o),l=n(s);if(-1===a||-1===l)return r.addNode(s);const c=Ue(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=>{Kl(e,this.mirror)&&this.iframeManager.addIframe(e),Hl(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),$l(s)&&this.shadowDomManager.addShadowRoot(Pl.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)gc(this.removesSubTreeCache,e,this.mirror)&&!this.movedSet.has(Pl.parentNode(e))||s(e);for(const e of this.addedSet)yc(this.droppedSet,e)||gc(this.removesSubTreeCache,e,this.mirror)?yc(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(Pl.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(Pl.parentNode(r.value));if(-1===n(r.value))continue;if(-1!==t){e=r;break}{const t=r.value,n=Pl.parentNode(t);if(n&&n.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const t=Pl.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=Pl.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))})),q(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)),t.attributes.value=Array.from(Pl.childNodes(e),(e=>Pl.textContent(e)||"")).join("")})),q(this,"processMutation",(e=>{if(!Gl(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=Pl.textContent(e.target);Vl(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:De(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,Wl(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=de(t);n=ce({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:e,value:n,maskInputFn:this.maskInputFn})}if(Vl(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"),!Ne(t.tagName,r))if(s.attributes[r]=Te(this.doc,ue(t.tagName),ue(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(Vl(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=se(e.target)?this.mirror.getId(Pl.host(e.target)):this.mirror.getId(e.target);Vl(e.target,this.blockClass,this.blockSelector,!1)||Gl(t,this.mirror,this.slimDOMOptions)||!ql(t,this.mirror)||(this.addedSet.has(t)?(mc(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||Zl(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[pc(r,n)]?mc(this.movedSet,t):(this.removes.push({parentId:n,id:r,isShadow:!(!se(e.target)||!oe(e.target))||void 0}),function(e,t){const r=[e];for(;r.length;){const e=r.pop();t.has(e)||(t.add(e),Pl.childNodes(e).forEach((e=>r.push(e))))}}(t,this.removesSubTreeCache))),this.mapRemoves.push(t))}))}})),q(this,"genAdds",((e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(Gl(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[pc(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Vl(e,this.blockClass,this.blockSelector,!1)||(Pl.childNodes(e).forEach((e=>this.genAdds(e))),$l(e)&&Pl.childNodes(Pl.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 mc(e,t){e.delete(t),Pl.childNodes(t).forEach((t=>mc(e,t)))}function gc(e,t,r){return 0!==e.size&&function(e,t,r){const n=Pl.parentNode(t);return!!n&&e.has(n)}(e,t)}function yc(e,t){return 0!==e.size&&vc(e,t)}function vc(e,t){const r=Pl.parentNode(t);return!!r&&(!!e.has(r)||vc(e,r))}let wc;const bc=e=>{if(!wc)return e;return(...t)=>{try{return e(...t)}catch(e){if(wc&&!0===wc(e))return;throw e}}};function Sc(e){return(...t)=>{try{return e(...t)}catch(e){try{e._external_=!0}catch{}throw e}}}const Cc=[];function Ic(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 xc(e,t){const r=new fc;Cc.push(r),r.init(e);const n=new(Al())(bc(r.processMutations.bind(r)));return n.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),n}function kc({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(ic).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==i[e])).forEach((o=>{let i=ue(o);const c=(t=>o=>{const i=Ic(o);if(Vl(i,n,s,!0))return;let a=null,c=t;if("pointerType"in o){switch(o.pointerType){case"mouse":a=ac.Mouse;break;case"touch":a=ac.Touch;break;case"pen":a=ac.Pen}a===ac.Touch?ic[t]===ic.MouseDown?c="TouchStart":ic[t]===ic.MouseUp&&(c="TouchEnd"):ac.Pen}else Jl(o)&&(a=ac.Touch);null!==a?(l=a,(c.startsWith("Touch")&&a===ac.Touch||c.startsWith("Mouse")&&a===ac.Mouse)&&(a=null)):ic[t]===ic.Click&&(a=l,l=null);const u=Jl(o)?o.changedTouches[0]:o;if(!u)return;const h=r.getId(i),{clientX:d,clientY:p}=u;bc(e)({type:ic[c],id:h,x:d,y:p,...null!==a&&{pointerType:a}})})(o);if(window.PointerEvent)switch(ic[o]){case ic.MouseDown:case ic.MouseUp:i=i.replace("mouse","pointer");break;case ic.TouchStart:case ic.TouchEnd:return}a.push(Tl(i,c,t))})),bc((()=>{a.forEach((e=>e()))}))}function Oc({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:s,sampling:o}){const i=bc(Dl(bc((o=>{const i=Ic(o);if(!i||Vl(i,n,s,!0))return;const a=r.getId(i);if(i===t&&t.defaultView){const r=Bl(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 Tl("scroll",i,t)}const Mc=["INPUT","TEXTAREA","SELECT"],Ec=new WeakMap;function Rc(e){return function(e,t){if(Nc("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||Nc("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||Nc("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||Nc("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 Ac(e,t,r){let n,s;return e?(e.ownerNode?n=t.getId(e.ownerNode):s=r.getId(e),{styleId:s,id:n}):{}}function Pc({mirror:e,stylesheetManager:t},r){var n,s,o;let i=null;i="#document"===r.nodeName?e.getId(r):e.getId(Pl.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}}),bc((()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))):()=>{}}function Tc(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=xc(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=Dl(bc((t=>{const r=Date.now()-i;e(a.map((e=>(e.timeOffset-=r,e))),t),a=[],i=null})),o),c=bc(Dl(bc((e=>{const t=Ic(e),{clientX:r,clientY:s}=Jl(e)?e.changedTouches[0]:e;i||(i=Ul()),a.push({x:r,y:s,id:n.getId(t),timeOffset:Ul()-i}),l("undefined"!=typeof DragEvent&&e instanceof DragEvent?oc.Drag:e instanceof MouseEvent?oc.MouseMove:oc.TouchMove)})),s,{trailing:!1})),u=[Tl("mousemove",c,r),Tl("touchmove",c,r),Tl("drag",c,r)];return bc((()=>{u.forEach((e=>e()))}))}(e),o=kc(e),i=Oc(e),a=function({viewportResizeCb:e},{win:t}){let r=-1,n=-1;return Tl("resize",bc(Dl(bc((()=>{const t=jl(),s=zl();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=Ic(e);const c=e.isTrusted,h=r&&r.tagName;if(r&&"OPTION"===h&&(r=Pl.parentElement(r)),!r||!h||Mc.indexOf(h)<0||Vl(r,n,s,!0))return;if(r.classList.contains(o)||i&&r.matches(i))return;let p=r.value,f=!1;const m=de(r)||"";"radio"===m||"checkbox"===m?f=r.checked:(a[h.toLowerCase()]||a[m])&&(p=ce({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=Ec.get(t);if(!s||s.text!==n.text||s.isChecked!==n.isChecked){Ec.set(t,n);const s=r.getId(t);bc(e)({...n,id:s})}}const p=("last"===c.input?["change"]:["input","change"]).map((e=>Tl(e,bc(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=>_l(e[0],e[1],{set(){bc(h)({target:this,isTrusted:!1})}},!1,f)))),bc((()=>{p.forEach((e=>e()))}))}(e),c=function({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:s,doc:o}){const i=bc((o=>Dl(bc((s=>{const i=Ic(s);if(!i||Vl(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=[Tl("play",i(cc.Play),o),Tl("pause",i(cc.Pause),o),Tl("seeked",i(cc.Seeked),o),Tl("volumechange",i(cc.VolumeChange),o),Tl("ratechange",i(cc.RateChange),o)];return bc((()=>{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:bc(((n,s,o)=>{const[i,a]=o,{id:l,styleId:c}=Ac(s,t,r.styleMirror);return(l&&-1!==l||c&&-1!==c)&&e({id:l,styleId:c,adds:[{rule:i,index:a}]}),Sc((()=>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:bc(((n,s,o)=>{const[i]=o,{id:a,styleId:l}=Ac(s,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:i}]}),Sc((()=>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:bc(((n,s,o)=>{const[i]=o,{id:a,styleId:l}=Ac(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:bc(((n,s,o)=>{const[i]=o,{id:a,styleId:l}=Ac(s,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,replaceSync:i}),n.apply(s,o)}))}));const l={};Lc("CSSGroupingRule")?l.CSSGroupingRule=n.CSSGroupingRule:(Lc("CSSMediaRule")&&(l.CSSMediaRule=n.CSSMediaRule),Lc("CSSConditionRule")&&(l.CSSConditionRule=n.CSSConditionRule),Lc("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:bc(((n,s,o)=>{const[i,a]=o,{id:l,styleId:c}=Ac(s.parentStyleSheet,t,r.styleMirror);return(l&&-1!==l||c&&-1!==c)&&e({id:l,styleId:c,adds:[{rule:i,index:[...Rc(s),a||0]}]}),n.apply(s,o)}))}),s.prototype.deleteRule=new Proxy(c[n].deleteRule,{apply:bc(((n,s,o)=>{const[i]=o,{id:a,styleId:l}=Ac(s.parentStyleSheet,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:[...Rc(s),i]}]}),n.apply(s,o)}))})})),bc((()=>{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=Pc(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:bc(((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}=Ac(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:Rc(i.parentRule)}),s.apply(i,a)}))});const i=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(i,{apply:bc(((s,o,a)=>{var l;const[c]=a;if(r.has(c))return i.apply(o,[c]);const{id:u,styleId:h}=Ac(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:Rc(o.parentRule)}),s.apply(o,a)}))}),bc((()=>{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=Fl(t.fonts,"add",(function(t){return function(r){return setTimeout(bc((()=>{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),bc((()=>{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=bc((()=>{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;Vl(i,n,s,!0)||Vl(c,n,s,!0)||a.push({start:r.getId(i),startOffset:l,end:r.getId(c),endOffset:u})}o({ranges:a})}));return a(),Tl("selectionchange",a)}(e),m=function({doc:e,customElementCb:t}){const r=e.defaultView;return r&&r.customElements?Fl(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 bc((()=>{Cc.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 Nc(e){return void 0!==window[e]}function Lc(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class Dc{constructor(e){q(this,"iframeIdToRemoteIdMap",new WeakMap),q(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 _c{constructor(e){q(this,"iframes",new WeakMap),q(this,"crossOriginIframeMap",new WeakMap),q(this,"crossOriginIframeMirror",new Dc(Ie)),q(this,"crossOriginIframeStyleMirror"),q(this,"crossOriginIframeRootIdMap",new WeakMap),q(this,"mirror"),q(this,"mutationCb"),q(this,"wrappedEmit"),q(this,"loadListener"),q(this,"stylesheetManager"),q(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Dc(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 sc.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:sc.IncrementalSnapshot,data:{source:oc.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case sc.Meta:case sc.Load:case sc.DomContentLoaded:return!1;case sc.Plugin:return t;case sc.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case sc.IncrementalSnapshot:switch(t.data.source){case oc.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 oc.Drag:case oc.TouchMove:case oc.MouseMove:return t.data.positions.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case oc.ViewportResize:return!1;case oc.MediaInteraction:case oc.MouseInteraction:case oc.Scroll:case oc.CanvasMutation:case oc.Input:return this.replaceIds(t.data,e,["id"]),t;case oc.StyleSheetRule:case oc.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case oc.Font:return t;case oc.Selection:return t.data.ranges.forEach((t=>{this.replaceIds(t,e,["start","end"])})),t;case oc.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===uc.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach((e=>{this.patchRootIdOnNode(e,t)}))}}class Fc{constructor(e){q(this,"shadowDoms",new WeakSet),q(this,"mutationCb"),q(this,"scrollCb"),q(this,"bypassOptions"),q(this,"mirror"),q(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(!oe(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const r=xc({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push((()=>r.disconnect())),this.restoreHandlers.push(Oc({...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(Pl.host(e))),this.restoreHandlers.push(Pc({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(Fl(e.prototype,"attachShadow",(function(e){return function(n){const s=e.call(this,n),o=Pl.shadowRoot(this);return o&&rc(this)&&r.addShadowRoot(o,t),s}})))}reset(){this.restoreHandlers.forEach((e=>{try{e()}catch(e){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var Uc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Bc="undefined"==typeof Uint8Array?[]:new Uint8Array(256),jc=0;jc<Uc.length;jc++)Bc[Uc.charCodeAt(jc)]=jc;const zc=new Map;const Wc=(e,t,r)=>{if(!e||!Gc(e,t)&&"object"!=typeof e)return;const n=function(e,t){let r=zc.get(e);return r||(r=new Map,zc.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 Vc(e,t,r){if(e instanceof Array)return e.map((e=>Vc(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+=Uc[r[t]>>2],s+=Uc[(3&r[t])<<4|r[t+1]>>4],s+=Uc[(15&r[t+1])<<2|r[t+2]>>6],s+=Uc[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:[Vc(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:[Vc(e.data,t,r),e.width,e.height]}}if(Gc(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:Wc(e,t,r)}}return e}const qc=(e,t,r)=>e.map((e=>Vc(e,t,r))),Gc=(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 Zc(e,t,r,n){const s=[];try{const o=Fl(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(s,...o){if(!Vl(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 Jc(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=Fl(e,l,(function(e){return function(...i){const a=e.apply(this,i);if(Wc(a,o,this),"tagName"in this.canvas&&!Vl(this.canvas,n,s,!0)){const e=qc(i,o,this),n={type:t,property:l,args:e};r(this.canvas,n)}return a}}));i.push(a)}catch{const n=_l(e,l,{set(e){r(this.canvas,{type:t,property:l,args:[e],setter:!0})}});i.push(n)}return i}const Yc="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Kc="undefined"!=typeof window&&window.Blob&&new Blob([(Hc=Yc,Uint8Array.from(atob(Hc),(e=>e.charCodeAt(0))))],{type:"text/javascript;charset=utf-8"});var Hc;function $c(e){let t;try{if(t=Kc&&(window.URL||window.webkitURL).createObjectURL(Kc),!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,"+Yc,{name:null==e?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}class Xc{constructor(e){q(this,"pendingCanvasMutations",new Map),q(this,"rafStamps",{latestId:0,invokeId:null}),q(this,"mirror"),q(this,"mutationCb"),q(this,"resetObservers"),q(this,"frozen",!1),q(this,"locked",!1),q(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=Zc(t,r,n,!0),i=new Map,a=new $c;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:lc["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=>{Vl(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=Zc(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=Fl(t.CanvasRenderingContext2D.prototype,i,(function(s){return function(...o){return Vl(this.canvas,r,n,!0)||setTimeout((()=>{const r=qc(o,t,this);e(this.canvas,{type:lc["2D"],property:i,args:r})}),0),s.apply(this,o)}}));s.push(o)}catch{const r=_l(t.CanvasRenderingContext2D.prototype,i,{set(t){e(this.canvas,{type:lc["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(...Jc(t.WebGLRenderingContext.prototype,lc.WebGL,e,r,n,t)),void 0!==t.WebGL2RenderingContext&&s.push(...Jc(t.WebGL2RenderingContext.prototype,lc.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 Qc{constructor(e){q(this,"trackedLinkElements",new WeakSet),q(this,"mutationCb"),q(this,"adoptedStyleSheetCb"),q(this,"styleMirror",new Xl),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:ae(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 eu{constructor(){q(this,"nodeMap",new WeakMap),q(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 tu,ru,nu,su=!1;try{if(2!==Array.from([1],(e=>2*e))[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(j=e.contentWindow)?void 0:j.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}const ou=new le;function iu(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:M=!1,plugins:E,keepIframeSrcFn:R=(()=>!1),ignoreCSSAttributes:A=new Set([]),errorHandler:P}=e;wc=P;const T=!I||window.parent===window;let N=!1;if(!T)try{window.parent.document&&(N=!1)}catch(e){N=!0}if(T&&!t)throw new Error("emit function is required");if(!T&&!N)return()=>{};void 0!==b&&void 0===v.mousemove&&(v.mousemove=b),ou.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},D=!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 _;Yl();let F=0;const U=e=>{for(const t of E||[])t.eventProcessor&&(e=t.eventProcessor(e));return y&&!N&&(e=y(e)),e};tu=(e,s)=>{var o;const i=e;if(i.timestamp=Ul(),!(null==(o=Cc[0])?void 0:o.isFrozen())||i.type===sc.FullSnapshot||i.type===sc.IncrementalSnapshot&&i.data.source===oc.Mutation||Cc.forEach((e=>e.unfreeze())),T)null==t||t(U(i),s);else if(N){const e={type:"rrweb",event:U(i),origin:window.location.origin,isCheckout:s};window.parent.postMessage(e,"*")}if(i.type===sc.FullSnapshot)_=i,F=0;else if(i.type===sc.IncrementalSnapshot){if(i.data.source===oc.Mutation&&i.data.isAttachIframe)return;F++;const e=n&&F>=n,t=r&&i.timestamp-_.timestamp>r;(e||t)&&ru(!0)}};const B=e=>{tu({type:sc.IncrementalSnapshot,data:{source:oc.Mutation,...e}})},j=e=>tu({type:sc.IncrementalSnapshot,data:{source:oc.Scroll,...e}}),z=e=>tu({type:sc.IncrementalSnapshot,data:{source:oc.CanvasMutation,...e}}),W=new Qc({mutationCb:B,adoptedStyleSheetCb:e=>tu({type:sc.IncrementalSnapshot,data:{source:oc.AdoptedStyleSheet,...e}})}),V=new _c({mirror:ou,mutationCb:B,stylesheetManager:W,recordCrossOriginIframes:I,wrappedEmit:tu});for(const e of E||[])e.getMirror&&e.getMirror({nodeMirror:ou,crossOriginIframeMirror:V.crossOriginIframeMirror,crossOriginIframeStyleMirror:V.crossOriginIframeStyleMirror});const q=new eu;nu=new Xc({recordCanvas:C,mutationCb:z,win:window,blockClass:s,blockSelector:o,mirror:ou,sampling:v.canvas,dataURLOptions:w});const G=new Fc({mutationCb:B,scrollCb:j,bypassOptions:{blockClass:s,blockSelector:o,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskInputOptions:L,dataURLOptions:w,maskTextFn:m,maskInputFn:f,recordCanvas:C,inlineImages:M,sampling:v,slimDOMOptions:D,iframeManager:V,stylesheetManager:W,canvasManager:nu,keepIframeSrcFn:R,processedNodeManager:q},mirror:ou});ru=(e=!1)=>{if(!S)return;tu({type:sc.Meta,data:{href:window.location.href,width:zl(),height:jl()}},e),W.reset(),G.init(),Cc.forEach((e=>e.lock()));const t=function(e,t){const{mirror:r=new le,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)}=t||{};return Ue(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})}(document,{mirror:ou,blockClass:s,blockSelector:o,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskAllInputs:L,maskTextFn:m,maskInputFn:f,slimDOM:D,dataURLOptions:w,recordCanvas:C,inlineImages:M,onSerialize:e=>{Kl(e,ou)&&V.addIframe(e),Hl(e,ou)&&W.trackLinkElement(e),$l(e)&&G.addShadowRoot(Pl.shadowRoot(e),document)},onIframeLoad:(e,t)=>{V.attachIframe(e,t),G.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{W.attachLinkElement(e,t)},keepIframeSrcFn:R});if(!t)return console.warn("Failed to snapshot the document");tu({type:sc.FullSnapshot,data:{node:t,initialOffset:Bl(window)}},e),Cc.forEach((e=>e.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&W.adoptStyleSheets(document.adoptedStyleSheets,ou.getId(document))};try{const e=[],t=e=>{var t;return bc(Tc)({mutationCb:B,mousemoveCb:(e,t)=>tu({type:sc.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>tu({type:sc.IncrementalSnapshot,data:{source:oc.MouseInteraction,...e}}),scrollCb:j,viewportResizeCb:e=>tu({type:sc.IncrementalSnapshot,data:{source:oc.ViewportResize,...e}}),inputCb:e=>tu({type:sc.IncrementalSnapshot,data:{source:oc.Input,...e}}),mediaInteractionCb:e=>tu({type:sc.IncrementalSnapshot,data:{source:oc.MediaInteraction,...e}}),styleSheetRuleCb:e=>tu({type:sc.IncrementalSnapshot,data:{source:oc.StyleSheetRule,...e}}),styleDeclarationCb:e=>tu({type:sc.IncrementalSnapshot,data:{source:oc.StyleDeclaration,...e}}),canvasMutationCb:z,fontCb:e=>tu({type:sc.IncrementalSnapshot,data:{source:oc.Font,...e}}),selectionCb:e=>{tu({type:sc.IncrementalSnapshot,data:{source:oc.Selection,...e}})},customElementCb:e=>{tu({type:sc.IncrementalSnapshot,data:{source:oc.CustomElement,...e}})},blockClass:s,ignoreClass:i,ignoreSelector:a,maskTextClass:l,maskTextSelector:c,maskInputOptions:L,inlineStylesheet:u,sampling:v,recordDOM:S,recordCanvas:C,inlineImages:M,userTriggeredOnInput:k,collectFonts:O,doc:e,maskInputFn:f,maskTextFn:m,keepIframeSrcFn:R,blockSelector:o,slimDOMOptions:D,dataURLOptions:w,mirror:ou,iframeManager:V,stylesheetManager:W,shadowDomManager:G,processedNodeManager:q,canvasManager:nu,ignoreCSSAttributes:A,plugins:(null==(t=null==E?void 0:E.filter((e=>e.observer)))?void 0:t.map((e=>({observer:e.observer,options:e.options,callback:t=>tu({type:sc.Plugin,data:{plugin:e.name,payload:t}})}))))||[]},g)};V.addLoadListener((r=>{try{e.push(t(r.contentDocument))}catch(e){console.warn(e)}}));const r=()=>{ru(),e.push(t(document)),su=!0};return"interactive"===document.readyState||"complete"===document.readyState?r():(e.push(Tl("DOMContentLoaded",(()=>{tu({type:sc.DomContentLoaded,data:{}}),"DOMContentLoaded"===x&&r()}))),e.push(Tl("load",(()=>{tu({type:sc.Load,data:{}}),"load"===x&&r()}),window))),()=>{e.forEach((e=>e())),q.destroy(),su=!1,wc=void 0}}catch(e){console.warn(e)}}var au,lu;iu.addCustomEvent=(e,t)=>{if(!su)throw new Error("please add custom event after start recording");tu({type:sc.Custom,data:{tag:e,payload:t}})},iu.freezePage=()=>{Cc.forEach((e=>e.freeze()))},iu.takeFullSnapshot=e=>{if(!su)throw new Error("please take full snapshot after start recording");ru(e)},iu.mirror=ou,(lu=au||(au={}))[lu.NotStarted=0]="NotStarted",lu[lu.Running=1]="Running",lu[lu.Stopped=2]="Stopped";var cu="Remote config fetch rejected due to timeout after 5 seconds",uu="Unexpected error occurred",hu=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.getRemoteConfig=function(e,t,r){return a(n,void 0,void 0,(function(){var n,s,o;return l(this,(function(i){switch(i.label){case 0:return n=Date.now(),[4,this.fetchWithTimeout(r)];case 1:return(s=i.sent())&&(o=s.configs&&s.configs[e])?(this.metrics.fetchTimeAPISuccess=Date.now()-n,[2,o[t]]):(this.metrics.fetchTimeAPIFail=Date.now()-n,[2,void 0])}}))}))},this.fetchWithTimeout=function(e){return a(n,void 0,void 0,(function(){var t,r,n;return l(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 a(n,void 0,void 0,(function(){var r,n,s,a,u,h,d,p,f,m,g,y;return l(this,(function(l){switch(l.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:cu})];t!==this.lastFetchedSessionId&&(this.lastFetchedSessionId=t,this.attempts=0),l.label=1;case 1:l.trys.push([1,3,,4]),r=new URLSearchParams({api_key:this.localConfig.apiKey});try{for(n=c(this.configKeys),s=n.next();!s.done;s=n.next())a=s.value,r.append("config_keys",a)}catch(e){m={error:e}}finally{try{s&&!s.done&&(g=n.return)&&g.call(n)}finally{if(m)throw m.error}}return t&&r.set("session_id",String(t)),u={headers:{Accept:"*/*"},method:"GET"},h="".concat(this.getServerUrl(),"?").concat(r.toString()),this.attempts+=1,[4,fetch(h,i(i({},u),{signal:e}))];case 2:if(null===(d=l.sent()))return[2,this.completeRequest({err:uu})];switch((new I).buildStatus(d.status)){case o.Success:return this.attempts=0,[2,this.parseAndStoreConfig(d)];case o.Failed:return[2,this.retryFetch(e,t)];default:return[2,this.completeRequest({err:"Network error occurred, remote config fetch failed"})]}case 3:return p=l.sent(),f=p,e.aborted?[2,this.completeRequest({err:cu})]:[2,this.completeRequest({err:null!==(y=f.message)&&void 0!==y?y:uu})];case 4:return[2]}}))}))},this.retryFetch=function(e,t){return a(n,void 0,void 0,(function(){var r=this;return l(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 a(n,void 0,void 0,(function(){var t;return l(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===s.STAGING?"https://sr-client-cfg.stag2.amplitude.com/config":this.localConfig.serverZone===s.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}(),du=function(e){var t=e.localConfig,r=e.configKeys;return a(void 0,void 0,void 0,(function(){return l(this,(function(e){return[2,new hu({localConfig:t,configKeys:r})]}))}))};function pu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function fu(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 mu={exports:{}},gu=String,yu=function(){return{isColorSupported:!1,reset:gu,bold:gu,dim:gu,italic:gu,underline:gu,inverse:gu,hidden:gu,strikethrough:gu,black:gu,red:gu,green:gu,yellow:gu,blue:gu,magenta:gu,cyan:gu,white:gu,gray:gu,bgBlack:gu,bgRed:gu,bgGreen:gu,bgYellow:gu,bgBlue:gu,bgMagenta:gu,bgCyan:gu,bgWhite:gu}};mu.exports=yu(),mu.exports.createColors=yu;var vu=mu.exports;const wu=fu(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let bu=vu,Su=wu,Cu=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=bu.isColorSupported),Su&&e&&(t=Su(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}=bu.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 Iu=Cu;Cu.default=Cu;var xu={};xu.isClean=Symbol("isClean"),xu.my=Symbol("my");const ku={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let Ou=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 ku[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=ku[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 Mu=Ou;Ou.default=Ou;let Eu=Mu;function Ru(e,t){new Eu(t).stringify(e)}var Au=Ru;Ru.default=Ru;let{isClean:Pu,my:Tu}=xu,Nu=Iu,Lu=Mu,Du=Au;function _u(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=>_u(e,r))):("object"===o&&null!==s&&(s=_u(s)),r[n]=s)}return r}let Fu=class{constructor(e={}){this.raws={},this[Pu]=!1,this[Tu]=!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=_u(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 Nu(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[Pu]){this[Pu]=!1;let e=this;for(;e=e.parent;)e[Pu]=!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 Lu).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=Du){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 Uu=Fu;Fu.default=Fu;let Bu=Uu,ju=class extends Bu{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 zu=ju;ju.default=ju;var Wu={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:Vu,SourceMapGenerator:qu}=wu,{existsSync:Gu,readFileSync:Zu}=wu,{dirname:Ju,join:Yu}=wu;let Ku=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=Ju(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new Vu(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=Ju(e),Gu(e))return this.mapFile=e,Zu(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 Vu)return qu.fromSourceMap(t).toString();if(t instanceof qu)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=Yu(Ju(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 Hu=Ku;Ku.default=Ku;let{SourceMapConsumer:$u,SourceMapGenerator:Xu}=wu,{fileURLToPath:Qu,pathToFileURL:eh}=wu,{isAbsolute:th,resolve:rh}=wu,{nanoid:nh}=Wu,sh=wu,oh=Iu,ih=Hu,ah=Symbol("fromOffsetCache"),lh=Boolean($u&&Xu),ch=Boolean(rh&&th),uh=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&&(!ch||/^\w+:\/\//.test(t.from)||th(t.from)?this.file=t.from:this.file=rh(t.from)),ch&&lh){let e=new ih(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 "+nh(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 oh(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 oh(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&&(eh&&(s.input.url=eh(this.file).toString()),s.input.file=this.file),s}fromOffset(e){let t,r;if(this[ah])r=this[ah];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[ah]=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:rh(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=th(a.source)?eh(a.source):new URL(a.source,this.map.consumer().sourceRoot||eh(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(!Qu)throw new Error("file: protocol is not available in this PostCSS build");l.file=Qu(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 hh=uh;uh.default=uh,sh&&sh.registerInput&&sh.registerInput(uh);let{SourceMapConsumer:dh,SourceMapGenerator:ph}=wu,{dirname:fh,relative:mh,resolve:gh,sep:yh}=wu,{pathToFileURL:vh}=wu,wh=hh,bh=Boolean(dh&&ph),Sh=Boolean(fh&&gh&&mh&&yh);var Ch=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||fh(e.file);!1===this.mapOpts.sourcesContent?(t=new dh(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(),Sh&&bh&&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=ph.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new ph({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 ph({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?fh(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=fh(gh(r,this.mapOpts.annotation)));let n=mh(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 wh(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(vh){let t=vh(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;"\\"===yh&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let Ih=Uu,xh=class extends Ih{constructor(e){super(e),this.type="comment"}};var kh=xh;xh.default=xh;let Oh,Mh,Eh,Rh,{isClean:Ah,my:Ph}=xu,Th=zu,Nh=kh,Lh=Uu;function Dh(e){return e.map((e=>(e.nodes&&(e.nodes=Dh(e.nodes)),delete e.source,e)))}function _h(e){if(e[Ah]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)_h(t)}let Fh=class e extends Lh{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=Dh(Oh(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 Th(t)]}else if(t.selector)t=[new Mh(t)];else if(t.name)t=[new Eh(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new Nh(t)]}let n=t.map((t=>(t[Ph]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[Ah]&&_h(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)));return n}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]}};Fh.registerParse=e=>{Oh=e},Fh.registerRule=e=>{Mh=e},Fh.registerAtRule=e=>{Eh=e},Fh.registerRoot=e=>{Rh=e};var Uh=Fh;Fh.default=Fh,Fh.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,Eh.prototype):"rule"===e.type?Object.setPrototypeOf(e,Mh.prototype):"decl"===e.type?Object.setPrototypeOf(e,Th.prototype):"comment"===e.type?Object.setPrototypeOf(e,Nh.prototype):"root"===e.type&&Object.setPrototypeOf(e,Rh.prototype),e[Ph]=!0,e.nodes&&e.nodes.forEach((e=>{Fh.rebuild(e)}))};let Bh,jh,zh=Uh,Wh=class extends zh{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new Bh(new jh,this,e).stringify()}};Wh.registerLazyResult=e=>{Bh=e},Wh.registerProcessor=e=>{jh=e};var Vh=Wh;Wh.default=Wh;let qh={};var Gh=function(e){qh[e]||(qh[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let Zh=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 Jh=Zh;Zh.default=Zh;let Yh=Jh,Kh=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 Yh(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter((e=>"warning"===e.type))}get content(){return this.css}};var Hh=Kh;Kh.default=Kh;const $h="'".charCodeAt(0),Xh='"'.charCodeAt(0),Qh="\\".charCodeAt(0),ed="/".charCodeAt(0),td="\n".charCodeAt(0),rd=" ".charCodeAt(0),nd="\f".charCodeAt(0),sd="\t".charCodeAt(0),od="\r".charCodeAt(0),id="[".charCodeAt(0),ad="]".charCodeAt(0),ld="(".charCodeAt(0),cd=")".charCodeAt(0),ud="{".charCodeAt(0),hd="}".charCodeAt(0),dd=";".charCodeAt(0),pd="*".charCodeAt(0),fd=":".charCodeAt(0),md="@".charCodeAt(0),gd=/[\t\n\f\r "#'()/;[\\\]{}]/g,yd=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,vd=/.[\r\n"'(/\\]/,wd=/[\da-f]/i;let bd=Uh,Sd=class extends bd{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 Cd=Sd;Sd.default=Sd,bd.registerAtRule(Sd);let Id,xd,kd=Uh,Od=class extends kd{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 Id(new xd,this,e).stringify()}};Od.registerLazyResult=e=>{Id=e},Od.registerProcessor=e=>{xd=e};var Md=Od;Od.default=Od,kd.registerRoot(Od);let Ed={comma:e=>Ed.split(e,[","],!0),space:e=>Ed.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 Rd=Ed;Ed.default=Ed;let Ad=Uh,Pd=Rd,Td=class extends Ad{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Pd.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 Nd=Td;Td.default=Td,Ad.registerRule(Td);let Ld=zu,Dd=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 td:case rd:case sd:case od:case nd:n=m;do{n+=1,r=d.charCodeAt(n)}while(r===rd||r===td||r===sd||r===od||r===nd);h=["space",d.slice(m,n)],m=n-1;break;case id:case ad:case ud:case hd:case fd:case dd:case cd:{let e=String.fromCharCode(r);h=[e,e,m];break}case ld:if(c=g.length?g.pop()[1]:"",u=d.charCodeAt(m+1),"url"===c&&u!==$h&&u!==Xh&&u!==rd&&u!==td&&u!==sd&&u!==nd&&u!==od){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)===Qh;)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||vd.test(o)?h=["(","(",m]:(h=["brackets",o,m,n],m=n);break;case $h:case Xh:s=r===$h?"'":'"',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)===Qh;)l-=1,a=!a}while(a);h=["string",d.slice(m,n+1),m,n],m=n;break;case md:gd.lastIndex=m+1,gd.test(d),n=0===gd.lastIndex?d.length-1:gd.lastIndex-2,h=["at-word",d.slice(m,n+1),m,n],m=n;break;case Qh:for(n=m,i=!0;d.charCodeAt(n+1)===Qh;)n+=1,i=!i;if(r=d.charCodeAt(n+1),i&&r!==ed&&r!==rd&&r!==td&&r!==sd&&r!==od&&r!==nd&&(n+=1,wd.test(d.charAt(n)))){for(;wd.test(d.charAt(n+1));)n+=1;d.charCodeAt(n+1)===rd&&(n+=1)}h=["word",d.slice(m,n+1),m,n],m=n;break;default:r===ed&&d.charCodeAt(m+1)===pd?(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):(yd.lastIndex=m+1,yd.test(d),n=0===yd.lastIndex?d.length-1:yd.lastIndex-2,h=["word",d.slice(m,n+1),m,n],g.push(h),m=n)}return m++,h},position:function(){return m}}},_d=kh,Fd=Cd,Ud=Md,Bd=Nd;const jd={empty:!0,space:!0};var zd=class{constructor(e){this.input=e,this.root=new Ud,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 Fd;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 _d;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=Dd(this.input)}decl(e,t){let r=new Ld;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}let a=e.some((e=>"space"!==e[0]&&"comment"!==e[0]));a&&(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 Bd;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",jd[a]||jd[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 Bd;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 Wd=Uh,Vd=zd,qd=hh;function Gd(e,t){let r=new qd(e,t),n=new Vd(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 Zd=Gd;Gd.default=Gd,Wd.registerParse(Gd);let{isClean:Jd,my:Yd}=xu,Kd=Ch,Hd=Au,$d=Uh,Xd=Vh,Qd=Gh,ep=Hh,tp=Zd,rp=Md;const np={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},sp={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},op={Once:!0,postcssPlugin:!0,prepare:!0};function ip(e){return"object"==typeof e&&"function"==typeof e.then}function ap(e){let t=!1,r=np[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 lp(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:ap(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function cp(e){return e[Jd]=!1,e.nodes&&e.nodes.forEach((e=>cp(e))),e}let up={},hp=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 ep)s=cp(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=tp;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[Yd]&&$d.rebuild(s)}else s=cp(r);this.result=new ep(t,s,n),this.helpers={...up,postcss:up,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(!sp[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!op[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(ip(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Jd];){e[Jd]=!0;let t=[lp(e)];for(;t.length>0;){let e=this.visitTick(t);if(ip(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 ip(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=Hd;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new Kd(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(ip(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Jd];)e[Jd]=!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||Qd("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(ip(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[Jd])return n[Jd]=!0,void e.push(lp(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[Jd]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[Jd]=!0;let t=ap(e);for(let r of t)if(0===r)e.nodes&&e.each((e=>{e[Jd]||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"}};hp.registerPostcss=e=>{up=e};var dp=hp;hp.default=hp,rp.registerLazyResult(hp),Xd.registerLazyResult(hp);let pp=Ch,fp=Au,mp=Gh,gp=Zd;const yp=Hh;let vp=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=fp;this.result=new yp(this._processor,n,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let i=new pp(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||mp("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=gp;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 wp=vp;vp.default=vp;let bp=wp,Sp=dp,Cp=Vh,Ip=Md,xp=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 Sp(this,e,t):new bp(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var kp=xp;xp.default=xp,Ip.registerProcessor(xp),Cp.registerProcessor(xp);let Op=zu,Mp=Hu,Ep=kh,Rp=Cd,Ap=hh,Pp=Md,Tp=Nd;function Np(e,t){if(Array.isArray(e))return e.map((e=>Np(e)));let{inputs:r,...n}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:Ap.prototype};r.map&&(r.map={...r.map,__proto__:Mp.prototype}),t.push(r)}}if(n.nodes&&(n.nodes=e.nodes.map((e=>Np(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 Pp(n);if("decl"===n.type)return new Op(n);if("rule"===n.type)return new Tp(n);if("comment"===n.type)return new Ep(n);if("atrule"===n.type)return new Rp(n);throw new Error("Unknown node type: "+e.type)}var Lp=Np;Np.default=Np;let Dp=Iu,_p=zu,Fp=dp,Up=Uh,Bp=kp,jp=Au,zp=Lp,Wp=Vh,Vp=Jh,qp=kh,Gp=Cd,Zp=Hh,Jp=hh,Yp=Zd,Kp=Rd,Hp=Nd,$p=Md,Xp=Uu;function Qp(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new Bp(e)}Qp.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 Bp).version,s}return Object.defineProperty(s,"postcss",{get:()=>(r||(r=s()),r)}),s.process=function(e,t,r){return Qp([s(r)]).process(e,t)},s},Qp.stringify=jp,Qp.parse=Yp,Qp.fromJSON=zp,Qp.list=Kp,Qp.comment=e=>new qp(e),Qp.atRule=e=>new Gp(e),Qp.decl=e=>new _p(e),Qp.rule=e=>new Hp(e),Qp.root=e=>new $p(e),Qp.document=e=>new Wp(e),Qp.CssSyntaxError=Dp,Qp.Declaration=_p,Qp.Container=Up,Qp.Processor=Bp,Qp.Document=Wp,Qp.Comment=qp,Qp.Warning=Vp,Qp.AtRule=Gp,Qp.Result=Zp,Qp.Input=Jp,Qp.Rule=Hp,Qp.Root=$p,Qp.Node=Xp,Fp.registerPostcss(Qp);var ef=Qp;Qp.default=Qp;const tf=pu(ef);tf.stringify,tf.fromJSON,tf.plugin,tf.parse,tf.list,tf.document,tf.comment,tf.atRule,tf.rule,tf.decl,tf.root,tf.CssSyntaxError,tf.Declaration,tf.Container,tf.Processor,tf.Document,tf.Comment,tf.Warning,tf.AtRule,tf.Result,tf.Input,tf.Rule,tf.Root,tf.Node;var rf="medium",nf=function(e,t,r){switch(t){case"light":if("input"!==e)return!0;var n=r?function(e){const 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 nf(e,rf,r)}},sf=function(e,t){return function(r,n){return function(e,t,r){var n,s,o;if(void 0===t&&(t={defaultMaskLevel:rf}),r){if(r.closest("."+B))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 nf(e,null!==(o=t.defaultMaskLevel)&&void 0!==o?o:rf,r)}(e,t,n)?r.replace(/[^\s]/g,"*"):r}},of=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},af=function(e,t){return t||(e===s.STAGING?"https://api-sr.stag2.amplitude.com/sessions/v2/track":e===s.EU?"https://api-sr.eu.amplitude.com/sessions/v2/track":"https://api-sr.amplitude.com/sessions/v2/track")},lf=function(){return a(void 0,void 0,void 0,(function(){var e,t,r,n,s,o,i;return l(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),(e=N())?[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:""}]}}))}))},cf=function(e){var t=i({},e),r=t.apiKey;return t.apiKey="****".concat(r.substring(r.length-4)),t},uf=function(){function e(e,t){this.localConfig=t,this.remoteConfigFetch=e}return e.prototype.generateJoinedConfig=function(e){var t,r,n;return a(this,void 0,void 0,(function(){var s,o,a,h,d,p,f,m,g,y,v,w,b,S,C,I,x,k,O,M;return l(this,(function(l){switch(l.label){case 0:(s=i({},this.localConfig)).optOut=this.localConfig.optOut,s.captureEnabled=!0,l.label=1;case 1:return l.trys.push([1,5,,6]),[4,this.remoteConfigFetch.getRemoteConfig("sessionReplay","sr_sampling_config",e)];case 2:return a=l.sent(),[4,this.remoteConfigFetch.getRemoteConfig("sessionReplay","sr_privacy_config",e)];case 3:return h=l.sent(),d=s,[4,this.remoteConfigFetch.getRemoteConfig("sessionReplay","sr_interaction_config",e)];case 4:return d.interactionConfig=l.sent(),(a||h)&&(o={},a&&(o.sr_sampling_config=a),h&&(o.sr_privacy_config=h)),[3,6];case 5:return p=l.sent(),f=p,this.localConfig.loggerProvider.warn(f.message),s.captureEnabled=!1,[3,6];case 6:if(!o)return[2,s];if(m=o.sr_sampling_config,g=o.sr_privacy_config,m&&Object.keys(m).length>0?(Object.prototype.hasOwnProperty.call(m,"capture_enabled")?s.captureEnabled=m.capture_enabled:s.captureEnabled=!1,Object.prototype.hasOwnProperty.call(m,"sample_rate")&&(s.sampleRate=m.sample_rate)):(s.captureEnabled=!0,this.localConfig.loggerProvider.debug("Remote config successfully fetched, but no values set for project, Session Replay capture enabled.")),g){y=null!==(t=s.privacyConfig)&&void 0!==t?t:{},v={defaultMaskLevel:null!==(n=null!==(r=g.defaultMaskLevel)&&void 0!==r?r:y.defaultMaskLevel)&&void 0!==n?n:"medium",blockSelector:[],maskSelector:[],unmaskSelector:[]},w=function(e){var t,r,n,s,o,i,a,l,u,h={};"string"==typeof e.blockSelector&&(e.blockSelector=[e.blockSelector]);try{for(var d=c(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=c(null!==(l=e.maskSelector)&&void 0!==l?l:[]),m=f.next();!m.done;m=f.next()){h[m.value]="mask"}}catch(e){n={error:e}}finally{try{m&&!m.done&&(s=f.return)&&s.call(f)}finally{if(n)throw n.error}}try{for(var g=c(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},b=i(i({},w(y)),w(g));try{for(S=c(Object.entries(b)),C=S.next();!C.done;C=S.next())I=u(C.value,2),x=I[0],"mask"===(k=I[1])?v.maskSelector.push(x):"block"===k?v.blockSelector.push(x):"unmask"===k&&v.unmaskSelector.push(x)}catch(e){O={error:e}}finally{try{C&&!C.done&&(M=S.return)&&M.call(S)}finally{if(O)throw O.error}}s.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}(v,this.localConfig.loggerProvider)}return this.localConfig.loggerProvider.debug(JSON.stringify({name:"session replay joined config",config:cf(s)},null,2)),[2,s]}}))}))},e}(),hf=function(e,t){return a(void 0,void 0,void 0,(function(){var r,n;return l(this,(function(s){switch(s.label){case 0:return r=new W(e,t),[4,du({localConfig:r,configKeys:["sessionReplay"]})];case 1:return n=s.sent(),[2,new uf(n,r)]}}))}))},df="Session replay event batch rejected due to exceeded retry count",pf="Failed to store session replay events in IndexedDB",ff="1.19.1",mf=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(i(i({},e),{attempts:0,timeout:0}))},e.prototype.addToQueue=function(){for(var e=this,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=t.filter((function(t){return t.attempts<(t.flushMaxRetries||0)?(t.attempts+=1,!0):(e.completeRequest({context:t,err:df}),!1)}));n.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),a(this,void 0,void 0,(function(){var t,r,n=this;return l(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),a(this,void 0,void 0,(function(){var s,o,i,a,c,u,h,d,p,f,m,g,y;return l(this,(function(l){switch(l.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(v=N(),i=(null==v?void 0:v.location)?v.location.href:"",a=ff,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)||a),0===(d=this.payloadBatcher({version:1,events:e.events})).events.length)return this.completeRequest({context:e}),[2];l.label=1;case 1:return l.trys.push([1,3,,4]),p={headers:{"Content-Type":"application/json",Accept:"*/*",Authorization:"Bearer ".concat(s),"X-Client-Version":a,"X-Client-Library":h,"X-Client-Url":i,"X-Client-Sample-Rate":"".concat(c)},body:JSON.stringify(d),method:"POST"},f="".concat(af(e.serverZone,this.trackServerUrl),"?").concat(u.toString()),[4,fetch(f,p)];case 2:if(null===(m=l.sent()))return this.completeRequest({context:e,err:"Unexpected error occurred"}),[2];if(t)this.handleReponse(m.status,e);else{g="";try{g=JSON.stringify(m.body,null,2)}catch(e){}this.completeRequest({context:e,success:"".concat(m.status,": ").concat(g)})}return[3,4];case 3:return y=l.sent(),this.completeRequest({context:e,err:y}),[3,4];case 4:return[2]}var v}))}))},e.prototype.handleReponse=function(e,t){switch((new I).buildStatus(e)){case o.Success:this.handleSuccessResponse(t);break;case o.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(i(i({},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 gf=(e,t)=>t.some((t=>e instanceof t));let yf,vf;const wf=new WeakMap,bf=new WeakMap,Sf=new WeakMap;let Cf={get(e,t,r){if(e instanceof IDBTransaction){if("done"===t)return wf.get(e);if("store"===t)return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return Of(e[t])},set:(e,t,r)=>(e[t]=r,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function If(e){Cf=e(Cf)}function xf(e){return(vf||(vf=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(Mf(this),t),Of(this.request)}:function(...t){return Of(e.apply(Mf(this),t))}}function kf(e){return"function"==typeof e?xf(e):(e instanceof IDBTransaction&&function(e){if(wf.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)}));wf.set(e,t)}(e),gf(e,yf||(yf=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,Cf):e)}function Of(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(Of(e.result)),n()},o=()=>{r(e.error),n()};e.addEventListener("success",s),e.addEventListener("error",o)}));return Sf.set(t,e),t}(e);if(bf.has(e))return bf.get(e);const t=kf(e);return t!==e&&(bf.set(e,t),Sf.set(t,e)),t}const Mf=e=>Sf.get(e);function Ef(e,t,{blocked:r,upgrade:n,blocking:s,terminated:o}={}){const i=indexedDB.open(e,t),a=Of(i);return n&&i.addEventListener("upgradeneeded",(e=>{n(Of(i.result),e.oldVersion,e.newVersion,Of(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 Rf=["get","getKey","getAll","getAllKeys","count"],Af=["put","add","delete","clear"],Pf=new Map;function Tf(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(Pf.get(t))return Pf.get(t);const r=t.replace(/FromIndex$/,""),n=t!==r,s=Af.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!s&&!Rf.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 Pf.set(t,o),o}If((e=>({...e,get:(t,r,n)=>Tf(t,r)||e.get(t,r,n),has:(t,r)=>!!Tf(t,r)||e.has(t,r)})));const Nf=["continue","continuePrimaryKey","advance"],Lf={},Df=new WeakMap,_f=new WeakMap,Ff={get(e,t){if(!Nf.includes(t))return e[t];let r=Lf[t];return r||(r=Lf[t]=function(...e){Df.set(this,_f.get(this)[t](...e))}),r}};async function*Uf(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;const r=new Proxy(t,Ff);for(_f.set(r,t),Sf.set(r,Mf(t));t;)yield r,t=await(Df.get(r)||t.continue()),Df.delete(r)}function Bf(e,t){return t===Symbol.asyncIterator&&gf(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===t&&gf(e,[IDBIndex,IDBObjectStore])}If((e=>({...e,get:(t,r,n)=>Bf(t,r)?Uf:e.get(t,r,n),has:(t,r)=>Bf(t,r)||e.has(t,r)})));var jf,zf=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=new Blob([t]).size;return new Blob(e).size+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}();!function(e){e.RECORDING="recording",e.SENT="sent"}(jf||(jf={}));var Wf,Vf,qf,Gf="sessionCurrentSequence",Zf="sequencesToSend",Jf=function(){var e=N();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)}}catch(e){r(e)}}))},Yf=function(e){return a(void 0,void 0,void 0,(function(){var t;return l(this,(function(r){switch(r.label){case 0:return e.length>0?(10,t=e.splice(0,10),[4,Promise.all(t)]):[3,2];case 1:return r.sent(),[3,0];case 2:return[2]}}))}))},Kf=function(e){var t,r;return e.objectStoreNames.contains(Gf)||(r=e.createObjectStore(Gf,{keyPath:"sessionId"})),e.objectStoreNames.contains(Zf)||(t=e.createObjectStore(Zf,{keyPath:"sequenceId",autoIncrement:!0})).createIndex("sessionId","sessionId"),{sequencesStore:t,currentSequenceStore:r}},Hf=function(e){return a(void 0,void 0,void 0,(function(){return l(this,(function(t){switch(t.label){case 0:return[4,Ef(e,1,{upgrade:Kf})];case 1:return[2,t.sent()]}}))}))},$f=function(e){function t(t){var r=e.call(this,t)||this;return r.getSequencesToSend=function(){return a(r,void 0,void 0,(function(){var e,t,r,n,s,o;return l(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(pf,": ").concat(o)),[3,6];case 6:return[2,void 0]}}))}))},r.storeCurrentSequence=function(e){return a(r,void 0,void 0,(function(){var t,r,n;return l(this,(function(s){switch(s.label){case 0:return s.trys.push([0,4,,5]),[4,this.db.get(Gf,e)];case 1:return(t=s.sent())?[4,this.db.put(Zf,{sessionId:e,events:t.events})]:[2,void 0];case 2:return r=s.sent(),[4,this.db.put(Gf,{sessionId:e,events:[]})];case 3:return s.sent(),[2,i(i({},t),{sessionId:e,sequenceId:r})];case 4:return n=s.sent(),this.loggerProvider.warn("".concat(pf,": ").concat(n)),[3,5];case 5:return[2,void 0]}}))}))},r.addEventToCurrentSequence=function(e,t){return a(r,void 0,void 0,(function(){var r,n,s,o,i,a;return l(this,(function(l){switch(l.label){case 0:return l.trys.push([0,10,,11]),[4,(r=this.db.transaction(Gf,"readwrite")).store.get(e)];case 1:return(n=l.sent())?[3,3]:[4,r.store.put({sessionId:e,events:[t]})];case 2:return l.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 l.sent(),[3,7];case 5:return o=n.events.concat(t),[4,r.store.put({sessionId:e,events:o})];case 6:l.sent(),l.label=7;case 7:return[4,r.done];case 8:return l.sent(),s?[4,this.storeSendingEvents(e,s)]:[2,void 0];case 9:return(i=l.sent())?[2,{events:s,sessionId:e,sequenceId:i}]:[2,void 0];case 10:return a=l.sent(),this.loggerProvider.warn("".concat(pf,": ").concat(a)),[3,11];case 11:return[2,void 0]}}))}))},r.storeSendingEvents=function(e,t){return a(r,void 0,void 0,(function(){var r;return l(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.db.put(Zf,{sessionId:e,events:t})];case 1:return[2,n.sent()];case 2:return r=n.sent(),this.loggerProvider.warn("".concat(pf,": ").concat(r)),[3,3];case 3:return[2,void 0]}}))}))},r.cleanUpSessionEventsStore=function(e,t){return a(r,void 0,void 0,(function(){var e;return l(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(Zf,t)];case 2:return r.sent(),[3,4];case 3:return e=r.sent(),this.loggerProvider.warn("".concat(pf,": ").concat(e)),[3,4];case 4:return[2]}}))}))},r.transitionFromKeyValStore=function(e){return a(r,void 0,void 0,(function(){var t,r,n,s,o,i,c,u,h=this;return l(this,(function(p){switch(p.label){case 0:return p.trys.push([0,6,,7]),[4,Jf()];case 1:if(!(t=p.sent()))return[2];r=function(e,t){return a(h,void 0,void 0,(function(){var r,n,s=this;return l(this,(function(o){switch(o.label){case 0:return r=t.sessionSequences,n=[],Object.keys(r).forEach((function(o){var i=parseInt(o,10),c=r[i];if(i===t.currentSequenceId){var u=c.events.map((function(t){return a(s,void 0,void 0,(function(){return l(this,(function(r){return[2,this.addEventToCurrentSequence(e,t)]}))}))}));n.concat(u)}else c.status!==jf.SENT&&n.push(s.storeSendingEvents(e,c.events))})),[4,Yf(n)];case 1:return o.sent(),[2]}}))}))},n="".concat(d,"_").concat(this.apiKey.substring(0,10)),p.label=2;case 2:return p.trys.push([2,4,,5]),s=t.transaction("keyval").objectStore("keyval").getAll(n),o=new Promise((function(t){s.onsuccess=function(n){return a(h,void 0,void 0,(function(){var s,o,i,a=this;return l(this,(function(l){switch(l.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 l=s.sessionSequences;Object.keys(l).forEach((function(e){var t=parseInt(e,10);l[t].status!==jf.SENT&&i.push(a.storeSendingEvents(n,l[t].events))}))}})),[4,Yf(i)]):[3,2];case 1:l.sent(),l.label=2;case 2:return t(),[2]}}))}))}})),[4,o];case 3:return p.sent(),(i=N())&&i.indexedDB.deleteDatabase("keyval-store"),[3,5];case 4:return c=p.sent(),this.loggerProvider.warn("Failed to transition session replay events from keyval to new store: ".concat(c)),[3,5];case 5:return[3,7];case 6:return u=p.sent(),this.loggerProvider.warn("Failed to access keyval store: ".concat(u,". 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 a(this,void 0,void 0,(function(){var s,o,a,c,u;return l(this,(function(l){switch(l.label){case 0:return l.trys.push([0,3,,4]),s="replay"===e?"":"_".concat(e),o="".concat(r.apiKey.substring(0,10),"_amp_session_replay_events").concat(s),[4,Hf(o)];case 1:return a=l.sent(),[4,(c=new t(i(i({},r),{db:a}))).transitionFromKeyValStore(n)];case 2:return l.sent(),[2,c];case 3:return u=l.sent(),r.loggerProvider.warn("".concat(pf,": ").concat(u)),[3,4];case 4:return[2]}}))}))},t.prototype.getCurrentSequenceEvents=function(e){return a(this,void 0,void 0,(function(){var t,r,n,s,o,i,a;return l(this,(function(l){switch(l.label){case 0:return e?[4,this.db.get("sessionCurrentSequence",e)]:[3,2];case 1:return(s=l.sent())?[2,[s]]:[2,void 0];case 2:t=[],l.label=3;case 3:return l.trys.push([3,8,9,10]),[4,this.db.getAll("sessionCurrentSequence")];case 4:r=c.apply(void 0,[l.sent()]),n=r.next(),l.label=5;case 5:if(n.done)return[3,7];s=n.value,t.push(s),l.label=6;case 6:return n=r.next(),[3,5];case 7:return[3,10];case 8:return o=l.sent(),i={error:o},[3,10];case 9:try{n&&!n.done&&(a=r.return)&&a.call(r)}finally{if(i)throw i.error}return[7];case 10:return[2,t]}}))}))},t}(zf),Xf=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=h([],u(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 a(this,void 0,void 0,(function(){return l(this,(function(e){return[2,Object.entries(this.finalizedSequences).map((function(e){var t=u(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 a(this,void 0,void 0,(function(){return l(this,(function(t){return this.sequences[e]?[2,this.addSequence(e)]:[2,void 0]}))}))},t.prototype.addEventToCurrentSequence=function(e,t){return a(this,void 0,void 0,(function(){var r;return l(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 a(this,void 0,void 0,(function(){return l(this,(function(r){return this.finalizedSequences[this.sequenceId]={sessionId:e,events:t},[2,this.sequenceId++]}))}))},t.prototype.cleanUpSessionEventsStore=function(e,t){return a(this,void 0,void 0,(function(){return l(this,(function(e){return void 0!==t&&delete this.finalizedSequences[t],[2]}))}))},t}(zf),Qf=function(e){var t=e.config,r=e.sessionId,n=e.minInterval,s=e.maxInterval,o=e.type,c=e.payloadBatcher,u=e.storeType;return a(void 0,void 0,void 0,(function(){function e(e){return void 0===e&&(e=!1),a(this,void 0,void 0,(function(){return l(this,(function(t){return[2,h.flush(e)]}))}))}var h,d,p,f,m,g,y,v,w;return l(this,(function(b){switch(b.label){case 0:return h=new mf(i(i({},t),{loggerProvider:t.loggerProvider,payloadBatcher:c})),d=function(){return new Xf({loggerProvider:t.loggerProvider,maxInterval:s,minInterval:n})},p=function(){return a(void 0,void 0,void 0,(function(){var e;return l(this,(function(i){switch(i.label){case 0:return[4,$f.new(o,{loggerProvider:t.loggerProvider,minInterval:n,maxInterval:s,apiKey:t.apiKey},r)];case 1:return e=i.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,i=e.sequenceId;t.debugMode&&lf().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:o,onComplete:function(){return a(void 0,void 0,void 0,(function(){return l(this,(function(e){switch(e.label){case 0:return[4,f.cleanUpSessionEventsStore(n,i)];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 a(void 0,void 0,void 0,(function(){var e;return l(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}]}}))}))},em=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 a(this,void 0,void 0,(function(){var t;return l(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 a(this,void 0,void 0,(function(){var t;return l(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}(),tm=(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))(tm||{});function rm(e,t){if(qf=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};Wf=i(i({},r),t),Vf=function(e,t){if(e.nodeType===Node.DOCUMENT_NODE)return e;if(e===t.root)return e.ownerDocument;return e}(Wf.root,r);var n=nm(e,"all",(function(){return nm(e,"two",(function(){return nm(e,"one",(function(){return nm(e,"none")}))}))}));if(n){var s=pm(fm(n,e));return s.length>0&&(n=s[0]),om(n)}throw new Error("Selector was not found.")}function nm(e,t,r){for(var n=null,s=[],o=e,i=0,a=function(){var e,a,l=(new Date).getTime()-qf.getTime();if(void 0!==Wf.timeoutMs&&l>Wf.timeoutMs)throw new Error("Timeout: Can't find a unique selector after ".concat(l,"ms"));var d=um(function(e){var t=e.getAttribute("id");if(t&&Wf.idName(t))return{name:"#"+CSS.escape(t),penalty:0};return null}(o))||um.apply(void 0,h([],u(function(e){var t=Array.from(e.attributes).filter((function(e){return Wf.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))||um.apply(void 0,h([],u(function(e){var t=Array.from(e.classList).filter(Wf.className);return t.map((function(e){return{name:"."+CSS.escape(e),penalty:1}}))}(o)),!1))||um(function(e){var t=e.tagName.toLowerCase();if(Wf.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(cm).map((function(e){return lm(e,p)}))));else if("two"==t)d=d.slice(0,1),p&&(d=d.concat(d.filter(cm).map((function(e){return lm(e,p)}))));else if("one"==t){var f=u(d=d.slice(0,1),1)[0];p&&cm(f)&&(d=[lm(f,p)])}else"none"==t&&(d=[{name:"*",penalty:3}],p&&(d=[lm(d[0],p)]));try{for(var m=(e=void 0,c(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>=Wf.seedMinLength&&(n=sm(s,r)))return"break";o=o.parentElement,i++};o;){if("break"===a())break}return n||(n=sm(s,r)),!n&&r?r():n}function sm(e,t){var r,n,s=pm(dm(e));if(s.length>Wf.threshold)return t?t():null;try{for(var o=c(s),i=o.next();!i.done;i=o.next()){var a=i.value;if(am(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 om(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 im(e){return e.map((function(e){return e.penalty})).reduce((function(e,t){return e+t}),0)}function am(e){var t=om(e);switch(Vf.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 lm(e,t){return{name:e.name+":nth-child(".concat(t,")"),penalty:e.penalty+1}}function cm(e){return"html"!==e.name&&!e.name.startsWith("#")}function um(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e.filter(hm);return r.length>0?r:null}function hm(e){return null!=e}function dm(e,t){var r,n,s,o,i,a;return void 0===t&&(t=[]),l(this,(function(l){switch(l.label){case 0:if(!(e.length>0))return[3,9];l.label=1;case 1:l.trys.push([1,6,7,8]),r=c(e[0]),n=r.next(),l.label=2;case 2:return n.done?[3,5]:(s=n.value,[5,c(dm(e.slice(1,e.length),t.concat(s)))]);case 3:l.sent(),l.label=4;case 4:return n=r.next(),[3,2];case 5:return[3,8];case 6:return o=l.sent(),i={error:o},[3,8];case 7:try{n&&!n.done&&(a=r.return)&&a.call(r)}finally{if(i)throw i.error}return[7];case 8:return[3,11];case 9:return[4,t];case 10:l.sent(),l.label=11;case 11:return[2]}}))}function pm(e){return h([],u(e),!1).sort((function(e,t){return im(e)-im(t)}))}function fm(e,t,r){var n,s,o;return void 0===r&&(r={counter:0,visited:new Map}),l(this,(function(i){switch(i.label){case 0:if(!(e.length>2&&e.length>Wf.optimizedMinLength))return[3,5];n=1,i.label=1;case 1:return n<e.length-1?r.counter>Wf.maxNumberOfTries?[2]:(r.counter+=1,(s=h([],u(e),!1)).splice(n,1),o=om(s),r.visited.has(o)?[2]:am(s)&&function(e,t){return Vf.querySelector(om(e))===t}(s,t)?[4,s]:[3,4]):[3,5];case 2:return i.sent(),r.visited.set(o,!0),[5,c(fm(s,t,r))];case 3:i.sent(),i.label=4;case 4:return n++,[3,1];case 5:return[2]}}))}var mm=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}},gm=function(e){var t=e.version,r=e.events,n=[];r.forEach((function(e){var t=JSON.parse(e);"click"===t.type&&n.push(t)}));var s=n.reduce((function(e,t){var r=t.x,n=t.y,s=t.selector,o=t.timestamp,a=o-o%36e5,l="".concat(r,":").concat(n,":").concat(null!=s?s:"",":").concat(a);return e[l]?e[l].count+=1:e[l]=i(i({},t),{timestamp:a,count:1}),e}),{});return{version:t,events:Object.values(s)}},ym=function(e,t){var r=t.eventsManager,n=t.sessionId,s=t.deviceIdFn;return function(t){if(t.type===tm.Click){var o=N();if(o){var i=o.location,a=o.innerHeight,l=o.innerWidth;if(i){var c=t.x,u=t.y;if(void 0!==c&&void 0!==u){var h,d=iu.mirror.getNode(t.id);if(d)try{h=rm(d)}catch(t){e.debug("error resolving selector from finder")}var p=nc.getWindowScroll(o),f={x:c+p.left,y:u+p.top,selector:h,viewportHeight:a,viewportWidth:l,pageUrl:i.href,timestamp:Date.now(),type:"click"},m=s();m&&r.addEvent({sessionId:n,event:{type:"interaction",data:JSON.stringify(f)},deviceId:m})}}}}}},vm=function(){function e(e,t){var r=N();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=af(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}(),wm=nc.getWindowHeight,bm=nc.getWindowWidth,Sm=function(){function e(e){var t=this;this.timestamp=Date.now(),this.hook=function(e){t.update(e)},this.send=function(e){return function(r){var n=e(),s=N();s&&n&&t.transport.send(n,{version:1,events:[{maxScrollX:t._maxScrollX,maxScrollY:t._maxScrollY,maxScrollWidth:t._maxScrollWidth,maxScrollHeight:t._maxScrollHeight,viewportHeight:wm(),viewportWidth:bm(),pageUrl:s.location.href,timestamp:t.timestamp,type:"scroll"}]})}},this._maxScrollX=0,this._maxScrollY=0,this._maxScrollWidth=bm(),this._maxScrollHeight=wm(),this.transport=e}return e.default=function(t,r){return new e(new vm(t,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=bm();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=wm();this._maxScrollY=e.y;var o=e.y+s;o>this._maxScrollHeight&&(this._maxScrollHeight=o),this.timestamp=t}},e}(),Cm=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))},Im=Uint8Array,xm=Uint16Array,km=Uint32Array,Om=new Im([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]),Mm=new Im([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]),Em=new Im([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Rm=function(e,t){for(var r=new xm(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];var s=new km(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]},Am=Rm(Om,2),Pm=Am[0],Tm=Am[1];Pm[28]=258,Tm[258]=28;for(var Nm=Rm(Mm,0)[1],Lm=new xm(32768),Dm=0;Dm<32768;++Dm){var _m=(43690&Dm)>>>1|(21845&Dm)<<1;_m=(61680&(_m=(52428&_m)>>>2|(13107&_m)<<2))>>>4|(3855&_m)<<4,Lm[Dm]=((65280&_m)>>>8|(255&_m)<<8)>>>1}var Fm=function(e,t,r){for(var n=e.length,s=0,o=new xm(t);s<n;++s)++o[e[s]-1];var i,a=new xm(t);for(s=0;s<t;++s)a[s]=a[s-1]+o[s-1]<<1;if(r){i=new xm(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[Lm[h]>>>l]=c}else for(i=new xm(n),s=0;s<n;++s)i[s]=Lm[a[e[s]-1]++]>>>15-e[s];return i},Um=new Im(288);for(Dm=0;Dm<144;++Dm)Um[Dm]=8;for(Dm=144;Dm<256;++Dm)Um[Dm]=9;for(Dm=256;Dm<280;++Dm)Um[Dm]=7;for(Dm=280;Dm<288;++Dm)Um[Dm]=8;var Bm=new Im(32);for(Dm=0;Dm<32;++Dm)Bm[Dm]=5;var jm=Fm(Um,9,0),zm=Fm(Bm,5,0),Wm=function(e){return(e/8>>0)+(7&e&&1)},Vm=function(e,t,r){(null==r||r>e.length)&&(r=e.length);var n=new(e instanceof xm?xm:e instanceof km?km:Im)(r-t);return n.set(e.subarray(t,r)),n},qm=function(e,t,r){r<<=7&t;var n=t/8>>0;e[n]|=r,e[n+1]|=r>>>8},Gm=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},Zm=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 Im(0),0];if(1==s){var i=new Im(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 xm(d+1),f=Jm(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 Im(p),f]},Jm=function(e,t,r){return-1==e.s?Math.max(Jm(e.l,t,r+1),Jm(e.r,t,r+1)):t[e.s]=r},Ym=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new xm(++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]},Km=function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},Hm=function(e,t,r){var n=r.length,s=Wm(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)},$m=function(e,t,r,n,s,o,i,a,l,c,u){qm(t,u++,r),++s[256];for(var h=Zm(s,15),d=h[0],p=h[1],f=Zm(o,15),m=f[0],g=f[1],y=Ym(d),v=y[0],w=y[1],b=Ym(m),S=b[0],C=b[1],I=new xm(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=Zm(I,7),O=k[0],M=k[1],E=19;E>4&&!O[Em[E-1]];--E);var R,A,P,T,N=c+5<<3,L=Km(s,Um)+Km(o,Bm)+i,D=Km(s,d)+Km(o,m)+i+14+3*E+Km(I,O)+(2*I[16]+3*I[17]+7*I[18]);if(N<=L&&N<=D)return Hm(t,u,e.subarray(l,l+c));if(qm(t,u,1+(D<L)),u+=2,D<L){R=Fm(d,p,0),A=d,P=Fm(m,g,0),T=m;var _=Fm(O,M,0);qm(t,u,w-257),qm(t,u+5,C-1),qm(t,u+10,E-4),u+=14;for(x=0;x<E;++x)qm(t,u+3*x,O[Em[x]]);u+=3*E;for(var F=[v,S],U=0;U<2;++U){var B=F[U];for(x=0;x<B.length;++x){var j=31&B[x];qm(t,u,_[j]),u+=O[j],j>15&&(qm(t,u,B[x]>>>5&127),u+=B[x]>>>12)}}}else R=jm,A=Um,P=zm,T=Bm;for(x=0;x<a;++x)if(n[x]>255){j=n[x]>>>18&31;Gm(t,u,R[j+257]),u+=A[j+257],j>7&&(qm(t,u,n[x]>>>23&31),u+=Om[j]);var z=31&n[x];Gm(t,u,P[z]),u+=T[z],z>3&&(Gm(t,u,n[x]>>>5&8191),u+=Mm[z])}else Gm(t,u,R[n[x]]),u+=A[n[x]];return Gm(t,u,R[256]),u+A[256]},Xm=new km([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Qm=function(e,t,r,n,s){return function(e,t,r,n,s,o){var i=e.length,a=new Im(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=Hm(l,c,e.subarray(u,h)):(l[u]=o,c=Hm(l,c,e.subarray(u,i)))}else{for(var d=Xm[t-1],p=d>>>13,f=8191&d,m=(1<<r)-1,g=new xm(32768),y=new xm(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 km(25e3),C=new xm(288),I=new xm(32),x=0,k=0,O=(u=0,0),M=0,E=0;u<i;++u){var R=b(u),A=32767&u,P=y[R];if(g[A]=P,y[R]=A,M<=u){var T=i-u;if((x>7e3||O>24576)&&T>423){c=$m(e,l,0,S,C,I,k,O,E,u-E,c),O=x=k=0,E=u;for(var N=0;N<286;++N)C[N]=0;for(N=0;N<30;++N)I[N]=0}var L=2,D=0,_=f,F=A-P&32767;if(T>2&&R==b(u-F))for(var U=Math.min(p,T)-1,B=Math.min(32767,u),j=Math.min(258,T);F<=B&&--_&&A!=P;){if(e[u+L]==e[u+L-F]){for(var z=0;z<j&&e[u+z]==e[u+z-F];++z);if(z>L){if(L=z,D=F,z>U)break;var W=Math.min(F,z-2),V=0;for(N=0;N<W;++N){var q=u-F+N+32768&32767,G=q-g[q]+32768&32767;G>V&&(V=G,P=q)}}}F+=(A=P)-(P=g[A])+32768&32767}if(D){S[O++]=268435456|Tm[L]<<18|Nm[D];var Z=31&Tm[L],J=31&Nm[D];k+=Om[Z]+Mm[J],++C[257+Z],++I[J],M=u+L,++x}else S[O++]=e[u],++C[e[u]]}}c=$m(e,l,o,S,C,I,k,O,E,u-E,c)}return Vm(a,0,n+Wm(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 eg(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=Qm(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 tg=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}(eg(function(e,t){var r=e.length;if(!t&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var n=new Im(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 Im(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 Vm(n,0,s)}(JSON.stringify(t))),!0)};var rg=function(){function e(e,t,r,n){var s,o,i,a=this;this.taskQueue=[],this.isProcessing=!1,this.compressEvent=function(e){var t=tg(e);return JSON.stringify(t)},this.addCompressedEventToManager=function(e,t){a.eventsManager&&a.deviceId&&a.eventsManager.addEvent({event:{type:"replay",data:e},sessionId:t,deviceId:a.deviceId})},this.addCompressedEvent=function(e,t){if(a.worker)a.worker.postMessage({event:e,sessionId:t});else{var r=a.compressEvent(e);a.addCompressedEventToManager(r,t)}},this.terminate=function(){var e;null===(e=a.worker)||void 0===e||e.terminate()};var l=N();this.canUseIdleCallback=l&&"requestIdleCallback"in l,this.eventsManager=e,this.config=t,this.deviceId=r,this.timeout=(null===(s=t.performanceConfig)||void 0===s?void 0:s.timeout)||2e3;var c=null!==(o='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]),o=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]),a=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),o=0;o<31;++o)t[o]=n+=1<<r[o-1];var a=new f(t[30]);for(o=1;o<30;++o)for(var i=t[o];i<t[o+1];++i)a[i]=i-t[o]<<5|o;return[t,a]},v=i(t,2),u=v[0],s=v[1];u[28]=258,s[258]=28;for(var l=i(o,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,o=0,a=new e(n);o<t;++o)++a[r[o]-1];var i,v=new e(n);for(o=0;o<n;++o)v[o]=v[o-1]+a[o-1]<<1;if(f){i=new e(1<<n);var u=15-n;for(o=0;o<t;++o)if(r[o])for(var s=o<<4|r[o],l=n-r[o],h=v[r[o]-1]++<<l,g=h|(1<<l)-1;h<=g;++h)i[c[h]>>>u]=s}else for(i=new e(t),o=0;o<t;++o)i[o]=c[v[r[o]-1]++]>>>15-r[o];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 M=w(d,9,0),y=w(m,5,0),b=function(r){return(r/8>>0)+(7&r&&1)},p=function(r,t,o){(null==o||o>r.length)&&(o=r.length);var a=new(r instanceof e?e:r instanceof f?f:n)(o-t);return a.set(r.subarray(t,o)),a},C=function(r,n,e){e<<=7&n;var f=n/8>>0;r[f]|=e,r[f+1]|=e>>>8},x=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},S=function(r,f){for(var t=[],o=0;o<r.length;++o)r[o]&&t.push({s:o,f:r[o]});var a=t.length,i=t.slice();if(!a)return[new n(0),0];if(1==a){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!=a-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(o=1;o<a;++o)i[o].s>g&&(g=i[o].s);var w=new e(g+1),d=A(t[c-1],w,0);if(d>f){o=0;var m=0,M=d-f,y=1<<M;for(i.sort((function(r,n){return w[n.s]-w[r.s]||r.f-n.f}));o<a;++o){var b=i[o].s;if(!(w[b]>f))break;m+=y-(1<<d-w[b]),w[b]=f}for(m>>>=M;m>0;){var p=i[o].s;w[p]<f?m-=1<<f-w[p]++-1:++o}for(;o>=0&&m;--o){var C=i[o].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,o=r[0],a=1,i=function(r){f[t++]=r},v=1;v<=n;++v)if(r[v]==o&&v!=n)++a;else{if(!o&&a>2){for(;a>138;a-=138)i(32754);a>2&&(i(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(i(o),--a;a>6;a-=6)i(8304);a>2&&(i(a-3<<5|8208),a=0)}for(;a--;)i(o);a=1,o=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=b(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 o=0;o<f;++o)r[t+o+4]=e[o];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 b=S(v,15),p=b[0],A=b[1],E=S(u,15),U=E[0],D=E[1],I=O(p),J=I[0],N=I[1],W=O(U),_=W[0],j=W[1],P=new e(19),q=0;q<J.length;++q)P[31&J[q]]++;for(q=0;q<_.length;++q)P[31&_[q]]++;for(var z=S(P,7),B=z[0],F=z[1],G=19;G>4&&!B[a[G-1]];--G);var H,K,L,Q,R=h+5<<3,V=T(v,d)+T(u,m)+s,X=T(v,p)+T(u,U)+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(p,A,0),K=p,L=w(U,D,0),Q=U;var Y=w(B,F,0);C(n,g,N-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[a[q]]);g+=3*G;for(var Z=[J,_],$=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=M,K=d,L=y,Q=m;for(q=0;q<l;++q)if(i[q]>255){nr=i[q]>>>18&31;x(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];x(n,g,L[er]),g+=Q[er],er>3&&(x(n,g,i[q]>>>5&8191),g+=o[er])}else x(n,g,H[i[q]]),g+=K[i[q]];return x(n,g,H[256]),g+K[256]},U=new f([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),D=function(r,a,i,v,u){return function(r,a,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(!a||h<8)for(var m=0;m<=h;m+=65535){var M=m+65535;M<h?d=k(w,d,r.subarray(m,M)):(w[m]=c,d=k(w,d,r.subarray(m,h)))}else{for(var y=U[a-1],C=y>>>13,x=8191&y,S=(1<<i)-1,A=new e(32768),O=new e(S+1),T=Math.ceil(i/3),D=2*T,I=function(n){return(r[n]^r[n+1]<<T^r[n+2]<<D)&S},J=new f(25e3),N=new e(288),W=new e(32),_=0,j=0,P=(m=0,0),q=0,z=0;m<h;++m){var B=I(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,J,N,W,j,P,z,m-z,d),P=_=j=0,z=m;for(var K=0;K<286;++K)N[K]=0;for(K=0;K<30;++K)W[K]=0}var L=2,Q=0,R=x,V=F-G&32767;if(H>2&&B==I(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){J[P++]=268435456|s[L]<<18|l[Q];var tr=31&s[L],or=31&l[Q];j+=t[tr]+o[or],++N[257+tr],++W[or],q=m+L,++_}else J[P++]=r[m],++N[r[m]]}}d=E(r,w,c,J,N,W,j,P,z,m-z,d)}return p(g,0,v+b(d)+u)}(r,null==a.level?6:a.level,null==a.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(r.length)))):12+a.mem,i,v,!u)};function I(r,n){void 0===n&&(n={});var e=function(){var r=1,n=0;return{p:function(e){for(var f=r,t=n,o=e.length,a=0;a!=o;){for(var i=Math.min(a+5552,o);a<i;++a)t+=f+=e[a];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,o,a=D(r,n,2,4);return f=a,t=n.level,o=0==t?0:t<6?1:9==t?3:2,f[0]=120,f[1]=o<<6|(o?32-2*o:1),function(r,n,e){for(;e;++n)r[n]=e,e>>>=8}(a,a.length-4,e.d()),a}const J=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}(I(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)),o=0,a=function(r){t[o++]=r},i=0;i<f;++i){if(o+5>t.length){var v=new n(o+8+(f-i<<1));v.set(t),t=v}var u=r.charCodeAt(i);u<128||e?a(u):u<2048?(a(192|u>>>6),a(128|63&u)):u>55295&&u<57344?(a(240|(u=65536+(1047552&u)|1023&r.charCodeAt(++i))>>>18),a(128|u>>>12&63),a(128|u>>>6&63),a(128|63&u)):(a(224|u>>>12),a(128|u>>>6&63),a(128|63&u))}return p(t,0,o)}(JSON.stringify(e))),!0)};onmessage=r=>{const{event:n,sessionId:e}=r.data,f=JSON.stringify(J(n));postMessage({compressedEvent:f,sessionId:e})};const N=onmessage;return r.compressionOnMessage=N,Object.defineProperty(r,"__esModule",{value:!0}),r}({});\n')?o:n;if((null===(i=this.config.experimental)||void 0===i?void 0:i.useWebWorker)&&l&&l.Worker&&c){t.loggerProvider.log("[Experimental] Enabling web worker for compression");var u=new Worker(URL.createObjectURL(new Blob([c],{type:"application/javascript"})));u.onerror=function(e){t.loggerProvider.error(e)},u.onmessage=function(e){var t=e.data,r=t.compressedEvent,n=t.sessionId;a.addCompressedEventToManager(r,n)},this.worker=u}}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}(),ng=function(){function e(){var e=this;this.name="@amplitude/session-replay-browser",this.recordCancelCallback=null,this.eventCount=0,this.pageLeaveFns=[],this.teardownEventListeners=function(t){var r=N();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()},this.pageLeaveListener=function(t){e.pageLeaveFns.forEach((function(e){e(t)}))},this.addCustomRRWebEvent=function(t,r,n){return void 0===r&&(r={}),void 0===n&&(n=!0),a(e,void 0,void 0,(function(){var e,s,o,a;return l(this,(function(l){switch(l.label){case 0:return l.trys.push([0,3,,4]),e=void 0,(s=this.config)?(e={config:cf(s),version:ff},n?[4,lf()]:[3,2]):[3,2];case 1:o=l.sent(),e=i(i({},o),e),l.label=2;case 2:return this.recordCancelCallback?iu.addCustomEvent(t,i(i({},r),e)):this.loggerProvider.debug("Not able to add custom replay capture event ".concat(t," due to no ongoing recording.")),[3,4];case 3:return a=l.sent(),this.loggerProvider.debug("Error while adding custom replay capture event: ",a),[3,4];case 4:return[2]}}))}))},this.stopRecordingEvents=function(){try{e.loggerProvider.log("Session Replay capture stopping."),e.recordCancelCallback&&e.recordCancelCallback(),e.recordCancelCallback=null}catch(r){var t=r;e.loggerProvider.warn("Error occurred while stopping replay capture: ".concat(t.toString()))}},this.loggerProvider=new g}return e.prototype.init=function(e,t){return f(this._init(e,t))},e.prototype._init=function(e,t){var r,n,s,o;return a(this,void 0,void 0,(function(){var i,a,c,d,p,f,m,y,v,w,b;return l(this,(function(l){switch(l.label){case 0:return this.loggerProvider=t.loggerProvider||new g,Object.prototype.hasOwnProperty.call(t,"logLevel")&&this.loggerProvider.enable(t.logLevel),this.identifiers=new Cm({sessionId:t.sessionId,deviceId:t.deviceId}),i=this,[4,hf(e,t)];case 1:return i.joinedConfigGenerator=l.sent(),a=this,[4,this.joinedConfigGenerator.generateJoinedConfig(this.identifiers.sessionId)];case 2:a.config=l.sent(),t.sessionId&&(null===(r=this.config.interactionConfig)||void 0===r?void 0:r.enabled)&&(c=Sm.default({sessionId:t.sessionId,type:"interaction"},this.config),this.pageLeaveFns=[c.send(this.getDeviceId.bind(this)).bind(c)],this.scrollHook=c.hook.bind(c)),d=[],"idb"!==(p=this.config.storeType)||(null===(n=N())||void 0===n?void 0:n.indexedDB)||(p="memory",this.loggerProvider.warn("Could not use preferred indexedDB storage, reverting to in memory option.")),this.loggerProvider.log("Using ".concat(p," for event storage.")),l.label=3;case 3:return l.trys.push([3,5,,6]),[4,Qf({config:this.config,sessionId:this.identifiers.sessionId,type:"replay",storeType:p})];case 4:return f=l.sent(),d.push({name:"replay",manager:f}),[3,6];case 5:return m=l.sent(),b=m,this.loggerProvider.warn("Error occurred while creating replay events manager: ".concat(b.toString())),[3,6];case 6:if(!(null===(s=this.config.interactionConfig)||void 0===s?void 0:s.enabled))return[3,10];y=this.config.interactionConfig.batch?gm:mm,l.label=7;case 7:return l.trys.push([7,9,,10]),[4,Qf({config:this.config,sessionId:this.identifiers.sessionId,type:"interaction",minInterval:null!==(o=this.config.interactionConfig.trackEveryNms)&&void 0!==o?o:3e4,maxInterval:6e4,payloadBatcher:y,storeType:p})];case 8:return v=l.sent(),d.push({name:"interaction",manager:v}),[3,10];case 9:return w=l.sent(),b=w,this.loggerProvider.warn("Error occurred while creating interaction events manager: ".concat(b.toString())),[3,10];case 10:return this.eventsManager=new(em.bind.apply(em,h([void 0],u(d),!1))),this.eventCompressor&&this.eventCompressor.terminate(),this.eventCompressor=new rg(this.eventsManager,this.config,this.getDeviceId()),this.loggerProvider.log("Installing @amplitude/session-replay-browser."),this.teardownEventListeners(!1),this.initialize(!0),[2]}}))}))},e.prototype.setSessionId=function(e,t){return f(this.asyncSetSessionId(e,t))},e.prototype.asyncSetSessionId=function(e,t){return a(this,void 0,void 0,(function(){var r,n,s;return l(this,(function(o){switch(o.label){case 0:return(r=this.identifiers&&this.identifiers.sessionId)&&this.sendEvents(r),n=t||this.getDeviceId(),this.identifiers=new Cm({sessionId:e,deviceId:n}),this.joinedConfigGenerator&&r?(s=this,[4,this.joinedConfigGenerator.generateJoinedConfig(this.identifiers.sessionId)]):[3,2];case 1:s.config=o.sent(),o.label=2;case 2:return this.recordEvents(),[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={})[_]=r.sessionReplayId?r.sessionReplayId:null,s=e,t.debugMode&&(s[U]=JSON.stringify({appHash:of(t.apiKey).toString()}))),this.addCustomRRWebEvent(R.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;if(void 0===e&&(e=!1),null===(t=this.identifiers)||void 0===t?void 0:t.sessionId){var r=this.getDeviceId();r?(this.eventsManager&&e&&this.eventsManager.sendStoredEvents({deviceId:r}),this.recordEvents()):this.loggerProvider.log("Session is not being recorded due to lack of device id.")}else this.loggerProvider.log("Session is not being recorded due to lack of session id.")},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="$default_instance"),T.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=(e=this.identifiers.sessionId,t=this.config.sampleRate,r=of(e.toString()),31*Math.abs(r)%1e6/1e6<t);return n||this.loggerProvider.log("Opting session ".concat(this.identifiers.sessionId," out of recording due to sample rate.")),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.recordEvents=function(){var e,t=this,r=this.config,n=this.getShouldRecord(),s=null===(e=this.identifiers)||void 0===e?void 0:e.sessionId;if(n&&s&&r){this.stopRecordingEvents();var o=r.privacyConfig,i=r.interactionConfig,a=(null==i?void 0:i.enabled)?{mouseInteraction:this.eventsManager&&ym(this.loggerProvider,{eventsManager:this.eventsManager,sessionId:s,deviceIdFn:this.getDeviceId.bind(this)}),scroll:this.scrollHook}:{};this.loggerProvider.log("Session Replay capture beginning for ".concat(s,".")),this.recordCancelCallback=iu({emit:function(e){if(t.shouldOptOut())return t.loggerProvider.log("Opting session ".concat(s," out of recording due to optOut config.")),t.stopRecordingEvents(),void t.sendEvents();t.eventCompressor&&t.eventCompressor.enqueueEvent(e,s)},inlineStylesheet:r.shouldInlineStylesheet,hooks:a,maskAllInputs:!0,maskTextClass:B,blockClass:"amp-block",blockSelector:this.getBlockSelectors(),maskInputFn:sf("input",o),maskTextFn:sf("text",o),maskTextSelector:this.getMaskTextSelectors(),recordCanvas:!1,errorHandler:function(e){var r=e;if(r.message.includes("insertRule")&&r.message.includes("CSSStyleSheet"))throw r;if(r._external_)throw r;return t.loggerProvider.warn("Error while capturing replay: ",r.toString()),!0}}),this.addCustomRRWebEvent(R.DEBUG_INFO)}},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),a(this,void 0,void 0,(function(){return l(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}(),sg=function(e){return function(){var t=e.config||z();return{logger:t.loggerProvider,logLevel:t.logLevel}}},og=function(){var e=new ng;return{init:C(e.init.bind(e),"init",sg(e)),setSessionId:C(e.setSessionId.bind(e),"setSessionId",sg(e)),getSessionId:C(e.getSessionId.bind(e),"getSessionId",sg(e)),getSessionReplayProperties:C(e.getSessionReplayProperties.bind(e),"getSessionReplayProperties",sg(e)),flush:C(e.flush.bind(e),"flush",sg(e)),shutdown:C(e.shutdown.bind(e),"shutdown",sg(e))}}(),ig=og.init,ag=og.setSessionId,lg=og.getSessionId,cg=og.getSessionReplayProperties;og.flush;var ug=og.shutdown,hg="1.13.2",dg=function(){function e(e){this.name="@amplitude/plugin-session-replay-browser",this.type="enrichment",this.options=i({forceSessionTracking:!1},e)}return e.prototype.setup=function(e){var t,r,n,s,o;return a(this,void 0,void 0,(function(){var a;return l(this,(function(l){switch(l.label){case 0:return l.trys.push([0,2,,3]),null==e||e.loggerProvider.log("Installing @amplitude/plugin-session-replay, version ".concat(hg,".")),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=i(i({},e.defaultTracking),{sessions:!0})),[4,ig(e.apiKey,{instanceName:this.config.instanceName,deviceId:null!==(t=this.options.deviceId)&&void 0!==t?t: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===(r=this.options.privacyConfig)||void 0===r?void 0:r.blockSelector,maskSelector:null===(n=this.options.privacyConfig)||void 0===n?void 0:n.maskSelector,unmaskSelector:null===(s=this.options.privacyConfig)||void 0===s?void 0:s.unmaskSelector,defaultMaskLevel:null===(o=this.options.privacyConfig)||void 0===o?void 0:o.defaultMaskLevel},debugMode:this.options.debugMode,shouldInlineStylesheet:this.options.shouldInlineStylesheet,version:{type:"plugin",version:hg},performanceConfig:this.options.performanceConfig,storeType:this.options.storeType,experimental:this.options.experimental}).promise];case 1:return l.sent(),[3,3];case 2:return a=l.sent(),null==e||e.loggerProvider.error("Session Replay: Failed to initialize due to ".concat(a.message)),[3,3];case 3:return[2]}}))}))},e.prototype.execute=function(e){var t;return a(this,void 0,void 0,(function(){var r,n,s;return l(this,(function(o){switch(o.label){case 0:return o.trys.push([0,8,,9]),this.options.customSessionId?(r=this.options.customSessionId(e))?r===lg()?[3,2]:[4,ag(r).promise]:[3,3]:[3,4];case 1:o.sent(),o.label=2;case 2:n=cg(),e.event_properties=i(i({},e.event_properties),n),o.label=3;case 3:return[3,7];case 4:return(r=this.config.sessionId)&&r!==lg()?[4,ag(r).promise]:[3,6];case 5:o.sent(),o.label=6;case 6:r&&r===e.session_id&&(n=cg(),e.event_properties=i(i({},e.event_properties),n)),o.label=7;case 7:return[2,Promise.resolve(e)];case 8:return s=o.sent(),null===(t=this.config)||void 0===t||t.loggerProvider.error("Session Replay: Failed to enrich event due to ".concat(s.message)),[2,Promise.resolve(e)];case 9:return[2]}}))}))},e.prototype.teardown=function(){var e;return a(this,void 0,void 0,(function(){return l(this,(function(t){try{ug(),this.config=null}catch(t){null===(e=this.config)||void 0===e||e.loggerProvider.error("Session Replay: teardown failed due to ".concat(t.message))}return[2]}))}))},e.prototype.getSessionReplayProperties=function(){return cg()},e}(),pg=function(e){return new dg(e)};return e.plugin=pg,e.sessionReplayPlugin=pg,Object.defineProperty(e,"__esModule",{value:!0}),e}({});
|