@amplitude/unified 1.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.d.ts +4 -0
- package/lib/cjs/index.d.ts.map +1 -0
- package/lib/cjs/index.js +12 -0
- package/lib/cjs/index.js.map +1 -0
- package/lib/cjs/unified-client-factory.d.ts +5 -0
- package/lib/cjs/unified-client-factory.d.ts.map +1 -0
- package/lib/cjs/unified-client-factory.js +36 -0
- package/lib/cjs/unified-client-factory.js.map +1 -0
- package/lib/cjs/unified.d.ts +38 -0
- package/lib/cjs/unified.d.ts.map +1 -0
- package/lib/cjs/unified.js +75 -0
- package/lib/cjs/unified.js.map +1 -0
- package/lib/esm/index.d.ts +4 -0
- package/lib/esm/index.d.ts.map +1 -0
- package/lib/esm/index.js +6 -0
- package/lib/esm/index.js.map +1 -0
- package/lib/esm/unified-client-factory.d.ts +5 -0
- package/lib/esm/unified-client-factory.d.ts.map +1 -0
- package/lib/esm/unified-client-factory.js +32 -0
- package/lib/esm/unified-client-factory.js.map +1 -0
- package/lib/esm/unified.d.ts +38 -0
- package/lib/esm/unified.d.ts.map +1 -0
- package/lib/esm/unified.js +72 -0
- package/lib/esm/unified.js.map +1 -0
- package/lib/scripts/amplitude-min.umd.js +1 -0
- package/lib/scripts/amplitude-min.umd.js.gz +0 -0
- package/lib/scripts/index.d.ts +4 -0
- package/lib/scripts/index.d.ts.map +1 -0
- package/lib/scripts/unified-client-factory.d.ts +5 -0
- package/lib/scripts/unified-client-factory.d.ts.map +1 -0
- package/lib/scripts/unified.d.ts +38 -0
- package/lib/scripts/unified.d.ts.map +1 -0
- package/package.json +50 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).amplitude={})}(this,(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,i,o=function(){return o=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},o.apply(this,arguments)};function s(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}function a(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((n=n.apply(e,t||[])).next())}))}function l(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(l){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}function u(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function c(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}function h(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}function d(e){return this instanceof d?(this.v=e,this):new d(e)}function p(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,i=r.apply(e,t||[]),o=[];return n={},s("next"),s("throw"),s("return"),n[Symbol.asyncIterator]=function(){return this},n;function s(e){i[e]&&(n[e]=function(t){return new Promise((function(r,n){o.push([e,t,r,n])>1||a(e,t)}))})}function a(e,t){try{(r=i[e](t)).value instanceof d?Promise.resolve(r.value.v).then(l,u):c(o[0][2],r)}catch(e){c(o[0][3],e)}var r}function l(e){a("next",e)}function u(e){a("throw",e)}function c(e,t){e(t),o.shift(),o.length&&a(o[0][0],o[0][1])}}function f(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=u(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise((function(n,i){(function(e,t,r,n){Promise.resolve(n).then((function(t){e({value:t,done:r})}),t)})(n,i,(t=e[r](t)).done,t.value)}))}}}!function(e){e.SET="$set",e.SET_ONCE="$setOnce",e.ADD="$add",e.APPEND="$append",e.PREPEND="$prepend",e.REMOVE="$remove",e.PREINSERT="$preInsert",e.POSTINSERT="$postInsert",e.UNSET="$unset",e.CLEAR_ALL="$clearAll"}(n||(n={})),function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"}(i||(i={}));var g,m="AMP",v="".concat(m,"_unsent"),y="https://api2.amplitude.com/2/httpapi",w=function(e){if(Object.keys(e).length>1e3)return!1;for(var t in e){var r=e[t];if(!b(t,r))return!1}return!0},b=function(e,t){var r,n;if("string"!=typeof e)return!1;if(Array.isArray(t)){var i=!0;try{for(var o=u(t),s=o.next();!s.done;s=o.next()){var a=s.value;if(Array.isArray(a))return!1;if("object"==typeof a)i=i&&w(a);else if(!["number","string"].includes(typeof a))return!1;if(!i)return!1}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}}else{if(null==t)return!1;if("object"==typeof t)return w(t);if(!["number","string","boolean"].includes(typeof t))return!1}return!0},S=function(){function e(){this._propertySet=new Set,this._properties={}}return e.prototype.getUserProperties=function(){return o({},this._properties)},e.prototype.set=function(e,t){return this._safeSet(g.SET,e,t),this},e.prototype.setOnce=function(e,t){return this._safeSet(g.SET_ONCE,e,t),this},e.prototype.append=function(e,t){return this._safeSet(g.APPEND,e,t),this},e.prototype.prepend=function(e,t){return this._safeSet(g.PREPEND,e,t),this},e.prototype.postInsert=function(e,t){return this._safeSet(g.POSTINSERT,e,t),this},e.prototype.preInsert=function(e,t){return this._safeSet(g.PREINSERT,e,t),this},e.prototype.remove=function(e,t){return this._safeSet(g.REMOVE,e,t),this},e.prototype.add=function(e,t){return this._safeSet(g.ADD,e,t),this},e.prototype.unset=function(e){return this._safeSet(g.UNSET,e,"-"),this},e.prototype.clearAll=function(){return this._properties={},this._properties[g.CLEAR_ALL]="-",this},e.prototype._safeSet=function(e,t,r){if(this._validate(e,t,r)){var n=this._properties[e];return void 0===n&&(n={},this._properties[e]=n),n[t]=r,this._propertySet.add(t),!0}return!1},e.prototype._validate=function(e,t,r){return void 0===this._properties[g.CLEAR_ALL]&&(!this._propertySet.has(t)&&(e===g.ADD?"number"==typeof r:e===g.UNSET||e===g.REMOVE||b(t,r)))},e}();!function(e){e.SET="$set",e.SET_ONCE="$setOnce",e.ADD="$add",e.APPEND="$append",e.PREPEND="$prepend",e.REMOVE="$remove",e.PREINSERT="$preInsert",e.POSTINSERT="$postInsert",e.UNSET="$unset",e.CLEAR_ALL="$clearAll"}(g||(g={}));var C,I=[g.CLEAR_ALL,g.UNSET,g.SET,g.SET_ONCE,g.ADD,g.APPEND,g.PREPEND,g.PREINSERT,g.POSTINSERT,g.REMOVE];!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"}(C||(C={}));var x,k=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=C.Unknown),{event:e,code:t,message:r}},E=function(){var e="ampIntegrationContext";return"undefined"!=typeof globalThis&&void 0!==globalThis[e]?globalThis[e]:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:void 0},O=h([],c(Array(256).keys()),!1).map((function(e){return e.toString(16).padStart(2,"0")})),A=function(e){var t,r=E();if(!(null===(t=null==r?void 0:r.crypto)||void 0===t?void 0:t.getRandomValues))return function(e){return e?(e^16*Math.random()>>e/4).toString(16):(String(1e7)+String(-1e3)+String(-4e3)+String(-8e3)+String(-1e11)).replace(/[018]/g,A)}(e);var n=r.crypto.getRandomValues(new Uint8Array(16));return n[6]=15&n[6]|64,n[8]=63&n[8]|128,h([],c(n.entries()),!1).map((function(e){var t=c(e,2),r=t[0],n=t[1];return[4,6,8,10].includes(r)?"-".concat(O[n]):O[n]})).join("")},R=function(){function e(e){this.client=e,this.queue=[],this.applying=!1,this.plugins=[]}return e.prototype.register=function(e,t){var r,n;return a(this,void 0,void 0,(function(){return l(this,(function(i){switch(i.label){case 0:return this.plugins.some((function(t){return t.name===e.name}))?(t.loggerProvider.warn("Plugin with name ".concat(e.name," already exists, skipping registration")),[2]):(void 0===e.name&&(e.name=A(),t.loggerProvider.warn("Plugin name is undefined. \n Generating a random UUID for plugin name: ".concat(e.name,". \n Set a name for the plugin to prevent it from being added multiple times."))),e.type=null!==(r=e.type)&&void 0!==r?r:"enrichment",[4,null===(n=e.setup)||void 0===n?void 0:n.call(e,t,this.client)]);case 1:return i.sent(),this.plugins.push(e),[2]}}))}))},e.prototype.deregister=function(e,t){var r;return a(this,void 0,void 0,(function(){var n,i;return l(this,(function(o){switch(o.label){case 0:return n=this.plugins.findIndex((function(t){return t.name===e})),-1===n?(t.loggerProvider.warn("Plugin with name ".concat(e," does not exist, skipping deregistration")),[2]):(i=this.plugins[n],this.plugins.splice(n,1),[4,null===(r=i.teardown)||void 0===r?void 0:r.call(i)]);case 1:return o.sent(),[2]}}))}))},e.prototype.reset=function(e){this.applying=!1,this.plugins.map((function(e){var t;return null===(t=e.teardown)||void 0===t?void 0:t.call(e)})),this.plugins=[],this.client=e},e.prototype.push=function(e){var t=this;return new Promise((function(r){t.queue.push([e,r]),t.scheduleApply(0)}))},e.prototype.scheduleApply=function(e){var t=this;this.applying||(this.applying=!0,setTimeout((function(){t.apply(t.queue.shift()).then((function(){t.applying=!1,t.queue.length>0&&t.scheduleApply(0)}))}),e))},e.prototype.apply=function(e){return a(this,void 0,void 0,(function(){var t,r,n,i,s,a,h,d,p,f,g,m,v,y,w,b,S,C,I,x;return l(this,(function(l){switch(l.label){case 0:if(!e)return[2];t=c(e,1),r=t[0],n=c(e,2),i=n[1],s=this.plugins.filter((function(e){return"before"===e.type})),l.label=1;case 1:l.trys.push([1,6,7,8]),a=u(s),h=a.next(),l.label=2;case 2:return h.done?[3,5]:(m=h.value).execute?[4,m.execute(o({},r))]:[3,4];case 3:if(null===(v=l.sent()))return i({event:r,code:0,message:""}),[2];r=v,l.label=4;case 4:return h=a.next(),[3,2];case 5:return[3,8];case 6:return d=l.sent(),S={error:d},[3,8];case 7:try{h&&!h.done&&(C=a.return)&&C.call(a)}finally{if(S)throw S.error}return[7];case 8:p=this.plugins.filter((function(e){return"enrichment"===e.type||void 0===e.type})),l.label=9;case 9:l.trys.push([9,14,15,16]),f=u(p),g=f.next(),l.label=10;case 10:return g.done?[3,13]:(m=g.value).execute?[4,m.execute(o({},r))]:[3,12];case 11:if(null===(v=l.sent()))return i({event:r,code:0,message:""}),[2];r=v,l.label=12;case 12:return g=f.next(),[3,10];case 13:return[3,16];case 14:return y=l.sent(),I={error:y},[3,16];case 15:try{g&&!g.done&&(x=f.return)&&x.call(f)}finally{if(I)throw I.error}return[7];case 16:return w=this.plugins.filter((function(e){return"destination"===e.type})),b=w.map((function(e){var t=o({},r);return e.execute(t).catch((function(e){return k(t,0,String(e))}))})),Promise.all(b).then((function(e){var t=c(e,1)[0]||k(r,100,"Event not tracked, no destination plugins on the instance");i(t)})),[2]}}))}))},e.prototype.flush=function(){return a(this,void 0,void 0,(function(){var e,t,r,n=this;return l(this,(function(i){switch(i.label){case 0:return e=this.queue,this.queue=[],[4,Promise.all(e.map((function(e){return n.apply(e)})))];case 1:return i.sent(),t=this.plugins.filter((function(e){return"destination"===e.type})),r=t.map((function(e){return e.flush&&e.flush()})),[4,Promise.all(r)];case 2:return i.sent(),[2]}}))}))},e.prototype.onIdentityChanged=function(e){this.plugins.forEach((function(t){var r;null===(r=t.onIdentityChanged)||void 0===r||r.call(t,e)}))},e.prototype.onSessionIdChanged=function(e){this.plugins.forEach((function(t){var r;null===(r=t.onSessionIdChanged)||void 0===r||r.call(t,e)}))},e.prototype.onOptOutChanged=function(e){this.plugins.forEach((function(t){var r;null===(r=t.onOptOutChanged)||void 0===r||r.call(t,e)}))},e}(),P=function(e,t){return o(o({},t),{event_type:i.IDENTIFY,user_properties:e.getUserProperties()})},M=function(e){return{promise:e||Promise.resolve()}},_=function(){function e(e){void 0===e&&(e="$default"),this.initializing=!1,this.isReady=!1,this.q=[],this.dispatchQ=[],this.logEvent=this.track.bind(this),this.timeline=new R(this),this.name=e}return e.prototype._init=function(e){return a(this,void 0,void 0,(function(){return l(this,(function(t){switch(t.label){case 0:return this.config=e,this.timeline.reset(this),[4,this.runQueuedFunctions("q")];case 1:return t.sent(),this.isReady=!0,[2]}}))}))},e.prototype.runQueuedFunctions=function(e){return a(this,void 0,void 0,(function(){var t,r,n,i,o,s,a,c;return l(this,(function(l){switch(l.label){case 0:t=this[e],this[e]=[],l.label=1;case 1:l.trys.push([1,8,9,10]),r=u(t),n=r.next(),l.label=2;case 2:return n.done?[3,7]:(i=n.value,(o=i())&&"promise"in o?[4,o.promise]:[3,4]);case 3:return l.sent(),[3,6];case 4:return[4,o];case 5:l.sent(),l.label=6;case 6:return n=r.next(),[3,2];case 7:return[3,10];case 8:return s=l.sent(),a={error:s},[3,10];case 9:try{n&&!n.done&&(c=r.return)&&c.call(r)}finally{if(a)throw a.error}return[7];case 10:return this[e].length?[4,this.runQueuedFunctions(e)]:[3,12];case 11:l.sent(),l.label=12;case 12:return[2]}}))}))},e.prototype.track=function(e,t,r){var n=function(e,t,r){return o(o(o({},"string"==typeof e?{event_type:e}:e),r),t&&{event_properties:t})}(e,t,r);return M(this.dispatch(n))},e.prototype.identify=function(e,t){var r=P(e,t);return M(this.dispatch(r))},e.prototype.groupIdentify=function(e,t,r,n){var s=function(e,t,r,n){var s;return o(o({},n),{event_type:i.GROUP_IDENTIFY,group_properties:r.getUserProperties(),groups:(s={},s[e]=t,s)})}(e,t,r,n);return M(this.dispatch(s))},e.prototype.setGroup=function(e,t,r){var n=function(e,t,r){var n,s=new S;return s.set(e,t),o(o({},r),{event_type:i.IDENTIFY,user_properties:s.getUserProperties(),groups:(n={},n[e]=t,n)})}(e,t,r);return M(this.dispatch(n))},e.prototype.revenue=function(e,t){var r=function(e,t){return o(o({},t),{event_type:i.REVENUE,event_properties:e.getEventProperties()})}(e,t);return M(this.dispatch(r))},e.prototype.add=function(e){return this.isReady?this._addPlugin(e):(this.q.push(this._addPlugin.bind(this,e)),M())},e.prototype._addPlugin=function(e){return M(this.timeline.register(e,this.config))},e.prototype.remove=function(e){return this.isReady?this._removePlugin(e):(this.q.push(this._removePlugin.bind(this,e)),M())},e.prototype._removePlugin=function(e){return M(this.timeline.deregister(e,this.config))},e.prototype.dispatchWithCallback=function(e,t){if(!this.isReady)return t(k(e,0,"Client not initialized"));this.process(e).then(t)},e.prototype.dispatch=function(e){return a(this,void 0,void 0,(function(){var t=this;return l(this,(function(r){return this.isReady?[2,this.process(e)]:[2,new Promise((function(r){t.dispatchQ.push(t.dispatchWithCallback.bind(t,e,r))}))]}))}))},e.prototype.getOperationAppliedUserProperties=function(e){var t={};if(void 0===e)return t;var r={};return Object.keys(e).forEach((function(t){Object.values(n).includes(t)||(r[t]=e[t])})),I.forEach((function(r){if(Object.keys(e).includes(r)){var i=e[r];switch(r){case n.CLEAR_ALL:Object.keys(t).forEach((function(e){delete t[e]}));break;case n.UNSET:Object.keys(i).forEach((function(e){delete t[e]}));break;case n.SET:Object.assign(t,i)}}})),Object.assign(t,r),t},e.prototype.process=function(e){return a(this,void 0,void 0,(function(){var t,r,n,o;return l(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),this.config.optOut?[2,k(e,0,"Event skipped due to optOut config")]:(e.event_type===i.IDENTIFY&&(t=this.getOperationAppliedUserProperties(e.user_properties),this.timeline.onIdentityChanged({userProperties:t})),[4,this.timeline.push(e)]);case 1:return 200===(o=s.sent()).code?this.config.loggerProvider.log(o.message):100===o.code?this.config.loggerProvider.warn(o.message):this.config.loggerProvider.error(o.message),[2,o];case 2:return r=s.sent(),n=String(r),this.config.loggerProvider.error(n),[2,o=k(e,0,n)];case 3:return[2]}}))}))},e.prototype.setOptOut=function(e){this.isReady?this._setOptOut(e):this.q.push(this._setOptOut.bind(this,Boolean(e)))},e.prototype._setOptOut=function(e){this.config.optOut!==e&&(this.timeline.onOptOutChanged(e),this.config.optOut=Boolean(e))},e.prototype.flush=function(){return M(this.timeline.flush())},e.prototype.plugin=function(e){var t=this.timeline.plugins.find((function(t){return t.name===e}));if(void 0!==t)return t;this.config.loggerProvider.debug("Cannot find plugin with name ".concat(e))},e}(),T=function(){function e(){this.productId="",this.quantity=1,this.price=0}return e.prototype.setProductId=function(e){return this.productId=e,this},e.prototype.setQuantity=function(e){return e>0&&(this.quantity=e),this},e.prototype.setPrice=function(e){return this.price=e,this},e.prototype.setRevenueType=function(e){return this.revenueType=e,this},e.prototype.setCurrency=function(e){return this.currency=e,this},e.prototype.setRevenue=function(e){return this.revenue=e,this},e.prototype.setReceipt=function(e){return this.receipt=e,this},e.prototype.setReceiptSig=function(e){return this.receiptSig=e,this},e.prototype.setEventProperties=function(e){return w(e)&&(this.properties=e),this},e.prototype.getEventProperties=function(){var e=this.properties?o({},this.properties):{};return e[x.REVENUE_PRODUCT_ID]=this.productId,e[x.REVENUE_QUANTITY]=this.quantity,e[x.REVENUE_PRICE]=this.price,e[x.REVENUE_TYPE]=this.revenueType,e[x.REVENUE_CURRENCY]=this.currency,e[x.REVENUE]=this.revenue,e[x.RECEIPT]=this.receipt,e[x.RECEIPT_SIG]=this.receiptSig,e},e}();!function(e){e.REVENUE_PRODUCT_ID="$productId",e.REVENUE_QUANTITY="$quantity",e.REVENUE_PRICE="$price",e.REVENUE_TYPE="$revenueType",e.REVENUE_CURRENCY="$currency",e.REVENUE="$revenue",e.RECEIPT="$receipt",e.RECEIPT_SIG="$receiptSig"}(x||(x={}));var N;!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={}));var L="Amplitude Logger ",D=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(L,"[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(L,"[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(L,"[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(L,"[Debug]: ").concat(e.join(" ")))},e}(),F=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,instanceName:"$default_instance",logLevel:N.Warn,loggerProvider:new D,offline:!1,optOut:!1,serverUrl:y,serverZone:"US",useBatch:!1}},U=function(){function e(e){var t,r,n,i;this._optOut=!1;var o=F();this.apiKey=e.apiKey,this.flushIntervalMillis=null!==(t=e.flushIntervalMillis)&&void 0!==t?t:o.flushIntervalMillis,this.flushMaxRetries=e.flushMaxRetries||o.flushMaxRetries,this.flushQueueSize=e.flushQueueSize||o.flushQueueSize,this.instanceName=e.instanceName||o.instanceName,this.loggerProvider=e.loggerProvider||o.loggerProvider,this.logLevel=null!==(r=e.logLevel)&&void 0!==r?r:o.logLevel,this.minIdLength=e.minIdLength,this.plan=e.plan,this.ingestionMetadata=e.ingestionMetadata,this.offline=void 0!==e.offline?e.offline:o.offline,this.optOut=null!==(n=e.optOut)&&void 0!==n?n:o.optOut,this.serverUrl=e.serverUrl,this.serverZone=e.serverZone||o.serverZone,this.storageProvider=e.storageProvider,this.transportProvider=e.transportProvider,this.useBatch=null!==(i=e.useBatch)&&void 0!==i?i:o.useBatch,this.loggerProvider.enable(this.logLevel);var s=B(e.serverUrl,e.serverZone,e.useBatch);this.serverZone=s.serverZone,this.serverUrl=s.serverUrl}return Object.defineProperty(e.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut=e},enumerable:!1,configurable:!0}),e}(),j=function(e,t){return"EU"===e?t?"https://api.eu.amplitude.com/batch":"https://api.eu.amplitude.com/2/httpapi":t?"https://api2.amplitude.com/batch":y},B=function(e,t,r){if(void 0===e&&(e=""),void 0===t&&(t=F().serverZone),void 0===r&&(r=F().useBatch),e)return{serverUrl:e,serverZone:void 0};var n=["US","EU"].includes(t)?t:F().serverZone;return{serverZone:n,serverUrl:j(n,r)}},z=function(){function e(){this.sdk={metrics:{histogram:{}}}}return e.prototype.recordHistogram=function(e,t){this.sdk.metrics.histogram[e]=t},e}();function V(e){var t="";try{"body"in e&&(t=JSON.stringify(e.body,null,2))}catch(e){}return t}var W=function(){function e(){this.name="amplitude",this.type="destination",this.retryTimeout=1e3,this.throttleTimeout=3e4,this.storageKey="",this.scheduleId=null,this.scheduledTimeout=0,this.flushId=null,this.queue=[]}return e.prototype.setup=function(e){var t;return a(this,void 0,void 0,(function(){var r,n=this;return l(this,(function(i){switch(i.label){case 0:return this.config=e,this.storageKey="".concat(v,"_").concat(this.config.apiKey.substring(0,10)),[4,null===(t=this.config.storageProvider)||void 0===t?void 0:t.get(this.storageKey)];case 1:return(r=i.sent())&&r.length>0&&Promise.all(r.map((function(e){return n.execute(e)}))).catch(),[2,Promise.resolve(void 0)]}}))}))},e.prototype.execute=function(e){var t=this;return e.insert_id||(e.insert_id=A()),new Promise((function(r){var n={event:e,attempts:0,callback:function(e){return r(e)},timeout:0};t.queue.push(n),t.schedule(t.config.flushIntervalMillis),t.saveEvents()}))},e.prototype.removeEventsExceedFlushMaxRetries=function(e){var t=this;return e.filter((function(e){return e.attempts+=1,e.attempts<t.config.flushMaxRetries||(t.fulfillRequest([e],500,"Event rejected due to exceeded retry count"),!1)}))},e.prototype.scheduleEvents=function(e){var t=this;e.forEach((function(e){t.schedule(0===e.timeout?t.config.flushIntervalMillis:e.timeout)}))},e.prototype.schedule=function(e){var t=this;if(!this.config.offline)return null===this.scheduleId||this.scheduleId&&e>this.scheduledTimeout?(this.scheduleId&&clearTimeout(this.scheduleId),this.scheduledTimeout=e,void(this.scheduleId=setTimeout((function(){t.queue=t.queue.map((function(e){return e.timeout=0,e})),t.flush(!0)}),e))):void 0},e.prototype.resetSchedule=function(){this.scheduleId=null,this.scheduledTimeout=0},e.prototype.flush=function(e){return void 0===e&&(e=!1),a(this,void 0,void 0,(function(){var t,r,n,i=this;return l(this,(function(o){switch(o.label){case 0:return this.config.offline?(this.resetSchedule(),this.config.loggerProvider.debug("Skipping flush while offline."),[2]):this.flushId?(this.resetSchedule(),this.config.loggerProvider.debug("Skipping flush because previous flush has not resolved."),[2]):(this.flushId=this.scheduleId,this.resetSchedule(),t=[],r=[],this.queue.forEach((function(e){return 0===e.timeout?t.push(e):r.push(e)})),s=t,u=this.config.flushQueueSize,c=Math.max(u,1),n=s.reduce((function(e,t,r){var n=Math.floor(r/c);return e[n]||(e[n]=[]),e[n].push(t),e}),[]),[4,n.reduce((function(t,r){return a(i,void 0,void 0,(function(){return l(this,(function(n){switch(n.label){case 0:return[4,t];case 1:return n.sent(),[4,this.send(r,e)];case 2:return[2,n.sent()]}}))}))}),Promise.resolve())]);case 1:return o.sent(),this.flushId=null,this.scheduleEvents(this.queue),[2]}var s,u,c}))}))},e.prototype.send=function(e,t){return void 0===t&&(t=!0),a(this,void 0,void 0,(function(){var r,n,i,o,a;return l(this,(function(l){switch(l.label){case 0:if(!this.config.apiKey)return[2,this.fulfillRequest(e,400,"Event rejected due to missing API key")];r={api_key:this.config.apiKey,events:e.map((function(e){var t=e.event;return t.extra,s(t,["extra"])})),options:{min_id_length:this.config.minIdLength},client_upload_time:(new Date).toISOString(),request_metadata:this.config.requestMetadata},this.config.requestMetadata=new z,l.label=1;case 1:return l.trys.push([1,3,,4]),n=B(this.config.serverUrl,this.config.serverZone,this.config.useBatch).serverUrl,[4,this.config.transportProvider.send(n,r)];case 2:return null===(i=l.sent())?(this.fulfillRequest(e,0,"Unexpected error occurred"),[2]):t?(this.handleResponse(i,e),[3,4]):("body"in i?this.fulfillRequest(e,i.statusCode,"".concat(i.status,": ").concat(V(i))):this.fulfillRequest(e,i.statusCode,i.status),[2]);case 3:return o=l.sent(),a=(u=o)instanceof Error?u.message:String(u),this.config.loggerProvider.error(a),this.handleResponse({status:C.Failed,statusCode:0},e),[3,4];case 4:return[2]}var u}))}))},e.prototype.handleResponse=function(e,t){var r=e.status;switch(r){case C.Success:this.handleSuccessResponse(e,t);break;case C.Invalid:this.handleInvalidResponse(e,t);break;case C.PayloadTooLarge:this.handlePayloadTooLargeResponse(e,t);break;case C.RateLimit:this.handleRateLimitResponse(e,t);break;default:this.config.loggerProvider.warn("{code: 0, error: \"Status '".concat(r,"' provided for ").concat(t.length,' events"}')),this.handleOtherResponse(t)}},e.prototype.handleSuccessResponse=function(e,t){this.fulfillRequest(t,e.statusCode,"Event tracked successfully")},e.prototype.handleInvalidResponse=function(e,t){var r=this;if(e.body.missingField||e.body.error.startsWith("Invalid API key"))this.fulfillRequest(t,e.statusCode,e.body.error);else{var n=h(h(h(h([],c(Object.values(e.body.eventsWithInvalidFields)),!1),c(Object.values(e.body.eventsWithMissingFields)),!1),c(Object.values(e.body.eventsWithInvalidIdLengths)),!1),c(e.body.silencedEvents),!1).flat(),i=new Set(n),o=t.filter((function(t,n){if(!i.has(n))return!0;r.fulfillRequest([t],e.statusCode,e.body.error)}));o.length>0&&this.config.loggerProvider.warn(V(e));var s=this.removeEventsExceedFlushMaxRetries(o);this.scheduleEvents(s)}},e.prototype.handlePayloadTooLargeResponse=function(e,t){if(1!==t.length){this.config.loggerProvider.warn(V(e)),this.config.flushQueueSize/=2;var r=this.removeEventsExceedFlushMaxRetries(t);this.scheduleEvents(r)}else this.fulfillRequest(t,e.statusCode,e.body.error)},e.prototype.handleRateLimitResponse=function(e,t){var r=this,n=Object.keys(e.body.exceededDailyQuotaUsers),i=Object.keys(e.body.exceededDailyQuotaDevices),o=e.body.throttledEvents,s=new Set(n),a=new Set(i),l=new Set(o),u=t.filter((function(t,n){if(!(t.event.user_id&&s.has(t.event.user_id)||t.event.device_id&&a.has(t.event.device_id)))return l.has(n)&&(t.timeout=r.throttleTimeout),!0;r.fulfillRequest([t],e.statusCode,e.body.error)}));u.length>0&&this.config.loggerProvider.warn(V(e));var c=this.removeEventsExceedFlushMaxRetries(u);this.scheduleEvents(c)},e.prototype.handleOtherResponse=function(e){var t=this,r=e.map((function(e){return e.timeout=e.attempts*t.retryTimeout,e})),n=this.removeEventsExceedFlushMaxRetries(r);this.scheduleEvents(n)},e.prototype.fulfillRequest=function(e,t,r){this.removeEvents(e),e.forEach((function(e){return e.callback(k(e.event,t,r))}))},e.prototype.saveEvents=function(){if(this.config.storageProvider){var e=this.queue.map((function(e){return e.event}));this.config.storageProvider.set(this.storageKey,e)}},e.prototype.removeEvents=function(e){this.queue=this.queue.filter((function(t){return!e.some((function(e){return e.event.insert_id===t.event.insert_id}))})),this.saveEvents()},e}(),q=function(){function e(){}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:G(),platform:"Web",os:void 0,deviceModel:void 0}},e}(),G=function(){return"undefined"!=typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},K=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}(),Y=function(){return Y=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Y.apply(this,arguments)};function Z(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 J(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}"function"==typeof SuppressedError&&SuppressedError;var $=function(e,t){var r,n,i=typeof e;if(i!==typeof t)return!1;try{for(var o=Z(["string","number","boolean","undefined"]),s=o.next();!s.done;s=o.next()){if(s.value===i)return e===t}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}if(null==e&&null==t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;var a=Array.isArray(e),l=Array.isArray(t);if(a!==l)return!1;if(!a||!l){var u=Object.keys(e).sort(),c=Object.keys(t).sort();if(!$(u,c))return!1;var h=!0;return Object.keys(e).forEach((function(r){$(e[r],t[r])||(h=!1)})),h}for(var d=0;d<e.length;d++)if(!$(e[d],t[d]))return!1;return!0};Object.entries||(Object.entries=function(e){for(var t=Object.keys(e),r=t.length,n=new Array(r);r--;)n[r]=[t[r],e[t[r]]];return n});var X,H=function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var e=this,t=Y({},this.identity.userProperties),r=Y(Y({},this.identity),{userProperties:t});return{setUserId:function(e){return r.userId=e,this},setDeviceId:function(e){return r.deviceId=e,this},setUserProperties:function(e){return r.userProperties=e,this},setOptOut:function(e){return r.optOut=e,this},updateUserProperties:function(e){var t,n,i,o,s,a,l=r.userProperties||{};try{for(var u=Z(Object.entries(e)),c=u.next();!c.done;c=u.next()){var h=J(c.value,2),d=h[0],p=h[1];switch(d){case"$set":try{for(var f=(i=void 0,Z(Object.entries(p))),g=f.next();!g.done;g=f.next()){var m=J(g.value,2),v=m[0],y=m[1];l[v]=y}}catch(e){i={error:e}}finally{try{g&&!g.done&&(o=f.return)&&o.call(f)}finally{if(i)throw i.error}}break;case"$unset":try{for(var w=(s=void 0,Z(Object.keys(p))),b=w.next();!b.done;b=w.next()){delete l[v=b.value]}}catch(e){s={error:e}}finally{try{b&&!b.done&&(a=w.return)&&a.call(w)}finally{if(s)throw s.error}}break;case"$clearAll":l={}}}}catch(e){t={error:e}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(t)throw t.error}}return r.userProperties=l,this},commit:function(){return e.setIdentity(r),this}}},e.prototype.getIdentity=function(){return Y({},this.identity)},e.prototype.setIdentity=function(e){var t=Y({},this.identity);this.identity=Y({},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}(),Q="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:self,ee=function(){function e(){this.identityStore=new H,this.eventBridge=new K,this.applicationContextProvider=new q}return e.getInstance=function(t){return Q.analyticsConnectorInstances||(Q.analyticsConnectorInstances={}),Q.analyticsConnectorInstances[t]||(Q.analyticsConnectorInstances[t]=new e),Q.analyticsConnectorInstances[t]},e}(),te=function(e){return void 0===e&&(e="$default_instance"),ee.getInstance(e)},re=function(){function e(){this.name="identity",this.type="before",this.identityStore=te().identityStore}return e.prototype.execute=function(e){return a(this,void 0,void 0,(function(){var t;return l(this,(function(r){return(t=e.user_properties)&&this.identityStore.editIdentity().updateUserProperties(t).commit(),[2,e]}))}))},e.prototype.setup=function(e){return a(this,void 0,void 0,(function(){return l(this,(function(t){return e.instanceName&&(this.identityStore=te(e.instanceName).identityStore),[2]}))}))},e}(),ne=function(e,t){return void 0===t&&(t=Date.now()),Date.now()-t>e},ie=function(e,t,r){return void 0===t&&(t=""),void 0===r&&(r=10),[m,t,e.substring(0,r)].filter(Boolean).join("_")},oe=function(){var e,t,r,n;if("undefined"==typeof navigator)return"";var i=navigator.userLanguage;return null!==(n=null!==(r=null!==(t=null===(e=navigator.languages)||void 0===e?void 0:e[0])&&void 0!==t?t:navigator.language)&&void 0!==r?r:i)&&void 0!==n?n:""},se=function(){var e,t=E();return(null===(e=null==t?void 0:t.location)||void 0===e?void 0:e.search)?t.location.search.substring(1).split("&").filter(Boolean).reduce((function(e,t){var r=t.split("=",2),n=ae(r[0]),i=ae(r[1]);return i?(e[n]=i,e):e}),{}):{}},ae=function(e){void 0===e&&(e="");try{return decodeURIComponent(e)}catch(e){return""}},le=function(e){return void 0===e&&(e=0),((new Error).stack||"").split("\n").slice(2+e).map((function(e){return e.trim()}))},ue=function(e){return function(){var t=o({},e.config);return{logger:t.loggerProvider,logLevel:t.logLevel}}},ce=function(e,t){var r,n;t=(t=t.replace(/\[(\w+)\]/g,".$1")).replace(/^\./,"");try{for(var i=u(t.split(".")),o=i.next();!o.done;o=i.next()){var s=o.value;if(!(s in e))return;e=e[s]}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return e},he=function(e,t){return function(){var r,n,i={};try{for(var o=u(t),s=o.next();!s.done;s=o.next()){var a=s.value;i[a]=ce(e,a)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return i}},de=function(e,t,r,n,i){return void 0===i&&(i=null),function(){for(var o=[],s=0;s<arguments.length;s++)o[s]=arguments[s];var a=r(),l=a.logger,u=a.logLevel;if(u&&u<N.Debug||!u||!l)return e.apply(i,o);var c={type:"invoke public method",name:t,args:o,stacktrace:le(1),time:{start:(new Date).toISOString()},states:{}};n&&c.states&&(c.states.before=n());var h=e.apply(i,o);return h&&h.promise?h.promise.then((function(){n&&c.states&&(c.states.after=n()),c.time&&(c.time.end=(new Date).toISOString()),l.debug(JSON.stringify(c,null,2))})):(n&&c.states&&(c.states.after=n()),c.time&&(c.time.end=(new Date).toISOString()),l.debug(JSON.stringify(c,null,2))),h}},pe=function(){function e(){this.memoryStorage=new Map}return e.prototype.isEnabled=function(){return a(this,void 0,void 0,(function(){return l(this,(function(e){return[2,!0]}))}))},e.prototype.get=function(e){return a(this,void 0,void 0,(function(){return l(this,(function(t){return[2,this.memoryStorage.get(e)]}))}))},e.prototype.getRaw=function(e){return a(this,void 0,void 0,(function(){var t;return l(this,(function(r){switch(r.label){case 0:return[4,this.get(e)];case 1:return[2,(t=r.sent())?JSON.stringify(t):void 0]}}))}))},e.prototype.set=function(e,t){return a(this,void 0,void 0,(function(){return l(this,(function(r){return this.memoryStorage.set(e,t),[2]}))}))},e.prototype.remove=function(e){return a(this,void 0,void 0,(function(){return l(this,(function(t){return this.memoryStorage.delete(e),[2]}))}))},e.prototype.reset=function(){return a(this,void 0,void 0,(function(){return l(this,(function(e){return this.memoryStorage.clear(),[2]}))}))},e}(),fe=function(){function e(e){this.options=o({},e)}return e.prototype.isEnabled=function(){return a(this,void 0,void 0,(function(){var t,r;return l(this,(function(n){switch(n.label){case 0:if(!E())return[2,!1];e.testValue=String(Date.now()),t=new e(this.options),r="AMP_TEST",n.label=1;case 1:return n.trys.push([1,4,5,7]),[4,t.set(r,e.testValue)];case 2:return n.sent(),[4,t.get(r)];case 3:return[2,n.sent()===e.testValue];case 4:return n.sent(),[2,!1];case 5:return[4,t.remove(r)];case 6:return n.sent(),[7];case 7:return[2]}}))}))},e.prototype.get=function(e){var t;return a(this,void 0,void 0,(function(){var r,n;return l(this,(function(i){switch(i.label){case 0:return[4,this.getRaw(e)];case 1:if(!(r=i.sent()))return[2,void 0];try{return void 0===(n=null!==(t=ge(r))&&void 0!==t?t:me(r))?(console.error("Amplitude Logger [Error]: Failed to decode cookie value for key: ".concat(e,", value: ").concat(r)),[2,void 0]):[2,JSON.parse(n)]}catch(t){return console.error("Amplitude Logger [Error]: Failed to parse cookie value for key: ".concat(e,", value: ").concat(r)),[2,void 0]}return[2]}}))}))},e.prototype.getRaw=function(e){var t,r;return a(this,void 0,void 0,(function(){var n,i,o;return l(this,(function(s){return n=E(),i=null!==(r=null===(t=null==n?void 0:n.document)||void 0===t?void 0:t.cookie.split("; "))&&void 0!==r?r:[],(o=i.find((function(t){return 0===t.indexOf(e+"=")})))?[2,o.substring(e.length+1)]:[2,void 0]}))}))},e.prototype.set=function(e,t){var r;return a(this,void 0,void 0,(function(){var n,i,o,s,a,u,c;return l(this,(function(l){try{n=null!==(r=this.options.expirationDays)&&void 0!==r?r:0,o=void 0,(i=null!==t?n:-1)&&((s=new Date).setTime(s.getTime()+24*i*60*60*1e3),o=s),a="".concat(e,"=").concat(btoa(encodeURIComponent(JSON.stringify(t)))),o&&(a+="; expires=".concat(o.toUTCString())),a+="; path=/",this.options.domain&&(a+="; domain=".concat(this.options.domain)),this.options.secure&&(a+="; Secure"),this.options.sameSite&&(a+="; SameSite=".concat(this.options.sameSite)),(u=E())&&(u.document.cookie=a)}catch(t){c=t instanceof Error?t.message:String(t),console.error("Amplitude Logger [Error]: Failed to set cookie for key: ".concat(e,". Error: ").concat(c))}return[2]}))}))},e.prototype.remove=function(e){return a(this,void 0,void 0,(function(){return l(this,(function(t){switch(t.label){case 0:return[4,this.set(e,null)];case 1:return t.sent(),[2]}}))}))},e.prototype.reset=function(){return a(this,void 0,void 0,(function(){return l(this,(function(e){return[2]}))}))},e}(),ge=function(e){try{return decodeURIComponent(atob(e))}catch(e){return}},me=function(e){try{return decodeURIComponent(atob(decodeURIComponent(e)))}catch(e){return}},ve=function(){function e(){}return e.prototype.send=function(e,t){return Promise.resolve(null)},e.prototype.buildResponse=function(e){var t,r,n,i,o,s,a,l,u,c,h,d,p,f,g,m,v,y,w,b,S,I;if("object"!=typeof e)return null;var x=e.code||0,k=this.buildStatus(x);switch(k){case C.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 C.Invalid:return{status:k,statusCode:x,body:{error:null!==(i=e.error)&&void 0!==i?i:"",missingField:null!==(o=e.missing_field)&&void 0!==o?o:"",eventsWithInvalidFields:null!==(s=e.events_with_invalid_fields)&&void 0!==s?s:{},eventsWithMissingFields:null!==(a=e.events_with_missing_fields)&&void 0!==a?a:{},eventsWithInvalidIdLengths:null!==(l=e.events_with_invalid_id_lengths)&&void 0!==l?l:{},epsThreshold:null!==(u=e.eps_threshold)&&void 0!==u?u:0,exceededDailyQuotaDevices:null!==(c=e.exceeded_daily_quota_devices)&&void 0!==c?c:{},silencedDevices:null!==(h=e.silenced_devices)&&void 0!==h?h:[],silencedEvents:null!==(d=e.silenced_events)&&void 0!==d?d:[],throttledDevices:null!==(p=e.throttled_devices)&&void 0!==p?p:{},throttledEvents:null!==(f=e.throttled_events)&&void 0!==f?f:[]}};case C.PayloadTooLarge:return{status:k,statusCode:x,body:{error:null!==(g=e.error)&&void 0!==g?g:""}};case C.RateLimit:return{status:k,statusCode:x,body:{error:null!==(m=e.error)&&void 0!==m?m:"",epsThreshold:null!==(v=e.eps_threshold)&&void 0!==v?v:0,throttledDevices:null!==(y=e.throttled_devices)&&void 0!==y?y:{},throttledUsers:null!==(w=e.throttled_users)&&void 0!==w?w:{},exceededDailyQuotaDevices:null!==(b=e.exceeded_daily_quota_devices)&&void 0!==b?b:{},exceededDailyQuotaUsers:null!==(S=e.exceeded_daily_quota_users)&&void 0!==S?S:{},throttledEvents:null!==(I=e.throttled_events)&&void 0!==I?I:[]}};case C.Timeout:default:return{status:k,statusCode:x}}},e.prototype.buildStatus=function(e){return e>=200&&e<300?C.Success:429===e?C.RateLimit:413===e?C.PayloadTooLarge:408===e?C.Timeout:e>=400&&e<500?C.Invalid:e>=500?C.Failed:C.Unknown},e}(),ye=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,i;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:i=o.sent();try{return[2,this.buildResponse(JSON.parse(i))]}catch(e){return[2,this.buildResponse({code:n.status})]}return[2]}}))}))},t}(ve);!function(e){e.US="US",e.EU="EU",e.STAGING="STAGING"}(X||(X={}));var we,be,Se,Ce,Ie,xe=["a","button","input","select","textarea","label","video","audio",'[contenteditable="true" i]',"[data-amp-default-track]",".amp-default-track"],ke="data-amp-track-",Ee=["div","span","h1","h2","h3","h4","h5","h6"],Oe=function(e,t){return"boolean"==typeof e?e:!1!==(null==e?void 0:e[t])},Ae=function(e){return Oe(e,"attribution")},Re=function(e){return Oe(e,"pageViews")},Pe=function(e){return Oe(e,"sessions")},Me=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.elementInteractions||"object"==typeof e.elementInteractions)},_e=function(e){if(Me(e.autocapture)&&"object"==typeof e.autocapture&&"object"==typeof e.autocapture.elementInteractions)return e.autocapture.elementInteractions},Te=function(e){var t,r=function(){return!1},n=void 0,i=e.pageCounter;return Re(e.defaultTracking)&&(r=void 0,t=void 0,e.defaultTracking&&"object"==typeof e.defaultTracking&&e.defaultTracking.pageViews&&"object"==typeof e.defaultTracking.pageViews&&("trackOn"in e.defaultTracking.pageViews&&(r=e.defaultTracking.pageViews.trackOn),"trackHistoryChanges"in e.defaultTracking.pageViews&&(n=e.defaultTracking.pageViews.trackHistoryChanges),"eventType"in e.defaultTracking.pageViews&&e.defaultTracking.pageViews.eventType&&(t=e.defaultTracking.pageViews.eventType))),{trackOn:r,trackHistoryChanges:n,eventType:t,pageCounter:i}},Ne=function(e,t){for(var r=0;r<t.length;r++){var n=t[r],i=n.name,o=n.args,s=n.resolve,a=e&&e[i];if("function"==typeof a){var l=a.apply(e,o);"function"==typeof s&&s(null==l?void 0:l.promise)}}return e},Le=function(e){return e&&void 0!==e._q},De="2.14.0",Fe=function(){function e(){this.name="@amplitude/plugin-context-browser",this.type="before",this.library="".concat("amplitude-ts","/").concat(De),"undefined"!=typeof navigator&&(this.userAgent=navigator.userAgent)}return e.prototype.setup=function(e){return this.config=e,Promise.resolve(void 0)},e.prototype.execute=function(e){var t,r;return a(this,void 0,void 0,(function(){var n,i,s;return l(this,(function(a){return n=(new Date).getTime(),i=null!==(t=this.config.lastEventId)&&void 0!==t?t:-1,s=null!==(r=e.event_id)&&void 0!==r?r:i+1,this.config.lastEventId=s,e.time||(this.config.lastEventTime=n),[2,o(o(o(o(o(o(o(o({user_id:this.config.userId,device_id:this.config.deviceId,session_id:this.config.sessionId,time:n},this.config.appVersion&&{app_version:this.config.appVersion}),this.config.trackingOptions.platform&&{platform:"Web"}),this.config.trackingOptions.language&&{language:oe()}),this.config.trackingOptions.ipAddress&&{ip:"$remote"}),{insert_id:A(),partner_id:this.config.partnerId,plan:this.config.plan}),this.config.ingestionMetadata&&{ingestion_metadata:{source_name:this.config.ingestionMetadata.sourceName,source_version:this.config.ingestionMetadata.sourceVersion}}),e),{event_id:s,library:this.library,user_agent:this.userAgent})]}))}))},e}(),Ue=function(){function e(e){this.storage=e}return e.prototype.isEnabled=function(){return a(this,void 0,void 0,(function(){var t,r,n;return l(this,(function(i){switch(i.label){case 0:if(!this.storage)return[2,!1];t=String(Date.now()),r=new e(this.storage),n="AMP_TEST",i.label=1;case 1:return i.trys.push([1,4,5,7]),[4,r.set(n,t)];case 2:return i.sent(),[4,r.get(n)];case 3:return[2,i.sent()===t];case 4:return i.sent(),[2,!1];case 5:return[4,r.remove(n)];case 6:return i.sent(),[7];case 7:return[2]}}))}))},e.prototype.get=function(e){return a(this,void 0,void 0,(function(){var t;return l(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.getRaw(e)];case 1:return(t=r.sent())?[2,JSON.parse(t)]:[2,void 0];case 2:return r.sent(),console.error("[Amplitude] Error: Could not get value from storage"),[2,void 0];case 3:return[2]}}))}))},e.prototype.getRaw=function(e){var t;return a(this,void 0,void 0,(function(){return l(this,(function(r){return[2,(null===(t=this.storage)||void 0===t?void 0:t.getItem(e))||void 0]}))}))},e.prototype.set=function(e,t){var r;return a(this,void 0,void 0,(function(){return l(this,(function(n){try{null===(r=this.storage)||void 0===r||r.setItem(e,JSON.stringify(t))}catch(e){}return[2]}))}))},e.prototype.remove=function(e){var t;return a(this,void 0,void 0,(function(){return l(this,(function(r){try{null===(t=this.storage)||void 0===t||t.removeItem(e)}catch(e){}return[2]}))}))},e.prototype.reset=function(){var e;return a(this,void 0,void 0,(function(){return l(this,(function(t){try{null===(e=this.storage)||void 0===e||e.clear()}catch(e){}return[2]}))}))},e}(),je=1e3,Be=function(e){function t(t){var r,n,i,o=this;try{i=null===(r=E())||void 0===r?void 0:r.localStorage}catch(e){null===(n=null==t?void 0:t.loggerProvider)||void 0===n||n.debug("Failed to access localStorage. error=".concat(JSON.stringify(e))),i=void 0}return(o=e.call(this,i)||this).loggerProvider=null==t?void 0:t.loggerProvider,o}return r(t,e),t.prototype.set=function(t,r){var n;return a(this,void 0,void 0,(function(){var i;return l(this,(function(o){switch(o.label){case 0:return Array.isArray(r)&&r.length>je?(i=r.length-je,[4,e.prototype.set.call(this,t,r.slice(0,je))]):[3,2];case 1:return o.sent(),null===(n=this.loggerProvider)||void 0===n||n.error("Failed to save ".concat(i," events because the queue length exceeded ").concat(je,".")),[3,4];case 2:return[4,e.prototype.set.call(this,t,r)];case 3:o.sent(),o.label=4;case 4:return[2]}}))}))},t}(Ue),ze=function(e){function t(){var t;return e.call(this,null===(t=E())||void 0===t?void 0:t.sessionStorage)||this}return r(t,e),t}(Ue),Ve=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={done:4},t}return r(t,e),t.prototype.send=function(e,t){return a(this,void 0,void 0,(function(){var r=this;return l(this,(function(n){return[2,new Promise((function(n,i){"undefined"==typeof XMLHttpRequest&&i(new Error("XHRTransport is not supported."));var o=new XMLHttpRequest;o.open("POST",e,!0),o.onreadystatechange=function(){if(o.readyState===r.state.done){var e=o.responseText;try{n(r.buildResponse(JSON.parse(e)))}catch(e){n(r.buildResponse({code:o.status}))}}},o.setRequestHeader("Content-Type","application/json"),o.setRequestHeader("Accept","*/*"),o.send(JSON.stringify(t))}))]}))}))},t}(ve),We=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=this;return l(this,(function(n){return[2,new Promise((function(n,i){var o=E();if(!(null==o?void 0:o.navigator.sendBeacon))throw new Error("SendBeaconTransport is not supported");try{var s=JSON.stringify(t);return n(o.navigator.sendBeacon(e,JSON.stringify(t))?r.buildResponse({code:200,events_ingested:t.events.length,payload_size_bytes:s.length,server_upload_time:Date.now()}):r.buildResponse({code:500}))}catch(e){i(e)}}))]}))}))},t}(ve),qe=function(e,t,r){return void 0===r&&(r=!0),a(void 0,void 0,void 0,(function(){var n,i,o,s,a,u,h,d,p;return l(this,(function(l){switch(l.label){case 0:return n=function(e){return"".concat(m.toLowerCase(),"_").concat(e.substring(0,6))}(e),[4,t.getRaw(n)];case 1:return(i=l.sent())?r?[4,t.remove(n)]:[3,3]:[2,{optOut:!1}];case 2:l.sent(),l.label=3;case 3:return o=c(i.split("."),6),s=o[0],a=o[1],u=o[2],h=o[3],d=o[4],p=o[5],[2,{deviceId:s,userId:Ke(a),sessionId:Ge(h),lastEventId:Ge(p),lastEventTime:Ge(d),optOut:Boolean(u)}]}}))}))},Ge=function(e){var t=parseInt(e,32);if(!isNaN(t))return t},Ke=function(e){if(atob&&escape&&e)try{return decodeURIComponent(escape(atob(e)))}catch(e){return}},Ye="[Amplitude]",Ze="".concat(Ye," Form Started"),Je="".concat(Ye," Form Submitted"),$e="".concat(Ye," File Downloaded"),Xe="session_start",He="session_end",Qe="".concat(Ye," File Extension"),et="".concat(Ye," File Name"),tt="".concat(Ye," Link ID"),rt="".concat(Ye," Link Text"),nt="".concat(Ye," Link URL"),it="".concat(Ye," Form ID"),ot="".concat(Ye," Form Name"),st="".concat(Ye," Form Destination"),at="cookie",lt=function(e){function t(t,r,n,i,o,s,a,l,u,c,h,d,p,f,g,m,v,y,w,b,S,C,I,x,k,E,O,A,R,P,M,_,T,L){void 0===n&&(n=new pe),void 0===i&&(i={domain:"",expiration:365,sameSite:"Lax",secure:!1,upgrade:!0}),void 0===l&&(l=1e3),void 0===u&&(u=5),void 0===c&&(c=30),void 0===h&&(h=at),void 0===m&&(m=new D),void 0===v&&(v=N.Warn),void 0===w&&(w=!1),void 0===b&&(b=!1),void 0===I&&(I=""),void 0===x&&(x="US"),void 0===E&&(E=18e5),void 0===O&&(O=new Be({loggerProvider:m})),void 0===A&&(A={ipAddress:!0,language:!0,platform:!0}),void 0===R&&(R="fetch"),void 0===P&&(P=!1),void 0===M&&(M=!0);var F=e.call(this,{apiKey:t,storageProvider:O,transportProvider:ht(R)})||this;return F.apiKey=t,F.appVersion=r,F.cookieOptions=i,F.defaultTracking=o,F.autocapture=s,F.flushIntervalMillis=l,F.flushMaxRetries=u,F.flushQueueSize=c,F.identityStorage=h,F.ingestionMetadata=d,F.instanceName=p,F.loggerProvider=m,F.logLevel=v,F.minIdLength=y,F.offline=w,F.partnerId=S,F.plan=C,F.serverUrl=I,F.serverZone=x,F.sessionTimeout=E,F.storageProvider=O,F.trackingOptions=A,F.transport=R,F.useBatch=P,F.fetchRemoteConfig=M,F.version=De,F._optOut=!1,F._cookieStorage=n,F.deviceId=a,F.lastEventId=f,F.lastEventTime=g,F.optOut=b,F.sessionId=k,F.pageCounter=T,F.userId=_,F.debugLogsEnabled=L,F.loggerProvider.enable(L?N.Debug:F.logLevel),F}return r(t,e),Object.defineProperty(t.prototype,"cookieStorage",{get:function(){return this._cookieStorage},set:function(e){this._cookieStorage!==e&&(this._cookieStorage=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"deviceId",{get:function(){return this._deviceId},set:function(e){this._deviceId!==e&&(this._deviceId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"userId",{get:function(){return this._userId},set:function(e){this._userId!==e&&(this._userId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sessionId",{get:function(){return this._sessionId},set:function(e){this._sessionId!==e&&(this._sessionId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut!==e&&(this._optOut=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastEventTime",{get:function(){return this._lastEventTime},set:function(e){this._lastEventTime!==e&&(this._lastEventTime=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastEventId",{get:function(){return this._lastEventId},set:function(e){this._lastEventId!==e&&(this._lastEventId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageCounter",{get:function(){return this._pageCounter},set:function(e){this._pageCounter!==e&&(this._pageCounter=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"debugLogsEnabled",{set:function(e){this._debugLogsEnabled!==e&&(this._debugLogsEnabled=e,this.updateStorage())},enumerable:!1,configurable:!0}),t.prototype.updateStorage=function(){var e={deviceId:this._deviceId,userId:this._userId,sessionId:this._sessionId,optOut:this._optOut,lastEventTime:this._lastEventTime,lastEventId:this._lastEventId,pageCounter:this._pageCounter,debugLogsEnabled:this._debugLogsEnabled};this.cookieStorage.set(ie(this.apiKey),e)},t}(U),ut=function(e,t,r){return void 0===t&&(t={}),a(void 0,void 0,void 0,(function(){var n,i,s,a,u,c,h,d,p,f,g,m,v,y,w,b,S,C,I,x,k,E,O,R,P,M,_,T,N,L,D,F,U,j,B,z,V,W,q,G,K,Y,Z;return l(this,(function(l){switch(l.label){case 0:return n=t.identityStorage||at,I={},n===at?[3,1]:(s="",[3,5]);case 1:return null===(k=null===(x=t.cookieOptions)||void 0===x?void 0:x.domain)||void 0===k?[3,2]:(a=k,[3,4]);case 2:return[4,dt()];case 3:a=l.sent(),l.label=4;case 4:s=a,l.label=5;case 5:return i=o.apply(void 0,[(I.domain=s,I.expiration=365,I.sameSite="Lax",I.secure=!1,I.upgrade=!0,I),t.cookieOptions]),u=ct(t.identityStorage,i),[4,qe(e,u,null===(O=null===(E=t.cookieOptions)||void 0===E?void 0:E.upgrade)||void 0===O||O)];case 6:return c=l.sent(),[4,u.get(ie(e))];case 7:return h=l.sent(),d=se(),p=null!==(T=null!==(_=null!==(M=null!==(P=null!==(R=t.deviceId)&&void 0!==R?R:d.ampDeviceId)&&void 0!==P?P:d.deviceId)&&void 0!==M?M:null==h?void 0:h.deviceId)&&void 0!==_?_:c.deviceId)&&void 0!==T?T:A(),f=null!==(N=null==h?void 0:h.lastEventId)&&void 0!==N?N:c.lastEventId,g=null!==(L=null==h?void 0:h.lastEventTime)&&void 0!==L?L:c.lastEventTime,m=null!==(F=null!==(D=t.optOut)&&void 0!==D?D:null==h?void 0:h.optOut)&&void 0!==F?F:c.optOut,v=null!==(U=null==h?void 0:h.sessionId)&&void 0!==U?U:c.sessionId,y=null!==(B=null!==(j=t.userId)&&void 0!==j?j:null==h?void 0:h.userId)&&void 0!==B?B:c.userId,r.previousSessionDeviceId=null!==(z=null==h?void 0:h.deviceId)&&void 0!==z?z:c.deviceId,r.previousSessionUserId=null!==(V=null==h?void 0:h.userId)&&void 0!==V?V:c.userId,w={ipAddress:null===(q=null===(W=t.trackingOptions)||void 0===W?void 0:W.ipAddress)||void 0===q||q,language:null===(K=null===(G=t.trackingOptions)||void 0===G?void 0:G.language)||void 0===K||K,platform:null===(Z=null===(Y=t.trackingOptions)||void 0===Y?void 0:Y.platform)||void 0===Z||Z},b=null==h?void 0:h.pageCounter,S=null==h?void 0:h.debugLogsEnabled,void 0!==t.autocapture&&(t.defaultTracking=t.autocapture),[4,(C=new lt(e,t.appVersion,u,i,t.defaultTracking,t.autocapture,p,t.flushIntervalMillis,t.flushMaxRetries,t.flushQueueSize,n,t.ingestionMetadata,t.instanceName,f,g,t.loggerProvider,t.logLevel,t.minIdLength,t.offline,m,t.partnerId,t.plan,t.serverUrl,t.serverZone,v,t.sessionTimeout,t.storageProvider,w,t.transport,t.useBatch,t.fetchRemoteConfig,y,b,S)).storageProvider.isEnabled()];case 8:return l.sent()||(C.loggerProvider.warn("Storage provider ".concat(C.storageProvider.constructor.name," is not enabled. Falling back to MemoryStorage.")),C.storageProvider=new pe),[2,C]}}))}))},ct=function(e,t){switch(void 0===e&&(e=at),void 0===t&&(t={}),e){case"localStorage":return new Be;case"sessionStorage":return new ze;case"none":return new pe;default:return new fe(o(o({},t),{expirationDays:t.expiration}))}},ht=function(e){return"xhr"===e?new Ve:"beacon"===e?new We:new ye},dt=function(e){return a(void 0,void 0,void 0,(function(){var t,r,n,i,o,s,a;return l(this,(function(l){switch(l.label){case 0:return[4,(new fe).isEnabled()];case 1:if(!l.sent()||!e&&("undefined"==typeof location||!location.hostname))return[2,""];for(t=null!=e?e:location.hostname,r=t.split("."),n=[],i="AMP_TLDTEST",o=r.length-2;o>=0;--o)n.push(r.slice(o).join("."));o=0,l.label=2;case 2:return o<n.length?(s=n[o],[4,(a=new fe({domain:"."+s})).set(i,1)]):[3,7];case 3:return l.sent(),[4,a.get(i)];case 4:return l.sent()?[4,a.remove(i)]:[3,6];case 5:return l.sent(),[2,"."+s];case 6:return o++,[3,2];case 7:return[2,""]}}))}))},pt=function(){var e="ampIntegrationContext";return"undefined"!=typeof globalThis&&void 0!==globalThis[e]?globalThis[e]:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:void 0},ft=function(){var e,t=pt();return(null===(e=null==t?void 0:t.location)||void 0===e?void 0:e.search)?t.location.search.substring(1).split("&").filter(Boolean).reduce((function(e,t){var r=t.split("=",2),n=gt(r[0]),i=gt(r[1]);return i?(e[n]=i,e):e}),{}):{}},gt=function(e){void 0===e&&(e="");try{return decodeURIComponent(e)}catch(e){return""}},mt="dclid",vt="fbclid",yt="gbraid",wt="gclid",bt="ko_click_id",St="li_fat_id",Ct="msclkid",It="rtd_cid",xt="ttclid",kt="twclid",Et="wbraid",Ot={utm_campaign:void 0,utm_content:void 0,utm_id:void 0,utm_medium:void 0,utm_source:void 0,utm_term:void 0,referrer:void 0,referring_domain:void 0,dclid:void 0,gbraid:void 0,gclid:void 0,fbclid:void 0,ko_click_id:void 0,li_fat_id:void 0,msclkid:void 0,rtd_cid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0},At=function(){function e(){}return e.prototype.parse=function(){return a(this,void 0,void 0,(function(){return l(this,(function(e){return[2,o(o(o(o({},Ot),this.getUtmParam()),this.getReferrer()),this.getClickIds())]}))}))},e.prototype.getUtmParam=function(){var e=ft();return{utm_campaign:e.utm_campaign,utm_content:e.utm_content,utm_id:e.utm_id,utm_medium:e.utm_medium,utm_source:e.utm_source,utm_term:e.utm_term}},e.prototype.getReferrer=function(){var e,t,r={referrer:void 0,referring_domain:void 0};try{r.referrer=document.referrer||void 0,r.referring_domain=null!==(t=null===(e=r.referrer)||void 0===e?void 0:e.split("/")[2])&&void 0!==t?t:void 0}catch(e){}return r},e.prototype.getClickIds=function(){var e,t=ft();return(e={})[mt]=t[mt],e[vt]=t[vt],e[yt]=t[yt],e[wt]=t[wt],e[bt]=t[bt],e[St]=t[St],e[Ct]=t[Ct],e[It]=t[It],e[xt]=t[xt],e[kt]=t[kt],e[Et]=t[Et],e},e}();!function(e){e.SET="$set",e.SET_ONCE="$setOnce",e.ADD="$add",e.APPEND="$append",e.PREPEND="$prepend",e.REMOVE="$remove",e.PREINSERT="$preInsert",e.POSTINSERT="$postInsert",e.UNSET="$unset",e.CLEAR_ALL="$clearAll"}(we||(we={})),function(e){e.REVENUE_PRODUCT_ID="$productId",e.REVENUE_QUANTITY="$quantity",e.REVENUE_PRICE="$price",e.REVENUE_TYPE="$revenueType",e.REVENUE_CURRENCY="$currency",e.REVENUE="$revenue"}(be||(be={})),function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"}(Se||(Se={})),function(e){e.US="US",e.EU="EU"}(Ce||(Ce={})),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"}(Ie||(Ie={}));var Rt=function(e){var t={};for(var r in e){var n=e[r];n&&(t[r]=n)}return t},Pt=function(e){var t;void 0===e&&(e={});var r,n,i=pt(),s=void 0,u=e.trackOn,h=e.trackHistoryChanges,d=e.eventType,p=void 0===d?"[Amplitude] Page Viewed":d,f=function(e){var t=e;try{t=decodeURI(e)}catch(e){null==s||s.error("Malformed URI sequence: ",e)}return t},g=function(){return a(void 0,void 0,void 0,(function(){var e,t,r;return l(this,(function(n){switch(n.label){case 0:return e=f("undefined"!=typeof location&&location.href||""),r={event_type:p},t=[{}],[4,Mt()];case 1:return[2,(r.event_properties=o.apply(void 0,[o.apply(void 0,t.concat([n.sent()])),{"[Amplitude] Page Domain":"undefined"!=typeof location&&location.hostname||"","[Amplitude] Page Location":e,"[Amplitude] Page Path":"undefined"!=typeof location&&f(location.pathname)||"","[Amplitude] Page Title":"undefined"!=typeof document&&document.title||"","[Amplitude] Page URL":e.split("?")[0]}]),r)]}}))}))},m=function(){return void 0===u||"function"==typeof u&&u()},v="undefined"!=typeof location?location.href:null,y=function(){return a(void 0,void 0,void 0,(function(){var e,r,n,i;return l(this,(function(o){switch(o.label){case 0:return e=location.href,r=Tt(h,e,v||"")&&m(),v=e,r?(null==s||s.log("Tracking page view event"),null!=t?[3,1]:[3,3]):[3,4];case 1:return i=(n=t).track,[4,g()];case 2:i.apply(n,[o.sent()]),o.label=3;case 3:o.label=4;case 4:return[2]}}))}))},w=function(){y()},b={name:"@amplitude/plugin-page-view-tracking-browser",type:"enrichment",setup:function(e,o){return a(void 0,void 0,void 0,(function(){var a,u;return l(this,(function(l){switch(l.label){case 0:return t=o,n=e,(s=e.loggerProvider).log("Installing @amplitude/plugin-page-view-tracking-browser"),i&&(i.addEventListener("popstate",w),r=i.history.pushState,i.history.pushState=new Proxy(i.history.pushState,{apply:function(e,t,r){var n=c(r,3),i=n[0],o=n[1],s=n[2];e.apply(t,[i,o,s]),y()}})),m()?(s.log("Tracking page view event"),u=(a=t).track,[4,g()]):[3,2];case 1:u.apply(a,[l.sent()]),l.label=2;case 2:return[2]}}))}))},execute:function(e){return a(void 0,void 0,void 0,(function(){var t;return l(this,(function(r){switch(r.label){case 0:return"attribution"===u&&_t(e)?(null==s||s.log("Enriching campaign event to page view event with campaign parameters"),[4,g()]):[3,2];case 1:t=r.sent(),e.event_type=t.event_type,e.event_properties=o(o({},e.event_properties),t.event_properties),r.label=2;case 2:return n&&e.event_type===p&&(n.pageCounter=n.pageCounter?n.pageCounter+1:1,e.event_properties=o(o({},e.event_properties),{"[Amplitude] Page Counter":n.pageCounter})),[2,e]}}))}))},teardown:function(){return a(void 0,void 0,void 0,(function(){return l(this,(function(e){return i&&(i.removeEventListener("popstate",w),r&&(i.history.pushState=r)),[2]}))}))}};return b},Mt=function(){return a(void 0,void 0,void 0,(function(){var e;return l(this,(function(t){switch(t.label){case 0:return e=Rt,[4,(new At).parse()];case 1:return[2,e.apply(void 0,[t.sent()])]}}))}))},_t=function(e){if("$identify"===e.event_type&&e.user_properties){var t=e.user_properties,r=t[we.SET]||{},n=t[we.UNSET]||{},i=h(h([],c(Object.keys(r)),!1),c(Object.keys(n)),!1);return Object.keys(Ot).every((function(e){return i.includes(e)}))}return!1},Tt=function(e,t,r){if("pathOnly"===e){if(""==r)return!0;var n=new URL(t),i=new URL(r);return n.origin+n.pathname!==i.origin+i.pathname}return t!==r},Nt=function(){var e,t=[],r=function(e,r,n){e.addEventListener(r,n),t.push({element:e,type:r,handler:n})};return{name:"@amplitude/plugin-form-interaction-tracking-browser",type:"enrichment",setup:function(t,n){return a(void 0,void 0,void 0,(function(){var i,o;return l(this,(function(s){return i=function(){if(n){if("undefined"!=typeof document){var i=function(e){var t=!1;r(e,"change",(function(){var r,i=Dt(e);t||n.track(Ze,((r={})[it]=Lt(e.id),r[ot]=Lt(e.name),r[st]=i,r)),t=!0})),r(e,"submit",(function(){var r,i,o=Dt(e);t||n.track(Ze,((r={})[it]=Lt(e.id),r[ot]=Lt(e.name),r[st]=o,r)),n.track(Je,((i={})[it]=Lt(e.id),i[ot]=Lt(e.name),i[st]=o,i)),t=!1}))};Array.from(document.getElementsByTagName("form")).forEach(i),"undefined"!=typeof MutationObserver&&(e=new MutationObserver((function(e){e.forEach((function(e){e.addedNodes.forEach((function(e){"FORM"===e.nodeName&&i(e),"querySelectorAll"in e&&"function"==typeof e.querySelectorAll&&Array.from(e.querySelectorAll("form")).map(i)}))}))})),e.observe(document.body,{subtree:!0,childList:!0}))}}else t.loggerProvider.warn("Form interaction tracking requires a later version of @amplitude/analytics-browser. Form interaction events are not tracked.")},"complete"===document.readyState?i():(o=E())?o.addEventListener("load",i):t.loggerProvider.debug("Form interaction tracking is not installed because global is undefined."),[2]}))}))},execute:function(e){return a(void 0,void 0,void 0,(function(){return l(this,(function(t){return[2,e]}))}))},teardown:function(){return a(void 0,void 0,void 0,(function(){return l(this,(function(r){return null==e||e.disconnect(),t.forEach((function(e){var t=e.element,r=e.type,n=e.handler;null==t||t.removeEventListener(r,n)})),t=[],[2]}))}))}}},Lt=function(e){if("string"==typeof e)return e},Dt=function(e){var t=e.getAttribute("action");try{t=new URL(encodeURI(null!=t?t:""),window.location.href).href}catch(e){}return t},Ft=function(){var e,t=[];return{name:"@amplitude/plugin-file-download-tracking-browser",type:"enrichment",setup:function(r,n){return a(void 0,void 0,void 0,(function(){var i,o;return l(this,(function(s){return i=function(){if(n){if("undefined"!=typeof document){var i=function(e){var r;try{r=new URL(e.href,window.location.href)}catch(e){return}var i=o.exec(r.href),s=null==i?void 0:i[1];s&&function(e,r,n){e.addEventListener(r,n),t.push({element:e,type:r,handler:n})}(e,"click",(function(){var t;s&&n.track($e,((t={})[Qe]=s,t[et]=r.pathname,t[tt]=e.id,t[rt]=e.text,t[nt]=e.href,t))}))},o=/\.(pdf|xlsx?|docx?|txt|rtf|csv|exe|key|pp(s|t|tx)|7z|pkg|rar|gz|zip|avi|mov|mp4|mpe?g|wmv|midi?|mp3|wav|wma)(\?.+)?$/;Array.from(document.getElementsByTagName("a")).forEach(i),"undefined"!=typeof MutationObserver&&(e=new MutationObserver((function(e){e.forEach((function(e){e.addedNodes.forEach((function(e){"A"===e.nodeName&&i(e),"querySelectorAll"in e&&"function"==typeof e.querySelectorAll&&Array.from(e.querySelectorAll("a")).map(i)}))}))})),e.observe(document.body,{subtree:!0,childList:!0}))}}else r.loggerProvider.warn("File download tracking requires a later version of @amplitude/analytics-browser. File download events are not tracked.")},"complete"===document.readyState?i():(o=E())?o.addEventListener("load",i):r.loggerProvider.debug("File download tracking is not installed because global is undefined."),[2]}))}))},execute:function(e){return a(void 0,void 0,void 0,(function(){return l(this,(function(t){return[2,e]}))}))},teardown:function(){return a(void 0,void 0,void 0,(function(){return l(this,(function(r){return null==e||e.disconnect(),t.forEach((function(e){var t=e.element,r=e.type,n=e.handler;null==t||t.removeEventListener(r,n)})),t=[],[2]}))}))}}},Ut=!1,jt=function(){var e=E(),t=[],r=function(r,n){e&&(e.addEventListener(r,n),t.push({type:r,handler:n}))};return{name:"@amplitude/plugin-network-checker-browser",type:"before",setup:function(e,t){return a(void 0,void 0,void 0,(function(){return l(this,(function(n){return"undefined"==typeof navigator?(e.loggerProvider.debug("Network connectivity checker plugin is disabled because navigator is not available."),e.offline=!1,[2]):(e.offline=!navigator.onLine,r("online",(function(){e.loggerProvider.debug("Network connectivity changed to online."),e.offline=!1,setTimeout((function(){t.flush()}),e.flushIntervalMillis)})),r("offline",(function(){e.loggerProvider.debug("Network connectivity changed to offline."),e.offline=!0})),[2])}))}))},teardown:function(){return a(void 0,void 0,void 0,(function(){return l(this,(function(r){return t.forEach((function(t){var r=t.type,n=t.handler;e&&e.removeEventListener(r,n)})),t=[],[2]}))}))}}},Bt="Remote config fetch rejected due to timeout after 5 seconds",zt=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,i,o;return l(this,(function(s){switch(s.label){case 0:return n=Date.now(),[4,this.fetchWithTimeout(r)];case 1:return(i=s.sent())&&(o=i.configs&&i.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(i){switch(i.label){case 0:return t=new AbortController,r=setTimeout((function(){return t.abort()}),5e3),[4,this.fetchRemoteConfig(t.signal,e)];case 1:return n=i.sent(),clearTimeout(r),[2,n]}}))}))},this.fetchRemoteConfig=function(e,t){return a(n,void 0,void 0,(function(){var r,n,i,s,a,c,h,d,p,f,g;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:Bt})];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=u(this.configKeys),i=n.next();!i.done;i=n.next())s=i.value,r.append("config_keys",s)}catch(e){f={error:e}}finally{try{i&&!i.done&&(g=n.return)&&g.call(n)}finally{if(f)throw f.error}}return t&&r.set("session_id",String(t)),a={headers:{Accept:"*/*"},method:"GET"},c="".concat(this.getServerUrl(),"?").concat(r.toString()),this.attempts+=1,[4,fetch(c,o(o({},a),{signal:e}))];case 2:if(null===(h=l.sent()))return[2,this.completeRequest({err:"Unexpected error occurred"})];switch((new ve).buildStatus(h.status)){case Ie.Success:return this.attempts=0,[2,this.parseAndStoreConfig(h)];case Ie.Failed:return[2,this.retryFetch(e,t)];default:return[2,this.completeRequest({err:"Network error occurred, remote config fetch failed"})]}case 3:return d=l.sent(),p=d,e.aborted?[2,this.completeRequest({err:Bt})]:[2,this.completeRequest({err:p.message})];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.serverZone===Ce.STAGING?"https://sr-client-cfg.stag2.amplitude.com/config":this.localConfig.serverZone===Ce.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}(),Vt=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 zt({localConfig:t,configKeys:r})]}))}))},Wt=function(){function e(e){this.config=e,this.config.loggerProvider.debug("Local configuration before merging with remote config",JSON.stringify(this.config,null,2))}return e.prototype.initialize=function(){return a(this,void 0,void 0,(function(){var e;return l(this,(function(t){switch(t.label){case 0:return e=this,[4,Vt({localConfig:this.config,configKeys:["analyticsSDK"]})];case 1:return e.remoteConfigFetch=t.sent(),[2]}}))}))},e.prototype.generateJoinedConfig=function(){var e,t,r,n;return a(this,void 0,void 0,(function(){var i,s,a;return l(this,(function(l){switch(l.label){case 0:return l.trys.push([0,3,,4]),(s=this.remoteConfigFetch)?[4,this.remoteConfigFetch.getRemoteConfig("analyticsSDK","browserSDK",this.config.sessionId)]:[3,2];case 1:s=l.sent(),l.label=2;case 2:return i=s,this.config.loggerProvider.debug("Remote configuration:",JSON.stringify(i,null,2)),i&&"autocapture"in i&&("boolean"==typeof i.autocapture&&(this.config.autocapture=i.autocapture),"object"==typeof i.autocapture&&(void 0===this.config.autocapture&&(this.config.autocapture=i.autocapture),"boolean"==typeof this.config.autocapture&&(this.config.autocapture=o({attribution:this.config.autocapture,fileDownloads:this.config.autocapture,formInteractions:this.config.autocapture,pageViews:this.config.autocapture,sessions:this.config.autocapture,elementInteractions:this.config.autocapture},i.autocapture)),"object"==typeof this.config.autocapture&&(this.config.autocapture=o(o({},this.config.autocapture),i.autocapture))),this.config.defaultTracking=this.config.autocapture),this.config.loggerProvider.debug("Joined configuration: ",JSON.stringify(this.config,null,2)),null!==(e=(n=this.config).requestMetadata)&&void 0!==e||(n.requestMetadata=new z),(null===(t=this.remoteConfigFetch)||void 0===t?void 0:t.metrics.fetchTimeAPISuccess)&&this.config.requestMetadata.recordHistogram("remote_config_fetch_time_API_success",this.remoteConfigFetch.metrics.fetchTimeAPISuccess),(null===(r=this.remoteConfigFetch)||void 0===r?void 0:r.metrics.fetchTimeAPIFail)&&this.config.requestMetadata.recordHistogram("remote_config_fetch_time_API_fail",this.remoteConfigFetch.metrics.fetchTimeAPIFail),[3,4];case 3:return a=l.sent(),this.config.loggerProvider.error("Failed to fetch remote configuration because of error: ",a),[3,4];case 4:return[2,this.config]}}))}))},e}(),qt="[Amplitude] Element Clicked",Gt="[Amplitude] Element Tag",Kt="[Amplitude] Element Text",Yt="[Amplitude] Page URL",Zt="https://app.amplitude.com",Jt={US:Zt,EU:"https://app.eu.amplitude.com",STAGING:"https://apps.stag2.amplitude.com"};function $t(e){return"function"==typeof e}function Xt(e){var t=e((function(e){Error.call(e),e.stack=(new Error).stack}));return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var Ht=Xt((function(e){return function(t){e(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t}}));function Qt(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var er=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}var t;return e.prototype.unsubscribe=function(){var e,t,r,n,i;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var s=u(o),a=s.next();!a.done;a=s.next()){a.value.remove(this)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}else o.remove(this);var l=this.initialTeardown;if($t(l))try{l()}catch(e){i=e instanceof Ht?e.errors:[e]}var d=this._finalizers;if(d){this._finalizers=null;try{for(var p=u(d),f=p.next();!f.done;f=p.next()){var g=f.value;try{nr(g)}catch(e){i=null!=i?i:[],e instanceof Ht?i=h(h([],c(i)),c(e.errors)):i.push(e)}}}catch(e){r={error:e}}finally{try{f&&!f.done&&(n=p.return)&&n.call(p)}finally{if(r)throw r.error}}}if(i)throw new Ht(i)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)nr(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(r=this._finalizers)&&void 0!==r?r:[]).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&Qt(t,e)},e.prototype.remove=function(t){var r=this._finalizers;r&&Qt(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=((t=new e).closed=!0,t),e}(),tr=er.EMPTY;function rr(e){return e instanceof er||e&&"closed"in e&&$t(e.remove)&&$t(e.add)&&$t(e.unsubscribe)}function nr(e){$t(e)?e():e.unsubscribe()}var ir={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},or=function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return setTimeout.apply(void 0,h([e,t],c(r)))};function sr(e){or((function(){throw e}))}function ar(){}function lr(e){e()}var ur=function(e){function t(t){var r=e.call(this)||this;return r.isStopped=!1,t?(r.destination=t,rr(t)&&t.add(r)):r.destination=gr,r}return r(t,e),t.create=function(e,t,r){return new pr(e,t,r)},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(er),cr=Function.prototype.bind;function hr(e,t){return cr.call(e,t)}var dr=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){fr(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){fr(e)}else fr(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){fr(e)}},e}(),pr=function(e){function t(t,r,n){var i,o,s=e.call(this)||this;$t(t)||!t?i={next:null!=t?t:void 0,error:null!=r?r:void 0,complete:null!=n?n:void 0}:s&&ir.useDeprecatedNextContext?((o=Object.create(t)).unsubscribe=function(){return s.unsubscribe()},i={next:t.next&&hr(t.next,o),error:t.error&&hr(t.error,o),complete:t.complete&&hr(t.complete,o)}):i=t;return s.destination=new dr(i),s}return r(t,e),t}(ur);function fr(e){sr(e)}var gr={closed:!0,next:ar,error:function(e){throw e},complete:ar},mr="function"==typeof Symbol&&Symbol.observable||"@@observable";function vr(e){return e}function yr(e){return 0===e.length?vr:1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)}}var wr=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(e,t,r){var n,i=this,o=(n=e)&&n instanceof ur||function(e){return e&&$t(e.next)&&$t(e.error)&&$t(e.complete)}(n)&&rr(n)?e:new pr(e,t,r);return lr((function(){var e=i,t=e.operator,r=e.source;o.add(t?t.call(o,r):r?i._subscribe(o):i._trySubscribe(o))})),o},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var r=this;return new(t=br(t))((function(t,n){var i=new pr({next:function(t){try{e(t)}catch(e){n(e),i.unsubscribe()}},error:n,complete:t});r.subscribe(i)}))},e.prototype._subscribe=function(e){var t;return null===(t=this.source)||void 0===t?void 0:t.subscribe(e)},e.prototype[mr]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return yr(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=br(e))((function(e,r){var n;t.subscribe((function(e){return n=e}),(function(e){return r(e)}),(function(){return e(n)}))}))},e.create=function(t){return new e(t)},e}();function br(e){var t;return null!==(t=null!=e?e:ir.Promise)&&void 0!==t?t:Promise}function Sr(e){return $t(null==e?void 0:e.lift)}function Cr(e){return function(t){if(Sr(t))return t.lift((function(t){try{return e(t,this)}catch(e){this.error(e)}}));throw new TypeError("Unable to lift unknown Observable type")}}function Ir(e,t,r,n,i){return new xr(e,t,r,n,i)}var xr=function(e){function t(t,r,n,i,o,s){var a=e.call(this,t)||this;return a.onFinalize=o,a.shouldUnsubscribe=s,a._next=r?function(e){try{r(e)}catch(e){t.error(e)}}:e.prototype._next,a._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,a._complete=n?function(){try{n()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,a}return r(t,e),t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;e.prototype.unsubscribe.call(this),!r&&(null===(t=this.onFinalize)||void 0===t||t.call(this))}},t}(ur);!function(e){function t(t,r){var n=e.call(this)||this;return n.source=t,n.subjectFactory=r,n._subject=null,n._refCount=0,n._connection=null,Sr(t)&&(n.lift=t.lift),n}r(t,e),t.prototype._subscribe=function(e){return this.getSubject().subscribe(e)},t.prototype.getSubject=function(){var e=this._subject;return e&&!e.isStopped||(this._subject=this.subjectFactory()),this._subject},t.prototype._teardown=function(){this._refCount=0;var e=this._connection;this._subject=this._connection=null,null==e||e.unsubscribe()},t.prototype.connect=function(){var e=this,t=this._connection;if(!t){t=this._connection=new er;var r=this.getSubject();t.add(this.source.subscribe(Ir(r,void 0,(function(){e._teardown(),r.complete()}),(function(t){e._teardown(),r.error(t)}),(function(){return e._teardown()})))),t.closed&&(this._connection=null,t=er.EMPTY)}return t},t.prototype.refCount=function(){return Cr((function(e,t){var r=null;e._refCount++;var n=Ir(t,void 0,void 0,void 0,(function(){if(!e||e._refCount<=0||0<--e._refCount)r=null;else{var n=e._connection,i=r;r=null,!n||i&&n!==i||n.unsubscribe(),t.unsubscribe()}}));e.subscribe(n),n.closed||(r=e.connect())}))(this)}}(wr);var kr,Er={now:function(){return(Er.delegate||performance).now()},delegate:void 0},Or={schedule:function(e){var t=requestAnimationFrame,r=cancelAnimationFrame,n=t((function(t){r=void 0,e(t)}));return new er((function(){return null==r?void 0:r(n)}))},requestAnimationFrame:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Or.delegate;return((null==r?void 0:r.requestAnimationFrame)||requestAnimationFrame).apply(void 0,h([],c(e)))},cancelAnimationFrame:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return cancelAnimationFrame.apply(void 0,h([],c(e)))},delegate:void 0};new wr((function(e){var t=kr||Er,r=t.now(),n=0,i=function(){e.closed||(n=Or.requestAnimationFrame((function(o){n=0;var s=t.now();e.next({timestamp:kr?s:o,elapsed:s-r}),i()})))};return i(),function(){n&&Or.cancelAnimationFrame(n)}}));var Ar=Xt((function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),Rr=function(e){function t(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return r(t,e),t.prototype.lift=function(e){var t=new Pr(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new Ar},t.prototype.next=function(e){var t=this;lr((function(){var r,n;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||(t.currentObservers=Array.from(t.observers));try{for(var i=u(t.currentObservers),o=i.next();!o.done;o=i.next()){o.value.next(e)}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}}}))},t.prototype.error=function(e){var t=this;lr((function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var r=t.observers;r.length;)r.shift().error(e)}}))},t.prototype.complete=function(){var e=this;lr((function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}}))},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return(null===(e=this.observers)||void 0===e?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,r=this,n=r.hasError,i=r.isStopped,o=r.observers;return n||i?tr:(this.currentObservers=null,o.push(e),new er((function(){t.currentObservers=null,Qt(o,e)})))},t.prototype._checkFinalizedStatuses=function(e){var t=this,r=t.hasError,n=t.thrownError,i=t.isStopped;r?e.error(n):i&&e.complete()},t.prototype.asObservable=function(){var e=new wr;return e.source=this,e},t.create=function(e,t){return new Pr(e,t)},t}(wr),Pr=function(e){function t(t,r){var n=e.call(this)||this;return n.destination=t,n.source=r,n}return r(t,e),t.prototype.next=function(e){var t,r;null===(r=null===(t=this.destination)||void 0===t?void 0:t.next)||void 0===r||r.call(t,e)},t.prototype.error=function(e){var t,r;null===(r=null===(t=this.destination)||void 0===t?void 0:t.error)||void 0===r||r.call(t,e)},t.prototype.complete=function(){var e,t;null===(t=null===(e=this.destination)||void 0===e?void 0:e.complete)||void 0===t||t.call(e)},t.prototype._subscribe=function(e){var t,r;return null!==(r=null===(t=this.source)||void 0===t?void 0:t.subscribe(e))&&void 0!==r?r:tr},t}(Rr);!function(e){function t(t){var r=e.call(this)||this;return r._value=t,r}r(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(t){var r=e.prototype._subscribe.call(this,t);return!r.closed&&t.next(this._value),r},t.prototype.getValue=function(){var e=this,t=e.hasError,r=e.thrownError,n=e._value;if(t)throw r;return this._throwIfClosed(),n},t.prototype.next=function(t){e.prototype.next.call(this,this._value=t)}}(Rr);var Mr={now:function(){return(Mr.delegate||Date).now()},delegate:void 0};!function(e){function t(t,r,n){void 0===t&&(t=1/0),void 0===r&&(r=1/0),void 0===n&&(n=Mr);var i=e.call(this)||this;return i._bufferSize=t,i._windowTime=r,i._timestampProvider=n,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=r===1/0,i._bufferSize=Math.max(1,t),i._windowTime=Math.max(1,r),i}r(t,e),t.prototype.next=function(t){var r=this,n=r.isStopped,i=r._buffer,o=r._infiniteTimeWindow,s=r._timestampProvider,a=r._windowTime;n||(i.push(t),!o&&i.push(s.now()+a)),this._trimBuffer(),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var t=this._innerSubscribe(e),r=this._infiniteTimeWindow,n=this._buffer.slice(),i=0;i<n.length&&!e.closed;i+=r?1:2)e.next(n[i]);return this._checkFinalizedStatuses(e),t},t.prototype._trimBuffer=function(){var e=this,t=e._bufferSize,r=e._timestampProvider,n=e._buffer,i=e._infiniteTimeWindow,o=(i?1:2)*t;if(t<1/0&&o<n.length&&n.splice(0,n.length-o),!i){for(var s=r.now(),a=0,l=1;l<n.length&&n[l]<=s;l+=2)a=l;a&&n.splice(0,a+1)}}}(Rr),function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._value=null,t._hasValue=!1,t._isComplete=!1,t}r(t,e),t.prototype._checkFinalizedStatuses=function(e){var t=this,r=t.hasError,n=t._hasValue,i=t._value,o=t.thrownError,s=t.isStopped,a=t._isComplete;r?e.error(o):(s||a)&&(n&&e.next(i),e.complete())},t.prototype.next=function(e){this.isStopped||(this._value=e,this._hasValue=!0)},t.prototype.complete=function(){var t=this,r=t._hasValue,n=t._value;t._isComplete||(this._isComplete=!0,r&&e.prototype.next.call(this,n),e.prototype.complete.call(this))}}(Rr);var _r,Tr=function(e){function t(t,r){return e.call(this)||this}return r(t,e),t.prototype.schedule=function(e,t){return this},t}(er),Nr=function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return setInterval.apply(void 0,h([e,t],c(r)))},Lr=function(e){return clearInterval(e)},Dr=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n.pending=!1,n}return r(t,e),t.prototype.schedule=function(e,t){var r;if(void 0===t&&(t=0),this.closed)return this;this.state=e;var n=this.id,i=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(i,n,t)),this.pending=!0,this.delay=t,this.id=null!==(r=this.id)&&void 0!==r?r:this.requestAsyncId(i,this.id,t),this},t.prototype.requestAsyncId=function(e,t,r){return void 0===r&&(r=0),Nr(e.flush.bind(e,this),r)},t.prototype.recycleAsyncId=function(e,t,r){if(void 0===r&&(r=0),null!=r&&this.delay===r&&!1===this.pending)return t;null!=t&&Lr(t)},t.prototype.execute=function(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var r=this._execute(e,t);if(r)return r;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var r,n=!1;try{this.work(e)}catch(e){n=!0,r=e||new Error("Scheduled action threw falsy error")}if(n)return this.unsubscribe(),r},t.prototype.unsubscribe=function(){if(!this.closed){var t=this.id,r=this.scheduler,n=r.actions;this.work=this.state=this.scheduler=null,this.pending=!1,Qt(n,this),null!=t&&(this.id=this.recycleAsyncId(r,t,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(Tr),Fr=1,Ur={};function jr(e){return e in Ur&&(delete Ur[e],!0)}var Br=function(e){var t=Fr++;return Ur[t]=!0,_r||(_r=Promise.resolve()),_r.then((function(){return jr(t)&&e()})),t},zr=function(e){jr(e)},Vr={setImmediate:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Vr.delegate;return((null==r?void 0:r.setImmediate)||Br).apply(void 0,h([],c(e)))},clearImmediate:function(e){return zr(e)},delegate:void 0},Wr=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n}return r(t,e),t.prototype.requestAsyncId=function(t,r,n){return void 0===n&&(n=0),null!==n&&n>0?e.prototype.requestAsyncId.call(this,t,r,n):(t.actions.push(this),t._scheduled||(t._scheduled=Vr.setImmediate(t.flush.bind(t,void 0))))},t.prototype.recycleAsyncId=function(t,r,n){var i;if(void 0===n&&(n=0),null!=n?n>0:this.delay>0)return e.prototype.recycleAsyncId.call(this,t,r,n);var o=t.actions;null!=r&&(null===(i=o[o.length-1])||void 0===i?void 0:i.id)!==r&&(Vr.clearImmediate(r),t._scheduled===r&&(t._scheduled=void 0))},t}(Dr),qr=function(){function e(t,r){void 0===r&&(r=e.now),this.schedulerActionCtor=t,this.now=r}return e.prototype.schedule=function(e,t,r){return void 0===t&&(t=0),new this.schedulerActionCtor(this,e).schedule(r,t)},e.now=Mr.now,e}(),Gr=function(e){function t(t,r){void 0===r&&(r=qr.now);var n=e.call(this,t,r)||this;return n.actions=[],n._active=!1,n}return r(t,e),t.prototype.flush=function(e){var t=this.actions;if(this._active)t.push(e);else{var r;this._active=!0;do{if(r=e.execute(e.state,e.delay))break}while(e=t.shift());if(this._active=!1,r){for(;e=t.shift();)e.unsubscribe();throw r}}},t}(qr),Kr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.flush=function(e){this._active=!0;var t=this._scheduled;this._scheduled=void 0;var r,n=this.actions;e=e||n.shift();do{if(r=e.execute(e.state,e.delay))break}while((e=n[0])&&e.id===t&&n.shift());if(this._active=!1,r){for(;(e=n[0])&&e.id===t&&n.shift();)e.unsubscribe();throw r}},t}(Gr);new Kr(Wr);var Yr=new Gr(Dr),Zr=Yr,Jr=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n}return r(t,e),t.prototype.schedule=function(t,r){return void 0===r&&(r=0),r>0?e.prototype.schedule.call(this,t,r):(this.delay=r,this.state=t,this.scheduler.flush(this),this)},t.prototype.execute=function(t,r){return r>0||this.closed?e.prototype.execute.call(this,t,r):this._execute(t,r)},t.prototype.requestAsyncId=function(t,r,n){return void 0===n&&(n=0),null!=n&&n>0||null==n&&this.delay>0?e.prototype.requestAsyncId.call(this,t,r,n):(t.flush(this),0)},t}(Dr),$r=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t}(Gr);new $r(Jr);var Xr=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n}return r(t,e),t.prototype.requestAsyncId=function(t,r,n){return void 0===n&&(n=0),null!==n&&n>0?e.prototype.requestAsyncId.call(this,t,r,n):(t.actions.push(this),t._scheduled||(t._scheduled=Or.requestAnimationFrame((function(){return t.flush(void 0)}))))},t.prototype.recycleAsyncId=function(t,r,n){var i;if(void 0===n&&(n=0),null!=n?n>0:this.delay>0)return e.prototype.recycleAsyncId.call(this,t,r,n);var o=t.actions;null!=r&&(null===(i=o[o.length-1])||void 0===i?void 0:i.id)!==r&&(Or.cancelAnimationFrame(r),t._scheduled=void 0)},t}(Dr),Hr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.flush=function(e){this._active=!0;var t=this._scheduled;this._scheduled=void 0;var r,n=this.actions;e=e||n.shift();do{if(r=e.execute(e.state,e.delay))break}while((e=n[0])&&e.id===t&&n.shift());if(this._active=!1,r){for(;(e=n[0])&&e.id===t&&n.shift();)e.unsubscribe();throw r}},t}(Gr);new Hr(Xr),function(e){function t(t,r){void 0===t&&(t=Qr),void 0===r&&(r=1/0);var n=e.call(this,t,(function(){return n.frame}))||this;return n.maxFrames=r,n.frame=0,n.index=-1,n}r(t,e),t.prototype.flush=function(){for(var e,t,r=this.actions,n=this.maxFrames;(t=r[0])&&t.delay<=n&&(r.shift(),this.frame=t.delay,!(e=t.execute(t.state,t.delay))););if(e){for(;t=r.shift();)t.unsubscribe();throw e}},t.frameTimeFactor=10}(Gr);var Qr=function(e){function t(t,r,n){void 0===n&&(n=t.index+=1);var i=e.call(this,t,r)||this;return i.scheduler=t,i.work=r,i.index=n,i.active=!0,i.index=t.index=n,i}return r(t,e),t.prototype.schedule=function(r,n){if(void 0===n&&(n=0),Number.isFinite(n)){if(!this.id)return e.prototype.schedule.call(this,r,n);this.active=!1;var i=new t(this.scheduler,this.work);return this.add(i),i.schedule(r,n)}return er.EMPTY},t.prototype.requestAsyncId=function(e,r,n){void 0===n&&(n=0),this.delay=e.frame+n;var i=e.actions;return i.push(this),i.sort(t.sortActions),1},t.prototype.recycleAsyncId=function(e,t,r){},t.prototype._execute=function(t,r){if(!0===this.active)return e.prototype._execute.call(this,t,r)},t.sortActions=function(e,t){return e.delay===t.delay?e.index===t.index?0:e.index>t.index?1:-1:e.delay>t.delay?1:-1},t}(Dr),en=new wr((function(e){return e.complete()}));function tn(e){return e&&$t(e.schedule)}function rn(e){return e[e.length-1]}function nn(e){return tn(rn(e))?e.pop():void 0}function on(e,t){return"number"==typeof rn(e)?e.pop():t}var sn=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e};function an(e){return $t(null==e?void 0:e.then)}function ln(e){return $t(e[mr])}function un(e){return Symbol.asyncIterator&&$t(null==e?void 0:e[Symbol.asyncIterator])}function cn(e){return new TypeError("You provided "+(null!==e&&"object"==typeof e?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}var hn,dn="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";function pn(e){return $t(null==e?void 0:e[dn])}function fn(e){return p(this,arguments,(function(){var t,r,n;return l(this,(function(i){switch(i.label){case 0:t=e.getReader(),i.label=1;case 1:i.trys.push([1,,9,10]),i.label=2;case 2:return[4,d(t.read())];case 3:return r=i.sent(),n=r.value,r.done?[4,d(void 0)]:[3,5];case 4:return[2,i.sent()];case 5:return[4,d(n)];case 6:return[4,i.sent()];case 7:return i.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}}))}))}function gn(e){return $t(null==e?void 0:e.getReader)}function mn(e){if(e instanceof wr)return e;if(null!=e){if(ln(e))return i=e,new wr((function(e){var t=i[mr]();if($t(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")}));if(sn(e))return n=e,new wr((function(e){for(var t=0;t<n.length&&!e.closed;t++)e.next(n[t]);e.complete()}));if(an(e))return r=e,new wr((function(e){r.then((function(t){e.closed||(e.next(t),e.complete())}),(function(t){return e.error(t)})).then(null,sr)}));if(un(e))return vn(e);if(pn(e))return t=e,new wr((function(e){var r,n;try{for(var i=u(t),o=i.next();!o.done;o=i.next()){var s=o.value;if(e.next(s),e.closed)return}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}e.complete()}));if(gn(e))return vn(fn(e))}var t,r,n,i;throw cn(e)}function vn(e){return new wr((function(t){(function(e,t){var r,n,i,o;return a(this,void 0,void 0,(function(){var s,a;return l(this,(function(l){switch(l.label){case 0:l.trys.push([0,5,6,11]),r=f(e),l.label=1;case 1:return[4,r.next()];case 2:if((n=l.sent()).done)return[3,4];if(s=n.value,t.next(s),t.closed)return[2];l.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return a=l.sent(),i={error:a},[3,11];case 6:return l.trys.push([6,,9,10]),n&&!n.done&&(o=r.return)?[4,o.call(r)]:[3,8];case 7:l.sent(),l.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}}))}))})(e,t).catch((function(e){return t.error(e)}))}))}function yn(e,t,r,n,i){void 0===n&&(n=0),void 0===i&&(i=!1);var o=t.schedule((function(){r(),i?e.add(this.schedule(null,n)):this.unsubscribe()}),n);if(e.add(o),!i)return o}function wn(e,t){return void 0===t&&(t=0),Cr((function(r,n){r.subscribe(Ir(n,(function(r){return yn(n,e,(function(){return n.next(r)}),t)}),(function(){return yn(n,e,(function(){return n.complete()}),t)}),(function(r){return yn(n,e,(function(){return n.error(r)}),t)})))}))}function bn(e,t){return void 0===t&&(t=0),Cr((function(r,n){n.add(e.schedule((function(){return r.subscribe(n)}),t))}))}function Sn(e,t){if(!e)throw new Error("Iterable cannot be null");return new wr((function(r){yn(r,t,(function(){var n=e[Symbol.asyncIterator]();yn(r,t,(function(){n.next().then((function(e){e.done?r.complete():r.next(e.value)}))}),0,!0)}))}))}function Cn(e,t){if(null!=e){if(ln(e))return function(e,t){return mn(e).pipe(bn(t),wn(t))}(e,t);if(sn(e))return function(e,t){return new wr((function(r){var n=0;return t.schedule((function(){n===e.length?r.complete():(r.next(e[n++]),r.closed||this.schedule())}))}))}(e,t);if(an(e))return function(e,t){return mn(e).pipe(bn(t),wn(t))}(e,t);if(un(e))return Sn(e,t);if(pn(e))return function(e,t){return new wr((function(r){var n;return yn(r,t,(function(){n=e[dn](),yn(r,t,(function(){var e,t,i;try{t=(e=n.next()).value,i=e.done}catch(e){return void r.error(e)}i?r.complete():r.next(t)}),0,!0)})),function(){return $t(null==n?void 0:n.return)&&n.return()}}))}(e,t);if(gn(e))return function(e,t){return Sn(fn(e),t)}(e,t)}throw cn(e)}function In(e,t){return t?Cn(e,t):mn(e)}function xn(e){return e instanceof Date&&!isNaN(e)}!function(e){e.NEXT="N",e.ERROR="E",e.COMPLETE="C"}(hn||(hn={})),Xt((function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}})),Xt((function(e){return function(){e(this),this.name="ArgumentOutOfRangeError",this.message="argument out of range"}})),Xt((function(e){return function(t){e(this),this.name="NotFoundError",this.message=t}})),Xt((function(e){return function(t){e(this),this.name="SequenceError",this.message=t}}));var kn=Xt((function(e){return function(t){void 0===t&&(t=null),e(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=t}}));function En(e){throw new kn(e)}function On(e,t){return Cr((function(r,n){var i=0;r.subscribe(Ir(n,(function(r){n.next(e.call(t,r,i++))})))}))}var An=Array.isArray;function Rn(e){return On((function(t){return function(e,t){return An(t)?e.apply(void 0,h([],c(t))):e(t)}(e,t)}))}function Pn(e,t,r){return void 0===r&&(r=1/0),$t(t)?Pn((function(r,n){return On((function(e,i){return t(r,e,n,i)}))(mn(e(r,n)))}),r):("number"==typeof t&&(r=t),Cr((function(t,n){return function(e,t,r,n,i,o,s,a){var l=[],u=0,c=0,h=!1,d=function(){!h||l.length||u||t.complete()},p=function(e){return u<n?f(e):l.push(e)},f=function(e){o&&t.next(e),u++;var a=!1;mn(r(e,c++)).subscribe(Ir(t,(function(e){null==i||i(e),o?p(e):t.next(e)}),(function(){a=!0}),void 0,(function(){if(a)try{u--;for(var e=function(){var e=l.shift();s?yn(t,s,(function(){return f(e)})):f(e)};l.length&&u<n;)e();d()}catch(e){t.error(e)}})))};return e.subscribe(Ir(t,p,(function(){h=!0,d()}))),function(){null==a||a()}}(t,n,e,r)})))}function Mn(e){return void 0===e&&(e=1/0),Pn(vr,e)}function _n(){return Mn(1)}var Tn=["addListener","removeListener"],Nn=["addEventListener","removeEventListener"],Ln=["on","off"];function Dn(e,t,r,n){if($t(r)&&(n=r,r=void 0),n)return Dn(e,t,r).pipe(Rn(n));var i=c(function(e){return $t(e.addEventListener)&&$t(e.removeEventListener)}(e)?Nn.map((function(n){return function(i){return e[n](t,i,r)}})):function(e){return $t(e.addListener)&&$t(e.removeListener)}(e)?Tn.map(Fn(e,t)):function(e){return $t(e.on)&&$t(e.off)}(e)?Ln.map(Fn(e,t)):[],2),o=i[0],s=i[1];if(!o&&sn(e))return Pn((function(e){return Dn(e,t,r)}))(mn(e));if(!o)throw new TypeError("Invalid event target");return new wr((function(e){var t=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.next(1<t.length?t:t[0])};return o(t),function(){return s(t)}}))}function Fn(e,t){return function(r){return function(n){return e[r](t,n)}}}function Un(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=nn(e),n=on(e,1/0),i=e;return i.length?1===i.length?mn(i[0]):Mn(n)(In(i,r)):en}function jn(e,t){return Cr((function(r,n){var i=0;r.subscribe(Ir(n,(function(r){return e.call(t,r,i++)&&n.next(r)})))}))}function Bn(e){return e<=0?function(){return en}:Cr((function(t,r){var n=0;t.subscribe(Ir(r,(function(t){++n<=e&&(r.next(t),e<=n&&r.complete())})))}))}function zn(e,t){return t?function(r){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return _n()(In(e,nn(e)))}(t.pipe(Bn(1),Cr((function(e,t){e.subscribe(Ir(t,ar))}))),r.pipe(zn(e)))}:Pn((function(t,r){return mn(e(t,r)).pipe(Bn(1),function(e){return On((function(){return e}))}(t))}))}function Vn(e,t){void 0===t&&(t=Yr);var r=function(e,t,r){void 0===e&&(e=0),void 0===r&&(r=Zr);var n=-1;return null!=t&&(tn(t)?r=t:n=t),new wr((function(t){var i=xn(e)?+e-r.now():e;i<0&&(i=0);var o=0;return r.schedule((function(){t.closed||(t.next(o++),0<=n?this.schedule(void 0,n):t.complete())}),i)}))}(e,t);return zn((function(){return r}))}function Wn(e){void 0===e&&(e={});var t=e.connector,r=void 0===t?function(){return new Rr}:t,n=e.resetOnError,i=void 0===n||n,o=e.resetOnComplete,s=void 0===o||o,a=e.resetOnRefCountZero,l=void 0===a||a;return function(e){var t,n,o,a=0,u=!1,c=!1,h=function(){null==n||n.unsubscribe(),n=void 0},d=function(){h(),t=o=void 0,u=c=!1},p=function(){var e=t;d(),null==e||e.unsubscribe()};return Cr((function(e,f){a++,c||u||h();var g=o=null!=o?o:r();f.add((function(){0!==--a||c||u||(n=qn(p,l))})),g.subscribe(f),!t&&a>0&&(t=new pr({next:function(e){return g.next(e)},error:function(e){c=!0,h(),n=qn(d,i,e),g.error(e)},complete:function(){u=!0,h(),n=qn(d,s),g.complete()}}),mn(e).subscribe(t))}))(e)}}function qn(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];if(!0!==t){if(!1!==t){var i=new pr({next:function(){i.unsubscribe(),e()}});return mn(t.apply(void 0,h([],c(r)))).subscribe(i)}}else e()}new wr(ar);var Gn=["input","select","textarea"],Kn=function(e,t){return function(r,n){var i,o,s,a=e.pageUrlAllowlist,l=e.shouldTrackEventResolver,u=null===(o=null===(i=null==n?void 0:n.tagName)||void 0===i?void 0:i.toLowerCase)||void 0===o?void 0:o.call(i);if(!u)return!1;if(l)return l(r,n);if(!$n(window.location.href,a))return!1;var c=String(null==n?void 0:n.getAttribute("type"))||"";if("string"==typeof c)switch(c.toLowerCase()){case"hidden":case"password":return!1}if(t){var h=t.some((function(e){var t;return!!(null===(t=null==n?void 0:n.matches)||void 0===t?void 0:t.call(n,e))}));if(!h)return!1}switch(u){case"input":case"select":case"textarea":return"change"===r||"click"===r;default:var d=null===(s=null===window||void 0===window?void 0:window.getComputedStyle)||void 0===s?void 0:s.call(window,n);return!(!d||"pointer"!==d.getPropertyValue("cursor")||"click"!==r)||"click"===r}}},Yn=function(e){if(null==e)return!1;if("string"==typeof e){if(/^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$/.test((e||"").replace(/[- ]/g,"")))return!1;if(/(^\d{3}-?\d{2}-?\d{4}$)/.test(e))return!1}return!0},Zn=function(e){var t,r,n,i=null===(r=null===(t=null==e?void 0:e.tagName)||void 0===t?void 0:t.toLowerCase)||void 0===r?void 0:r.call(t),o=e instanceof HTMLElement&&"true"===(null===(n=e.getAttribute("contenteditable"))||void 0===n?void 0:n.toLowerCase());return!Gn.includes(i)&&!o},Jn=function(e){var t="";return Zn(e)&&e.childNodes&&e.childNodes.length&&e.childNodes.forEach((function(e){var r="";!function(e){return!!e&&3===e.nodeType}(e)?r=Jn(e):e.textContent&&(r=e.textContent),t+=r.split(/(\s+)/).filter(Yn).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)})),t},$n=function(e,t){return!t||!t.length||t.some((function(t){return"string"==typeof t?e===t:e.match(t)}))},Xn=function(e){return Object.keys(e).reduce((function(t,r){var n=e[r];return function(e){return null==e||"object"==typeof e&&0===Object.keys(e).length||"string"==typeof e&&0===e.trim().length}(n)||(t[r]=n),t}),{})},Hn=function(e){var t,r=e.parentElement;if(!r)return"";try{t=r.querySelector(":scope>span,h1,h2,h3,h4,h5,h6")}catch(e){t=null}if(t){var n=t.textContent||"";return Yn(n)?n:""}return Hn(r)},Qn=function(e,t){return e?t.some((function(t){var r;return null===(r=null==e?void 0:e.matches)||void 0===r?void 0:r.call(e,t)}))?e:Qn(null==e?void 0:e.parentElement,t):null},ei=function(e){var t,r,n;if(!e)return{};var i=null===(n=null===(r=null==e?void 0:e.tagName)||void 0===r?void 0:r.toLowerCase)||void 0===n?void 0:n.call(r),o=((t={})[Gt]=i,t[Kt]=Jn(e),t[Yt]=window.location.href.split("?")[0],t);return Xn(o)};var ti=function(e){return!(null===e.event.target||!e.closestTrackedAncestor)},ri=function(){function e(e){var t=(void 0===e?{}:e).origin,r=void 0===t?Zt:t,n=this;this.endpoint=Zt,this.requestCallbacks={},this.onSelect=function(e){n.notify({action:"element-selected",data:e})},this.onTrack=function(e,t){"selector-mode-changed"===e?n.notify({action:"track-selector-mode-changed",data:t}):"selector-moved"===e&&n.notify({action:"track-selector-moved",data:t})},this.endpoint=r}return e.prototype.notify=function(e){var t,r,n,i;null===(r=null===(t=this.logger)||void 0===t?void 0:t.debug)||void 0===r||r.call(t,"Message sent: ",JSON.stringify(e)),null===(i=null===(n=window.opener)||void 0===n?void 0:n.postMessage)||void 0===i||i.call(n,e,this.endpoint)},e.prototype.sendRequest=function(e,t,r){var n=this;void 0===r&&(r={timeout:15e3});var i="".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9)),o={id:i,action:e,args:t},s=new Promise((function(t,s){n.requestCallbacks[i]={resolve:t,reject:s},n.notify(o),(null==r?void 0:r.timeout)>0&&setTimeout((function(){s(new Error("".concat(e," timed out (id: ").concat(i,")"))),delete n.requestCallbacks[i]}),r.timeout)}));return s},e.prototype.handleResponse=function(e){var t;this.requestCallbacks[e.id]?(this.requestCallbacks[e.id].resolve(e.responseData),delete this.requestCallbacks[e.id]):null===(t=this.logger)||void 0===t||t.warn("No callback found for request id: ".concat(e.id))},e.prototype.setup=function(e){var t=this,r=void 0===e?{}:e,n=r.logger,i=r.endpoint,o=r.isElementSelectable,s=r.cssSelectorAllowlist,a=r.actionClickAllowlist;this.logger=n,i&&this.endpoint===Zt&&(this.endpoint=i);var l=null;window.addEventListener("message",(function(e){var r,n,i,u,c;if(null===(n=null===(r=t.logger)||void 0===r?void 0:r.debug)||void 0===n||n.call(r,"Message received: ",JSON.stringify(e)),t.endpoint===e.origin){var h,d=null==e?void 0:e.data,p=null==d?void 0:d.action;if(p)if("id"in d)null===(u=null===(i=t.logger)||void 0===i?void 0:i.debug)||void 0===u||u.call(i,"Received Response to previous request: ",JSON.stringify(e)),t.handleResponse(d);else if("ping"===p)t.notify({action:"pong"});else if("initialize-visual-tagging-selector"===p){var f=null==d?void 0:d.data;(h="https://cdn.amplitude.com/libs/visual-tagging-selector-1.0.0-alpha.js.gz",new Promise((function(e,t){var r;try{var n=document.createElement("script");n.type="text/javascript",n.async=!0,n.src=h,n.addEventListener("load",(function(){e({status:!0})}),{once:!0}),n.addEventListener("error",(function(){t({status:!1,message:"Failed to load the script ".concat(h)})})),null===(r=document.head)||void 0===r||r.appendChild(n)}catch(e){t(e)}}))).then((function(){var e;l=null===(e=null===window||void 0===window?void 0:window.amplitudeVisualTaggingSelector)||void 0===e?void 0:e.call(window,{getEventTagProps:ei,isElementSelectable:function(e){return!o||o((null==f?void 0:f.actionType)||"click",e)},onTrack:t.onTrack,onSelect:t.onSelect,visualHighlightClass:"amp-visual-tagging-selector-highlight",messenger:t,cssSelectorAllowlist:s,actionClickAllowlist:a}),t.notify({action:"selector-loaded"})})).catch((function(){var e;null===(e=t.logger)||void 0===e||e.warn("Failed to initialize visual tagging selector")}))}else"close-visual-tagging-selector"===p&&(null===(c=null==l?void 0:l.close)||void 0===c||c.call(l))}})),this.notify({action:"page-loaded"})},e}(),ni=["id","class","style","value","onclick","onchange","oninput","onblur","onsubmit","onfocus","onkeydown","onkeyup","onkeypress","data-reactid","data-react-checksum","data-reactroot"],ii=["type"],oi=["svg","path","g"],si=["password","hidden"];var ai=function(e){var t;return e?(t=function(e,t){for(var r=0,n=0;n<e.length;n++){var i=e[n];if(null===i)r+=4;else{var o=li(i);r+=o?Array.from(o).length:4}if(r>t)return e.slice(0,n)}return e}(function(e){var t=[];if(!e)return t;t.push(e);for(var r=e.parentElement;r&&"HTML"!==r.tagName;)t.push(r),r=r.parentElement;return t}(e).map((function(e){return function(e){var t,r,n,i,o,s;if(null===e)return null;var a=String(e.tagName).toLowerCase(),l={tag:a},c=Array.from(null!==(i=null===(n=e.parentElement)||void 0===n?void 0:n.children)&&void 0!==i?i:[]);c.length&&(l.index=c.indexOf(e),l.indexOfType=c.filter((function(t){return t.tagName===e.tagName})).indexOf(e));var h=null===(s=null===(o=e.previousElementSibling)||void 0===o?void 0:o.tagName)||void 0===s?void 0:s.toLowerCase();h&&(l.prevSib=String(h));var d=e.getAttribute("id");d&&(l.id=String(d));var p=Array.from(e.classList);p.length&&(l.classes=p);var f={},g=Array.from(e.attributes).filter((function(e){return!ni.includes(e.name)})),m=!Zn(e);if(!si.includes(String(e.getAttribute("type")))&&!oi.includes(a))try{for(var v=u(g),y=v.next();!y.done;y=v.next()){var w=y.value;m&&!ii.includes(w.name)||(f[w.name]=String(w.value).substring(0,128))}}catch(e){t={error:e}}finally{try{y&&!y.done&&(r=v.return)&&r.call(v)}finally{if(t)throw t.error}}return Object.keys(f).length&&(l.attrs=f),l}(e)})),1024),t):[]};function li(e,t){void 0===t&&(t=!1);try{if(null==e)return t?"None":null;if("string"==typeof e)return t?(e=e.replace(/\\/g,"\\\\").replace(/\n/g,"\\n").replace(/\t/g,"\\t").replace(/\r/g,"\\r")).includes('"')?"'".concat(e,"'"):e.includes("'")?'"'.concat(e.replace(/'/g,"\\'"),'"'):"'".concat(e,"'"):e;if("boolean"==typeof e)return e?"True":"False";if(Array.isArray(e)){var r=e.map((function(e){return li(e,!0)}));return"[".concat(r.join(", "),"]")}if("object"==typeof e){var n=Object.entries(e).filter((function(e){return null!=c(e,1)[0]})).map((function(e){var t=c(e,2),r=t[0],n=t[1];return"".concat(String(li(r,!0)),": ").concat(String(li(n,!0)))})),i="{".concat(n.join(", "),"}");return i.includes("\\'")&&(i=i.replace(/'/g,"'").replace(/'/g,"\\'")),i}return e.toString()}catch(e){return null}}var ui;function ci(e){var t,r,n,i=e.amplitude,o=e.allObservables,s=e.options,a=e.shouldTrackEvent,l=o.clickObservable,h=l.pipe(Cr((function(e,t){var r,n=!1;e.subscribe(Ir(t,(function(e){var i=r;r=e,n&&t.next([i,e]),n=!0})))})),jn((function(e){var t=c(e,2),r=t[0],n=t[1],i=r.event.target!==n.event.target,o=Math.abs(n.event.screenX-r.event.screenX)<=20&&Math.abs(n.event.screenY-r.event.screenY)<=20;return i&&!o}))),d=Un(h,l.pipe((t=s.debounceTime,void 0===r&&(r=Yr),Cr((function(e,n){var i=null,o=null,s=null,a=function(){if(i){i.unsubscribe(),i=null;var e=o;o=null,n.next(e)}};function l(){var e=s+t,o=r.now();if(o<e)return i=this.schedule(void 0,e-o),void n.add(i);a()}e.subscribe(Ir(n,(function(e){o=e,s=r.now(),i||(i=r.schedule(l,t),n.add(i))}),(function(){a(),n.complete()}),void 0,(function(){o=i=null})))}))),On((function(){return"timeout"}))));return l.pipe(Vn(0),jn(ti),jn((function(e){return a("click",e.closestTrackedAncestor)})),(n=d,Cr((function(e,t){var r=[];return e.subscribe(Ir(t,(function(e){return r.push(e)}),(function(){t.next(r),t.complete()}))),mn(n).subscribe(Ir(t,(function(){var e=r;r=[],t.next(e)}),ar)),function(){r=null}})))).subscribe((function(e){var t,r,n=(e.length,qt);try{for(var o=u(e),s=o.next();!s.done;s=o.next()){var a=s.value;null==i||i.track(n,a.targetElementProperties)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}}))}function hi(e){var t=e.amplitude,r=e.allObservables,n=e.options,i=e.getEventProperties,o=e.shouldTrackEvent,s=e.shouldTrackActionClick,a=r.clickObservable,l=r.mutationObservable,u=r.navigateObservable,d=a.pipe(jn((function(e){return!o("click",e.closestTrackedAncestor)})),On((function(e){var t=Qn(e.event.target,n.actionClickAllowlist);return e.closestTrackedAncestor=t,null!==e.closestTrackedAncestor&&(e.targetElementProperties=i(e.type,e.closestTrackedAncestor)),e})),jn(ti),jn((function(e){return s("click",e.closestTrackedAncestor)}))),p=[l];u&&p.push(u);var f,g,m=Un.apply(void 0,h([],c(p),!1)),v=d.pipe((f=function(e){return m.pipe(Bn(1),function(e,t){var r=xn(e)?{first:e}:"number"==typeof e?{each:e}:e,n=r.first,i=r.each,o=r.with,s=void 0===o?En:o,a=r.scheduler,l=void 0===a?null!=t?t:Yr:a,u=r.meta,c=void 0===u?null:u;if(null==n&&null==i)throw new TypeError("No timeout provided.");return Cr((function(e,t){var r,o,a=null,u=0,h=function(e){o=yn(t,l,(function(){try{r.unsubscribe(),mn(s({meta:c,lastValue:a,seen:u})).subscribe(t)}catch(e){t.error(e)}}),e)};r=e.subscribe(Ir(t,(function(e){null==o||o.unsubscribe(),u++,t.next(a=e),i>0&&h(i)}),void 0,void 0,(function(){(null==o?void 0:o.closed)||null==o||o.unsubscribe(),a=null}))),!u&&h(null!=n?"number"==typeof n?n:+n-l.now():i)}))}({first:500,with:function(){return en}}),On((function(){return e})))},Cr((function(e,t){var r=null,n=0,i=!1,o=function(){return i&&!r&&t.complete()};e.subscribe(Ir(t,(function(e){null==r||r.unsubscribe();var i=0,s=n++;mn(f(e,s)).subscribe(r=Ir(t,(function(r){return t.next(g?g(e,r,s,i++):r)}),(function(){r=null,o()})))}),(function(){i=!0,o()})))}))));return v.subscribe((function(e){null==t||t.track(qt,i("click",e.closestTrackedAncestor))}))}!function(e){e.ClickObservable="clickObservable",e.ChangeObservable="changeObservable",e.NavigateObservable="navigateObservable",e.MutationObservable="mutationObservable"}(ui||(ui={}));var di,pi=function(e){var t,r,n;void 0===e&&(e={});var i=e.dataAttributePrefix,s=void 0===i?ke:i,d=e.visualTaggingOptions,p=void 0===d?{enabled:!0,messenger:new ri}:d;e.cssSelectorAllowlist=null!==(t=e.cssSelectorAllowlist)&&void 0!==t?t:xe,e.actionClickAllowlist=null!==(r=e.actionClickAllowlist)&&void 0!==r?r:Ee,e.debounceTime=null!==(n=e.debounceTime)&&void 0!==n?n:0;var f="@amplitude/plugin-autocapture-browser",g=[],m=function(e,t){var r,n,i,o=null===(i=null===(n=null==t?void 0:t.tagName)||void 0===n?void 0:n.toLowerCase)||void 0===i?void 0:i.call(n),a="function"==typeof t.getBoundingClientRect?t.getBoundingClientRect():{left:null,top:null},l=t.getAttribute("aria-label"),u=function(e,t){return e.getAttributeNames().reduce((function(r,n){if(n.startsWith(t)){var i=n.replace(t,""),o=e.getAttribute(n);i&&(r[i]=o||"")}return r}),{})}(t,s),c=Hn(t),h=((r={})["[Amplitude] Element ID"]=t.getAttribute("id")||"",r["[Amplitude] Element Class"]=t.getAttribute("class"),r["[Amplitude] Element Hierarchy"]=ai(t),r[Gt]=o,r[Kt]=Jn(t),r["[Amplitude] Element Position Left"]=null==a.left?null:Math.round(a.left),r["[Amplitude] Element Position Top"]=null==a.top?null:Math.round(a.top),r["[Amplitude] Element Aria Label"]=l,r["[Amplitude] Element Attributes"]=u,r["[Amplitude] Element Parent Label"]=c,r[Yt]=window.location.href.split("?")[0],r["[Amplitude] Page Title"]="undefined"!=typeof document&&document.title||"",r["[Amplitude] Viewport Height"]=window.innerHeight,r["[Amplitude] Viewport Width"]=window.innerWidth,r);return"a"===o&&"click"===e&&t instanceof HTMLAnchorElement&&(h["[Amplitude] Element Href"]=t.href),Xn(h)},v=function(t,r){var n={event:t,timestamp:Date.now(),type:r};if(function(e){return"click"===e.type||"change"===e.type}(n)&&null!==n.event.target){var i=Qn(n.event.target,e.cssSelectorAllowlist);return i&&(n.closestTrackedAncestor=i,n.targetElementProperties=m(n.type,i)),n}return n};return{name:f,type:"enrichment",setup:function(t,r){return a(void 0,void 0,void 0,(function(){var n,i,s,a,u,d,y,w,b,S;return l(this,(function(l){return"undefined"==typeof document||(n=Kn(e,e.cssSelectorAllowlist),i=Kn(e,e.actionClickAllowlist),s=function(){var e,t,r=Dn(document,"click",{capture:!0}).pipe(On((function(e){return v(e,"click")})),Wn()),n=Dn(document,"change",{capture:!0}).pipe(On((function(e){return v(e,"change")})),Wn());window.navigation&&(t=Dn(window.navigation,"navigate").pipe(On((function(e){return v(e,"navigate")})),Wn()));var i=new wr((function(e){var t=new MutationObserver((function(t){e.next(t)}));return t.observe(document.body,{childList:!0,attributes:!0,characterData:!0,subtree:!0}),function(){return t.disconnect()}})).pipe(On((function(e){return v(e,"mutation")})),Wn());return(e={})[ui.ClickObservable]=r,e[ui.ChangeObservable]=n,e[ui.NavigateObservable]=t,e[ui.MutationObservable]=i,e}(),a=ci({allObservables:s,options:e,amplitude:r,shouldTrackEvent:n}),g.push(a),u=function(e){var t=e.amplitude,r=e.allObservables,n=e.getEventProperties,i=e.shouldTrackEvent;return r.changeObservable.pipe(jn(ti),jn((function(e){return i("change",e.closestTrackedAncestor)}))).subscribe((function(e){null==t||t.track("[Amplitude] Element Changed",n("change",e.closestTrackedAncestor))}))}({allObservables:s,getEventProperties:m,amplitude:r,shouldTrackEvent:n}),g.push(u),d=hi({allObservables:s,options:e,getEventProperties:m,amplitude:r,shouldTrackEvent:n,shouldTrackActionClick:i}),g.push(d),null===(b=null==t?void 0:t.loggerProvider)||void 0===b||b.log("".concat(f," has been successfully added.")),window.opener&&p.enabled&&(y=e.cssSelectorAllowlist,w=e.actionClickAllowlist,null===(S=p.messenger)||void 0===S||S.setup(o(o({logger:null==t?void 0:t.loggerProvider},(null==t?void 0:t.serverZone)&&{endpoint:Jt[t.serverZone]}),{isElementSelectable:Kn(e,h(h([],c(y),!1),c(w),!1)),cssSelectorAllowlist:y,actionClickAllowlist:w})))),[2]}))}))},execute:function(e){return a(void 0,void 0,void 0,(function(){return l(this,(function(t){return[2,e]}))}))},teardown:function(){return a(void 0,void 0,void 0,(function(){var e,t,r,n;return l(this,(function(i){try{for(e=u(g),t=e.next();!t.done;t=e.next())t.value.unsubscribe()}catch(e){r={error:e}}finally{try{t&&!t.done&&(n=e.return)&&n.call(e)}finally{if(r)throw r.error}}return[2]}))}))}}},fi="dclid",gi="fbclid",mi="gbraid",vi="gclid",yi="ko_click_id",wi="li_fat_id",bi="msclkid",Si="rtd_cid",Ci="ttclid",Ii="twclid",xi="wbraid",ki={utm_campaign:void 0,utm_content:void 0,utm_id:void 0,utm_medium:void 0,utm_source:void 0,utm_term:void 0,referrer:void 0,referring_domain:void 0,dclid:void 0,gbraid:void 0,gclid:void 0,fbclid:void 0,ko_click_id:void 0,li_fat_id:void 0,msclkid:void 0,rtd_cid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0},Ei=function(e){var t=e.split(".");return t.length<=2?e:t.slice(t.length-2,t.length).join(".")},Oi=function(e,t,r,n,i){void 0===i&&(i=!0),e.referrer;var o=e.referring_domain,a=s(e,["referrer","referring_domain"]),l=t||{};l.referrer;var u=l.referring_domain,c=s(l,["referrer","referring_domain"]);if(Ai(r.excludeReferrers,e.referring_domain))return n.debug("This is not a new campaign because ".concat(e.referring_domain," is in the exclude referrer list.")),!1;if(!i&&function(e){return Object.values(e).every((function(e){return!e}))}(e)&&t)return n.debug("This is not a new campaign because this is a direct traffic in the same session."),!1;var h=JSON.stringify(a)!==JSON.stringify(c),d=Ei(o||"")!==Ei(u||""),p=!t||h||d;return p?n.debug("This is a new campaign. An $identify event will be sent."):n.debug("This is not a new campaign because it's the same as the previous one."),p},Ai=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=""),e.some((function(e){return e instanceof RegExp?e.test(t):e===t}))},Ri=function(){function e(){}return e.prototype.parse=function(){return a(this,void 0,void 0,(function(){return l(this,(function(e){return[2,o(o(o(o({},ki),this.getUtmParam()),this.getReferrer()),this.getClickIds())]}))}))},e.prototype.getUtmParam=function(){var e=se();return{utm_campaign:e.utm_campaign,utm_content:e.utm_content,utm_id:e.utm_id,utm_medium:e.utm_medium,utm_source:e.utm_source,utm_term:e.utm_term}},e.prototype.getReferrer=function(){var e,t,r={referrer:void 0,referring_domain:void 0};try{r.referrer=document.referrer||void 0,r.referring_domain=null!==(t=null===(e=r.referrer)||void 0===e?void 0:e.split("/")[2])&&void 0!==t?t:void 0}catch(e){}return r},e.prototype.getClickIds=function(){var e,t=se();return(e={})[fi]=t[fi],e[gi]=t[gi],e[mi]=t[mi],e[vi]=t[vi],e[yi]=t[yi],e[wi]=t[wi],e[bi]=t[bi],e[Si]=t[Si],e[Ci]=t[Ci],e[Ii]=t[Ii],e[xi]=t[xi],e},e}(),Pi=function(){function e(e,t){var r,n,i,s,a,l;this.shouldTrackNewCampaign=!1,this.options=o({initialEmptyValue:"EMPTY",resetSessionOnNewCampaign:!1,excludeReferrers:(n=null===(r=t.cookieOptions)||void 0===r?void 0:r.domain,i=n,i?(i.startsWith(".")&&(i=i.substring(1)),[new RegExp("".concat(i.replace(".","\\."),"$"))]):[])},e),this.storage=t.cookieStorage,this.storageKey=(s=t.apiKey,void 0===(a="MKTG")&&(a=""),void 0===l&&(l=10),[m,a,s.substring(0,l)].filter(Boolean).join("_")),this.currentCampaign=ki,this.sessionTimeout=t.sessionTimeout,this.lastEventTime=t.lastEventTime,this.logger=t.loggerProvider,t.loggerProvider.log("Installing web attribution tracking.")}return e.prototype.init=function(){return a(this,void 0,void 0,(function(){var e,t;return l(this,(function(r){switch(r.label){case 0:return[4,this.fetchCampaign()];case 1:return t=c.apply(void 0,[r.sent(),2]),this.currentCampaign=t[0],this.previousCampaign=t[1],e=!this.lastEventTime||ne(this.sessionTimeout,this.lastEventTime),Oi(this.currentCampaign,this.previousCampaign,this.options,this.logger,e)?(this.shouldTrackNewCampaign=!0,[4,this.storage.set(this.storageKey,this.currentCampaign)]):[3,3];case 2:r.sent(),r.label=3;case 3:return[2]}}))}))},e.prototype.fetchCampaign=function(){return a(this,void 0,void 0,(function(){return l(this,(function(e){switch(e.label){case 0:return[4,Promise.all([(new Ri).parse(),this.storage.get(this.storageKey)])];case 1:return[2,e.sent()]}}))}))},e.prototype.generateCampaignEvent=function(e){this.shouldTrackNewCampaign=!1;var t,r,n,i,s=(t=this.currentCampaign,r=this.options,n=o(o({},ki),t),i=Object.entries(n).reduce((function(e,t){var n,i=c(t,2),o=i[0],s=i[1];return e.setOnce("initial_".concat(o),null!==(n=null!=s?s:r.initialEmptyValue)&&void 0!==n?n:"EMPTY"),s?e.set(o,s):e.unset(o)}),new S),P(i));return e&&(s.event_id=e),s},e.prototype.shouldSetSessionIdOnNewCampaign=function(){return this.shouldTrackNewCampaign&&!!this.options.resetSessionOnNewCampaign},e}(),Mi=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.init=function(e,t,r){var n,i;return void 0===e&&(e=""),arguments.length>2?(n=t,i=r):"string"==typeof t?(n=t,i=void 0):(n=null==t?void 0:t.userId,i=t),M(this._init(o(o({},i),{userId:n,apiKey:e})))},t.prototype._init=function(t){var r,n,i;return a(this,void 0,void 0,(function(){var s,u,c,h,d,p=this;return l(this,(function(f){switch(f.label){case 0:return this.initializing?[2]:(this.initializing=!0,[4,ut(t.apiKey,t,this)]);case 1:return s=f.sent(),t.fetchRemoteConfig?[4,(m=s,a(void 0,void 0,void 0,(function(){var e;return l(this,(function(t){switch(t.label){case 0:return[4,(e=new Wt(m)).initialize()];case 1:return t.sent(),[2,e]}}))})))]:[3,4];case 2:return[4,f.sent().generateJoinedConfig()];case 3:s=f.sent(),f.label=4;case 4:return[4,e.prototype._init.call(this,s)];case 5:return f.sent(),this.logBrowserOptions(s),Ae(this.config.defaultTracking)?(u=function(e){return Ae(e.defaultTracking)&&e.defaultTracking&&"object"==typeof e.defaultTracking&&e.defaultTracking.attribution&&"object"==typeof e.defaultTracking.attribution?o({},e.defaultTracking.attribution):{}}(this.config),this.webAttribution=new Pi(u,this.config),[4,this.webAttribution.init()]):[3,7];case 6:f.sent(),f.label=7;case 7:return c=se(),h=Number.isNaN(Number(c.ampSessionId))?void 0:Number(c.ampSessionId),this.setSessionId(null!==(i=null!==(n=null!==(r=t.sessionId)&&void 0!==r?r:h)&&void 0!==n?n:this.config.sessionId)&&void 0!==i?i:Date.now()),(d=te(t.instanceName)).identityStore.setIdentity({userId:this.config.userId,deviceId:this.config.deviceId}),null===this.config.offline?[3,9]:[4,this.add(jt()).promise];case 8:f.sent(),f.label=9;case 9:return[4,this.add(new W).promise];case 10:return f.sent(),[4,this.add(new Fe).promise];case 11:return f.sent(),[4,this.add(new re).promise];case 12:return f.sent(),function(e){Ut||void 0!==e.defaultTracking||(e.loggerProvider.warn("`options.defaultTracking` is set to undefined. This implicitly configures your Amplitude instance to track Page Views, Sessions, File Downloads, and Form Interactions. You can suppress this warning by explicitly setting a value to `options.defaultTracking`. The value must either be a boolean, to enable and disable all default events, or an object, for advanced configuration. For example:\n\namplitude.init(<YOUR_API_KEY>, {\n defaultTracking: true,\n});\n\nVisit https://www.docs.developers.amplitude.com/data/sdks/browser-2/#tracking-default-events for more details."),Ut=!0)}(this.config),g=this.config.defaultTracking,Oe(g,"fileDownloads")?(this.config.loggerProvider.debug("Adding file download tracking plugin"),[4,this.add(Ft()).promise]):[3,14];case 13:f.sent(),f.label=14;case 14:return function(e){return Oe(e,"formInteractions")}(this.config.defaultTracking)?(this.config.loggerProvider.debug("Adding form interaction plugin"),[4,this.add(Nt()).promise]):[3,16];case 15:f.sent(),f.label=16;case 16:return Re(this.config.defaultTracking)?(this.config.loggerProvider.debug("Adding page view tracking plugin"),[4,this.add(Pt(Te(this.config))).promise]):[3,18];case 17:f.sent(),f.label=18;case 18:return Me(this.config.autocapture)?(this.config.loggerProvider.debug("Adding user interactions plugin (autocapture plugin)"),[4,this.add(pi(_e(this.config))).promise]):[3,20];case 19:f.sent(),f.label=20;case 20:return this.initializing=!1,[4,this.runQueuedFunctions("dispatchQ")];case 21:return f.sent(),d.eventBridge.setEventReceiver((function(e){p.track(e.eventType,e.eventProperties)})),[2]}var g,m}))}))},t.prototype.getUserId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.userId},t.prototype.setUserId=function(e){this.config?(this.config.loggerProvider.debug("function setUserId: ",e),e===this.config.userId&&void 0!==e||(this.config.userId=e,this.timeline.onIdentityChanged({userId:e}),function(e,t){te(t).identityStore.editIdentity().setUserId(e).commit()}(e,this.config.instanceName))):this.q.push(this.setUserId.bind(this,e))},t.prototype.getDeviceId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.deviceId},t.prototype.setDeviceId=function(e){this.config?(this.config.loggerProvider.debug("function setDeviceId: ",e),e!==this.config.deviceId&&(this.config.deviceId=e,this.timeline.onIdentityChanged({deviceId:e}),function(e,t){te(t).identityStore.editIdentity().setDeviceId(e).commit()}(e,this.config.instanceName))):this.q.push(this.setDeviceId.bind(this,e))},t.prototype.reset=function(){this.setDeviceId(A()),this.setUserId(void 0)},t.prototype.getSessionId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.sessionId},t.prototype.setSessionId=function(e){var t,r=[];if(!this.config)return this.q.push(this.setSessionId.bind(this,e)),M(Promise.resolve());if(e===this.config.sessionId)return M(Promise.resolve());this.config.loggerProvider.debug("function setSessionId: ",e);var n=this.getSessionId();n!==e&&this.timeline.onSessionIdChanged(e);var i=this.config.lastEventTime,o=null!==(t=this.config.lastEventId)&&void 0!==t?t:-1;this.config.sessionId=e,this.config.lastEventTime=void 0,this.config.pageCounter=0,Pe(this.config.defaultTracking)&&(n&&i&&r.push(this.track(He,void 0,{device_id:this.previousSessionDeviceId,event_id:++o,session_id:n,time:i+1,user_id:this.previousSessionUserId}).promise),this.config.lastEventTime=this.config.sessionId);var s=this.trackCampaignEventIfNeeded(++o,r);return Pe(this.config.defaultTracking)&&r.push(this.track(Xe,void 0,{event_id:s?++o:o,session_id:this.config.sessionId,time:this.config.lastEventTime}).promise),this.previousSessionDeviceId=this.config.deviceId,this.previousSessionUserId=this.config.userId,M(Promise.all(r))},t.prototype.extendSession=function(){this.config?this.config.lastEventTime=Date.now():this.q.push(this.extendSession.bind(this))},t.prototype.setTransport=function(e){this.config?this.config.transportProvider=ht(e):this.q.push(this.setTransport.bind(this,e))},t.prototype.identify=function(t,r){if(Le(t)){var n=t._q;t._q=[],t=Ne(new S,n)}return(null==r?void 0:r.user_id)&&this.setUserId(r.user_id),(null==r?void 0:r.device_id)&&this.setDeviceId(r.device_id),e.prototype.identify.call(this,t,r)},t.prototype.groupIdentify=function(t,r,n,i){if(Le(n)){var o=n._q;n._q=[],n=Ne(new S,o)}return e.prototype.groupIdentify.call(this,t,r,n,i)},t.prototype.revenue=function(t,r){if(Le(t)){var n=t._q;t._q=[],t=Ne(new T,n)}return e.prototype.revenue.call(this,t,r)},t.prototype.trackCampaignEventIfNeeded=function(e,t){if(!this.webAttribution||!this.webAttribution.shouldTrackNewCampaign)return!1;var r=this.webAttribution.generateCampaignEvent(e);return t?t.push(this.track(r).promise):this.track(r),this.config.loggerProvider.log("Tracking attribution."),!0},t.prototype.process=function(t){return a(this,void 0,void 0,(function(){var r,n,i;return l(this,(function(o){return r=Date.now(),n=ne(this.config.sessionTimeout,this.config.lastEventTime),i=this.webAttribution&&this.webAttribution.shouldSetSessionIdOnNewCampaign(),t.event_type===Xe||t.event_type===He||t.session_id&&t.session_id!==this.getSessionId()||(n||i?(this.setSessionId(r),i&&this.config.loggerProvider.log("Created a new session for new campaign.")):n||this.trackCampaignEventIfNeeded()),[2,e.prototype.process.call(this,t)]}))}))},t.prototype.logBrowserOptions=function(e){try{var t=o(o({},e),{apiKey:e.apiKey.substring(0,10)+"********"});this.config.loggerProvider.debug("Initialized Amplitude with BrowserConfig:",JSON.stringify(t))}catch(e){this.config.loggerProvider.error("Error logging browser config",e)}},t}(_),_i=function(){var e=new Mi;return{init:de(e.init.bind(e),"init",ue(e),he(e,["config"])),add:de(e.add.bind(e),"add",ue(e),he(e,["config.apiKey","timeline.plugins"])),remove:de(e.remove.bind(e),"remove",ue(e),he(e,["config.apiKey","timeline.plugins"])),track:de(e.track.bind(e),"track",ue(e),he(e,["config.apiKey","timeline.queue.length"])),logEvent:de(e.logEvent.bind(e),"logEvent",ue(e),he(e,["config.apiKey","timeline.queue.length"])),identify:de(e.identify.bind(e),"identify",ue(e),he(e,["config.apiKey","timeline.queue.length"])),groupIdentify:de(e.groupIdentify.bind(e),"groupIdentify",ue(e),he(e,["config.apiKey","timeline.queue.length"])),setGroup:de(e.setGroup.bind(e),"setGroup",ue(e),he(e,["config.apiKey","timeline.queue.length"])),revenue:de(e.revenue.bind(e),"revenue",ue(e),he(e,["config.apiKey","timeline.queue.length"])),flush:de(e.flush.bind(e),"flush",ue(e),he(e,["config.apiKey","timeline.queue.length"])),getUserId:de(e.getUserId.bind(e),"getUserId",ue(e),he(e,["config","config.userId"])),setUserId:de(e.setUserId.bind(e),"setUserId",ue(e),he(e,["config","config.userId"])),getDeviceId:de(e.getDeviceId.bind(e),"getDeviceId",ue(e),he(e,["config","config.deviceId"])),setDeviceId:de(e.setDeviceId.bind(e),"setDeviceId",ue(e),he(e,["config","config.deviceId"])),reset:de(e.reset.bind(e),"reset",ue(e),he(e,["config","config.userId","config.deviceId"])),getSessionId:de(e.getSessionId.bind(e),"getSessionId",ue(e),he(e,["config"])),setSessionId:de(e.setSessionId.bind(e),"setSessionId",ue(e),he(e,["config"])),extendSession:de(e.extendSession.bind(e),"extendSession",ue(e),he(e,["config"])),setOptOut:de(e.setOptOut.bind(e),"setOptOut",ue(e),he(e,["config"])),setTransport:de(e.setTransport.bind(e),"setTransport",ue(e),he(e,["config"]))}}();_i.add,_i.extendSession,_i.flush,_i.getDeviceId,_i.getSessionId,_i.getUserId,_i.groupIdentify,_i.identify,_i.init,_i.logEvent,_i.remove,_i.reset,_i.revenue,_i.setDeviceId,_i.setGroup,_i.setOptOut,_i.setSessionId,_i.setTransport,_i.setUserId,_i.track,e.Types=void 0,(di=e.Types||(e.Types={})).IdentifyOperation=n,di.SpecialEventType=i,di.RevenueProperty=x,di.LogLevel=N,di.ServerZone=X,di.OfflineDisabled=null,di.DEFAULT_CSS_SELECTOR_ALLOWLIST=xe,di.DEFAULT_DATA_ATTRIBUTE_PREFIX=ke,di.DEFAULT_ACTION_CLICK_ALLOWLIST=Ee;var Ti,Ni="[Amplitude]",Li="".concat(Ni," Session Replay ID"),Di=X.US,Fi="".concat(Ni," Session Replay Debug"),Ui="amp-mask";!function(e){e.GET_SR_PROPS="get-sr-props",e.DEBUG_INFO="debug-info",e.FETCH_REQUEST="fetch-request"}(Ti||(Ti={}));var ji,Bi=function(){function e(e){this.logger=e,this.log=this.getSafeMethod("log"),this.warn=this.getSafeMethod("warn"),this.error=this.getSafeMethod("error"),this.debug=this.getSafeMethod("debug")}return e.prototype.getSafeMethod=function(e){var t;if(!this.logger)return function(){};var r=this.logger[e];return"function"==typeof r?(null!==(t=r.__rrweb_original__)&&void 0!==t?t:r).bind(this.logger):function(){}},e.prototype.enable=function(e){this.logger.enable(e)},e.prototype.disable=function(){this.logger.disable()},e}(),zi=function(){return{flushMaxRetries:2,logLevel:N.Warn,loggerProvider:new D,transportProvider:new ye}},Vi=function(e){function t(t,r){var n,i=this,s=zi();return(i=e.call(this,o(o({transportProvider:s.transportProvider,loggerProvider:new Bi(r.loggerProvider||s.loggerProvider)},r),{apiKey:t}))||this).flushMaxRetries=void 0!==r.flushMaxRetries&&r.flushMaxRetries<=s.flushMaxRetries?r.flushMaxRetries:s.flushMaxRetries,i.apiKey=t,i.sampleRate=r.sampleRate||0,i.serverZone=r.serverZone||Di,i.configServerUrl=r.configServerUrl,i.trackServerUrl=r.trackServerUrl,i.shouldInlineStylesheet=r.shouldInlineStylesheet,i.version=r.version,i.performanceConfig=r.performanceConfig,i.storeType=null!==(n=r.storeType)&&void 0!==n?n:"idb",r.privacyConfig&&(i.privacyConfig=r.privacyConfig),r.debugMode&&(i.debugMode=r.debugMode),r.experimental&&(i.experimental=r.experimental),i}return r(t,e),t}(U),Wi=Object.defineProperty,qi=(e,t,r)=>((e,t,r)=>t in e?Wi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Gi=Object.defineProperty,Ki=(e,t,r)=>((e,t,r)=>t in e?Gi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Yi=(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))(Yi||{});const Zi={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Ji={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},$i={};function Xi(e){if($i[e])return $i[e];const t=globalThis[e],r=t.prototype,n=e in Zi?Zi[e]:void 0,i=Boolean(n&&n.every((e=>{var t,n;return Boolean(null==(n=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:n.toString().includes("[native code]"))}))),o=e in Ji?Ji[e]:void 0,s=Boolean(o&&o.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(i&&s&&!globalThis.Zone)return $i[e]=t.prototype,t.prototype;try{const n=document.createElement("iframe");document.body.appendChild(n);const i=n.contentWindow;if(!i)return t.prototype;const o=i[e].prototype;return document.body.removeChild(n),o?$i[e]=o:r}catch{return r}}const Hi={};function Qi(e,t,r){var n;const i=`${e}.${String(r)}`;if(Hi[i])return Hi[i].call(t);const o=Xi(e),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(Hi[i]=s,s.call(t)):t[r]}const eo={};function to(e,t,r){const n=`${e}.${String(r)}`;if(eo[n])return eo[n].bind(t);const i=Xi(e)[r];return"function"!=typeof i?t[r]:(eo[n]=i,i.bind(t))}const ro={childNodes:function(e){return Qi("Node",e,"childNodes")},parentNode:function(e){return Qi("Node",e,"parentNode")},parentElement:function(e){return Qi("Node",e,"parentElement")},textContent:function(e){return Qi("Node",e,"textContent")},contains:function(e,t){return to("Node",e,"contains")(t)},getRootNode:function(e){return to("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Qi("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Qi("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Qi("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Qi("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return Xi("MutationObserver").constructor}};function no(e){return e.nodeType===e.ELEMENT_NODE}function io(e){const t=e&&"host"in e&&"mode"in e&&ro.host(e)||null;return Boolean(t&&"shadowRoot"in t&&ro.shadowRoot(t)===e)}function oo(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function so(e){try{const r=e.rules||e.cssRules;if(!r)return null;let n=e.href;!n&&e.ownerNode&&e.ownerNode.ownerDocument&&(n=e.ownerNode.ownerDocument.location.href);const i=Array.from(r,(e=>ao(e,n))).join("");return(t=i).includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t}catch(e){return null}var t}function ao(e,t){if(function(e){return"styleSheet"in e}(e)){let t;try{t=so(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?wo(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?wo(r,t):r}}class lo{constructor(){Ki(this,"idNodeMap",new Map),Ki(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 uo({element:e,maskInputOptions:t,tagName:r,type:n,value:i,maskInputFn:o}){let s=i||"";const a=n&&co(n);return(t[r.toLowerCase()]||a&&t[a])&&(s=o?o(s,e):"*".repeat(s.length)),s}function co(e){return e.toLowerCase()}const ho="__rrweb_original__";function po(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?co(t):null}function fo(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 go=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,mo=/^(?:[a-z+]+:)?\/\//i,vo=/^www\..*/i,yo=/^(data:)([^,]*),(.*)/i;function wo(e,t){return(e||"").replace(go,((e,r,n,i,o,s)=>{const a=n||o||s,l=r||i||"";if(!a)return e;if(mo.test(a)||vo.test(a))return`url(${l}${a}${l})`;if(yo.test(a))return`url(${l}${a}${l})`;if("/"===a[0])return`url(${l}${function(e){let t="";return t=e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0],t=t.split("?")[0],t}(t)+a}${l})`;const u=t.split("/"),c=a.split("/");u.pop();for(const e of c)"."!==e&&(".."===e?u.pop():u.push(e));return`url(${l}${u.join("/")}${l})`}))}function bo(e,t=!1){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function So(e,t){return function(e,t,r=!1){const n=Array.from(t.childNodes),i=[];let o=0;if(n.length>1&&e&&"string"==typeof e){let t=bo(e,r);const s=t.length/e.length;for(let a=1;a<n.length;a++)if(n[a].textContent&&"string"==typeof n[a].textContent){const l=bo(n[a].textContent,r),u=100;let c=3;for(;c<l.length&&(l[c].match(/[a-zA-Z0-9]/)||-1!==l.indexOf(l.substring(0,c),1));c++);for(;c<l.length;c++){let h=l.substring(0,c),d=t.split(h),p=-1;if(2===d.length)p=d[0].length;else if(d.length>2&&""===d[0]&&""!==n[a-1].textContent)p=t.indexOf(h,1);else if(1===d.length){if(h=h.substring(0,h.length-1),d=t.split(h),d.length<=1)return i.push(e),i;c=u+1}else c===l.length-1&&(p=t.indexOf(h));if(d.length>=2&&c>u){const e=n[a-1].textContent;if(e&&"string"==typeof e){const r=bo(e).length;p=t.indexOf(h,r)}-1===p&&(p=d[0].length)}if(-1!==p){let a=Math.floor(p/s);for(;a>0&&a<e.length;){if(o+=1,o>50*n.length)return i.push(e),i;const l=bo(e.substring(0,a),r);if(l.length===p){i.push(e.substring(0,a)),e=e.substring(a),t=t.substring(p);break}l.length<p?a+=Math.max(1,Math.floor((p-l.length)/s)):a-=Math.max(1,Math.floor((l.length-p)*s))}break}}}}return i.push(e),i}(e,t).join("/* rr_split */")}let Co=1;const Io=new RegExp("[^a-z0-9-_:]");function xo(){return Co++}let ko,Eo;const Oo=/^[^ \t\n\r\u000c]+/,Ao=/^[, \t\n\r\u000c]+/;const Ro=new WeakMap;function Po(e,t){return t&&""!==t.trim()?_o(e,t):t}function Mo(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function _o(e,t){let r=Ro.get(e);if(r||(r=e.createElement("a"),Ro.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function To(e,t,r,n){return n?"src"===r||"href"===r&&("use"!==t||"#"!==n[0])||"xlink:href"===r&&"#"!==n[0]?Po(e,n):"background"!==r||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===r?function(e,t){if(""===t.trim())return t;let r=0;function n(e){let n;const i=e.exec(t.substring(r));return i?(n=i[0],r+=n.length,n):""}const i=[];for(;n(Ao),!(r>=t.length);){let o=n(Oo);if(","===o.slice(-1))o=Po(e,o.substring(0,o.length-1)),i.push(o);else{let n="";o=Po(e,o);let s=!1;for(;;){const e=t.charAt(r);if(""===e){i.push((o+n).trim());break}if(s)")"===e&&(s=!1);else{if(","===e){r+=1,i.push((o+n).trim());break}"("===e&&(s=!0)}n+=e,r+=1}}}return i.join(", ")}(e,n):"style"===r?wo(n,_o(e)):"object"===t&&"data"===r?Po(e,n):n:Po(e,n):n}function No(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function Lo(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&Lo(ro.parentNode(e),t,r);for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!!r&&Lo(ro.parentNode(e),t,r)}function Do(e,t,r,n){let i;if(no(e)){if(i=e,!ro.childNodes(i).length)return!1}else{if(null===ro.parentElement(e))return!1;i=ro.parentElement(e)}try{if("string"==typeof t){if(n){if(i.closest(`.${t}`))return!0}else if(i.classList.contains(t))return!0}else if(Lo(i,t,n))return!0;if(r)if(n){if(i.closest(r))return!0}else if(i.matches(r))return!0}catch(e){}return!1}function Fo(e,t){const{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:s,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:u,maskInputFn:c,dataURLOptions:h={},inlineImages:d,recordCanvas:p,keepIframeSrcFn:f,newlyAddedElement:g=!1,cssCaptured:m=!1}=t,v=function(e,t){if(!t.hasNode(e))return;const r=t.getId(e);return 1===r?void 0:r}(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:Yi.Document,childNodes:[],compatMode:e.compatMode}:{type:Yi.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:Yi.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:v};case e.ELEMENT_NODE:return function(e,t){const{doc:r,blockClass:n,blockSelector:i,inlineStylesheet:o,maskInputOptions:s={},maskInputFn:a,dataURLOptions:l={},inlineImages:u,recordCanvas:c,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,i),g=function(e){if(e instanceof HTMLFormElement)return"form";const t=co(e.tagName);return Io.test(t)?"div":t}(e);let m={};const v=e.attributes.length;for(let t=0;t<v;t++){const n=e.attributes[t];No(g,n.name,n.value)||(m[n.name]=To(r,g,co(n.name),n.value))}if("link"===g&&o){const t=Array.from(r.styleSheets).find((t=>t.href===e.href));let n=null;t&&(n=so(t)),n&&(delete m.rel,delete m.href,m._cssText=n)}if("style"===g&&e.sheet){let t=so(e.sheet);t&&(e.childNodes.length>1&&(t=So(t,e)),m._cssText=t)}if("input"===g||"textarea"===g||"select"===g){const t=e.value,r=e.checked;"radio"!==m.type&&"checkbox"!==m.type&&"submit"!==m.type&&"button"!==m.type&&t?m.value=uo({element:e,type:po(e),tagName:g,value:t,maskInputOptions:s,maskInputFn:a}):r&&(m.checked=r)}"option"===g&&(e.selected&&!s.select?m.selected=!0:delete m.selected);"dialog"===g&&e.open&&(m.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal");if("canvas"===g&&c)if("2d"===e.__context)(function(e){const t=e.getContext("2d");if(!t)return!0;for(let r=0;r<e.width;r+=50)for(let n=0;n<e.height;n+=50){const i=t.getImageData,o=ho in i?i[ho]:i;if(new Uint32Array(o.call(t,r,n,Math.min(50,e.width-r),Math.min(50,e.height-n)).data.buffer).some((e=>0!==e)))return!1}return!0})(e)||(m.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)&&(m.rr_dataURL=t)}if("img"===g&&u){ko||(ko=r.createElement("canvas"),Eo=ko.getContext("2d"));const t=e,n=t.currentSrc||t.getAttribute("src")||"<unknown-src>",i=t.crossOrigin,o=()=>{t.removeEventListener("load",o);try{ko.width=t.naturalWidth,ko.height=t.naturalHeight,Eo.drawImage(t,0,0),m.rr_dataURL=ko.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&&(i?m.crossOrigin=i:t.removeAttribute("crossorigin"))};t.complete&&0!==t.naturalWidth?o():t.addEventListener("load",o)}if("audio"===g||"video"===g){const t=m;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&&(m.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(m.rr_scrollTop=e.scrollTop));if(f){const{width:t,height:r}=e.getBoundingClientRect();m={class:m.class,rr_width:`${t}px`,rr_height:`${r}px`}}"iframe"!==g||h(m.src)||(e.contentDocument||(m.rr_src=m.src),delete m.src);let y;try{customElements.get(g)&&(y=!0)}catch(e){}return{type:Yi.Element,tagName:g,attributes:m,childNodes:[],isSVG:Mo(e)||void 0,needBlock:f,rootId:p,isCustom:y}}(e,{doc:r,blockClass:i,blockSelector:o,inlineStylesheet:a,maskInputOptions:l,maskInputFn:c,dataURLOptions:h,inlineImages:d,recordCanvas:p,keepIframeSrcFn:f,newlyAddedElement:g,rootId:v});case e.TEXT_NODE:return function(e,t){const{needsMask:r,maskTextFn:n,rootId:i,cssCaptured:o}=t,s=ro.parentNode(e),a=s&&s.tagName;let l="";const u="STYLE"===a||void 0,c="SCRIPT"===a||void 0;c?l="SCRIPT_PLACEHOLDER":o||(l=ro.textContent(e),u&&l&&(l=wo(l,_o(t.doc))));!u&&!c&&l&&r&&(l=n?n(l,ro.parentElement(e)):l.replace(/[\S]/g,"*"));return{type:Yi.Text,textContent:l||"",rootId:i}}(e,{doc:r,needsMask:s,maskTextFn:u,rootId:v,cssCaptured:m});case e.CDATA_SECTION_NODE:return{type:Yi.CDATA,textContent:"",rootId:v};case e.COMMENT_NODE:return{type:Yi.Comment,textContent:ro.textContent(e)||"",rootId:v};default:return!1}}function Uo(e){return null==e?"":e.toLowerCase()}function jo(e,t){const{doc:r,mirror:n,blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:a,skipChild:l=!1,inlineStylesheet:u=!0,maskInputOptions:c={},maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:f={},inlineImages:g=!1,recordCanvas:m=!1,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:w=5e3,onStylesheetLoad:b,stylesheetLoadTimeout:S=5e3,keepIframeSrcFn:C=(()=>!1),newlyAddedElement:I=!1,cssCaptured:x=!1}=t;let{needsMask:k}=t,{preserveWhiteSpace:E=!0}=t;if(!k){k=Do(e,s,a,void 0===k)}const O=Fo(e,{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:k,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:d,dataURLOptions:f,inlineImages:g,recordCanvas:m,keepIframeSrcFn:C,newlyAddedElement:I,cssCaptured:x});if(!O)return console.warn(e,"not serialized"),null;let A;A=n.hasNode(e)?n.getId(e):function(e,t){if(t.comment&&e.type===Yi.Comment)return!0;if(e.type===Yi.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"===fo(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(Uo(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Uo(e.attributes.name)||"icon"===Uo(e.attributes.rel)||"apple-touch-icon"===Uo(e.attributes.rel)||"shortcut icon"===Uo(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&Uo(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Uo(e.attributes.property).match(/^(og|twitter|fb):/)||Uo(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===Uo(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===Uo(e.attributes.name)||"googlebot"===Uo(e.attributes.name)||"bingbot"===Uo(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===Uo(e.attributes.name)||"generator"===Uo(e.attributes.name)||"framework"===Uo(e.attributes.name)||"publisher"===Uo(e.attributes.name)||"progid"===Uo(e.attributes.name)||Uo(e.attributes.property).match(/^article:/)||Uo(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===Uo(e.attributes.name)||"yandex-verification"===Uo(e.attributes.name)||"csrf-token"===Uo(e.attributes.name)||"p:domain_verify"===Uo(e.attributes.name)||"verify-v1"===Uo(e.attributes.name)||"verification"===Uo(e.attributes.name)||"shopify-checkout-api-token"===Uo(e.attributes.name)))return!0}}return!1}(O,p)||!E&&O.type===Yi.Text&&!O.textContent.replace(/^\s+|\s+$/gm,"").length?-2:xo();const R=Object.assign(O,{id:A});if(n.add(e,R),-2===A)return null;v&&v(e);let P=!l;if(R.type===Yi.Element){P=P&&!R.needBlock,delete R.needBlock;const t=ro.shadowRoot(e);t&&oo(t)&&(R.isShadowHost=!0)}if((R.type===Yi.Document||R.type===Yi.Element)&&P){p.headWhitespace&&R.type===Yi.Element&&"head"===R.tagName&&(E=!1);const t={doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:k,maskTextClass:s,maskTextSelector:a,skipChild:l,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:f,inlineImages:g,recordCanvas:m,preserveWhiteSpace:E,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:w,onStylesheetLoad:b,stylesheetLoadTimeout:S,keepIframeSrcFn:C,cssCaptured:!1};if(R.type===Yi.Element&&"textarea"===R.tagName&&void 0!==R.attributes.value);else{R.type===Yi.Element&&void 0!==R.attributes._cssText&&"string"==typeof R.attributes._cssText&&(t.cssCaptured=!0);for(const r of Array.from(ro.childNodes(e))){const e=jo(r,t);e&&R.childNodes.push(e)}}let I=null;if(no(e)&&(I=ro.shadowRoot(e)))for(const e of Array.from(ro.childNodes(I))){const r=jo(e,t);r&&(oo(I)&&(r.isShadow=!0),R.childNodes.push(r))}}const M=ro.parentNode(e);return M&&io(M)&&oo(M)&&(R.isShadow=!0),R.type===Yi.Element&&"iframe"===R.tagName&&function(e,t,r){const n=e.contentWindow;if(!n)return;let i,o=!1;try{i=n.document.readyState}catch(e){return}if("complete"!==i){const n=setTimeout((()=>{o||(t(),o=!0)}),r);return void e.addEventListener("load",(()=>{clearTimeout(n),o=!0,t()}))}const s="about:blank";if(n.location.href!==s||e.src===s||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}(e,(()=>{const t=e.contentDocument;if(t&&y){const r=jo(t,{doc:t,mirror:n,blockClass:i,blockSelector:o,needsMask:k,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:f,inlineImages:g,recordCanvas:m,preserveWhiteSpace:E,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:w,onStylesheetLoad:b,stylesheetLoadTimeout:S,keepIframeSrcFn:C});r&&y(e,r)}}),w),R.type===Yi.Element&&"link"===R.tagName&&"string"==typeof R.attributes.rel&&("stylesheet"===R.attributes.rel||"preload"===R.attributes.rel&&"string"==typeof R.attributes.href&&"css"===fo(R.attributes.href))&&function(e,t,r){let n,i=!1;try{n=e.sheet}catch(e){return}if(n)return;const o=setTimeout((()=>{i||(t(),i=!0)}),r);e.addEventListener("load",(()=>{clearTimeout(o),i=!0,t()}))}(e,(()=>{if(b){const t=jo(e,{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:k,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:f,inlineImages:g,recordCanvas:m,preserveWhiteSpace:E,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:w,onStylesheetLoad:b,stylesheetLoadTimeout:S,keepIframeSrcFn:C});t&&b(e,t)}}),S),R}function Bo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function zo(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 Vo={exports:{}},Wo=String,qo=function(){return{isColorSupported:!1,reset:Wo,bold:Wo,dim:Wo,italic:Wo,underline:Wo,inverse:Wo,hidden:Wo,strikethrough:Wo,black:Wo,red:Wo,green:Wo,yellow:Wo,blue:Wo,magenta:Wo,cyan:Wo,white:Wo,gray:Wo,bgBlack:Wo,bgRed:Wo,bgGreen:Wo,bgYellow:Wo,bgBlue:Wo,bgMagenta:Wo,bgCyan:Wo,bgWhite:Wo}};Vo.exports=qo(),Vo.exports.createColors=qo;var Go=Vo.exports;const Ko=zo(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let Yo=Go,Zo=Ko,Jo=class e extends Error{constructor(t,r,n,i,o,s){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),i&&(this.source=i),s&&(this.plugin=s),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=Yo.isColorSupported),Zo&&e&&(t=Zo(t));let r,n,i=t.split(/\r?\n/),o=Math.max(this.line-3,0),s=Math.min(this.line+2,i.length),a=String(s).length;if(e){let{bold:e,gray:t,red:i}=Yo.createColors(!0);r=t=>e(i(t)),n=e=>t(e)}else r=n=e=>e;return i.slice(o,s).map(((e,t)=>{let i=o+1+t,s=" "+(" "+i).slice(-a)+" | ";if(i===this.line){let t=n(s.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return r(">")+n(s)+e+"\n "+t+r("^")}return" "+n(s)+e})).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};var $o=Jo;Jo.default=Jo;var Xo={};Xo.isClean=Symbol("isClean"),Xo.my=Symbol("my");const Ho={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let Qo=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 i=(e.raws.between||"")+(t?";":"");this.builder(r+n+i,e)}}beforeAfter(e,t){let r;r="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let n=e.parent,i=0;for(;n&&"root"!==n.type;)i+=1,n=n.parent;if(r.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<i;e++)r+=t}return r}block(e,t){let r,n=this.raw(e,"between","beforeOpen");this.builder(t+n+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),r=this.raw(e,"after")):r=this.raw(e,"after","emptyBody"),r&&this.builder(r),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let r=this.raw(e,"semicolon");for(let n=0;n<e.nodes.length;n++){let i=e.nodes[n],o=this.raw(i,"before");o&&this.builder(o),this.stringify(i,t!==n||r)}}comment(e){let t=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)}decl(e,t){let r=this.raw(e,"between","colon"),n=e.prop+r+this.rawValue(e,"value");e.important&&(n+=e.raws.important||" !important"),t&&(n+=";"),this.builder(n,e)}document(e){this.body(e)}raw(e,t,r){let n;if(r||(r=t),t&&(n=e.raws[t],void 0!==n))return n;let i=e.parent;if("before"===r){if(!i||"root"===i.type&&i.first===e)return"";if(i&&"document"===i.type)return""}if(!i)return Ho[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 i="raw"+((s=r)[0].toUpperCase()+s.slice(1));this[i]?n=this[i](o,e):o.walk((e=>{if(n=e.raws[t],void 0!==n)return!1}))}var s;return void 0===n&&(n=Ho[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 es=Qo;Qo.default=Qo;let ts=es;function rs(e,t){new ts(t).stringify(e)}var ns=rs;rs.default=rs;let{isClean:is,my:os}=Xo,ss=$o,as=es,ls=ns;function us(e,t){let r=new e.constructor;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if("proxyCache"===n)continue;let i=e[n],o=typeof i;"parent"===n&&"object"===o?t&&(r[n]=t):"source"===n?r[n]=i:Array.isArray(i)?r[n]=i.map((e=>us(e,r))):("object"===o&&null!==i&&(i=us(i)),r[n]=i)}return r}let cs=class{constructor(e={}){this.raws={},this[is]=!1,this[os]=!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=us(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 ss(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[is]){this[is]=!1;let e=this;for(;e=e.parent;)e[is]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){let n=(t=this.toString()).indexOf(e.word);-1!==n&&(r=this.positionInside(n,t))}return r}positionInside(e,t){let r=t||this.toString(),n=this.source.start.column,i=this.source.start.line;for(let t=0;t<e;t++)"\n"===r[t]?(n=1,i+=1):n+=1;return{column:n,line:i}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let n=this.toString(),i=n.indexOf(e.word);-1!==i&&(t=this.positionInside(i,n),r=this.positionInside(i+e.word.length,n))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return(new as).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let n of e)n===this?r=!0:r?(this.parent.insertAfter(t,n),t=n):this.parent.insertBefore(t,n);r||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let r={},n=null==t;t=t||new Map;let i=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let n=this[e];if(Array.isArray(n))r[e]=n.map((e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e));else if("object"==typeof n&&n.toJSON)r[e]=n.toJSON(null,t);else if("source"===e){let o=t.get(n.input);null==o&&(o=i,t.set(n.input,i),i++),r[e]={end:n.end,inputId:o,start:n.start}}else r[e]=n}return n&&(r.inputs=[...t.keys()].map((e=>e.toJSON()))),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=ls){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 hs=cs;cs.default=cs;let ds=hs,ps=class extends ds{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 fs=ps;ps.default=ps;var gs={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(r=t)=>{let n="",i=r;for(;i--;)n+=e[Math.random()*e.length|0];return n}};let{SourceMapConsumer:ms,SourceMapGenerator:vs}=Ko,{existsSync:ys,readFileSync:ws}=Ko,{dirname:bs,join:Ss}=Ko;let Cs=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=bs(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new ms(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t;let r=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+r)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let r=e.lastIndexOf(t.pop()),n=e.indexOf("*/",r);r>-1&&n>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,n)))}loadFile(e){if(this.root=bs(e),ys(e))return this.mapFile=e,ws(e,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof ms)return vs.fromSourceMap(t).toString();if(t instanceof vs)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=Ss(bs(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 Is=Cs;Cs.default=Cs;let{SourceMapConsumer:xs,SourceMapGenerator:ks}=Ko,{fileURLToPath:Es,pathToFileURL:Os}=Ko,{isAbsolute:As,resolve:Rs}=Ko,{nanoid:Ps}=gs,Ms=Ko,_s=$o,Ts=Is,Ns=Symbol("fromOffsetCache"),Ls=Boolean(xs&&ks),Ds=Boolean(Rs&&As),Fs=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&&(!Ds||/^\w+:\/\//.test(t.from)||As(t.from)?this.file=t.from:this.file=Rs(t.from)),Ds&&Ls){let e=new Ts(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 "+Ps(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let i,o,s;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,s=e.col}else o=n.line,s=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let a=this.origin(t,r,o,s);return i=a?new _s(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 _s(e,void 0===o?t:{column:r,line:t},void 0===o?r:{column:s,line:o},this.css,this.file,n.plugin),i.input={column:r,endColumn:s,endLine:o,line:t,source:this.css},this.file&&(Os&&(i.input.url=Os(this.file).toString()),i.input.file=this.file),i}fromOffset(e){let t,r;if(this[Ns])r=this[Ns];else{let e=this.css.split("\n");r=new Array(e.length);let t=0;for(let n=0,i=e.length;n<i;n++)r[n]=t,t+=e[n].length+1;this[Ns]=r}t=r[r.length-1];let n=0;if(e>=t)n=r.length-1;else{let t,i=r.length-2;for(;n<i;)if(t=n+(i-n>>1),e<r[t])i=t-1;else{if(!(e>=r[t+1])){n=t;break}n=t+1}}return{col:e-r[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:Rs(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,n){if(!this.map)return!1;let i,o,s=this.map.consumer(),a=s.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof r&&(i=s.originalPositionFor({column:n,line:r})),o=As(a.source)?Os(a.source):new URL(a.source,this.map.consumer().sourceRoot||Os(this.map.mapFile));let l={column:a.column,endColumn:i&&i.column,endLine:i&&i.line,line:a.line,url:o.toString()};if("file:"===o.protocol){if(!Es)throw new Error("file: protocol is not available in this PostCSS build");l.file=Es(o)}let u=s.sourceContentFor(a.source);return u&&(l.source=u),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 Us=Fs;Fs.default=Fs,Ms&&Ms.registerInput&&Ms.registerInput(Fs);let{SourceMapConsumer:js,SourceMapGenerator:Bs}=Ko,{dirname:zs,relative:Vs,resolve:Ws,sep:qs}=Ko,{pathToFileURL:Gs}=Ko,Ks=Us,Ys=Boolean(js&&Bs),Zs=Boolean(zs&&Ws&&Vs&&qs);var Js=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t,r=this.toUrl(this.path(e.file)),n=e.root||zs(e.file);!1===this.mapOpts.sourcesContent?(t=new js(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(),Zs&&Ys&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,(t=>{e+=t})),[e]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=Bs.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new Bs({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 Bs({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,r=1,n=1,i="<no source>",o={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,((s,a,l)=>{if(this.css+=s,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=i,o.original.line=1,o.original.column=0,this.map.addMapping(o))),e=s.match(/\n/g),e?(r+=e.length,t=s.lastIndexOf("\n"),n=s.length-t):n+=s.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=i,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?zs(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=zs(Ws(r,this.mapOpts.annotation)));let n=Vs(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 Ks(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk((t=>{if(t.source){let r=t.source.input.from;if(r&&!e[r]){e[r]=!0;let n=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(n,t.source.input.css)}}}));else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(Gs){let t=Gs(e).toString();return this.memoizedFileURLs.set(e,t),t}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;"\\"===qs&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let $s=hs,Xs=class extends $s{constructor(e){super(e),this.type="comment"}};var Hs=Xs;Xs.default=Xs;let Qs,ea,ta,ra,{isClean:na,my:ia}=Xo,oa=fs,sa=Hs,aa=hs;function la(e){return e.map((e=>(e.nodes&&(e.nodes=la(e.nodes)),delete e.source,e)))}function ua(e){if(e[na]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)ua(t)}let ca=class e extends aa{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,r,n=this.getIterator();for(;this.indexes[n]<this.proxyOf.nodes.length&&(t=this.indexes[n],r=e(this.proxyOf.nodes[t],t),!1!==r);)this.indexes[n]+=1;return delete this.indexes[n],r}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...r)=>e[t](...r.map((e=>"function"==typeof e?(t,r)=>e(t.toProxy(),r):e))):"every"===t||"some"===t?r=>e[t](((e,...t)=>r(e.toProxy(),...t))):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map((e=>e.toProxy())):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let r,n=this.index(e),i=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let e of i)this.proxyOf.nodes.splice(n+1,0,e);for(let e in this.indexes)r=this.indexes[e],n<r&&(this.indexes[e]=r+i.length);return this.markDirty(),this}insertBefore(e,t){let r,n=this.index(e),i=0===n&&"prepend",o=this.normalize(t,this.proxyOf.nodes[n],i).reverse();n=this.index(e);for(let e of o)this.proxyOf.nodes.splice(n,0,e);for(let e in this.indexes)r=this.indexes[e],n<=r&&(this.indexes[e]=r+o.length);return this.markDirty(),this}normalize(t,r){if("string"==typeof t)t=la(Qs(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 oa(t)]}else if(t.selector)t=[new ea(t)];else if(t.name)t=[new ta(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new sa(t)]}return t.map((t=>(t[ia]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[na]&&ua(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]}};ca.registerParse=e=>{Qs=e},ca.registerRule=e=>{ea=e},ca.registerAtRule=e=>{ta=e},ca.registerRoot=e=>{ra=e};var ha=ca;ca.default=ca,ca.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,ta.prototype):"rule"===e.type?Object.setPrototypeOf(e,ea.prototype):"decl"===e.type?Object.setPrototypeOf(e,oa.prototype):"comment"===e.type?Object.setPrototypeOf(e,sa.prototype):"root"===e.type&&Object.setPrototypeOf(e,ra.prototype),e[ia]=!0,e.nodes&&e.nodes.forEach((e=>{ca.rebuild(e)}))};let da,pa,fa=ha,ga=class extends fa{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new da(new pa,this,e).stringify()}};ga.registerLazyResult=e=>{da=e},ga.registerProcessor=e=>{pa=e};var ma=ga;ga.default=ga;let va={};var ya=function(e){va[e]||(va[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let wa=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 ba=wa;wa.default=wa;let Sa=ba,Ca=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 Sa(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter((e=>"warning"===e.type))}get content(){return this.css}};var Ia=Ca;Ca.default=Ca;const xa="'".charCodeAt(0),ka='"'.charCodeAt(0),Ea="\\".charCodeAt(0),Oa="/".charCodeAt(0),Aa="\n".charCodeAt(0),Ra=" ".charCodeAt(0),Pa="\f".charCodeAt(0),Ma="\t".charCodeAt(0),_a="\r".charCodeAt(0),Ta="[".charCodeAt(0),Na="]".charCodeAt(0),La="(".charCodeAt(0),Da=")".charCodeAt(0),Fa="{".charCodeAt(0),Ua="}".charCodeAt(0),ja=";".charCodeAt(0),Ba="*".charCodeAt(0),za=":".charCodeAt(0),Va="@".charCodeAt(0),Wa=/[\t\n\f\r "#'()/;[\\\]{}]/g,qa=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Ga=/.[\r\n"'(/\\]/,Ka=/[\da-f]/i;let Ya=ha,Za=class extends Ya{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 Ja=Za;Za.default=Za,Ya.registerAtRule(Za);let $a,Xa,Ha=ha,Qa=class extends Ha{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 $a(new Xa,this,e).stringify()}};Qa.registerLazyResult=e=>{$a=e},Qa.registerProcessor=e=>{Xa=e};var el=Qa;Qa.default=Qa,Ha.registerRoot(Qa);let tl={comma:e=>tl.split(e,[","],!0),space:e=>tl.split(e,[" ","\n","\t"]),split(e,t,r){let n=[],i="",o=!1,s=0,a=!1,l="",u=!1;for(let r of e)u?u=!1:"\\"===r?u=!0:a?r===l&&(a=!1):'"'===r||"'"===r?(a=!0,l=r):"("===r?s+=1:")"===r?s>0&&(s-=1):0===s&&t.includes(r)&&(o=!0),o?(""!==i&&n.push(i.trim()),i="",o=!1):i+=r;return(r||""!==i)&&n.push(i.trim()),n}};var rl=tl;tl.default=tl;let nl=ha,il=rl,ol=class extends nl{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return il.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 sl=ol;ol.default=ol,nl.registerRule(ol);let al=fs,ll=function(e,t={}){let r,n,i,o,s,a,l,u,c,h,d=e.css.valueOf(),p=t.ignoreErrors,f=d.length,g=0,m=[],v=[];function y(t){throw e.error("Unclosed "+t,g)}return{back:function(e){v.push(e)},endOfFile:function(){return 0===v.length&&g>=f},nextToken:function(e){if(v.length)return v.pop();if(g>=f)return;let t=!!e&&e.ignoreUnclosed;switch(r=d.charCodeAt(g),r){case Aa:case Ra:case Ma:case _a:case Pa:n=g;do{n+=1,r=d.charCodeAt(n)}while(r===Ra||r===Aa||r===Ma||r===_a||r===Pa);h=["space",d.slice(g,n)],g=n-1;break;case Ta:case Na:case Fa:case Ua:case za:case ja:case Da:{let e=String.fromCharCode(r);h=[e,e,g];break}case La:if(u=m.length?m.pop()[1]:"",c=d.charCodeAt(g+1),"url"===u&&c!==xa&&c!==ka&&c!==Ra&&c!==Aa&&c!==Ma&&c!==Pa&&c!==_a){n=g;do{if(a=!1,n=d.indexOf(")",n+1),-1===n){if(p||t){n=g;break}y("bracket")}for(l=n;d.charCodeAt(l-1)===Ea;)l-=1,a=!a}while(a);h=["brackets",d.slice(g,n+1),g,n],g=n}else n=d.indexOf(")",g+1),o=d.slice(g,n+1),-1===n||Ga.test(o)?h=["(","(",g]:(h=["brackets",o,g,n],g=n);break;case xa:case ka:i=r===xa?"'":'"',n=g;do{if(a=!1,n=d.indexOf(i,n+1),-1===n){if(p||t){n=g+1;break}y("string")}for(l=n;d.charCodeAt(l-1)===Ea;)l-=1,a=!a}while(a);h=["string",d.slice(g,n+1),g,n],g=n;break;case Va:Wa.lastIndex=g+1,Wa.test(d),n=0===Wa.lastIndex?d.length-1:Wa.lastIndex-2,h=["at-word",d.slice(g,n+1),g,n],g=n;break;case Ea:for(n=g,s=!0;d.charCodeAt(n+1)===Ea;)n+=1,s=!s;if(r=d.charCodeAt(n+1),s&&r!==Oa&&r!==Ra&&r!==Aa&&r!==Ma&&r!==_a&&r!==Pa&&(n+=1,Ka.test(d.charAt(n)))){for(;Ka.test(d.charAt(n+1));)n+=1;d.charCodeAt(n+1)===Ra&&(n+=1)}h=["word",d.slice(g,n+1),g,n],g=n;break;default:r===Oa&&d.charCodeAt(g+1)===Ba?(n=d.indexOf("*/",g+2)+1,0===n&&(p||t?n=d.length:y("comment")),h=["comment",d.slice(g,n+1),g,n],g=n):(qa.lastIndex=g+1,qa.test(d),n=0===qa.lastIndex?d.length-1:qa.lastIndex-2,h=["word",d.slice(g,n+1),g,n],m.push(h),g=n)}return g++,h},position:function(){return g}}},ul=Hs,cl=Ja,hl=el,dl=sl;const pl={empty:!0,space:!0};var fl=class{constructor(e){this.input=e,this.root=new hl,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,i=new cl;i.name=e[1].slice(1),""===i.name&&this.unnamedAtrule(i,e),this.init(i,e[2]);let o=!1,s=!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){i.source.end=this.getPosition(e[2]),i.source.end.offset++,this.semicolon=!0;break}if("{"===t){s=!0;break}if("}"===t){if(a.length>0){for(n=a.length-1,r=a[n];r&&"space"===r[0];)r=a[--n];r&&(i.source.end=this.getPosition(r[3]||r[2]),i.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}i.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(i.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(i,"params",a),o&&(e=a[a.length-1],i.source.end=this.getPosition(e[3]||e[2]),i.source.end.offset++,this.spaces=i.raws.between,i.raws.between="")):(i.raws.afterName="",i.params=""),s&&(i.nodes=[],this.current=i)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let r,n=0;for(let i=t-1;i>=0&&(r=e[i],"space"===r[0]||(n+=1,2!==n));i--);throw this.input.error("Missed semicolon","word"===r[0]?r[3]+1:r[2])}colon(e){let t,r,n,i=0;for(let[o,s]of e.entries()){if(t=s,r=t[0],"("===r&&(i+=1),")"===r&&(i-=1),0===i&&":"===r){if(n){if("word"===n[0]&&"progid"===n[1])continue;return o}this.doubleColon(t)}n=t}return!1}comment(e){let t=new ul;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=ll(this.input)}decl(e,t){let r=new al;this.init(r,e[0][2]);let n,i=e[e.length-1];for(";"===i[0]&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(i[3]||i[2]||function(e){for(let t=e.length-1;t>=0;t--){let r=e[t],n=r[3]||r[2];if(n)return n}}(e)),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,s=[];for(;e.length&&(o=e[0][0],"space"===o||"comment"===o);)s.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),i="";for(let e=t;e>0;e--){let t=n[e][0];if(0===i.trim().indexOf("!")&&"space"!==t)break;i=n.pop()[1]+i}0===i.trim().indexOf("!")&&(r.important=!0,r.raws.important=i,e=n)}if("space"!==n[0]&&"comment"!==n[0])break}e.some((e=>"space"!==e[0]&&"comment"!==e[0]))&&(r.raws.between+=s.map((e=>e[1])).join(""),s=[]),this.raw(r,"value",s.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 dl;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,r=null,n=!1,i=null,o=[],s=e[1].startsWith("--"),a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)i||(i=l),o.push("("===r?")":"]");else if(s&&n&&"{"===r)i||(i=l),o.push("}");else if(0===o.length){if(";"===r){if(n)return void this.decl(a,s);break}if("{"===r)return void this.rule(a);if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}":"===r&&(n=!0)}else r===o[o.length-1]&&(o.pop(),0===o.length&&(i=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(i),t&&n){if(!s)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,s)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,r,n){let i,o,s,a,l=r.length,u="",c=!0;for(let e=0;e<l;e+=1)i=r[e],o=i[0],"space"!==o||e!==l-1||n?"comment"===o?(a=r[e-1]?r[e-1][0]:"empty",s=r[e+1]?r[e+1][0]:"empty",pl[a]||pl[s]||","===u.slice(-1)?c=!1:u+=i[1]):u+=i[1]:c=!1;if(!c){let n=r.reduce(((e,t)=>e+t[1]),"");e.raws[t]={raw:n,value:u}}e[t]=u}rule(e){e.pop();let t=new dl;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 gl=ha,ml=fl,vl=Us;function yl(e,t){let r=new vl(e,t),n=new ml(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 wl=yl;yl.default=yl,gl.registerParse(yl);let{isClean:bl,my:Sl}=Xo,Cl=Js,Il=ns,xl=ha,kl=ma,El=ya,Ol=Ia,Al=wl,Rl=el;const Pl={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Ml={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},_l={Once:!0,postcssPlugin:!0,prepare:!0};function Tl(e){return"object"==typeof e&&"function"==typeof e.then}function Nl(e){let t=!1,r=Pl[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 Ll(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:Nl(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function Dl(e){return e[bl]=!1,e.nodes&&e.nodes.forEach((e=>Dl(e))),e}let Fl={},Ul=class e{constructor(t,r,n){let i;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof e||r instanceof Ol)i=Dl(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=Al;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{i=e(r,n)}catch(e){this.processed=!0,this.error=e}i&&!i[Sl]&&xl.rebuild(i)}else i=Dl(r);this.result=new Ol(t,i,n),this.helpers={...Fl,postcss:Fl,result:this.result},this.plugins=this.processor.plugins.map((e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e))}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let r=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(r.postcssVersion&&"production"!==process.env.NODE_ENV){let e=r.postcssPlugin,t=r.postcssVersion,n=this.result.processor.version,i=t.split("."),o=n.split(".");(i[0]!==o[0]||parseInt(i[1])>parseInt(o[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+n+", but "+e+" uses "+t+". Perhaps this is the source of the error below.")}}else e.plugin=r.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,r)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,r])};for(let t of this.plugins)if("object"==typeof t)for(let r in t){if(!Ml[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!_l[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(Tl(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[bl];){e[bl]=!0;let t=[Ll(e)];for(;t.length>0;){let e=this.visitTick(t);if(Tl(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 Tl(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=Il;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new Cl(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(Tl(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[bl];)e[bl]=!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||El("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(Tl(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,i]=n[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===n.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return i(r.toProxy(),this.helpers)}catch(e){throw this.handleError(e,r)}}if(0!==t.iterator){let n,i=t.iterator;for(;n=r.nodes[r.indexes[i]];)if(r.indexes[i]+=1,!n[bl])return n[bl]=!0,void e.push(Ll(n));t.iterator=0,delete r.indexes[i]}let i=t.events;for(;t.eventIndex<i.length;){let e=i[t.eventIndex];if(t.eventIndex+=1,0===e)return void(r.nodes&&r.nodes.length&&(r[bl]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[bl]=!0;let t=Nl(e);for(let r of t)if(0===r)e.nodes&&e.each((e=>{e[bl]||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"}};Ul.registerPostcss=e=>{Fl=e};var jl=Ul;Ul.default=Ul,Rl.registerLazyResult(Ul),kl.registerLazyResult(Ul);let Bl=Js,zl=ns,Vl=ya,Wl=wl;const ql=Ia;let Gl=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 i=zl;this.result=new ql(this._processor,n,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let s=new Bl(i,n,this._opts,t);if(s.isMap()){let[e,t]=s.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else s.clearAnnotation(),this.result.css=s.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||Vl("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=Wl;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 Kl=Gl;Gl.default=Gl;let Yl=Kl,Zl=jl,Jl=ma,$l=el,Xl=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 Zl(this,e,t):new Yl(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var Hl=Xl;Xl.default=Xl,$l.registerProcessor(Xl),Jl.registerProcessor(Xl);let Ql=fs,eu=Is,tu=Hs,ru=Ja,nu=Us,iu=el,ou=sl;function su(e,t){if(Array.isArray(e))return e.map((e=>su(e)));let{inputs:r,...n}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:nu.prototype};r.map&&(r.map={...r.map,__proto__:eu.prototype}),t.push(r)}}if(n.nodes&&(n.nodes=e.nodes.map((e=>su(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 iu(n);if("decl"===n.type)return new Ql(n);if("rule"===n.type)return new ou(n);if("comment"===n.type)return new tu(n);if("atrule"===n.type)return new ru(n);throw new Error("Unknown node type: "+e.type)}var au=su;su.default=su;let lu=$o,uu=fs,cu=jl,hu=ha,du=Hl,pu=ns,fu=au,gu=ma,mu=ba,vu=Hs,yu=Ja,wu=Ia,bu=Us,Su=wl,Cu=rl,Iu=sl,xu=el,ku=hs;function Eu(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new du(e)}Eu.plugin=function(e,t){let r,n=!1;function i(...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 i=t(...r);return i.postcssPlugin=e,i.postcssVersion=(new du).version,i}return Object.defineProperty(i,"postcss",{get:()=>(r||(r=i()),r)}),i.process=function(e,t,r){return Eu([i(r)]).process(e,t)},i},Eu.stringify=pu,Eu.parse=Su,Eu.fromJSON=fu,Eu.list=Cu,Eu.comment=e=>new vu(e),Eu.atRule=e=>new yu(e),Eu.decl=e=>new uu(e),Eu.rule=e=>new Iu(e),Eu.root=e=>new xu(e),Eu.document=e=>new gu(e),Eu.CssSyntaxError=lu,Eu.Declaration=uu,Eu.Container=hu,Eu.Processor=du,Eu.Document=gu,Eu.Comment=vu,Eu.Warning=mu,Eu.AtRule=yu,Eu.Result=wu,Eu.Input=bu,Eu.Rule=Iu,Eu.Root=xu,Eu.Node=ku,cu.registerPostcss(Eu);var Ou=Eu;Eu.default=Eu;const Au=Bo(Ou);Au.stringify,Au.fromJSON,Au.plugin,Au.parse,Au.list,Au.document,Au.comment,Au.atRule,Au.rule,Au.decl,Au.root,Au.CssSyntaxError,Au.Declaration,Au.Container,Au.Processor,Au.Document,Au.Comment,Au.Warning,Au.AtRule,Au.Result,Au.Input,Au.Rule,Au.Root,Au.Node;var Ru=Object.defineProperty,Pu=(e,t,r)=>((e,t,r)=>t in e?Ru(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);function Mu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function _u(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 Tu={exports:{}},Nu=String,Lu=function(){return{isColorSupported:!1,reset:Nu,bold:Nu,dim:Nu,italic:Nu,underline:Nu,inverse:Nu,hidden:Nu,strikethrough:Nu,black:Nu,red:Nu,green:Nu,yellow:Nu,blue:Nu,magenta:Nu,cyan:Nu,white:Nu,gray:Nu,bgBlack:Nu,bgRed:Nu,bgGreen:Nu,bgYellow:Nu,bgBlue:Nu,bgMagenta:Nu,bgCyan:Nu,bgWhite:Nu}};Tu.exports=Lu(),Tu.exports.createColors=Lu;var Du=Tu.exports;const Fu=_u(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let Uu=Du,ju=Fu,Bu=class e extends Error{constructor(t,r,n,i,o,s){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),i&&(this.source=i),s&&(this.plugin=s),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=Uu.isColorSupported),ju&&e&&(t=ju(t));let r,n,i=t.split(/\r?\n/),o=Math.max(this.line-3,0),s=Math.min(this.line+2,i.length),a=String(s).length;if(e){let{bold:e,gray:t,red:i}=Uu.createColors(!0);r=t=>e(i(t)),n=e=>t(e)}else r=n=e=>e;return i.slice(o,s).map(((e,t)=>{let i=o+1+t,s=" "+(" "+i).slice(-a)+" | ";if(i===this.line){let t=n(s.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return r(">")+n(s)+e+"\n "+t+r("^")}return" "+n(s)+e})).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};var zu=Bu;Bu.default=Bu;var Vu={};Vu.isClean=Symbol("isClean"),Vu.my=Symbol("my");const Wu={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let qu=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 i=(e.raws.between||"")+(t?";":"");this.builder(r+n+i,e)}}beforeAfter(e,t){let r;r="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let n=e.parent,i=0;for(;n&&"root"!==n.type;)i+=1,n=n.parent;if(r.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<i;e++)r+=t}return r}block(e,t){let r,n=this.raw(e,"between","beforeOpen");this.builder(t+n+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),r=this.raw(e,"after")):r=this.raw(e,"after","emptyBody"),r&&this.builder(r),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let r=this.raw(e,"semicolon");for(let n=0;n<e.nodes.length;n++){let i=e.nodes[n],o=this.raw(i,"before");o&&this.builder(o),this.stringify(i,t!==n||r)}}comment(e){let t=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)}decl(e,t){let r=this.raw(e,"between","colon"),n=e.prop+r+this.rawValue(e,"value");e.important&&(n+=e.raws.important||" !important"),t&&(n+=";"),this.builder(n,e)}document(e){this.body(e)}raw(e,t,r){let n;if(r||(r=t),t&&(n=e.raws[t],void 0!==n))return n;let i=e.parent;if("before"===r){if(!i||"root"===i.type&&i.first===e)return"";if(i&&"document"===i.type)return""}if(!i)return Wu[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 i="raw"+((s=r)[0].toUpperCase()+s.slice(1));this[i]?n=this[i](o,e):o.walk((e=>{if(n=e.raws[t],void 0!==n)return!1}))}var s;return void 0===n&&(n=Wu[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 Gu=qu;qu.default=qu;let Ku=Gu;function Yu(e,t){new Ku(t).stringify(e)}var Zu=Yu;Yu.default=Yu;let{isClean:Ju,my:$u}=Vu,Xu=zu,Hu=Gu,Qu=Zu;function ec(e,t){let r=new e.constructor;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if("proxyCache"===n)continue;let i=e[n],o=typeof i;"parent"===n&&"object"===o?t&&(r[n]=t):"source"===n?r[n]=i:Array.isArray(i)?r[n]=i.map((e=>ec(e,r))):("object"===o&&null!==i&&(i=ec(i)),r[n]=i)}return r}let tc=class{constructor(e={}){this.raws={},this[Ju]=!1,this[$u]=!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=ec(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 Xu(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[Ju]){this[Ju]=!1;let e=this;for(;e=e.parent;)e[Ju]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){let n=(t=this.toString()).indexOf(e.word);-1!==n&&(r=this.positionInside(n,t))}return r}positionInside(e,t){let r=t||this.toString(),n=this.source.start.column,i=this.source.start.line;for(let t=0;t<e;t++)"\n"===r[t]?(n=1,i+=1):n+=1;return{column:n,line:i}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let n=this.toString(),i=n.indexOf(e.word);-1!==i&&(t=this.positionInside(i,n),r=this.positionInside(i+e.word.length,n))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return(new Hu).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let n of e)n===this?r=!0:r?(this.parent.insertAfter(t,n),t=n):this.parent.insertBefore(t,n);r||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let r={},n=null==t;t=t||new Map;let i=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let n=this[e];if(Array.isArray(n))r[e]=n.map((e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e));else if("object"==typeof n&&n.toJSON)r[e]=n.toJSON(null,t);else if("source"===e){let o=t.get(n.input);null==o&&(o=i,t.set(n.input,i),i++),r[e]={end:n.end,inputId:o,start:n.start}}else r[e]=n}return n&&(r.inputs=[...t.keys()].map((e=>e.toJSON()))),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=Qu){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 rc=tc;tc.default=tc;let nc=rc,ic=class extends nc{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 oc=ic;ic.default=ic;var sc={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(r=t)=>{let n="",i=r;for(;i--;)n+=e[Math.random()*e.length|0];return n}};let{SourceMapConsumer:ac,SourceMapGenerator:lc}=Fu,{existsSync:uc,readFileSync:cc}=Fu,{dirname:hc,join:dc}=Fu;let pc=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=hc(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new ac(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=hc(e),uc(e))return this.mapFile=e,cc(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 ac)return lc.fromSourceMap(t).toString();if(t instanceof lc)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=dc(hc(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 fc=pc;pc.default=pc;let{SourceMapConsumer:gc,SourceMapGenerator:mc}=Fu,{fileURLToPath:vc,pathToFileURL:yc}=Fu,{isAbsolute:wc,resolve:bc}=Fu,{nanoid:Sc}=sc,Cc=Fu,Ic=zu,xc=fc,kc=Symbol("fromOffsetCache"),Ec=Boolean(gc&&mc),Oc=Boolean(bc&&wc),Ac=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&&(!Oc||/^\w+:\/\//.test(t.from)||wc(t.from)?this.file=t.from:this.file=bc(t.from)),Oc&&Ec){let e=new xc(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 "+Sc(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let i,o,s;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,s=e.col}else o=n.line,s=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let a=this.origin(t,r,o,s);return i=a?new Ic(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 Ic(e,void 0===o?t:{column:r,line:t},void 0===o?r:{column:s,line:o},this.css,this.file,n.plugin),i.input={column:r,endColumn:s,endLine:o,line:t,source:this.css},this.file&&(yc&&(i.input.url=yc(this.file).toString()),i.input.file=this.file),i}fromOffset(e){let t,r;if(this[kc])r=this[kc];else{let e=this.css.split("\n");r=new Array(e.length);let t=0;for(let n=0,i=e.length;n<i;n++)r[n]=t,t+=e[n].length+1;this[kc]=r}t=r[r.length-1];let n=0;if(e>=t)n=r.length-1;else{let t,i=r.length-2;for(;n<i;)if(t=n+(i-n>>1),e<r[t])i=t-1;else{if(!(e>=r[t+1])){n=t;break}n=t+1}}return{col:e-r[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:bc(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,n){if(!this.map)return!1;let i,o,s=this.map.consumer(),a=s.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof r&&(i=s.originalPositionFor({column:n,line:r})),o=wc(a.source)?yc(a.source):new URL(a.source,this.map.consumer().sourceRoot||yc(this.map.mapFile));let l={column:a.column,endColumn:i&&i.column,endLine:i&&i.line,line:a.line,url:o.toString()};if("file:"===o.protocol){if(!vc)throw new Error("file: protocol is not available in this PostCSS build");l.file=vc(o)}let u=s.sourceContentFor(a.source);return u&&(l.source=u),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 Rc=Ac;Ac.default=Ac,Cc&&Cc.registerInput&&Cc.registerInput(Ac);let{SourceMapConsumer:Pc,SourceMapGenerator:Mc}=Fu,{dirname:_c,relative:Tc,resolve:Nc,sep:Lc}=Fu,{pathToFileURL:Dc}=Fu,Fc=Rc,Uc=Boolean(Pc&&Mc),jc=Boolean(_c&&Nc&&Tc&&Lc);var Bc=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||_c(e.file);!1===this.mapOpts.sourcesContent?(t=new Pc(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(),jc&&Uc&&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=Mc.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new Mc({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 Mc({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,r=1,n=1,i="<no source>",o={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,((s,a,l)=>{if(this.css+=s,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=i,o.original.line=1,o.original.column=0,this.map.addMapping(o))),e=s.match(/\n/g),e?(r+=e.length,t=s.lastIndexOf("\n"),n=s.length-t):n+=s.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=i,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?_c(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=_c(Nc(r,this.mapOpts.annotation)));let n=Tc(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 Fc(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(Dc){let t=Dc(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;"\\"===Lc&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let zc=rc,Vc=class extends zc{constructor(e){super(e),this.type="comment"}};var Wc=Vc;Vc.default=Vc;let qc,Gc,Kc,Yc,{isClean:Zc,my:Jc}=Vu,$c=oc,Xc=Wc,Hc=rc;function Qc(e){return e.map((e=>(e.nodes&&(e.nodes=Qc(e.nodes)),delete e.source,e)))}function eh(e){if(e[Zc]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)eh(t)}let th=class e extends Hc{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,r,n=this.getIterator();for(;this.indexes[n]<this.proxyOf.nodes.length&&(t=this.indexes[n],r=e(this.proxyOf.nodes[t],t),!1!==r);)this.indexes[n]+=1;return delete this.indexes[n],r}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...r)=>e[t](...r.map((e=>"function"==typeof e?(t,r)=>e(t.toProxy(),r):e))):"every"===t||"some"===t?r=>e[t](((e,...t)=>r(e.toProxy(),...t))):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map((e=>e.toProxy())):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let r,n=this.index(e),i=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let e of i)this.proxyOf.nodes.splice(n+1,0,e);for(let e in this.indexes)r=this.indexes[e],n<r&&(this.indexes[e]=r+i.length);return this.markDirty(),this}insertBefore(e,t){let r,n=this.index(e),i=0===n&&"prepend",o=this.normalize(t,this.proxyOf.nodes[n],i).reverse();n=this.index(e);for(let e of o)this.proxyOf.nodes.splice(n,0,e);for(let e in this.indexes)r=this.indexes[e],n<=r&&(this.indexes[e]=r+o.length);return this.markDirty(),this}normalize(t,r){if("string"==typeof t)t=Qc(qc(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 $c(t)]}else if(t.selector)t=[new Gc(t)];else if(t.name)t=[new Kc(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new Xc(t)]}return t.map((t=>(t[Jc]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[Zc]&&eh(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]}};th.registerParse=e=>{qc=e},th.registerRule=e=>{Gc=e},th.registerAtRule=e=>{Kc=e},th.registerRoot=e=>{Yc=e};var rh=th;th.default=th,th.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,Kc.prototype):"rule"===e.type?Object.setPrototypeOf(e,Gc.prototype):"decl"===e.type?Object.setPrototypeOf(e,$c.prototype):"comment"===e.type?Object.setPrototypeOf(e,Xc.prototype):"root"===e.type&&Object.setPrototypeOf(e,Yc.prototype),e[Jc]=!0,e.nodes&&e.nodes.forEach((e=>{th.rebuild(e)}))};let nh,ih,oh=rh,sh=class extends oh{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new nh(new ih,this,e).stringify()}};sh.registerLazyResult=e=>{nh=e},sh.registerProcessor=e=>{ih=e};var ah=sh;sh.default=sh;let lh={};var uh=function(e){lh[e]||(lh[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let ch=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 hh=ch;ch.default=ch;let dh=hh,ph=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 dh(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter((e=>"warning"===e.type))}get content(){return this.css}};var fh=ph;ph.default=ph;const gh="'".charCodeAt(0),mh='"'.charCodeAt(0),vh="\\".charCodeAt(0),yh="/".charCodeAt(0),wh="\n".charCodeAt(0),bh=" ".charCodeAt(0),Sh="\f".charCodeAt(0),Ch="\t".charCodeAt(0),Ih="\r".charCodeAt(0),xh="[".charCodeAt(0),kh="]".charCodeAt(0),Eh="(".charCodeAt(0),Oh=")".charCodeAt(0),Ah="{".charCodeAt(0),Rh="}".charCodeAt(0),Ph=";".charCodeAt(0),Mh="*".charCodeAt(0),_h=":".charCodeAt(0),Th="@".charCodeAt(0),Nh=/[\t\n\f\r "#'()/;[\\\]{}]/g,Lh=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Dh=/.[\r\n"'(/\\]/,Fh=/[\da-f]/i;let Uh=rh,jh=class extends Uh{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 Bh=jh;jh.default=jh,Uh.registerAtRule(jh);let zh,Vh,Wh=rh,qh=class extends Wh{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 zh(new Vh,this,e).stringify()}};qh.registerLazyResult=e=>{zh=e},qh.registerProcessor=e=>{Vh=e};var Gh=qh;qh.default=qh,Wh.registerRoot(qh);let Kh={comma:e=>Kh.split(e,[","],!0),space:e=>Kh.split(e,[" ","\n","\t"]),split(e,t,r){let n=[],i="",o=!1,s=0,a=!1,l="",u=!1;for(let r of e)u?u=!1:"\\"===r?u=!0:a?r===l&&(a=!1):'"'===r||"'"===r?(a=!0,l=r):"("===r?s+=1:")"===r?s>0&&(s-=1):0===s&&t.includes(r)&&(o=!0),o?(""!==i&&n.push(i.trim()),i="",o=!1):i+=r;return(r||""!==i)&&n.push(i.trim()),n}};var Yh=Kh;Kh.default=Kh;let Zh=rh,Jh=Yh,$h=class extends Zh{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Jh.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 Xh=$h;$h.default=$h,Zh.registerRule($h);let Hh=oc,Qh=function(e,t={}){let r,n,i,o,s,a,l,u,c,h,d=e.css.valueOf(),p=t.ignoreErrors,f=d.length,g=0,m=[],v=[];function y(t){throw e.error("Unclosed "+t,g)}return{back:function(e){v.push(e)},endOfFile:function(){return 0===v.length&&g>=f},nextToken:function(e){if(v.length)return v.pop();if(g>=f)return;let t=!!e&&e.ignoreUnclosed;switch(r=d.charCodeAt(g),r){case wh:case bh:case Ch:case Ih:case Sh:n=g;do{n+=1,r=d.charCodeAt(n)}while(r===bh||r===wh||r===Ch||r===Ih||r===Sh);h=["space",d.slice(g,n)],g=n-1;break;case xh:case kh:case Ah:case Rh:case _h:case Ph:case Oh:{let e=String.fromCharCode(r);h=[e,e,g];break}case Eh:if(u=m.length?m.pop()[1]:"",c=d.charCodeAt(g+1),"url"===u&&c!==gh&&c!==mh&&c!==bh&&c!==wh&&c!==Ch&&c!==Sh&&c!==Ih){n=g;do{if(a=!1,n=d.indexOf(")",n+1),-1===n){if(p||t){n=g;break}y("bracket")}for(l=n;d.charCodeAt(l-1)===vh;)l-=1,a=!a}while(a);h=["brackets",d.slice(g,n+1),g,n],g=n}else n=d.indexOf(")",g+1),o=d.slice(g,n+1),-1===n||Dh.test(o)?h=["(","(",g]:(h=["brackets",o,g,n],g=n);break;case gh:case mh:i=r===gh?"'":'"',n=g;do{if(a=!1,n=d.indexOf(i,n+1),-1===n){if(p||t){n=g+1;break}y("string")}for(l=n;d.charCodeAt(l-1)===vh;)l-=1,a=!a}while(a);h=["string",d.slice(g,n+1),g,n],g=n;break;case Th:Nh.lastIndex=g+1,Nh.test(d),n=0===Nh.lastIndex?d.length-1:Nh.lastIndex-2,h=["at-word",d.slice(g,n+1),g,n],g=n;break;case vh:for(n=g,s=!0;d.charCodeAt(n+1)===vh;)n+=1,s=!s;if(r=d.charCodeAt(n+1),s&&r!==yh&&r!==bh&&r!==wh&&r!==Ch&&r!==Ih&&r!==Sh&&(n+=1,Fh.test(d.charAt(n)))){for(;Fh.test(d.charAt(n+1));)n+=1;d.charCodeAt(n+1)===bh&&(n+=1)}h=["word",d.slice(g,n+1),g,n],g=n;break;default:r===yh&&d.charCodeAt(g+1)===Mh?(n=d.indexOf("*/",g+2)+1,0===n&&(p||t?n=d.length:y("comment")),h=["comment",d.slice(g,n+1),g,n],g=n):(Lh.lastIndex=g+1,Lh.test(d),n=0===Lh.lastIndex?d.length-1:Lh.lastIndex-2,h=["word",d.slice(g,n+1),g,n],m.push(h),g=n)}return g++,h},position:function(){return g}}},ed=Wc,td=Bh,rd=Gh,nd=Xh;const id={empty:!0,space:!0};var od=class{constructor(e){this.input=e,this.root=new rd,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,i=new td;i.name=e[1].slice(1),""===i.name&&this.unnamedAtrule(i,e),this.init(i,e[2]);let o=!1,s=!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){i.source.end=this.getPosition(e[2]),i.source.end.offset++,this.semicolon=!0;break}if("{"===t){s=!0;break}if("}"===t){if(a.length>0){for(n=a.length-1,r=a[n];r&&"space"===r[0];)r=a[--n];r&&(i.source.end=this.getPosition(r[3]||r[2]),i.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}i.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(i.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(i,"params",a),o&&(e=a[a.length-1],i.source.end=this.getPosition(e[3]||e[2]),i.source.end.offset++,this.spaces=i.raws.between,i.raws.between="")):(i.raws.afterName="",i.params=""),s&&(i.nodes=[],this.current=i)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let r,n=0;for(let i=t-1;i>=0&&(r=e[i],"space"===r[0]||(n+=1,2!==n));i--);throw this.input.error("Missed semicolon","word"===r[0]?r[3]+1:r[2])}colon(e){let t,r,n,i=0;for(let[o,s]of e.entries()){if(t=s,r=t[0],"("===r&&(i+=1),")"===r&&(i-=1),0===i&&":"===r){if(n){if("word"===n[0]&&"progid"===n[1])continue;return o}this.doubleColon(t)}n=t}return!1}comment(e){let t=new ed;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=Qh(this.input)}decl(e,t){let r=new Hh;this.init(r,e[0][2]);let n,i=e[e.length-1];for(";"===i[0]&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(i[3]||i[2]||function(e){for(let t=e.length-1;t>=0;t--){let r=e[t],n=r[3]||r[2];if(n)return n}}(e)),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,s=[];for(;e.length&&(o=e[0][0],"space"===o||"comment"===o);)s.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),i="";for(let e=t;e>0;e--){let t=n[e][0];if(0===i.trim().indexOf("!")&&"space"!==t)break;i=n.pop()[1]+i}0===i.trim().indexOf("!")&&(r.important=!0,r.raws.important=i,e=n)}if("space"!==n[0]&&"comment"!==n[0])break}e.some((e=>"space"!==e[0]&&"comment"!==e[0]))&&(r.raws.between+=s.map((e=>e[1])).join(""),s=[]),this.raw(r,"value",s.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 nd;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,r=null,n=!1,i=null,o=[],s=e[1].startsWith("--"),a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)i||(i=l),o.push("("===r?")":"]");else if(s&&n&&"{"===r)i||(i=l),o.push("}");else if(0===o.length){if(";"===r){if(n)return void this.decl(a,s);break}if("{"===r)return void this.rule(a);if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}":"===r&&(n=!0)}else r===o[o.length-1]&&(o.pop(),0===o.length&&(i=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(i),t&&n){if(!s)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,s)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,r,n){let i,o,s,a,l=r.length,u="",c=!0;for(let e=0;e<l;e+=1)i=r[e],o=i[0],"space"!==o||e!==l-1||n?"comment"===o?(a=r[e-1]?r[e-1][0]:"empty",s=r[e+1]?r[e+1][0]:"empty",id[a]||id[s]||","===u.slice(-1)?c=!1:u+=i[1]):u+=i[1]:c=!1;if(!c){let n=r.reduce(((e,t)=>e+t[1]),"");e.raws[t]={raw:n,value:u}}e[t]=u}rule(e){e.pop();let t=new nd;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 sd=rh,ad=od,ld=Rc;function ud(e,t){let r=new ld(e,t),n=new ad(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 cd=ud;ud.default=ud,sd.registerParse(ud);let{isClean:hd,my:dd}=Vu,pd=Bc,fd=Zu,gd=rh,md=ah,vd=uh,yd=fh,wd=cd,bd=Gh;const Sd={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Cd={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},Id={Once:!0,postcssPlugin:!0,prepare:!0};function xd(e){return"object"==typeof e&&"function"==typeof e.then}function kd(e){let t=!1,r=Sd[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 Ed(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:kd(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function Od(e){return e[hd]=!1,e.nodes&&e.nodes.forEach((e=>Od(e))),e}let Ad={},Rd=class e{constructor(t,r,n){let i;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof e||r instanceof yd)i=Od(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=wd;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{i=e(r,n)}catch(e){this.processed=!0,this.error=e}i&&!i[dd]&&gd.rebuild(i)}else i=Od(r);this.result=new yd(t,i,n),this.helpers={...Ad,postcss:Ad,result:this.result},this.plugins=this.processor.plugins.map((e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e))}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let r=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(r.postcssVersion&&"production"!==process.env.NODE_ENV){let e=r.postcssPlugin,t=r.postcssVersion,n=this.result.processor.version,i=t.split("."),o=n.split(".");(i[0]!==o[0]||parseInt(i[1])>parseInt(o[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+n+", but "+e+" uses "+t+". Perhaps this is the source of the error below.")}}else e.plugin=r.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,r)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,r])};for(let t of this.plugins)if("object"==typeof t)for(let r in t){if(!Cd[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Id[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(xd(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[hd];){e[hd]=!0;let t=[Ed(e)];for(;t.length>0;){let e=this.visitTick(t);if(xd(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 xd(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=fd;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new pd(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(xd(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[hd];)e[hd]=!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||vd("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(xd(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,i]=n[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===n.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return i(r.toProxy(),this.helpers)}catch(e){throw this.handleError(e,r)}}if(0!==t.iterator){let n,i=t.iterator;for(;n=r.nodes[r.indexes[i]];)if(r.indexes[i]+=1,!n[hd])return n[hd]=!0,void e.push(Ed(n));t.iterator=0,delete r.indexes[i]}let i=t.events;for(;t.eventIndex<i.length;){let e=i[t.eventIndex];if(t.eventIndex+=1,0===e)return void(r.nodes&&r.nodes.length&&(r[hd]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[hd]=!0;let t=kd(e);for(let r of t)if(0===r)e.nodes&&e.each((e=>{e[hd]||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"}};Rd.registerPostcss=e=>{Ad=e};var Pd=Rd;Rd.default=Rd,bd.registerLazyResult(Rd),md.registerLazyResult(Rd);let Md=Bc,_d=Zu,Td=uh,Nd=cd;const Ld=fh;let Dd=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 i=_d;this.result=new Ld(this._processor,n,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let s=new Md(i,n,this._opts,t);if(s.isMap()){let[e,t]=s.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else s.clearAnnotation(),this.result.css=s.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||Td("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=Nd;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 Fd=Dd;Dd.default=Dd;let Ud=Fd,jd=Pd,Bd=ah,zd=Gh,Vd=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 jd(this,e,t):new Ud(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var Wd=Vd;Vd.default=Vd,zd.registerProcessor(Vd),Bd.registerProcessor(Vd);let qd=oc,Gd=fc,Kd=Wc,Yd=Bh,Zd=Rc,Jd=Gh,$d=Xh;function Xd(e,t){if(Array.isArray(e))return e.map((e=>Xd(e)));let{inputs:r,...n}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:Zd.prototype};r.map&&(r.map={...r.map,__proto__:Gd.prototype}),t.push(r)}}if(n.nodes&&(n.nodes=e.nodes.map((e=>Xd(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 Jd(n);if("decl"===n.type)return new qd(n);if("rule"===n.type)return new $d(n);if("comment"===n.type)return new Kd(n);if("atrule"===n.type)return new Yd(n);throw new Error("Unknown node type: "+e.type)}var Hd=Xd;Xd.default=Xd;let Qd=zu,ep=oc,tp=Pd,rp=rh,np=Wd,ip=Zu,op=Hd,sp=ah,ap=hh,lp=Wc,up=Bh,cp=fh,hp=Rc,dp=cd,pp=Yh,fp=Xh,gp=Gh,mp=rc;function vp(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new np(e)}vp.plugin=function(e,t){let r,n=!1;function i(...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 i=t(...r);return i.postcssPlugin=e,i.postcssVersion=(new np).version,i}return Object.defineProperty(i,"postcss",{get:()=>(r||(r=i()),r)}),i.process=function(e,t,r){return vp([i(r)]).process(e,t)},i},vp.stringify=ip,vp.parse=dp,vp.fromJSON=op,vp.list=pp,vp.comment=e=>new lp(e),vp.atRule=e=>new up(e),vp.decl=e=>new ep(e),vp.rule=e=>new fp(e),vp.root=e=>new gp(e),vp.document=e=>new sp(e),vp.CssSyntaxError=Qd,vp.Declaration=ep,vp.Container=rp,vp.Processor=np,vp.Document=sp,vp.Comment=lp,vp.Warning=ap,vp.AtRule=up,vp.Result=cp,vp.Input=hp,vp.Rule=fp,vp.Root=gp,vp.Node=mp,tp.registerPostcss(vp);var yp=vp;vp.default=vp;const wp=Mu(yp);wp.stringify,wp.fromJSON,wp.plugin,wp.parse,wp.list,wp.document,wp.comment,wp.atRule,wp.rule,wp.decl,wp.root,wp.CssSyntaxError,wp.Declaration,wp.Container,wp.Processor,wp.Document,wp.Comment,wp.Warning,wp.AtRule,wp.Result,wp.Input,wp.Rule,wp.Root,wp.Node;class bp{constructor(...e){Pu(this,"parentElement",null),Pu(this,"parentNode",null),Pu(this,"ownerDocument"),Pu(this,"firstChild",null),Pu(this,"lastChild",null),Pu(this,"previousSibling",null),Pu(this,"nextSibling",null),Pu(this,"ELEMENT_NODE",1),Pu(this,"TEXT_NODE",3),Pu(this,"nodeType"),Pu(this,"nodeName"),Pu(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 bp))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 Sp={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Cp={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Ip={};function xp(e){if(Ip[e])return Ip[e];const t=globalThis[e],r=t.prototype,n=e in Sp?Sp[e]:void 0,i=Boolean(n&&n.every((e=>{var t,n;return Boolean(null==(n=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:n.toString().includes("[native code]"))}))),o=e in Cp?Cp[e]:void 0,s=Boolean(o&&o.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(i&&s&&!globalThis.Zone)return Ip[e]=t.prototype,t.prototype;try{const n=document.createElement("iframe");document.body.appendChild(n);const i=n.contentWindow;if(!i)return t.prototype;const o=i[e].prototype;return document.body.removeChild(n),o?Ip[e]=o:r}catch{return r}}const kp={};function Ep(e,t,r){var n;const i=`${e}.${String(r)}`;if(kp[i])return kp[i].call(t);const o=xp(e),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(kp[i]=s,s.call(t)):t[r]}const Op={};function Ap(e,t,r){const n=`${e}.${String(r)}`;if(Op[n])return Op[n].bind(t);const i=xp(e)[r];return"function"!=typeof i?t[r]:(Op[n]=i,i.bind(t))}function Rp(){return xp("MutationObserver").constructor}const Pp={childNodes:function(e){return Ep("Node",e,"childNodes")},parentNode:function(e){return Ep("Node",e,"parentNode")},parentElement:function(e){return Ep("Node",e,"parentElement")},textContent:function(e){return Ep("Node",e,"textContent")},contains:function(e,t){return Ap("Node",e,"contains")(t)},getRootNode:function(e){return Ap("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Ep("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Ep("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Ep("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Ep("Element",e,"querySelectorAll")(t)},mutationObserver:Rp};function Mp(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}const _p="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.";let Tp={map:{},getId:()=>(console.error(_p),-1),getNode:()=>(console.error(_p),null),removeNodeFromMap(){console.error(_p)},has:()=>(console.error(_p),!1),reset(){console.error(_p)}};function Np(e,t,r={}){let n=null,i=0;return function(...o){const s=Date.now();i||!1!==r.leading||(i=s);const a=t-(s-i),l=this;a<=0||a>t?(n&&(clearTimeout(n),n=null),i=s,e.apply(l,o)):n||!1===r.trailing||(n=setTimeout((()=>{i=!1===r.leading?0:Date.now(),n=null,e.apply(l,o)}),a))}}function Lp(e,t,r,n,i=window){const o=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,n?r:{set(e){setTimeout((()=>{r.set.call(this,e)}),0),o&&o.set&&o.set.call(this,e)}}),()=>Lp(e,t,o||{},!0)}function Dp(e,t,r){try{if(!(t in e))return()=>{};const n=e[t],i=r(n);return"function"==typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=i,()=>{e[t]=n}}catch{return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Tp=new Proxy(Tp,{get:(e,t,r)=>("map"===t&&console.error(_p),Reflect.get(e,t,r))}));let Fp=Date.now;function Up(e){var t,r,n,i;const o=e.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(t=Pp.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=Pp.parentElement(o.body))?void 0:n.scrollTop)||(null==(i=null==o?void 0:o.body)?void 0:i.scrollTop)||0}}function jp(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Bp(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function zp(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:Pp.parentElement(e)}function Vp(e,t,r,n){if(!e)return!1;const i=zp(e);if(!i)return!1;try{if("string"==typeof t){if(i.classList.contains(t))return!0;if(n&&null!==i.closest("."+t))return!0}else if(Lo(i,t,n))return!0}catch(e){}if(r){if(i.matches(r))return!0;if(n&&null!==i.closest(r))return!0}return!1}function Wp(e,t){return-1!==t.getId(e)}function qp(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||-2===t.getId(e)}function Gp(e,t){if(io(e))return!1;const r=t.getId(e);if(!t.has(r))return!0;const n=Pp.parentNode(e);return(!n||n.nodeType!==e.DOCUMENT_NODE)&&(!n||Gp(n,t))}function Kp(e){return Boolean(e.changedTouches)}function Yp(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 Zp(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Jp(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function $p(e){return!!e&&(e instanceof bp&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(Pp.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(Fp=()=>(new Date).getTime());class Xp{constructor(){qi(this,"id",1),qi(this,"styleIDMap",new WeakMap),qi(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 Hp(e){var t;let r=null;return"getRootNode"in e&&(null==(t=Pp.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&Pp.host(Pp.getRootNode(e))&&(r=Pp.host(Pp.getRootNode(e))),r}function Qp(e){let t,r=e;for(;t=Hp(r);)r=t;return r}function ef(e){const t=e.ownerDocument;if(!t)return!1;const r=Qp(e);return Pp.contains(t,r)}function tf(e){const t=e.ownerDocument;return!!t&&(Pp.contains(t,e)||ef(e))}const rf=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:Xp,get _mirror(){return Tp},closestElementOfNode:zp,getBaseDimension:function e(t,r){var n,i;const o=null==(i=null==(n=t.ownerDocument)?void 0:n.defaultView)?void 0:i.frameElement;if(!o||o===r)return{x:0,y:0,relativeScale:1,absoluteScale:1};const s=o.getBoundingClientRect(),a=e(o,r),l=s.height/o.clientHeight;return{x:s.x*a.relativeScale+a.x,y:s.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:Qp,getShadowHost:Hp,getWindowHeight:jp,getWindowScroll:Up,getWindowWidth:Bp,hasShadowRoot:$p,hookSetter:Lp,inDom:tf,isAncestorRemoved:Gp,isBlocked:Vp,isIgnored:qp,isSerialized:Wp,isSerializedIframe:Zp,isSerializedStylesheet:Jp,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:Kp,get nowTimestamp(){return Fp},on:Mp,patch:Dp,polyfill:Yp,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 i of e){const{nextId:e,parentId:o}=i;if(e&&e in t){const o=t[e];if(o.parent){const e=o.parent.children.indexOf(o);o.parent.children.splice(e,0,r(i,o.parent))}else{const e=n.indexOf(o);n.splice(e,0,r(i,null))}}else if(o in t){const e=t[o];e.children.push(r(i,e))}else n.push(r(i,null))}return n},shadowHostInDom:ef,throttle:Np,uniqueTextMutations:function(e){const t=new Set,r=[];for(let n=e.length;n--;){const i=e[n];t.has(i.id)||(r.push(i),t.add(i.id))}return r}},Symbol.toStringTag,{value:"Module"}));var nf=(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))(nf||{}),of=(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))(of||{}),sf=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(sf||{}),af=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(af||{}),lf=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(lf||{}),uf=(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))(uf||{}),cf=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(cf||{});function hf(e){return"__ln"in e}class df{constructor(){qi(this,"length",0),qi(this,"head",null),qi(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&&hf(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&&hf(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 pf=(e,t)=>`${e}@${t}`;class ff{constructor(){qi(this,"frozen",!1),qi(this,"locked",!1),qi(this,"texts",[]),qi(this,"attributes",[]),qi(this,"attributeMap",new WeakMap),qi(this,"removes",[]),qi(this,"mapRemoves",[]),qi(this,"movedMap",{}),qi(this,"addedSet",new Set),qi(this,"movedSet",new Set),qi(this,"droppedSet",new Set),qi(this,"removesSubTreeCache",new Set),qi(this,"mutationCb"),qi(this,"blockClass"),qi(this,"blockSelector"),qi(this,"maskTextClass"),qi(this,"maskTextSelector"),qi(this,"inlineStylesheet"),qi(this,"maskInputOptions"),qi(this,"maskTextFn"),qi(this,"maskInputFn"),qi(this,"keepIframeSrcFn"),qi(this,"recordCanvas"),qi(this,"inlineImages"),qi(this,"slimDOMOptions"),qi(this,"dataURLOptions"),qi(this,"doc"),qi(this,"mirror"),qi(this,"iframeManager"),qi(this,"stylesheetManager"),qi(this,"shadowDomManager"),qi(this,"canvasManager"),qi(this,"processedNodeManager"),qi(this,"unattachedDoc"),qi(this,"processMutations",(e=>{e.forEach(this.processMutation),this.emit()})),qi(this,"emit",(()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,r=new df,n=e=>{let t=e,r=-2;for(;-2===r;)t=t&&t.nextSibling,r=t&&this.mirror.getId(t);return r},i=i=>{const o=Pp.parentNode(i);if(!o||!tf(i))return;let s=!1;if(i.nodeType===Node.TEXT_NODE){const e=o.tagName;if("TEXTAREA"===e)return;"STYLE"===e&&this.addedSet.has(o)&&(s=!0)}const a=io(o)?this.mirror.getId(Hp(i)):this.mirror.getId(o),l=n(i);if(-1===a||-1===l)return r.addNode(i);const u=jo(i,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:e=>{Zp(e,this.mirror)&&this.iframeManager.addIframe(e),Jp(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),$p(i)&&this.shadowDomManager.addShadowRoot(Pp.shadowRoot(i),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)},cssCaptured:s});u&&(e.push({parentId:a,nextId:l,node:u}),t.add(u.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const e of this.movedSet)mf(this.removesSubTreeCache,e,this.mirror)&&!this.movedSet.has(Pp.parentNode(e))||i(e);for(const e of this.addedSet)vf(this.droppedSet,e)||mf(this.removesSubTreeCache,e,this.mirror)?vf(this.movedSet,e)?i(e):this.droppedSet.add(e):i(e);let o=null;for(;r.length;){let e=null;if(o){const t=this.mirror.getId(Pp.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(Pp.parentNode(r.value));if(-1===n(r.value))continue;if(-1!==t){e=r;break}{const t=r.value,n=Pp.parentNode(t);if(n&&n.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const t=Pp.host(n);if(-1!==this.mirror.getId(t)){e=r;break}}}}}}if(!e){for(;r.head;)r.removeNode(r.head.value);break}o=e.previous,r.removeNode(e.value),i(e.value)}const s={texts:this.texts.map((e=>{const t=e.node,r=Pp.parentNode(t);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{id:this.mirror.getId(t),value:e.value}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),attributes:this.attributes.map((e=>{const{attributes:t}=e;if("string"==typeof t.style){const r=JSON.stringify(e.styleDiff),n=JSON.stringify(e._unchangedStyles);r.length<t.style.length&&(r+n).split("var(").length===t.style.split("var(").length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),removes:this.removes,adds:e};(s.texts.length||s.attributes.length||s.removes.length||s.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(s))})),qi(this,"genTextAreaValueMutation",(e=>{let t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t));const r=Array.from(Pp.childNodes(e),(e=>Pp.textContent(e)||"")).join("");t.attributes.value=uo({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:po(e),value:r,maskInputFn:this.maskInputFn})})),qi(this,"processMutation",(e=>{if(!qp(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=Pp.textContent(e.target);Vp(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:Do(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,zp(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=po(t);n=uo({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:e,value:n,maskInputFn:this.maskInputFn})}if(Vp(e.target,this.blockClass,this.blockSelector,!1)||n===e.oldValue)return;let i=this.attributeMap.get(e.target);if("IFRAME"===t.tagName&&"src"===r&&!this.keepIframeSrcFn(n)){if(t.contentDocument)return;r="rr_src"}if(i||(i={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(i),this.attributeMap.set(e.target,i)),"type"===r&&"INPUT"===t.tagName&&"password"===(e.oldValue||"").toLowerCase()&&t.setAttribute("data-rr-is-password","true"),!No(t.tagName,r))if(i.attributes[r]=To(this.doc,co(t.tagName),co(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)?i.styleDiff[e]=""===o?n:[n,o]:i._unchangedStyles[e]=[n,o]}for(const e of Array.from(r.style))""===t.style.getPropertyValue(e)&&(i.styleDiff[e]=!1)}else"open"===r&&"DIALOG"===t.tagName&&(t.matches("dialog:modal")?i.attributes.rr_open_mode="modal":i.attributes.rr_open_mode="non-modal");break}case"childList":if(Vp(e.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===e.target.tagName)return void this.genTextAreaValueMutation(e.target);e.addedNodes.forEach((t=>this.genAdds(t,e.target))),e.removedNodes.forEach((t=>{const r=this.mirror.getId(t),n=io(e.target)?this.mirror.getId(Pp.host(e.target)):this.mirror.getId(e.target);Vp(e.target,this.blockClass,this.blockSelector,!1)||qp(t,this.mirror,this.slimDOMOptions)||!Wp(t,this.mirror)||(this.addedSet.has(t)?(gf(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||Gp(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[pf(r,n)]?gf(this.movedSet,t):(this.removes.push({parentId:n,id:r,isShadow:!(!io(e.target)||!oo(e.target))||void 0}),function(e,t){const r=[e];for(;r.length;){const e=r.pop();t.has(e)||(t.add(e),Pp.childNodes(e).forEach((e=>r.push(e))))}}(t,this.removesSubTreeCache))),this.mapRemoves.push(t))}))}})),qi(this,"genAdds",((e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(qp(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[pf(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Vp(e,this.blockClass,this.blockSelector,!1)||(Pp.childNodes(e).forEach((e=>this.genAdds(e))),$p(e)&&Pp.childNodes(Pp.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 gf(e,t){e.delete(t),Pp.childNodes(t).forEach((t=>gf(e,t)))}function mf(e,t,r){return 0!==e.size&&function(e,t,r){const n=Pp.parentNode(t);return!!n&&e.has(n)}(e,t)}function vf(e,t){return 0!==e.size&&yf(e,t)}function yf(e,t){const r=Pp.parentNode(t);return!!r&&(!!e.has(r)||yf(e,r))}let wf;const bf=e=>{if(!wf)return e;return(...t)=>{try{return e(...t)}catch(e){if(wf&&!0===wf(e))return;throw e}}};function Sf(e){return(...t)=>{try{return e(...t)}catch(e){try{e._external_=!0}catch{}throw e}}}const Cf=[];function If(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function xf(e,t){const r=new ff;Cf.push(r),r.init(e);const n=new(Rp())(bf(r.processMutations.bind(r)));return n.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),n}function kf({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,blockSelector:i,sampling:o}){if(!1===o.mouseInteraction)return()=>{};const s=!0===o.mouseInteraction||void 0===o.mouseInteraction?{}:o.mouseInteraction,a=[];let l=null;return Object.keys(sf).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==s[e])).forEach((o=>{let s=co(o);const u=(t=>o=>{const s=If(o);if(Vp(s,n,i,!0))return;let a=null,u=t;if("pointerType"in o){switch(o.pointerType){case"mouse":a=af.Mouse;break;case"touch":a=af.Touch;break;case"pen":a=af.Pen}a===af.Touch?sf[t]===sf.MouseDown?u="TouchStart":sf[t]===sf.MouseUp&&(u="TouchEnd"):af.Pen}else Kp(o)&&(a=af.Touch);null!==a?(l=a,(u.startsWith("Touch")&&a===af.Touch||u.startsWith("Mouse")&&a===af.Mouse)&&(a=null)):sf[t]===sf.Click&&(a=l,l=null);const c=Kp(o)?o.changedTouches[0]:o;if(!c)return;const h=r.getId(s),{clientX:d,clientY:p}=c;bf(e)({type:sf[u],id:h,x:d,y:p,...null!==a&&{pointerType:a}})})(o);if(window.PointerEvent)switch(sf[o]){case sf.MouseDown:case sf.MouseUp:s=s.replace("mouse","pointer");break;case sf.TouchStart:case sf.TouchEnd:return}a.push(Mp(s,u,t))})),bf((()=>{a.forEach((e=>e()))}))}function Ef({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:i,sampling:o}){const s=bf(Np(bf((o=>{const s=If(o);if(!s||Vp(s,n,i,!0))return;const a=r.getId(s);if(s===t&&t.defaultView){const r=Up(t.defaultView);e({id:a,x:r.left,y:r.top})}else e({id:a,x:s.scrollLeft,y:s.scrollTop})})),o.scroll||100));return Mp("scroll",s,t)}const Of=["INPUT","TEXTAREA","SELECT"],Af=new WeakMap;function Rf(e){return function(e,t){if(Tf("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||Tf("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||Tf("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||Tf("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){const r=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(r)}else if(e.parentStyleSheet){const r=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(r)}return t}(e,[])}function Pf(e,t,r){let n,i;return e?(e.ownerNode?n=t.getId(e.ownerNode):i=r.getId(e),{styleId:i,id:n}):{}}function Mf({mirror:e,stylesheetManager:t},r){var n,i,o;let s=null;s="#document"===r.nodeName?e.getId(r):e.getId(Pp.host(r));const a="#document"===r.nodeName?null==(n=r.defaultView)?void 0:n.Document:null==(o=null==(i=r.ownerDocument)?void 0:i.defaultView)?void 0:o.ShadowRoot,l=(null==a?void 0:a.prototype)?Object.getOwnPropertyDescriptor(null==a?void 0:a.prototype,"adoptedStyleSheets"):void 0;return null!==s&&-1!==s&&a&&l?(Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var e;return null==(e=l.get)?void 0:e.call(this)},set(e){var r;const n=null==(r=l.set)?void 0:r.call(this,e);if(null!==s&&-1!==s)try{t.adoptStyleSheets(e,s)}catch(e){}return n}}),bf((()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))):()=>{}}function _f(e,t={}){const r=e.doc.defaultView;if(!r)return()=>{};let n;!function(e,t){const{mutationCb:r,mousemoveCb:n,mouseInteractionCb:i,scrollCb:o,viewportResizeCb:s,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:u,styleDeclarationCb:c,canvasMutationCb: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),i(...e)},e.scrollCb=(...e)=>{t.scroll&&t.scroll(...e),o(...e)},e.viewportResizeCb=(...e)=>{t.viewportResize&&t.viewportResize(...e),s(...e)},e.inputCb=(...e)=>{t.input&&t.input(...e),a(...e)},e.mediaInteractionCb=(...e)=>{t.mediaInteaction&&t.mediaInteaction(...e),l(...e)},e.styleSheetRuleCb=(...e)=>{t.styleSheetRule&&t.styleSheetRule(...e),u(...e)},e.styleDeclarationCb=(...e)=>{t.styleDeclaration&&t.styleDeclaration(...e),c(...e)},e.canvasMutationCb=(...e)=>{t.canvasMutation&&t.canvasMutation(...e),h(...e)},e.fontCb=(...e)=>{t.font&&t.font(...e),d(...e)},e.selectionCb=(...e)=>{t.selection&&t.selection(...e),p(...e)},e.customElementCb=(...e)=>{t.customElement&&t.customElement(...e),f(...e)}}(e,t),e.recordDOM&&(n=xf(e,e.doc));const i=function({mousemoveCb:e,sampling:t,doc:r,mirror:n}){if(!1===t.mousemove)return()=>{};const i="number"==typeof t.mousemove?t.mousemove:50,o="number"==typeof t.mousemoveCallback?t.mousemoveCallback:500;let s,a=[];const l=Np(bf((t=>{const r=Date.now()-s;e(a.map((e=>(e.timeOffset-=r,e))),t),a=[],s=null})),o),u=bf(Np(bf((e=>{const t=If(e),{clientX:r,clientY:i}=Kp(e)?e.changedTouches[0]:e;s||(s=Fp()),a.push({x:r,y:i,id:n.getId(t),timeOffset:Fp()-s}),l("undefined"!=typeof DragEvent&&e instanceof DragEvent?of.Drag:e instanceof MouseEvent?of.MouseMove:of.TouchMove)})),i,{trailing:!1})),c=[Mp("mousemove",u,r),Mp("touchmove",u,r),Mp("drag",u,r)];return bf((()=>{c.forEach((e=>e()))}))}(e),o=kf(e),s=Ef(e),a=function({viewportResizeCb:e},{win:t}){let r=-1,n=-1;return Mp("resize",bf(Np(bf((()=>{const t=jp(),i=Bp();r===t&&n===i||(e({width:Number(i),height:Number(t)}),r=t,n=i)})),200)),t)}(e,{win:r}),l=function({inputCb:e,doc:t,mirror:r,blockClass:n,blockSelector:i,ignoreClass:o,ignoreSelector:s,maskInputOptions:a,maskInputFn:l,sampling:u,userTriggeredOnInput:c}){function h(e){let r=If(e);const u=e.isTrusted,h=r&&r.tagName;if(r&&"OPTION"===h&&(r=Pp.parentElement(r)),!r||!h||Of.indexOf(h)<0||Vp(r,n,i,!0))return;if(r.classList.contains(o)||s&&r.matches(s))return;let p=r.value,f=!1;const g=po(r)||"";"radio"===g||"checkbox"===g?f=r.checked:(a[h.toLowerCase()]||a[g])&&(p=uo({element:r,maskInputOptions:a,tagName:h,type:g,value:p,maskInputFn:l})),d(r,c?{text:p,isChecked:f,userTriggered:u}:{text:p,isChecked:f});const m=r.name;"radio"===g&&m&&f&&t.querySelectorAll(`input[type="radio"][name="${m}"]`).forEach((e=>{if(e!==r){const t=e.value;d(e,c?{text:t,isChecked:!f,userTriggered:!1}:{text:t,isChecked:!f})}}))}function d(t,n){const i=Af.get(t);if(!i||i.text!==n.text||i.isChecked!==n.isChecked){Af.set(t,n);const i=r.getId(t);bf(e)({...n,id:i})}}const p=("last"===u.input?["change"]:["input","change"]).map((e=>Mp(e,bf(h),t))),f=t.defaultView;if(!f)return()=>{p.forEach((e=>e()))};const g=f.Object.getOwnPropertyDescriptor(f.HTMLInputElement.prototype,"value"),m=[[f.HTMLInputElement.prototype,"value"],[f.HTMLInputElement.prototype,"checked"],[f.HTMLSelectElement.prototype,"value"],[f.HTMLTextAreaElement.prototype,"value"],[f.HTMLSelectElement.prototype,"selectedIndex"],[f.HTMLOptionElement.prototype,"selected"]];return g&&g.set&&p.push(...m.map((e=>Lp(e[0],e[1],{set(){bf(h)({target:this,isTrusted:!1})}},!1,f)))),bf((()=>{p.forEach((e=>e()))}))}(e),u=function({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:i,doc:o}){const s=bf((o=>Np(bf((i=>{const s=If(i);if(!s||Vp(s,t,r,!0))return;const{currentTime:a,volume:l,muted:u,playbackRate:c,loop:h}=s;e({type:o,id:n.getId(s),currentTime:a,volume:l,muted:u,playbackRate:c,loop:h})})),i.media||500))),a=[Mp("play",s(uf.Play),o),Mp("pause",s(uf.Pause),o),Mp("seeked",s(uf.Seeked),o),Mp("volumechange",s(uf.VolumeChange),o),Mp("ratechange",s(uf.RateChange),o)];return bf((()=>{a.forEach((e=>e()))}))}(e);let c=()=>{},h=()=>{},d=()=>{},p=()=>{};e.recordDOM&&(c=function({styleSheetRuleCb:e,mirror:t,stylesheetManager:r},{win:n}){if(!n.CSSStyleSheet||!n.CSSStyleSheet.prototype)return()=>{};const i=n.CSSStyleSheet.prototype.insertRule;n.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:bf(((n,i,o)=>{const[s,a]=o,{id:l,styleId:u}=Pf(i,t,r.styleMirror);return(l&&-1!==l||u&&-1!==u)&&e({id:l,styleId:u,adds:[{rule:s,index:a}]}),Sf((()=>n.apply(i,o)))()}))}),n.CSSStyleSheet.prototype.addRule=function(e,t,r=this.cssRules.length){const i=`${e} { ${t} }`;return n.CSSStyleSheet.prototype.insertRule.apply(this,[i,r])};const o=n.CSSStyleSheet.prototype.deleteRule;let s,a;n.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:bf(((n,i,o)=>{const[s]=o,{id:a,styleId:l}=Pf(i,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:s}]}),Sf((()=>n.apply(i,o)))()}))}),n.CSSStyleSheet.prototype.removeRule=function(e){return n.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},n.CSSStyleSheet.prototype.replace&&(s=n.CSSStyleSheet.prototype.replace,n.CSSStyleSheet.prototype.replace=new Proxy(s,{apply:bf(((n,i,o)=>{const[s]=o,{id:a,styleId:l}=Pf(i,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,replace:s}),n.apply(i,o)}))})),n.CSSStyleSheet.prototype.replaceSync&&(a=n.CSSStyleSheet.prototype.replaceSync,n.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:bf(((n,i,o)=>{const[s]=o,{id:a,styleId:l}=Pf(i,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,replaceSync:s}),n.apply(i,o)}))}));const l={};Nf("CSSGroupingRule")?l.CSSGroupingRule=n.CSSGroupingRule:(Nf("CSSMediaRule")&&(l.CSSMediaRule=n.CSSMediaRule),Nf("CSSConditionRule")&&(l.CSSConditionRule=n.CSSConditionRule),Nf("CSSSupportsRule")&&(l.CSSSupportsRule=n.CSSSupportsRule));const u={};return Object.entries(l).forEach((([n,i])=>{u[n]={insertRule:i.prototype.insertRule,deleteRule:i.prototype.deleteRule},i.prototype.insertRule=new Proxy(u[n].insertRule,{apply:bf(((n,i,o)=>{const[s,a]=o,{id:l,styleId:u}=Pf(i.parentStyleSheet,t,r.styleMirror);return(l&&-1!==l||u&&-1!==u)&&e({id:l,styleId:u,adds:[{rule:s,index:[...Rf(i),a||0]}]}),n.apply(i,o)}))}),i.prototype.deleteRule=new Proxy(u[n].deleteRule,{apply:bf(((n,i,o)=>{const[s]=o,{id:a,styleId:l}=Pf(i.parentStyleSheet,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:[...Rf(i),s]}]}),n.apply(i,o)}))})})),bf((()=>{n.CSSStyleSheet.prototype.insertRule=i,n.CSSStyleSheet.prototype.deleteRule=o,s&&(n.CSSStyleSheet.prototype.replace=s),a&&(n.CSSStyleSheet.prototype.replaceSync=a),Object.entries(l).forEach((([e,t])=>{t.prototype.insertRule=u[e].insertRule,t.prototype.deleteRule=u[e].deleteRule}))}))}(e,{win:r}),h=Mf(e,e.doc),d=function({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:r,stylesheetManager:n},{win:i}){const o=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:bf(((i,s,a)=>{var l;const[u,c,h]=a;if(r.has(u))return o.apply(s,[u,c,h]);const{id:d,styleId:p}=Pf(null==(l=s.parentRule)?void 0:l.parentStyleSheet,t,n.styleMirror);return(d&&-1!==d||p&&-1!==p)&&e({id:d,styleId:p,set:{property:u,value:c,priority:h},index:Rf(s.parentRule)}),i.apply(s,a)}))});const s=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(s,{apply:bf(((i,o,a)=>{var l;const[u]=a;if(r.has(u))return s.apply(o,[u]);const{id:c,styleId:h}=Pf(null==(l=o.parentRule)?void 0:l.parentStyleSheet,t,n.styleMirror);return(c&&-1!==c||h&&-1!==h)&&e({id:c,styleId:h,remove:{property:u},index:Rf(o.parentRule)}),i.apply(o,a)}))}),bf((()=>{i.CSSStyleDeclaration.prototype.setProperty=o,i.CSSStyleDeclaration.prototype.removeProperty=s}))}(e,{win:r}),e.collectFonts&&(p=function({fontCb:e,doc:t}){const r=t.defaultView;if(!r)return()=>{};const n=[],i=new WeakMap,o=r.FontFace;r.FontFace=function(e,t,r){const n=new o(e,t,r);return i.set(n,{family:e,buffer:"string"!=typeof t,descriptors:r,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),n};const s=Dp(t.fonts,"add",(function(t){return function(r){return setTimeout(bf((()=>{const t=i.get(r);t&&(e(t),i.delete(r))})),0),t.apply(this,[r])}}));return n.push((()=>{r.FontFace=o})),n.push(s),bf((()=>{n.forEach((e=>e()))}))}(e)));const f=function(e){const{doc:t,mirror:r,blockClass:n,blockSelector:i,selectionCb:o}=e;let s=!0;const a=bf((()=>{const e=t.getSelection();if(!e||s&&(null==e?void 0:e.isCollapsed))return;s=e.isCollapsed||!1;const a=[],l=e.rangeCount||0;for(let t=0;t<l;t++){const o=e.getRangeAt(t),{startContainer:s,startOffset:l,endContainer:u,endOffset:c}=o;Vp(s,n,i,!0)||Vp(u,n,i,!0)||a.push({start:r.getId(s),startOffset:l,end:r.getId(u),endOffset:c})}o({ranges:a})}));return a(),Mp("selectionchange",a)}(e),g=function({doc:e,customElementCb:t}){const r=e.defaultView;return r&&r.customElements?Dp(r.customElements,"define",(function(e){return function(r,n,i){try{t({define:{name:r}})}catch(e){console.warn(`Custom element callback failed for ${r}`)}return e.apply(this,[r,n,i])}})):()=>{}}(e),m=[];for(const t of e.plugins)m.push(t.observer(t.callback,r,t.options));return bf((()=>{Cf.forEach((e=>e.reset())),null==n||n.disconnect(),i(),o(),s(),a(),l(),u(),c(),h(),d(),p(),f(),g(),m.forEach((e=>e()))}))}function Tf(e){return void 0!==window[e]}function Nf(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class Lf{constructor(e){qi(this,"iframeIdToRemoteIdMap",new WeakMap),qi(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,n){const i=r||this.getIdToRemoteIdMap(e),o=n||this.getRemoteIdToIdMap(e);let s=i.get(t);return s||(s=this.generateIdFn(),i.set(t,s),o.set(s,t)),s}getIds(e,t){const r=this.getIdToRemoteIdMap(e),n=this.getRemoteIdToIdMap(e);return t.map((t=>this.getId(e,t,r,n)))}getRemoteId(e,t,r){const n=r||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;const i=n.get(t);return i||-1}getRemoteIds(e,t){const r=this.getRemoteIdToIdMap(e);return t.map((t=>this.getRemoteId(e,t,r)))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class Df{constructor(e){qi(this,"iframes",new WeakMap),qi(this,"crossOriginIframeMap",new WeakMap),qi(this,"crossOriginIframeMirror",new Lf(xo)),qi(this,"crossOriginIframeStyleMirror"),qi(this,"crossOriginIframeRootIdMap",new WeakMap),qi(this,"mirror"),qi(this,"mutationCb"),qi(this,"wrappedEmit"),qi(this,"loadListener"),qi(this,"stylesheetManager"),qi(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Lf(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var r,n;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(r=e.contentWindow)||r.addEventListener("message",this.handleMessage.bind(this))),null==(n=this.loadListener)||n.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){const t=e;if("rrweb"!==t.data.type||t.origin!==t.data.origin)return;if(!e.source)return;const r=this.crossOriginIframeMap.get(e.source);if(!r)return;const n=this.transformCrossOriginEvent(r,t.data.event);n&&this.wrappedEmit(n,t.data.isCheckout)}transformCrossOriginEvent(e,t){var r;switch(t.type){case nf.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:nf.IncrementalSnapshot,data:{source:of.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case nf.Meta:case nf.Load:case nf.DomContentLoaded:return!1;case nf.Plugin:return t;case nf.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case nf.IncrementalSnapshot:switch(t.data.source){case of.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 of.Drag:case of.TouchMove:case of.MouseMove:return t.data.positions.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case of.ViewportResize:return!1;case of.MediaInteraction:case of.MouseInteraction:case of.Scroll:case of.CanvasMutation:case of.Input:return this.replaceIds(t.data,e,["id"]),t;case of.StyleSheetRule:case of.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case of.Font:return t;case of.Selection:return t.data.ranges.forEach((t=>{this.replaceIds(t,e,["start","end"])})),t;case of.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null==(r=t.data.styles)||r.forEach((t=>{this.replaceStyleIds(t,e,["styleId"])})),t}}return!1}replace(e,t,r,n){for(const i of n)(Array.isArray(t[i])||"number"==typeof t[i])&&(Array.isArray(t[i])?t[i]=e.getIds(r,t[i]):t[i]=e.getId(r,t[i]));return t}replaceIds(e,t,r){return this.replace(this.crossOriginIframeMirror,e,t,r)}replaceStyleIds(e,t,r){return this.replace(this.crossOriginIframeStyleMirror,e,t,r)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach((e=>{this.replaceIdOnNode(e,t)}))}patchRootIdOnNode(e,t){e.type===cf.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach((e=>{this.patchRootIdOnNode(e,t)}))}}class Ff{constructor(e){qi(this,"shadowDoms",new WeakSet),qi(this,"mutationCb"),qi(this,"scrollCb"),qi(this,"bypassOptions"),qi(this,"mirror"),qi(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(!oo(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const r=xf({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push((()=>r.disconnect())),this.restoreHandlers.push(Ef({...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(Pp.host(e))),this.restoreHandlers.push(Mf({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(Dp(e.prototype,"attachShadow",(function(e){return function(n){const i=e.call(this,n),o=Pp.shadowRoot(this);return o&&tf(this)&&r.addShadowRoot(o,t),i}})))}reset(){this.restoreHandlers.forEach((e=>{try{e()}catch(e){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var Uf="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",jf="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Bf=0;Bf<Uf.length;Bf++)jf[Uf.charCodeAt(Bf)]=Bf;const zf=new Map;const Vf=(e,t,r)=>{if(!e||!Gf(e,t)&&"object"!=typeof e)return;const n=function(e,t){let r=zf.get(e);return r||(r=new Map,zf.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}(r,e.constructor.name);let i=n.indexOf(e);return-1===i&&(i=n.length,n.push(e)),i};function Wf(e,t,r){if(e instanceof Array)return e.map((e=>Wf(e,t,r)));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray){return{rr_type:e.constructor.name,args:[Object.values(e)]}}if(e instanceof ArrayBuffer){return{rr_type:e.constructor.name,base64:function(e){var t,r=new Uint8Array(e),n=r.length,i="";for(t=0;t<n;t+=3)i+=Uf[r[t]>>2],i+=Uf[(3&r[t])<<4|r[t+1]>>4],i+=Uf[(15&r[t+1])<<2|r[t+2]>>6],i+=Uf[63&r[t+2]];return n%3==2?i=i.substring(0,i.length-1)+"=":n%3==1&&(i=i.substring(0,i.length-2)+"=="),i}(e)}}if(e instanceof DataView){return{rr_type:e.constructor.name,args:[Wf(e.buffer,t,r),e.byteOffset,e.byteLength]}}if(e instanceof HTMLImageElement){const t=e.constructor.name,{src:r}=e;return{rr_type:t,src:r}}if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}if(e instanceof ImageData){return{rr_type:e.constructor.name,args:[Wf(e.data,t,r),e.width,e.height]}}if(Gf(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:Vf(e,t,r)}}return e}const qf=(e,t,r)=>e.map((e=>Wf(e,t,r))),Gf=(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 Kf(e,t,r,n){const i=[];try{const o=Dp(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(i,...o){if(!Vp(this,t,r,!0)){const e=function(e){return"experimental-webgl"===e?"webgl":e}(i);if("__context"in this||(this.__context=e),n&&["webgl","webgl2"].includes(e))if(o[0]&&"object"==typeof o[0]){const e=o[0];e.preserveDrawingBuffer||(e.preserveDrawingBuffer=!0)}else o.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[i,...o])}}));i.push(o)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{i.forEach((e=>e()))}}function Yf(e,t,r,n,i,o){const s=[],a=Object.getOwnPropertyNames(e);for(const l of a)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))try{if("function"!=typeof e[l])continue;const a=Dp(e,l,(function(e){return function(...s){const a=e.apply(this,s);if(Vf(a,o,this),"tagName"in this.canvas&&!Vp(this.canvas,n,i,!0)){const e=qf(s,o,this),n={type:t,property:l,args:e};r(this.canvas,n)}return a}}));s.push(a)}catch{const n=Lp(e,l,{set(e){r(this.canvas,{type:t,property:l,args:[e],setter:!0})}});s.push(n)}return s}const Zf="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Jf="undefined"!=typeof window&&window.Blob&&new Blob([($f=Zf,Uint8Array.from(atob($f),(e=>e.charCodeAt(0))))],{type:"text/javascript;charset=utf-8"});var $f;function Xf(e){let t;try{if(t=Jf&&(window.URL||window.webkitURL).createObjectURL(Jf),!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,"+Zf,{name:null==e?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}class Hf{constructor(e){qi(this,"pendingCanvasMutations",new Map),qi(this,"rafStamps",{latestId:0,invokeId:null}),qi(this,"mirror"),qi(this,"mutationCb"),qi(this,"resetObservers"),qi(this,"frozen",!1),qi(this,"locked",!1),qi(this,"processMutation",((e,t)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)}));const{sampling:t="all",win:r,blockClass:n,blockSelector:i,recordCanvas:o,dataURLOptions:s}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,o&&"all"===t&&this.initCanvasMutationObserver(r,n,i),o&&"number"==typeof t&&this.initCanvasFPSObserver(t,r,n,i,{dataURLOptions:s})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,t,r,n,i){const o=Kf(t,r,n,!0),s=new Map,a=new Xf;a.onmessage=e=>{const{id:t}=e.data;if(s.set(t,!1),!("base64"in e.data))return;const{base64:r,type:n,width:i,height:o}=e.data;this.mutationCb({id:t,type:lf["2D"],commands:[{property:"clearRect",args:[0,0,i,o]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:n}]},0,0]}]})};const l=1e3/e;let u,c=0;const h=e=>{c&&e-c<l||(c=e,(()=>{const e=[];return t.document.querySelectorAll("canvas").forEach((t=>{Vp(t,r,n,!0)||e.push(t)})),e})().forEach((async e=>{var t;const r=this.mirror.getId(e);if(s.get(r))return;if(0===e.width||0===e.height)return;if(s.set(r,!0),["webgl","webgl2"].includes(e.__context)){const r=e.getContext(e.__context);!1===(null==(t=null==r?void 0:r.getContextAttributes())?void 0:t.preserveDrawingBuffer)&&r.clear(r.COLOR_BUFFER_BIT)}const n=await createImageBitmap(e);a.postMessage({id:r,bitmap:n,width:e.width,height:e.height,dataURLOptions:i.dataURLOptions},[n])}))),u=requestAnimationFrame(h)};u=requestAnimationFrame(h),this.resetObservers=()=>{o(),cancelAnimationFrame(u)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const n=Kf(e,t,r,!1),i=function(e,t,r,n){const i=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const s of o)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[s])continue;const o=Dp(t.CanvasRenderingContext2D.prototype,s,(function(i){return function(...o){return Vp(this.canvas,r,n,!0)||setTimeout((()=>{const r=qf(o,t,this);e(this.canvas,{type:lf["2D"],property:s,args:r})}),0),i.apply(this,o)}}));i.push(o)}catch{const r=Lp(t.CanvasRenderingContext2D.prototype,s,{set(t){e(this.canvas,{type:lf["2D"],property:s,args:[t],setter:!0})}});i.push(r)}return()=>{i.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r),o=function(e,t,r,n){const i=[];return i.push(...Yf(t.WebGLRenderingContext.prototype,lf.WebGL,e,r,n,t)),void 0!==t.WebGL2RenderingContext&&i.push(...Yf(t.WebGL2RenderingContext.prototype,lf.WebGL2,e,r,n,t)),()=>{i.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r);this.resetObservers=()=>{n(),i(),o()}}startPendingCanvasMutationFlusher(){requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((e,t)=>{const r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)})),requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const r=this.pendingCanvasMutations.get(e);if(!r||-1===t)return;const n=r.map((e=>{const{type:t,...r}=e;return r})),{type:i}=r[0];this.mutationCb({id:t,type:i,commands:n}),this.pendingCanvasMutations.delete(e)}}class Qf{constructor(e){qi(this,"trackedLinkElements",new WeakSet),qi(this,"mutationCb"),qi(this,"adoptedStyleSheetCb"),qi(this,"styleMirror",new Xp),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:ao(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 eg{constructor(){qi(this,"nodeMap",new WeakMap),qi(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 tg,rg,ng,ig=!1;try{if(2!==Array.from([1],(e=>2*e))[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(ji=e.contentWindow)?void 0:ji.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}const og=new lo;function sg(e={}){const{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:i="rr-block",blockSelector:o=null,ignoreClass:s="rr-ignore",ignoreSelector:a=null,maskTextClass:l="rr-mask",maskTextSelector:u=null,inlineStylesheet:c=!0,maskAllInputs:h,maskInputOptions:d,slimDOMOptions:p,maskInputFn:f,maskTextFn:g,hooks:m,packFn:v,sampling:y={},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:E=!1,inlineImages:O=!1,plugins:A,keepIframeSrcFn:R=(()=>!1),ignoreCSSAttributes:P=new Set([]),errorHandler:M}=e;wf=M;const _=!I||window.parent===window;let T=!1;if(!_)try{window.parent.document&&(T=!1)}catch(e){T=!0}if(_&&!t)throw new Error("emit function is required");if(!_&&!T)return()=>{};void 0!==b&&void 0===y.mousemove&&(y.mousemove=b),og.reset();const N=!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},L=!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 D;Yp();let F=0;const U=e=>{for(const t of A||[])t.eventProcessor&&(e=t.eventProcessor(e));return v&&!T&&(e=v(e)),e};tg=(e,i)=>{var o;const s=e;if(s.timestamp=Fp(),!(null==(o=Cf[0])?void 0:o.isFrozen())||s.type===nf.FullSnapshot||s.type===nf.IncrementalSnapshot&&s.data.source===of.Mutation||Cf.forEach((e=>e.unfreeze())),_)null==t||t(U(s),i);else if(T){const e={type:"rrweb",event:U(s),origin:window.location.origin,isCheckout:i};window.parent.postMessage(e,"*")}if(s.type===nf.FullSnapshot)D=s,F=0;else if(s.type===nf.IncrementalSnapshot){if(s.data.source===of.Mutation&&s.data.isAttachIframe)return;F++;const e=n&&F>=n,t=r&&s.timestamp-D.timestamp>r;(e||t)&&rg(!0)}};const j=e=>{tg({type:nf.IncrementalSnapshot,data:{source:of.Mutation,...e}})},B=e=>tg({type:nf.IncrementalSnapshot,data:{source:of.Scroll,...e}}),z=e=>tg({type:nf.IncrementalSnapshot,data:{source:of.CanvasMutation,...e}}),V=new Qf({mutationCb:j,adoptedStyleSheetCb:e=>tg({type:nf.IncrementalSnapshot,data:{source:of.AdoptedStyleSheet,...e}})}),W=new Df({mirror:og,mutationCb:j,stylesheetManager:V,recordCrossOriginIframes:I,wrappedEmit:tg});for(const e of A||[])e.getMirror&&e.getMirror({nodeMirror:og,crossOriginIframeMirror:W.crossOriginIframeMirror,crossOriginIframeStyleMirror:W.crossOriginIframeStyleMirror});const q=new eg;ng=new Hf({recordCanvas:C,mutationCb:z,win:window,blockClass:i,blockSelector:o,mirror:og,sampling:y.canvas,dataURLOptions:w});const G=new Ff({mutationCb:j,scrollCb:B,bypassOptions:{blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:u,inlineStylesheet:c,maskInputOptions:N,dataURLOptions:w,maskTextFn:g,maskInputFn:f,recordCanvas:C,inlineImages:O,sampling:y,slimDOMOptions:L,iframeManager:W,stylesheetManager:V,canvasManager:ng,keepIframeSrcFn:R,processedNodeManager:q},mirror:og});rg=(e=!1)=>{if(!S)return;tg({type:nf.Meta,data:{href:window.location.href,width:Bp(),height:jp()}},e),V.reset(),G.init(),Cf.forEach((e=>e.lock()));const t=function(e,t){const{mirror:r=new lo,blockClass:n="rr-block",blockSelector:i=null,maskTextClass:o="rr-mask",maskTextSelector:s=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:u=!1,maskAllInputs:c=!1,maskTextFn:h,maskInputFn:d,slimDOM:p=!1,dataURLOptions:f,preserveWhiteSpace:g,onSerialize:m,onIframeLoad:v,iframeLoadTimeout:y,onStylesheetLoad:w,stylesheetLoadTimeout:b,keepIframeSrcFn:S=(()=>!1)}=t||{};return jo(e,{doc:e,mirror:r,blockClass:n,blockSelector:i,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:a,maskInputOptions:!0===c?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===c?{password:!0}:c,maskTextFn: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:u,preserveWhiteSpace:g,onSerialize:m,onIframeLoad:v,iframeLoadTimeout:y,onStylesheetLoad:w,stylesheetLoadTimeout:b,keepIframeSrcFn:S,newlyAddedElement:!1})}(document,{mirror:og,blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:u,inlineStylesheet:c,maskAllInputs:N,maskTextFn:g,maskInputFn:f,slimDOM:L,dataURLOptions:w,recordCanvas:C,inlineImages:O,onSerialize:e=>{Zp(e,og)&&W.addIframe(e),Jp(e,og)&&V.trackLinkElement(e),$p(e)&&G.addShadowRoot(Pp.shadowRoot(e),document)},onIframeLoad:(e,t)=>{W.attachIframe(e,t),G.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{V.attachLinkElement(e,t)},keepIframeSrcFn:R});if(!t)return console.warn("Failed to snapshot the document");tg({type:nf.FullSnapshot,data:{node:t,initialOffset:Up(window)}},e),Cf.forEach((e=>e.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&V.adoptStyleSheets(document.adoptedStyleSheets,og.getId(document))};try{const e=[],t=e=>{var t;return bf(_f)({mutationCb:j,mousemoveCb:(e,t)=>tg({type:nf.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>tg({type:nf.IncrementalSnapshot,data:{source:of.MouseInteraction,...e}}),scrollCb:B,viewportResizeCb:e=>tg({type:nf.IncrementalSnapshot,data:{source:of.ViewportResize,...e}}),inputCb:e=>tg({type:nf.IncrementalSnapshot,data:{source:of.Input,...e}}),mediaInteractionCb:e=>tg({type:nf.IncrementalSnapshot,data:{source:of.MediaInteraction,...e}}),styleSheetRuleCb:e=>tg({type:nf.IncrementalSnapshot,data:{source:of.StyleSheetRule,...e}}),styleDeclarationCb:e=>tg({type:nf.IncrementalSnapshot,data:{source:of.StyleDeclaration,...e}}),canvasMutationCb:z,fontCb:e=>tg({type:nf.IncrementalSnapshot,data:{source:of.Font,...e}}),selectionCb:e=>{tg({type:nf.IncrementalSnapshot,data:{source:of.Selection,...e}})},customElementCb:e=>{tg({type:nf.IncrementalSnapshot,data:{source:of.CustomElement,...e}})},blockClass:i,ignoreClass:s,ignoreSelector:a,maskTextClass:l,maskTextSelector:u,maskInputOptions:N,inlineStylesheet:c,sampling:y,recordDOM:S,recordCanvas:C,inlineImages:O,userTriggeredOnInput:k,collectFonts:E,doc:e,maskInputFn:f,maskTextFn:g,keepIframeSrcFn:R,blockSelector:o,slimDOMOptions:L,dataURLOptions:w,mirror:og,iframeManager:W,stylesheetManager:V,shadowDomManager:G,processedNodeManager:q,canvasManager:ng,ignoreCSSAttributes:P,plugins:(null==(t=null==A?void 0:A.filter((e=>e.observer)))?void 0:t.map((e=>({observer:e.observer,options:e.options,callback:t=>tg({type:nf.Plugin,data:{plugin:e.name,payload:t}})}))))||[]},m)};W.addLoadListener((r=>{try{e.push(t(r.contentDocument))}catch(e){console.warn(e)}}));const r=()=>{rg(),e.push(t(document)),ig=!0};return"interactive"===document.readyState||"complete"===document.readyState?r():(e.push(Mp("DOMContentLoaded",(()=>{tg({type:nf.DomContentLoaded,data:{}}),"DOMContentLoaded"===x&&r()}))),e.push(Mp("load",(()=>{tg({type:nf.Load,data:{}}),"load"===x&&r()}),window))),()=>{e.forEach((e=>e())),q.destroy(),ig=!1,wf=void 0}}catch(e){console.warn(e)}}var ag,lg,ug,cg;sg.addCustomEvent=(e,t)=>{if(!ig)throw new Error("please add custom event after start recording");tg({type:nf.Custom,data:{tag:e,payload:t}})},sg.freezePage=()=>{Cf.forEach((e=>e.freeze()))},sg.takeFullSnapshot=e=>{if(!ig)throw new Error("please take full snapshot after start recording");rg(e)},sg.mirror=og,(lg=ag||(ag={}))[lg.NotStarted=0]="NotStarted",lg[lg.Running=1]="Running",lg[lg.Stopped=2]="Stopped",function(e){e.US="US",e.EU="EU",e.STAGING="STAGING"}(ug||(ug={})),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"}(cg||(cg={}));var hg=function(){function e(){}return e.prototype.send=function(e,t){return Promise.resolve(null)},e.prototype.buildResponse=function(e){var t,r,n,i,o,s,a,l,u,c,h,d,p,f,g,m,v,y,w,b,S,C;if("object"!=typeof e)return null;var I=e.code||0,x=this.buildStatus(I);switch(x){case cg.Success:return{status:x,statusCode:I,body:{eventsIngested:null!==(t=e.events_ingested)&&void 0!==t?t:0,payloadSizeBytes:null!==(r=e.payload_size_bytes)&&void 0!==r?r:0,serverUploadTime:null!==(n=e.server_upload_time)&&void 0!==n?n:0}};case cg.Invalid:return{status:x,statusCode:I,body:{error:null!==(i=e.error)&&void 0!==i?i:"",missingField:null!==(o=e.missing_field)&&void 0!==o?o:"",eventsWithInvalidFields:null!==(s=e.events_with_invalid_fields)&&void 0!==s?s:{},eventsWithMissingFields:null!==(a=e.events_with_missing_fields)&&void 0!==a?a:{},eventsWithInvalidIdLengths:null!==(l=e.events_with_invalid_id_lengths)&&void 0!==l?l:{},epsThreshold:null!==(u=e.eps_threshold)&&void 0!==u?u:0,exceededDailyQuotaDevices:null!==(c=e.exceeded_daily_quota_devices)&&void 0!==c?c:{},silencedDevices:null!==(h=e.silenced_devices)&&void 0!==h?h:[],silencedEvents:null!==(d=e.silenced_events)&&void 0!==d?d:[],throttledDevices:null!==(p=e.throttled_devices)&&void 0!==p?p:{},throttledEvents:null!==(f=e.throttled_events)&&void 0!==f?f:[]}};case cg.PayloadTooLarge:return{status:x,statusCode:I,body:{error:null!==(g=e.error)&&void 0!==g?g:""}};case cg.RateLimit:return{status:x,statusCode:I,body:{error:null!==(m=e.error)&&void 0!==m?m:"",epsThreshold:null!==(v=e.eps_threshold)&&void 0!==v?v:0,throttledDevices:null!==(y=e.throttled_devices)&&void 0!==y?y:{},throttledUsers:null!==(w=e.throttled_users)&&void 0!==w?w:{},exceededDailyQuotaDevices:null!==(b=e.exceeded_daily_quota_devices)&&void 0!==b?b:{},exceededDailyQuotaUsers:null!==(S=e.exceeded_daily_quota_users)&&void 0!==S?S:{},throttledEvents:null!==(C=e.throttled_events)&&void 0!==C?C:[]}};case cg.Timeout:default:return{status:x,statusCode:I}}},e.prototype.buildStatus=function(e){return e>=200&&e<300?cg.Success:429===e?cg.RateLimit:413===e?cg.PayloadTooLarge:408===e?cg.Timeout:e>=400&&e<500?cg.Invalid:e>=500?cg.Failed:cg.Unknown},e}(),dg="Remote config fetch rejected due to timeout after 5 seconds",pg="Unexpected error occurred",fg=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,i,o;return l(this,(function(s){switch(s.label){case 0:return n=Date.now(),[4,this.fetchWithTimeout(r)];case 1:return(i=s.sent())&&(o=i.configs&&i.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(i){switch(i.label){case 0:return t=new AbortController,r=setTimeout((function(){return t.abort()}),5e3),[4,this.fetchRemoteConfig(t.signal,e)];case 1:return n=i.sent(),clearTimeout(r),[2,n]}}))}))},this.fetchRemoteConfig=function(e,t){return a(n,void 0,void 0,(function(){var r,n,i,s,a,c,h,d,p,f,g,m;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:dg})];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=u(this.configKeys),i=n.next();!i.done;i=n.next())s=i.value,r.append("config_keys",s)}catch(e){f={error:e}}finally{try{i&&!i.done&&(g=n.return)&&g.call(n)}finally{if(f)throw f.error}}return t&&r.set("session_id",String(t)),a={headers:{Accept:"*/*"},method:"GET"},c="".concat(this.getServerUrl(),"?").concat(r.toString()),this.attempts+=1,[4,fetch(c,o(o({},a),{signal:e}))];case 2:if(null===(h=l.sent()))return[2,this.completeRequest({err:pg})];switch((new hg).buildStatus(h.status)){case cg.Success:return this.attempts=0,[2,this.parseAndStoreConfig(h)];case cg.Failed:return[2,this.retryFetch(e,t)];default:return[2,this.completeRequest({err:"Network error occurred, remote config fetch failed"})]}case 3:return d=l.sent(),p=d,e.aborted?[2,this.completeRequest({err:dg})]:[2,this.completeRequest({err:null!==(m=p.message)&&void 0!==m?m:pg})];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===ug.STAGING?"https://sr-client-cfg.stag2.amplitude.com/config":this.localConfig.serverZone===ug.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}(),gg=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 fg({localConfig:t,configKeys:r})]}))}))};function mg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function vg(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var r=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})})),r}var yg={exports:{}},wg=String,bg=function(){return{isColorSupported:!1,reset:wg,bold:wg,dim:wg,italic:wg,underline:wg,inverse:wg,hidden:wg,strikethrough:wg,black:wg,red:wg,green:wg,yellow:wg,blue:wg,magenta:wg,cyan:wg,white:wg,gray:wg,bgBlack:wg,bgRed:wg,bgGreen:wg,bgYellow:wg,bgBlue:wg,bgMagenta:wg,bgCyan:wg,bgWhite:wg}};yg.exports=bg(),yg.exports.createColors=bg;var Sg=yg.exports;const Cg=vg(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let Ig=Sg,xg=Cg,kg=class e extends Error{constructor(t,r,n,i,o,s){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),i&&(this.source=i),s&&(this.plugin=s),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=Ig.isColorSupported),xg&&e&&(t=xg(t));let r,n,i=t.split(/\r?\n/),o=Math.max(this.line-3,0),s=Math.min(this.line+2,i.length),a=String(s).length;if(e){let{bold:e,gray:t,red:i}=Ig.createColors(!0);r=t=>e(i(t)),n=e=>t(e)}else r=n=e=>e;return i.slice(o,s).map(((e,t)=>{let i=o+1+t,s=" "+(" "+i).slice(-a)+" | ";if(i===this.line){let t=n(s.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return r(">")+n(s)+e+"\n "+t+r("^")}return" "+n(s)+e})).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};var Eg=kg;kg.default=kg;var Og={};Og.isClean=Symbol("isClean"),Og.my=Symbol("my");const Ag={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let Rg=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 i=(e.raws.between||"")+(t?";":"");this.builder(r+n+i,e)}}beforeAfter(e,t){let r;r="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let n=e.parent,i=0;for(;n&&"root"!==n.type;)i+=1,n=n.parent;if(r.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<i;e++)r+=t}return r}block(e,t){let r,n=this.raw(e,"between","beforeOpen");this.builder(t+n+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),r=this.raw(e,"after")):r=this.raw(e,"after","emptyBody"),r&&this.builder(r),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let r=this.raw(e,"semicolon");for(let n=0;n<e.nodes.length;n++){let i=e.nodes[n],o=this.raw(i,"before");o&&this.builder(o),this.stringify(i,t!==n||r)}}comment(e){let t=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)}decl(e,t){let r=this.raw(e,"between","colon"),n=e.prop+r+this.rawValue(e,"value");e.important&&(n+=e.raws.important||" !important"),t&&(n+=";"),this.builder(n,e)}document(e){this.body(e)}raw(e,t,r){let n;if(r||(r=t),t&&(n=e.raws[t],void 0!==n))return n;let i=e.parent;if("before"===r){if(!i||"root"===i.type&&i.first===e)return"";if(i&&"document"===i.type)return""}if(!i)return Ag[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 i="raw"+((s=r)[0].toUpperCase()+s.slice(1));this[i]?n=this[i](o,e):o.walk((e=>{if(n=e.raws[t],void 0!==n)return!1}))}var s;return void 0===n&&(n=Ag[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 Pg=Rg;Rg.default=Rg;let Mg=Pg;function _g(e,t){new Mg(t).stringify(e)}var Tg=_g;_g.default=_g;let{isClean:Ng,my:Lg}=Og,Dg=Eg,Fg=Pg,Ug=Tg;function jg(e,t){let r=new e.constructor;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if("proxyCache"===n)continue;let i=e[n],o=typeof i;"parent"===n&&"object"===o?t&&(r[n]=t):"source"===n?r[n]=i:Array.isArray(i)?r[n]=i.map((e=>jg(e,r))):("object"===o&&null!==i&&(i=jg(i)),r[n]=i)}return r}let Bg=class{constructor(e={}){this.raws={},this[Ng]=!1,this[Lg]=!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=jg(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 Dg(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[Ng]){this[Ng]=!1;let e=this;for(;e=e.parent;)e[Ng]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){let n=(t=this.toString()).indexOf(e.word);-1!==n&&(r=this.positionInside(n,t))}return r}positionInside(e,t){let r=t||this.toString(),n=this.source.start.column,i=this.source.start.line;for(let t=0;t<e;t++)"\n"===r[t]?(n=1,i+=1):n+=1;return{column:n,line:i}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let n=this.toString(),i=n.indexOf(e.word);-1!==i&&(t=this.positionInside(i,n),r=this.positionInside(i+e.word.length,n))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return(new Fg).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let n of e)n===this?r=!0:r?(this.parent.insertAfter(t,n),t=n):this.parent.insertBefore(t,n);r||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let r={},n=null==t;t=t||new Map;let i=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let n=this[e];if(Array.isArray(n))r[e]=n.map((e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e));else if("object"==typeof n&&n.toJSON)r[e]=n.toJSON(null,t);else if("source"===e){let o=t.get(n.input);null==o&&(o=i,t.set(n.input,i),i++),r[e]={end:n.end,inputId:o,start:n.start}}else r[e]=n}return n&&(r.inputs=[...t.keys()].map((e=>e.toJSON()))),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=Ug){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 zg=Bg;Bg.default=Bg;let Vg=zg,Wg=class extends Vg{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 qg=Wg;Wg.default=Wg;var Gg={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(r=t)=>{let n="",i=r;for(;i--;)n+=e[Math.random()*e.length|0];return n}};let{SourceMapConsumer:Kg,SourceMapGenerator:Yg}=Cg,{existsSync:Zg,readFileSync:Jg}=Cg,{dirname:$g,join:Xg}=Cg;let Hg=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=$g(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new Kg(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=$g(e),Zg(e))return this.mapFile=e,Jg(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 Kg)return Yg.fromSourceMap(t).toString();if(t instanceof Yg)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=Xg($g(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 Qg=Hg;Hg.default=Hg;let{SourceMapConsumer:em,SourceMapGenerator:tm}=Cg,{fileURLToPath:rm,pathToFileURL:nm}=Cg,{isAbsolute:im,resolve:om}=Cg,{nanoid:sm}=Gg,am=Cg,lm=Eg,um=Qg,cm=Symbol("fromOffsetCache"),hm=Boolean(em&&tm),dm=Boolean(om&&im),pm=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&&(!dm||/^\w+:\/\//.test(t.from)||im(t.from)?this.file=t.from:this.file=om(t.from)),dm&&hm){let e=new um(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 "+sm(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let i,o,s;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,s=e.col}else o=n.line,s=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let a=this.origin(t,r,o,s);return i=a?new lm(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 lm(e,void 0===o?t:{column:r,line:t},void 0===o?r:{column:s,line:o},this.css,this.file,n.plugin),i.input={column:r,endColumn:s,endLine:o,line:t,source:this.css},this.file&&(nm&&(i.input.url=nm(this.file).toString()),i.input.file=this.file),i}fromOffset(e){let t,r;if(this[cm])r=this[cm];else{let e=this.css.split("\n");r=new Array(e.length);let t=0;for(let n=0,i=e.length;n<i;n++)r[n]=t,t+=e[n].length+1;this[cm]=r}t=r[r.length-1];let n=0;if(e>=t)n=r.length-1;else{let t,i=r.length-2;for(;n<i;)if(t=n+(i-n>>1),e<r[t])i=t-1;else{if(!(e>=r[t+1])){n=t;break}n=t+1}}return{col:e-r[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:om(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,n){if(!this.map)return!1;let i,o,s=this.map.consumer(),a=s.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof r&&(i=s.originalPositionFor({column:n,line:r})),o=im(a.source)?nm(a.source):new URL(a.source,this.map.consumer().sourceRoot||nm(this.map.mapFile));let l={column:a.column,endColumn:i&&i.column,endLine:i&&i.line,line:a.line,url:o.toString()};if("file:"===o.protocol){if(!rm)throw new Error("file: protocol is not available in this PostCSS build");l.file=rm(o)}let u=s.sourceContentFor(a.source);return u&&(l.source=u),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 fm=pm;pm.default=pm,am&&am.registerInput&&am.registerInput(pm);let{SourceMapConsumer:gm,SourceMapGenerator:mm}=Cg,{dirname:vm,relative:ym,resolve:wm,sep:bm}=Cg,{pathToFileURL:Sm}=Cg,Cm=fm,Im=Boolean(gm&&mm),xm=Boolean(vm&&wm&&ym&&bm);var km=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||vm(e.file);!1===this.mapOpts.sourcesContent?(t=new gm(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(),xm&&Im&&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=mm.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new mm({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 mm({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,r=1,n=1,i="<no source>",o={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,((s,a,l)=>{if(this.css+=s,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=i,o.original.line=1,o.original.column=0,this.map.addMapping(o))),e=s.match(/\n/g),e?(r+=e.length,t=s.lastIndexOf("\n"),n=s.length-t):n+=s.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=i,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?vm(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=vm(wm(r,this.mapOpts.annotation)));let n=ym(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 Cm(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(Sm){let t=Sm(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;"\\"===bm&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let Em=zg,Om=class extends Em{constructor(e){super(e),this.type="comment"}};var Am=Om;Om.default=Om;let Rm,Pm,Mm,_m,{isClean:Tm,my:Nm}=Og,Lm=qg,Dm=Am,Fm=zg;function Um(e){return e.map((e=>(e.nodes&&(e.nodes=Um(e.nodes)),delete e.source,e)))}function jm(e){if(e[Tm]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)jm(t)}let Bm=class e extends Fm{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,r,n=this.getIterator();for(;this.indexes[n]<this.proxyOf.nodes.length&&(t=this.indexes[n],r=e(this.proxyOf.nodes[t],t),!1!==r);)this.indexes[n]+=1;return delete this.indexes[n],r}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...r)=>e[t](...r.map((e=>"function"==typeof e?(t,r)=>e(t.toProxy(),r):e))):"every"===t||"some"===t?r=>e[t](((e,...t)=>r(e.toProxy(),...t))):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map((e=>e.toProxy())):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let r,n=this.index(e),i=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let e of i)this.proxyOf.nodes.splice(n+1,0,e);for(let e in this.indexes)r=this.indexes[e],n<r&&(this.indexes[e]=r+i.length);return this.markDirty(),this}insertBefore(e,t){let r,n=this.index(e),i=0===n&&"prepend",o=this.normalize(t,this.proxyOf.nodes[n],i).reverse();n=this.index(e);for(let e of o)this.proxyOf.nodes.splice(n,0,e);for(let e in this.indexes)r=this.indexes[e],n<=r&&(this.indexes[e]=r+o.length);return this.markDirty(),this}normalize(t,r){if("string"==typeof t)t=Um(Rm(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 Lm(t)]}else if(t.selector)t=[new Pm(t)];else if(t.name)t=[new Mm(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new Dm(t)]}let n=t.map((t=>(t[Nm]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[Tm]&&jm(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]}};Bm.registerParse=e=>{Rm=e},Bm.registerRule=e=>{Pm=e},Bm.registerAtRule=e=>{Mm=e},Bm.registerRoot=e=>{_m=e};var zm=Bm;Bm.default=Bm,Bm.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,Mm.prototype):"rule"===e.type?Object.setPrototypeOf(e,Pm.prototype):"decl"===e.type?Object.setPrototypeOf(e,Lm.prototype):"comment"===e.type?Object.setPrototypeOf(e,Dm.prototype):"root"===e.type&&Object.setPrototypeOf(e,_m.prototype),e[Nm]=!0,e.nodes&&e.nodes.forEach((e=>{Bm.rebuild(e)}))};let Vm,Wm,qm=zm,Gm=class extends qm{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new Vm(new Wm,this,e).stringify()}};Gm.registerLazyResult=e=>{Vm=e},Gm.registerProcessor=e=>{Wm=e};var Km=Gm;Gm.default=Gm;let Ym={};var Zm=function(e){Ym[e]||(Ym[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let Jm=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 $m=Jm;Jm.default=Jm;let Xm=$m,Hm=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 Xm(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter((e=>"warning"===e.type))}get content(){return this.css}};var Qm=Hm;Hm.default=Hm;const ev="'".charCodeAt(0),tv='"'.charCodeAt(0),rv="\\".charCodeAt(0),nv="/".charCodeAt(0),iv="\n".charCodeAt(0),ov=" ".charCodeAt(0),sv="\f".charCodeAt(0),av="\t".charCodeAt(0),lv="\r".charCodeAt(0),uv="[".charCodeAt(0),cv="]".charCodeAt(0),hv="(".charCodeAt(0),dv=")".charCodeAt(0),pv="{".charCodeAt(0),fv="}".charCodeAt(0),gv=";".charCodeAt(0),mv="*".charCodeAt(0),vv=":".charCodeAt(0),yv="@".charCodeAt(0),wv=/[\t\n\f\r "#'()/;[\\\]{}]/g,bv=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Sv=/.[\r\n"'(/\\]/,Cv=/[\da-f]/i;let Iv=zm,xv=class extends Iv{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 kv=xv;xv.default=xv,Iv.registerAtRule(xv);let Ev,Ov,Av=zm,Rv=class extends Av{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 Ev(new Ov,this,e).stringify()}};Rv.registerLazyResult=e=>{Ev=e},Rv.registerProcessor=e=>{Ov=e};var Pv=Rv;Rv.default=Rv,Av.registerRoot(Rv);let Mv={comma:e=>Mv.split(e,[","],!0),space:e=>Mv.split(e,[" ","\n","\t"]),split(e,t,r){let n=[],i="",o=!1,s=0,a=!1,l="",u=!1;for(let r of e)u?u=!1:"\\"===r?u=!0:a?r===l&&(a=!1):'"'===r||"'"===r?(a=!0,l=r):"("===r?s+=1:")"===r?s>0&&(s-=1):0===s&&t.includes(r)&&(o=!0),o?(""!==i&&n.push(i.trim()),i="",o=!1):i+=r;return(r||""!==i)&&n.push(i.trim()),n}};var _v=Mv;Mv.default=Mv;let Tv=zm,Nv=_v,Lv=class extends Tv{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Nv.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 Dv=Lv;Lv.default=Lv,Tv.registerRule(Lv);let Fv=qg,Uv=function(e,t={}){let r,n,i,o,s,a,l,u,c,h,d=e.css.valueOf(),p=t.ignoreErrors,f=d.length,g=0,m=[],v=[];function y(t){throw e.error("Unclosed "+t,g)}return{back:function(e){v.push(e)},endOfFile:function(){return 0===v.length&&g>=f},nextToken:function(e){if(v.length)return v.pop();if(g>=f)return;let t=!!e&&e.ignoreUnclosed;switch(r=d.charCodeAt(g),r){case iv:case ov:case av:case lv:case sv:n=g;do{n+=1,r=d.charCodeAt(n)}while(r===ov||r===iv||r===av||r===lv||r===sv);h=["space",d.slice(g,n)],g=n-1;break;case uv:case cv:case pv:case fv:case vv:case gv:case dv:{let e=String.fromCharCode(r);h=[e,e,g];break}case hv:if(u=m.length?m.pop()[1]:"",c=d.charCodeAt(g+1),"url"===u&&c!==ev&&c!==tv&&c!==ov&&c!==iv&&c!==av&&c!==sv&&c!==lv){n=g;do{if(a=!1,n=d.indexOf(")",n+1),-1===n){if(p||t){n=g;break}y("bracket")}for(l=n;d.charCodeAt(l-1)===rv;)l-=1,a=!a}while(a);h=["brackets",d.slice(g,n+1),g,n],g=n}else n=d.indexOf(")",g+1),o=d.slice(g,n+1),-1===n||Sv.test(o)?h=["(","(",g]:(h=["brackets",o,g,n],g=n);break;case ev:case tv:i=r===ev?"'":'"',n=g;do{if(a=!1,n=d.indexOf(i,n+1),-1===n){if(p||t){n=g+1;break}y("string")}for(l=n;d.charCodeAt(l-1)===rv;)l-=1,a=!a}while(a);h=["string",d.slice(g,n+1),g,n],g=n;break;case yv:wv.lastIndex=g+1,wv.test(d),n=0===wv.lastIndex?d.length-1:wv.lastIndex-2,h=["at-word",d.slice(g,n+1),g,n],g=n;break;case rv:for(n=g,s=!0;d.charCodeAt(n+1)===rv;)n+=1,s=!s;if(r=d.charCodeAt(n+1),s&&r!==nv&&r!==ov&&r!==iv&&r!==av&&r!==lv&&r!==sv&&(n+=1,Cv.test(d.charAt(n)))){for(;Cv.test(d.charAt(n+1));)n+=1;d.charCodeAt(n+1)===ov&&(n+=1)}h=["word",d.slice(g,n+1),g,n],g=n;break;default:r===nv&&d.charCodeAt(g+1)===mv?(n=d.indexOf("*/",g+2)+1,0===n&&(p||t?n=d.length:y("comment")),h=["comment",d.slice(g,n+1),g,n],g=n):(bv.lastIndex=g+1,bv.test(d),n=0===bv.lastIndex?d.length-1:bv.lastIndex-2,h=["word",d.slice(g,n+1),g,n],m.push(h),g=n)}return g++,h},position:function(){return g}}},jv=Am,Bv=kv,zv=Pv,Vv=Dv;const Wv={empty:!0,space:!0};var qv=class{constructor(e){this.input=e,this.root=new zv,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,i=new Bv;i.name=e[1].slice(1),""===i.name&&this.unnamedAtrule(i,e),this.init(i,e[2]);let o=!1,s=!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){i.source.end=this.getPosition(e[2]),i.source.end.offset++,this.semicolon=!0;break}if("{"===t){s=!0;break}if("}"===t){if(a.length>0){for(n=a.length-1,r=a[n];r&&"space"===r[0];)r=a[--n];r&&(i.source.end=this.getPosition(r[3]||r[2]),i.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}i.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(i.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(i,"params",a),o&&(e=a[a.length-1],i.source.end=this.getPosition(e[3]||e[2]),i.source.end.offset++,this.spaces=i.raws.between,i.raws.between="")):(i.raws.afterName="",i.params=""),s&&(i.nodes=[],this.current=i)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let r,n=0;for(let i=t-1;i>=0&&(r=e[i],"space"===r[0]||(n+=1,2!==n));i--);throw this.input.error("Missed semicolon","word"===r[0]?r[3]+1:r[2])}colon(e){let t,r,n,i=0;for(let[o,s]of e.entries()){if(t=s,r=t[0],"("===r&&(i+=1),")"===r&&(i-=1),0===i&&":"===r){if(n){if("word"===n[0]&&"progid"===n[1])continue;return o}this.doubleColon(t)}n=t}return!1}comment(e){let t=new jv;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=Uv(this.input)}decl(e,t){let r=new Fv;this.init(r,e[0][2]);let n,i=e[e.length-1];for(";"===i[0]&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(i[3]||i[2]||function(e){for(let t=e.length-1;t>=0;t--){let r=e[t],n=r[3]||r[2];if(n)return n}}(e)),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,s=[];for(;e.length&&(o=e[0][0],"space"===o||"comment"===o);)s.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),i="";for(let e=t;e>0;e--){let t=n[e][0];if(0===i.trim().indexOf("!")&&"space"!==t)break;i=n.pop()[1]+i}0===i.trim().indexOf("!")&&(r.important=!0,r.raws.important=i,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+=s.map((e=>e[1])).join(""),s=[]),this.raw(r,"value",s.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 Vv;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,r=null,n=!1,i=null,o=[],s=e[1].startsWith("--"),a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)i||(i=l),o.push("("===r?")":"]");else if(s&&n&&"{"===r)i||(i=l),o.push("}");else if(0===o.length){if(";"===r){if(n)return void this.decl(a,s);break}if("{"===r)return void this.rule(a);if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}":"===r&&(n=!0)}else r===o[o.length-1]&&(o.pop(),0===o.length&&(i=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(i),t&&n){if(!s)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,s)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,r,n){let i,o,s,a,l=r.length,u="",c=!0;for(let e=0;e<l;e+=1)i=r[e],o=i[0],"space"!==o||e!==l-1||n?"comment"===o?(a=r[e-1]?r[e-1][0]:"empty",s=r[e+1]?r[e+1][0]:"empty",Wv[a]||Wv[s]||","===u.slice(-1)?c=!1:u+=i[1]):u+=i[1]:c=!1;if(!c){let n=r.reduce(((e,t)=>e+t[1]),"");e.raws[t]={raw:n,value:u}}e[t]=u}rule(e){e.pop();let t=new Vv;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 Gv=zm,Kv=qv,Yv=fm;function Zv(e,t){let r=new Yv(e,t),n=new Kv(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 Jv=Zv;Zv.default=Zv,Gv.registerParse(Zv);let{isClean:$v,my:Xv}=Og,Hv=km,Qv=Tg,ey=zm,ty=Km,ry=Zm,ny=Qm,iy=Jv,oy=Pv;const sy={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},ay={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},ly={Once:!0,postcssPlugin:!0,prepare:!0};function uy(e){return"object"==typeof e&&"function"==typeof e.then}function cy(e){let t=!1,r=sy[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 hy(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:cy(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function dy(e){return e[$v]=!1,e.nodes&&e.nodes.forEach((e=>dy(e))),e}let py={},fy=class e{constructor(t,r,n){let i;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof e||r instanceof ny)i=dy(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=iy;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{i=e(r,n)}catch(e){this.processed=!0,this.error=e}i&&!i[Xv]&&ey.rebuild(i)}else i=dy(r);this.result=new ny(t,i,n),this.helpers={...py,postcss:py,result:this.result},this.plugins=this.processor.plugins.map((e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e))}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let r=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(r.postcssVersion&&"production"!==process.env.NODE_ENV){let e=r.postcssPlugin,t=r.postcssVersion,n=this.result.processor.version,i=t.split("."),o=n.split(".");(i[0]!==o[0]||parseInt(i[1])>parseInt(o[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+n+", but "+e+" uses "+t+". Perhaps this is the source of the error below.")}}else e.plugin=r.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,r)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,r])};for(let t of this.plugins)if("object"==typeof t)for(let r in t){if(!ay[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!ly[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(uy(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[$v];){e[$v]=!0;let t=[hy(e)];for(;t.length>0;){let e=this.visitTick(t);if(uy(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 uy(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=Qv;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new Hv(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(uy(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[$v];)e[$v]=!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||ry("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(uy(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,i]=n[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===n.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return i(r.toProxy(),this.helpers)}catch(e){throw this.handleError(e,r)}}if(0!==t.iterator){let n,i=t.iterator;for(;n=r.nodes[r.indexes[i]];)if(r.indexes[i]+=1,!n[$v])return n[$v]=!0,void e.push(hy(n));t.iterator=0,delete r.indexes[i]}let i=t.events;for(;t.eventIndex<i.length;){let e=i[t.eventIndex];if(t.eventIndex+=1,0===e)return void(r.nodes&&r.nodes.length&&(r[$v]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[$v]=!0;let t=cy(e);for(let r of t)if(0===r)e.nodes&&e.each((e=>{e[$v]||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"}};fy.registerPostcss=e=>{py=e};var gy=fy;fy.default=fy,oy.registerLazyResult(fy),ty.registerLazyResult(fy);let my=km,vy=Tg,yy=Zm,wy=Jv;const by=Qm;let Sy=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 i=vy;this.result=new by(this._processor,n,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let s=new my(i,n,this._opts,t);if(s.isMap()){let[e,t]=s.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else s.clearAnnotation(),this.result.css=s.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||yy("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=wy;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 Cy=Sy;Sy.default=Sy;let Iy=Cy,xy=gy,ky=Km,Ey=Pv,Oy=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 xy(this,e,t):new Iy(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var Ay=Oy;Oy.default=Oy,Ey.registerProcessor(Oy),ky.registerProcessor(Oy);let Ry=qg,Py=Qg,My=Am,_y=kv,Ty=fm,Ny=Pv,Ly=Dv;function Dy(e,t){if(Array.isArray(e))return e.map((e=>Dy(e)));let{inputs:r,...n}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:Ty.prototype};r.map&&(r.map={...r.map,__proto__:Py.prototype}),t.push(r)}}if(n.nodes&&(n.nodes=e.nodes.map((e=>Dy(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 Ny(n);if("decl"===n.type)return new Ry(n);if("rule"===n.type)return new Ly(n);if("comment"===n.type)return new My(n);if("atrule"===n.type)return new _y(n);throw new Error("Unknown node type: "+e.type)}var Fy=Dy;Dy.default=Dy;let Uy=Eg,jy=qg,By=gy,zy=zm,Vy=Ay,Wy=Tg,qy=Fy,Gy=Km,Ky=$m,Yy=Am,Zy=kv,Jy=Qm,$y=fm,Xy=Jv,Hy=_v,Qy=Dv,ew=Pv,tw=zg;function rw(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new Vy(e)}rw.plugin=function(e,t){let r,n=!1;function i(...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 i=t(...r);return i.postcssPlugin=e,i.postcssVersion=(new Vy).version,i}return Object.defineProperty(i,"postcss",{get:()=>(r||(r=i()),r)}),i.process=function(e,t,r){return rw([i(r)]).process(e,t)},i},rw.stringify=Wy,rw.parse=Xy,rw.fromJSON=qy,rw.list=Hy,rw.comment=e=>new Yy(e),rw.atRule=e=>new Zy(e),rw.decl=e=>new jy(e),rw.rule=e=>new Qy(e),rw.root=e=>new ew(e),rw.document=e=>new Gy(e),rw.CssSyntaxError=Uy,rw.Declaration=jy,rw.Container=zy,rw.Processor=Vy,rw.Document=Gy,rw.Comment=Yy,rw.Warning=Ky,rw.AtRule=Zy,rw.Result=Jy,rw.Input=$y,rw.Rule=Qy,rw.Root=ew,rw.Node=tw,By.registerPostcss(rw);var nw=rw;rw.default=rw;const iw=mg(nw);iw.stringify,iw.fromJSON,iw.plugin,iw.parse,iw.list,iw.document,iw.comment,iw.atRule,iw.rule,iw.decl,iw.root,iw.CssSyntaxError,iw.Declaration,iw.Container,iw.Processor,iw.Document,iw.Comment,iw.Warning,iw.AtRule,iw.Result,iw.Input,iw.Rule,iw.Root,iw.Node;var ow="medium",sw=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 sw(e,ow,r)}},aw=function(e,t){return function(r,n){return function(e,t,r){var n,i,o;if(void 0===t&&(t={defaultMaskLevel:ow}),r){if(r.closest("."+Ui))return!0;var s=(null!==(n=t.maskSelector)&&void 0!==n?n:[]).some((function(e){return r.closest(e)}));if(s)return!0;if(r.closest(".amp-unmask"))return!1;var a=(null!==(i=t.unmaskSelector)&&void 0!==i?i:[]).some((function(e){return r.closest(e)}));if(a)return!1}return sw(e,null!==(o=t.defaultMaskLevel)&&void 0!==o?o:ow,r)}(e,t,n)?r.replace(/[^\s]/g,"*"):r}},lw=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},uw=function(e,t){return t||(e===X.STAGING?"https://api-sr.stag2.amplitude.com/sessions/v2/track":e===X.EU?"https://api-sr.eu.amplitude.com/sessions/v2/track":"https://api-sr.amplitude.com/sessions/v2/track")},cw=function(){return a(void 0,void 0,void 0,(function(){var e,t,r,n,i,o,s;return l(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),(e=E())?[4,e.navigator.storage.estimate()]:[3,2];case 1:return t=a.sent(),r=t.usage,n=t.quota,i=t.usageDetails,o=r?Math.round(r/1024):0,s=r&&n?Math.round(1e3*(r/n+Number.EPSILON))/1e3:0,[2,{totalStorageSize:o,percentOfQuota:s,usageDetails:JSON.stringify(i)}];case 2:return[3,4];case 3:return a.sent(),[3,4];case 4:return[2,{totalStorageSize:0,percentOfQuota:0,usageDetails:""}]}}))}))},hw=function(e){var t=o({},e),r=t.apiKey;return t.apiKey="****".concat(r.substring(r.length-4)),t},dw=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 i,s,a,h,d,p,f,g,m,v,y,w,b,S,C,I,x,k,E,O,A;return l(this,(function(l){switch(l.label){case 0:(i=o({},this.localConfig)).optOut=this.localConfig.optOut,i.captureEnabled=!0,l.label=1;case 1:return l.trys.push([1,6,,7]),[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=i,[4,this.remoteConfigFetch.getRemoteConfig("sessionReplay","sr_interaction_config",e)];case 4:return d.interactionConfig=l.sent(),p=i,[4,this.remoteConfigFetch.getRemoteConfig("sessionReplay","sr_logging_config",e)];case 5:return p.loggingConfig=l.sent(),(a||h)&&(s={},a&&(s.sr_sampling_config=a),h&&(s.sr_privacy_config=h)),[3,7];case 6:return f=l.sent(),g=f,this.localConfig.loggerProvider.warn(g.message),i.captureEnabled=!1,[3,7];case 7:if(!s)return[2,i];if(m=s.sr_sampling_config,v=s.sr_privacy_config,m&&Object.keys(m).length>0?(Object.prototype.hasOwnProperty.call(m,"capture_enabled")?i.captureEnabled=m.capture_enabled:i.captureEnabled=!1,Object.prototype.hasOwnProperty.call(m,"sample_rate")&&(i.sampleRate=m.sample_rate)):(i.captureEnabled=!0,this.localConfig.loggerProvider.debug("Remote config successfully fetched, but no values set for project, Session Replay capture enabled.")),v){y=null!==(t=i.privacyConfig)&&void 0!==t?t:{},w={defaultMaskLevel:null!==(n=null!==(r=v.defaultMaskLevel)&&void 0!==r?r:y.defaultMaskLevel)&&void 0!==n?n:"medium",blockSelector:[],maskSelector:[],unmaskSelector:[]},b=function(e){var t,r,n,i,o,s,a,l,c,h={};"string"==typeof e.blockSelector&&(e.blockSelector=[e.blockSelector]);try{for(var d=u(null!==(a=e.blockSelector)&&void 0!==a?a:[]),p=d.next();!p.done;p=d.next()){h[p.value]="block"}}catch(e){t={error:e}}finally{try{p&&!p.done&&(r=d.return)&&r.call(d)}finally{if(t)throw t.error}}try{for(var f=u(null!==(l=e.maskSelector)&&void 0!==l?l:[]),g=f.next();!g.done;g=f.next()){h[g.value]="mask"}}catch(e){n={error:e}}finally{try{g&&!g.done&&(i=f.return)&&i.call(f)}finally{if(n)throw n.error}}try{for(var m=u(null!==(c=e.unmaskSelector)&&void 0!==c?c:[]),v=m.next();!v.done;v=m.next()){h[v.value]="unmask"}}catch(e){o={error:e}}finally{try{v&&!v.done&&(s=m.return)&&s.call(m)}finally{if(o)throw o.error}}return h},S=o(o({},b(y)),b(v));try{for(C=u(Object.entries(S)),I=C.next();!I.done;I=C.next())x=c(I.value,2),k=x[0],"mask"===(E=x[1])?w.maskSelector.push(k):"block"===E?w.blockSelector.push(k):"unmask"===E&&w.unmaskSelector.push(k)}catch(e){O={error:e}}finally{try{I&&!I.done&&(A=C.return)&&A.call(C)}finally{if(O)throw O.error}}i.privacyConfig=function(e,t){var r=document.createDocumentFragment(),n=function(e){if(void 0===e&&(e=[]),"string"==typeof e&&(e=[e]),e=e.filter((function(e){try{r.querySelector(e)}catch(r){return t.warn('[session-replay-browser] omitting selector "'.concat(e,'" because it is invalid')),!1}return!0})),0!==e.length)return e};return e.blockSelector=n(e.blockSelector),e.maskSelector=n(e.maskSelector),e.unmaskSelector=n(e.unmaskSelector),e}(w,this.localConfig.loggerProvider)}return this.localConfig.loggerProvider.debug(JSON.stringify({name:"session replay joined config",config:hw(i)},null,2)),[2,i]}}))}))},e}(),pw=function(e,t){return a(void 0,void 0,void 0,(function(){var r,n;return l(this,(function(i){switch(i.label){case 0:return r=new Vi(e,t),[4,gg({localConfig:r,configKeys:["sessionReplay"]})];case 1:return n=i.sent(),[2,new dw(n,r)]}}))}))},fw="Session replay event batch rejected due to exceeded retry count",gw="Failed to store session replay events in IndexedDB",mw="1.21.1",vw=function(){function e(e){var t=e.trackServerUrl,r=e.loggerProvider,n=e.payloadBatcher;this.storageKey="",this.retryTimeout=1e3,this.scheduled=null,this.queue=[],this.loggerProvider=r,this.payloadBatcher=n||function(e){return e},this.trackServerUrl=t}return e.prototype.sendEventsList=function(e){this.addToQueue(o(o({},e),{attempts:0,timeout:0}))},e.prototype.addToQueue=function(){for(var e=this,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=t.filter((function(t){return t.attempts<(t.flushMaxRetries||0)?(t.attempts+=1,!0):(e.completeRequest({context:t,err:fw}),!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(i){switch(i.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 i.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 i,o,s,a,u,c,h,d,p,f,g,m,v;return l(this,(function(l){switch(l.label){case 0:if(!(i=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(y=E(),s=(null==y?void 0:y.location)?y.location.href:"",a=mw,u=e.sampleRate,c=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(i),"X-Client-Version":a,"X-Client-Library":h,"X-Client-Url":s.substring(0,1e3),"X-Client-Sample-Rate":"".concat(u)},body:JSON.stringify(d),method:"POST"},f="".concat(uw(e.serverZone,this.trackServerUrl),"?").concat(c.toString()),[4,fetch(f,p)];case 2:if(null===(g=l.sent()))return this.completeRequest({context:e,err:"Unexpected error occurred"}),[2];if(t)this.handleReponse(g.status,e);else{m="";try{m=JSON.stringify(g.body,null,2)}catch(e){}this.completeRequest({context:e,success:"".concat(g.status,": ").concat(m)})}return[3,4];case 3:return v=l.sent(),this.completeRequest({context:e,err:v}),[3,4];case 4:return[2]}var y}))}))},e.prototype.handleReponse=function(e,t){switch((new ve).buildStatus(e)){case C.Success:this.handleSuccessResponse(t);break;case C.Failed:this.handleOtherResponse(t);break;default:this.completeRequest({context:t,err:"Network error occurred, event batch rejected"})}},e.prototype.handleSuccessResponse=function(e){var t=Math.round(new Blob(e.events).size/1024);this.completeRequest({context:e,success:"Session replay event batch tracked successfully for session id ".concat(e.sessionId,", size of events: ").concat(t," KB")})},e.prototype.handleOtherResponse=function(e){this.addToQueue(o(o({},e),{timeout:e.attempts*this.retryTimeout}))},e.prototype.completeRequest=function(e){var t=e.context,r=e.err,n=e.success;t.onComplete(),r?this.loggerProvider.warn(r):n&&this.loggerProvider.log(n)},e}();const yw=(e,t)=>t.some((t=>e instanceof t));let ww,bw;const Sw=new WeakMap,Cw=new WeakMap,Iw=new WeakMap;let xw={get(e,t,r){if(e instanceof IDBTransaction){if("done"===t)return Sw.get(e);if("store"===t)return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return Aw(e[t])},set:(e,t,r)=>(e[t]=r,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function kw(e){xw=e(xw)}function Ew(e){return(bw||(bw=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(Rw(this),t),Aw(this.request)}:function(...t){return Aw(e.apply(Rw(this),t))}}function Ow(e){return"function"==typeof e?Ew(e):(e instanceof IDBTransaction&&function(e){if(Sw.has(e))return;const t=new Promise(((t,r)=>{const n=()=>{e.removeEventListener("complete",i),e.removeEventListener("error",o),e.removeEventListener("abort",o)},i=()=>{t(),n()},o=()=>{r(e.error||new DOMException("AbortError","AbortError")),n()};e.addEventListener("complete",i),e.addEventListener("error",o),e.addEventListener("abort",o)}));Sw.set(e,t)}(e),yw(e,ww||(ww=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,xw):e)}function Aw(e){if(e instanceof IDBRequest)return function(e){const t=new Promise(((t,r)=>{const n=()=>{e.removeEventListener("success",i),e.removeEventListener("error",o)},i=()=>{t(Aw(e.result)),n()},o=()=>{r(e.error),n()};e.addEventListener("success",i),e.addEventListener("error",o)}));return Iw.set(t,e),t}(e);if(Cw.has(e))return Cw.get(e);const t=Ow(e);return t!==e&&(Cw.set(e,t),Iw.set(t,e)),t}const Rw=e=>Iw.get(e);function Pw(e,t,{blocked:r,upgrade:n,blocking:i,terminated:o}={}){const s=indexedDB.open(e,t),a=Aw(s);return n&&s.addEventListener("upgradeneeded",(e=>{n(Aw(s.result),e.oldVersion,e.newVersion,Aw(s.transaction),e)})),r&&s.addEventListener("blocked",(e=>r(e.oldVersion,e.newVersion,e))),a.then((e=>{o&&e.addEventListener("close",(()=>o())),i&&e.addEventListener("versionchange",(e=>i(e.oldVersion,e.newVersion,e)))})).catch((()=>{})),a}const Mw=["get","getKey","getAll","getAllKeys","count"],_w=["put","add","delete","clear"],Tw=new Map;function Nw(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(Tw.get(t))return Tw.get(t);const r=t.replace(/FromIndex$/,""),n=t!==r,i=_w.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!i&&!Mw.includes(r))return;const o=async function(e,...t){const o=this.transaction(e,i?"readwrite":"readonly");let s=o.store;return n&&(s=s.index(t.shift())),(await Promise.all([s[r](...t),i&&o.done]))[0]};return Tw.set(t,o),o}kw((e=>({...e,get:(t,r,n)=>Nw(t,r)||e.get(t,r,n),has:(t,r)=>!!Nw(t,r)||e.has(t,r)})));const Lw=["continue","continuePrimaryKey","advance"],Dw={},Fw=new WeakMap,Uw=new WeakMap,jw={get(e,t){if(!Lw.includes(t))return e[t];let r=Dw[t];return r||(r=Dw[t]=function(...e){Fw.set(this,Uw.get(this)[t](...e))}),r}};async function*Bw(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;const r=new Proxy(t,jw);for(Uw.set(r,t),Iw.set(r,Rw(t));t;)yield r,t=await(Fw.get(r)||t.continue()),Fw.delete(r)}function zw(e,t){return t===Symbol.asyncIterator&&yw(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===t&&yw(e,[IDBIndex,IDBObjectStore])}kw((e=>({...e,get:(t,r,n)=>zw(t,r)?Bw:e.get(t,r,n),has:(t,r)=>zw(t,r)||e.has(t,r)})));var Vw,Ww=function(){function e(e){var t,r,n,i=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>=i.maxPersistedEventsSize||!!(Date.now()-i.timeAtLastSplit>i.interval&&e.length)&&(i.interval=Math.min(i.maxInterval,i.interval+i.minInterval),i._timeAtLastSplit=Date.now(),!0)},this.loggerProvider=e.loggerProvider,this.minInterval=null!==(t=e.minInterval)&&void 0!==t?t:this.minInterval,this.maxInterval=null!==(r=e.maxInterval)&&void 0!==r?r:this.maxInterval,this.maxPersistedEventsSize=null!==(n=e.maxPersistedEventsSize)&&void 0!==n?n:this.maxPersistedEventsSize}return Object.defineProperty(e.prototype,"timeAtLastSplit",{get:function(){return this._timeAtLastSplit},enumerable:!1,configurable:!0}),e}();!function(e){e.RECORDING="recording",e.SENT="sent"}(Vw||(Vw={}));var qw,Gw,Kw,Yw="sessionCurrentSequence",Zw="sequencesToSend",Jw=function(){var e=E();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)}}))},$w=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]}}))}))},Xw=function(e){var t,r;return e.objectStoreNames.contains(Yw)||(r=e.createObjectStore(Yw,{keyPath:"sessionId"})),e.objectStoreNames.contains(Zw)||(t=e.createObjectStore(Zw,{keyPath:"sequenceId",autoIncrement:!0})).createIndex("sessionId","sessionId"),{sequencesStore:t,currentSequenceStore:r}},Hw=function(e){return a(void 0,void 0,void 0,(function(){return l(this,(function(t){switch(t.label){case 0:return[4,Pw(e,1,{upgrade:Xw})];case 1:return[2,t.sent()]}}))}))},Qw=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,i,o;return l(this,(function(s){switch(s.label){case 0:return s.trys.push([0,5,,6]),e=[],[4,this.db.transaction("sequencesToSend").store.openCursor()];case 1:t=s.sent(),s.label=2;case 2:return t?(r=t.value,n=r.sessionId,i=r.events,e.push({events:i,sequenceId:t.key,sessionId:n}),[4,t.continue()]):[3,4];case 3:return t=s.sent(),[3,2];case 4:return[2,e];case 5:return o=s.sent(),this.loggerProvider.warn("".concat(gw,": ").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(i){switch(i.label){case 0:return i.trys.push([0,4,,5]),[4,this.db.get(Yw,e)];case 1:return(t=i.sent())?[4,this.db.put(Zw,{sessionId:e,events:t.events})]:[2,void 0];case 2:return r=i.sent(),[4,this.db.put(Yw,{sessionId:e,events:[]})];case 3:return i.sent(),[2,o(o({},t),{sessionId:e,sequenceId:r})];case 4:return n=i.sent(),this.loggerProvider.warn("".concat(gw,": ").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,i,o,s,a;return l(this,(function(l){switch(l.label){case 0:return l.trys.push([0,10,,11]),[4,(r=this.db.transaction(Yw,"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 i=void 0,this.shouldSplitEventsList(n.events,t)?(i=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(),i?[4,this.storeSendingEvents(e,i)]:[2,void 0];case 9:return(s=l.sent())?[2,{events:i,sessionId:e,sequenceId:s}]:[2,void 0];case 10:return a=l.sent(),this.loggerProvider.warn("".concat(gw,": ").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(Zw,{sessionId:e,events:t})];case 1:return[2,n.sent()];case 2:return r=n.sent(),this.loggerProvider.warn("".concat(gw,": ").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(Zw,t)];case 2:return r.sent(),[3,4];case 3:return e=r.sent(),this.loggerProvider.warn("".concat(gw,": ").concat(e)),[3,4];case 4:return[2]}}))}))},r.transitionFromKeyValStore=function(e){return a(r,void 0,void 0,(function(){var t,r,n,i,o,s,u,c,h=this;return l(this,(function(d){switch(d.label){case 0:return d.trys.push([0,6,,7]),[4,Jw()];case 1:if(!(t=d.sent()))return[2];r=function(e,t){return a(h,void 0,void 0,(function(){var r,n,i=this;return l(this,(function(o){switch(o.label){case 0:return r=t.sessionSequences,n=[],Object.keys(r).forEach((function(o){var s=parseInt(o,10),u=r[s];if(s===t.currentSequenceId){var c=u.events.map((function(t){return a(i,void 0,void 0,(function(){return l(this,(function(r){return[2,this.addEventToCurrentSequence(e,t)]}))}))}));n.concat(c)}else u.status!==Vw.SENT&&n.push(i.storeSendingEvents(e,u.events))})),[4,$w(n)];case 1:return o.sent(),[2]}}))}))},n="".concat(v,"_").concat(this.apiKey.substring(0,10)),d.label=2;case 2:return d.trys.push([2,4,,5]),i=t.transaction("keyval").objectStore("keyval").getAll(n),o=new Promise((function(t){i.onsuccess=function(n){return a(h,void 0,void 0,(function(){var i,o,s,a=this;return l(this,(function(l){switch(l.label){case 0:return i=n&&n.target.result,(o=i&&i[0])?(s=[],Object.keys(o).forEach((function(t){var n=parseInt(t,10),i=o[n];if(e===n)s.push(r(n,i));else{var l=i.sessionSequences;Object.keys(l).forEach((function(e){var t=parseInt(e,10);l[t].status!==Vw.SENT&&s.push(a.storeSendingEvents(n,l[t].events))}))}})),[4,$w(s)]):[3,2];case 1:l.sent(),l.label=2;case 2:return t(),[2]}}))}))}})),[4,o];case 3:return d.sent(),(s=E())&&s.indexedDB.deleteDatabase("keyval-store"),[3,5];case 4:return u=d.sent(),this.loggerProvider.warn("Failed to transition session replay events from keyval to new store: ".concat(u)),[3,5];case 5:return[3,7];case 6:return c=d.sent(),this.loggerProvider.warn("Failed to access keyval store: ".concat(c,". 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 i,s,a,u,c;return l(this,(function(l){switch(l.label){case 0:return l.trys.push([0,3,,4]),i="replay"===e?"":"_".concat(e),s="".concat(r.apiKey.substring(0,10),"_amp_session_replay_events").concat(i),[4,Hw(s)];case 1:return a=l.sent(),[4,(u=new t(o(o({},r),{db:a}))).transitionFromKeyValStore(n)];case 2:return l.sent(),[2,u];case 3:return c=l.sent(),r.loggerProvider.warn("".concat(gw,": ").concat(c)),[3,4];case 4:return[2]}}))}))},t.prototype.getCurrentSequenceEvents=function(e){return a(this,void 0,void 0,(function(){var t,r,n,i,o,s,a;return l(this,(function(l){switch(l.label){case 0:return e?[4,this.db.get("sessionCurrentSequence",e)]:[3,2];case 1:return(i=l.sent())?[2,[i]]:[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=u.apply(void 0,[l.sent()]),n=r.next(),l.label=5;case 5:if(n.done)return[3,7];i=n.value,t.push(i),l.label=6;case 6:return n=r.next(),[3,5];case 7:return[3,10];case 8:return o=l.sent(),s={error:o},[3,10];case 9:try{n&&!n.done&&(a=r.return)&&a.call(r)}finally{if(s)throw s.error}return[7];case 10:return[2,t]}}))}))},t}(Ww),eb=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([],c(this.sequences[e]),!1);return this.finalizedSequences[t]={sessionId:e,events:r},this.resetCurrentSequence(e),{sequenceId:t,events:r,sessionId:e}},t.prototype.getSequencesToSend=function(){return a(this,void 0,void 0,(function(){return l(this,(function(e){return[2,Object.entries(this.finalizedSequences).map((function(e){var t=c(e,2),r=t[0],n=t[1],i=n.sessionId,o=n.events;return{sequenceId:Number(r),sessionId:i,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}(Ww),tb=function(e){var t=e.config,r=e.sessionId,n=e.minInterval,i=e.maxInterval,s=e.type,u=e.payloadBatcher,c=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,g,m,v,y,w;return l(this,(function(b){switch(b.label){case 0:return h=new vw(o(o({},t),{loggerProvider:t.loggerProvider,payloadBatcher:u})),d=function(){return new eb({loggerProvider:t.loggerProvider,maxInterval:i,minInterval:n})},p=function(){return a(void 0,void 0,void 0,(function(){var e;return l(this,(function(o){switch(o.label){case 0:return[4,Qw.new(s,{loggerProvider:t.loggerProvider,minInterval:n,maxInterval:i,apiKey:t.apiKey},r)];case 1:return e=o.sent(),t.loggerProvider.log("Failed to initialize idb store, falling back to memory store."),[2,null!=e?e:d()]}}))}))},"idb"!==c?[3,2]:[4,p()];case 1:return g=b.sent(),[3,3];case 2:g=d(),b.label=3;case 3:return f=g,m=function(e){var r=e.events,n=e.sessionId,i=e.deviceId,o=e.sequenceId;t.debugMode&&cw().then((function(e){var r=e.totalStorageSize,n=e.percentOfQuota,i=e.usageDetails;t.loggerProvider.debug("Total storage size: ".concat(r," KB, percentage of quota: ").concat(n,"%, usage details: ").concat(i))})).catch((function(){})),h.sendEventsList({events:r,sessionId:n,flushMaxRetries:t.flushMaxRetries,apiKey:t.apiKey,deviceId:i,sampleRate:t.sampleRate,serverZone:t.serverZone,version:t.version,type:s,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,o)];case 1:return e.sent(),[2]}}))}))}})},v=function(e){var r=e.sessionId,n=e.deviceId;f.storeCurrentSequence(r).then((function(e){e&&m({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)}))},y=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){m({sequenceId:e.sequenceId,events:e.events,sessionId:e.sessionId,deviceId:t})})),[2]}}))}))},w=function(e){var r=e.event,n=e.sessionId,i=e.deviceId;f.addEventToCurrentSequence(n,r.data).then((function(e){return e&&m({sequenceId:e.sequenceId,events:e.events,sessionId:e.sessionId,deviceId:i})})).catch((function(e){t.loggerProvider.warn("Failed to add event to session replay capture:",e)}))},[2,{sendCurrentSequenceEvents:v,addEvent:w,sendStoredEvents:y,flush:e}]}}))}))},rb=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,i=e.deviceId;null===(t=this.managers.get(n.type))||void 0===t||t.addEvent({sessionId:r,event:n,deviceId:i})},e.prototype.sendCurrentSequenceEvents=function(e){var t=e.sessionId,r=e.deviceId;this.managers.forEach((function(e){e.sendCurrentSequenceEvents({sessionId:t,deviceId:r})}))},e.prototype.flush=function(e){return 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}(),nb=(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))(nb||{});function ib(e,t){if(Kw=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};qw=o(o({},r),t),Gw=function(e,t){if(e.nodeType===Node.DOCUMENT_NODE)return e;if(e===t.root)return e.ownerDocument;return e}(qw.root,r);var n=ob(e,"all",(function(){return ob(e,"two",(function(){return ob(e,"one",(function(){return ob(e,"none")}))}))}));if(n){var i=gb(mb(n,e));return i.length>0&&(n=i[0]),ab(n)}throw new Error("Selector was not found.")}function ob(e,t,r){for(var n=null,i=[],o=e,s=0,a=function(){var e,a,l=(new Date).getTime()-Kw.getTime();if(void 0!==qw.timeoutMs&&l>qw.timeoutMs)throw new Error("Timeout: Can't find a unique selector after ".concat(l,"ms"));var d=db(function(e){var t=e.getAttribute("id");if(t&&qw.idName(t))return{name:"#"+CSS.escape(t),penalty:0};return null}(o))||db.apply(void 0,h([],c(function(e){var t=Array.from(e.attributes).filter((function(e){return qw.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))||db.apply(void 0,h([],c(function(e){var t=Array.from(e.classList).filter(qw.className);return t.map((function(e){return{name:"."+CSS.escape(e),penalty:1}}))}(o)),!1))||db(function(e){var t=e.tagName.toLowerCase();if(qw.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(hb).map((function(e){return cb(e,p)}))));else if("two"==t)d=d.slice(0,1),p&&(d=d.concat(d.filter(hb).map((function(e){return cb(e,p)}))));else if("one"==t){var f=c(d=d.slice(0,1),1)[0];p&&hb(f)&&(d=[cb(f,p)])}else"none"==t&&(d=[{name:"*",penalty:3}],p&&(d=[cb(d[0],p)]));try{for(var g=(e=void 0,u(d)),m=g.next();!m.done;m=g.next()){(f=m.value).level=s}}catch(t){e={error:t}}finally{try{m&&!m.done&&(a=g.return)&&a.call(g)}finally{if(e)throw e.error}}if(i.push(d),i.length>=qw.seedMinLength&&(n=sb(i,r)))return"break";o=o.parentElement,s++};o;){if("break"===a())break}return n||(n=sb(i,r)),!n&&r?r():n}function sb(e,t){var r,n,i=gb(fb(e));if(i.length>qw.threshold)return t?t():null;try{for(var o=u(i),s=o.next();!s.done;s=o.next()){var a=s.value;if(ub(a))return a}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return null}function ab(e){for(var t=e[0],r=t.name,n=1;n<e.length;n++){var i=e[n].level||0;r=t.level===i-1?"".concat(e[n].name," > ").concat(r):"".concat(e[n].name," ").concat(r),t=e[n]}return r}function lb(e){return e.map((function(e){return e.penalty})).reduce((function(e,t){return e+t}),0)}function ub(e){var t=ab(e);switch(Gw.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 cb(e,t){return{name:e.name+":nth-child(".concat(t,")"),penalty:e.penalty+1}}function hb(e){return"html"!==e.name&&!e.name.startsWith("#")}function db(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e.filter(pb);return r.length>0?r:null}function pb(e){return null!=e}function fb(e,t){var r,n,i,o,s,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=u(e[0]),n=r.next(),l.label=2;case 2:return n.done?[3,5]:(i=n.value,[5,u(fb(e.slice(1,e.length),t.concat(i)))]);case 3:l.sent(),l.label=4;case 4:return n=r.next(),[3,2];case 5:return[3,8];case 6:return o=l.sent(),s={error:o},[3,8];case 7:try{n&&!n.done&&(a=r.return)&&a.call(r)}finally{if(s)throw s.error}return[7];case 8:return[3,11];case 9:return[4,t];case 10:l.sent(),l.label=11;case 11:return[2]}}))}function gb(e){return h([],c(e),!1).sort((function(e,t){return lb(e)-lb(t)}))}function mb(e,t,r){var n,i,o;return void 0===r&&(r={counter:0,visited:new Map}),l(this,(function(s){switch(s.label){case 0:if(!(e.length>2&&e.length>qw.optimizedMinLength))return[3,5];n=1,s.label=1;case 1:return n<e.length-1?r.counter>qw.maxNumberOfTries?[2]:(r.counter+=1,(i=h([],c(e),!1)).splice(n,1),o=ab(i),r.visited.has(o)?[2]:ub(i)&&function(e,t){return Gw.querySelector(ab(e))===t}(i,t)?[4,i]:[3,4]):[3,5];case 2:return s.sent(),r.visited.set(o,!0),[5,u(mb(i,t,r))];case 3:s.sent(),s.label=4;case 4:return n++,[3,1];case 5:return[2]}}))}var vb=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}},yb=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 i=n.reduce((function(e,t){var r=t.x,n=t.y,i=t.selector,s=t.timestamp,a=s-s%36e5,l="".concat(r,":").concat(n,":").concat(null!=i?i:"",":").concat(a);return e[l]?e[l].count+=1:e[l]=o(o({},t),{timestamp:a,count:1}),e}),{});return{version:t,events:Object.values(i)}},wb=function(e,t){var r=t.eventsManager,n=t.sessionId,i=t.deviceIdFn;return function(t){if(t.type===nb.Click){var o=E();if(o){var s=o.location,a=o.innerHeight,l=o.innerWidth;if(s){var u=t.x,c=t.y;if(void 0!==u&&void 0!==c){var h,d=sg.mirror.getNode(t.id);if(d)try{h=ib(d)}catch(t){e.debug("error resolving selector from finder")}var p=rf.getWindowScroll(o),f={x:u+p.left,y:c+p.top,selector:h,viewportHeight:a,viewportWidth:l,pageUrl:s.href,timestamp:Date.now(),type:"click"},g=i();g&&r.addEvent({sessionId:n,event:{type:"interaction",data:JSON.stringify(f)},deviceId:g})}}}}}},bb=function(){function e(e,t){var r=E();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=uw(t.serverZone,t.trackServerUrl),this.apiKey=t.apiKey,this.context=e}return e.prototype.send=function(e,t){var r=this.context,n=r.sessionId,i=r.type,o=new URLSearchParams({device_id:e,session_id:String(n),type:String(i),api_key:this.apiKey}),s="".concat(this.basePageUrl,"?").concat(o.toString());this.sendBeacon(s,t)||this.sendXhr(s,t)},e}(),Sb=rf.getWindowHeight,Cb=rf.getWindowWidth,Ib=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(),i=E();i&&n&&t.transport.send(n,{version:1,events:[{maxScrollX:t._maxScrollX,maxScrollY:t._maxScrollY,maxScrollWidth:t._maxScrollWidth,maxScrollHeight:t._maxScrollHeight,viewportHeight:Sb(),viewportWidth:Cb(),pageUrl:i.location.href,timestamp:t.timestamp,type:"scroll"}]})}},this._maxScrollX=0,this._maxScrollY=0,this._maxScrollWidth=Cb(),this._maxScrollHeight=Sb(),this.transport=e}return e.default=function(t,r){return new e(new bb(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=Cb();this._maxScrollX=e.x;var n=e.x+r;n>this._maxScrollWidth&&(this._maxScrollWidth=n),this.timestamp=t}if(e.y>this._maxScrollY){var i=Sb();this._maxScrollY=e.y;var o=e.y+i;o>this._maxScrollHeight&&(this._maxScrollHeight=o),this.timestamp=t}},e}(),xb=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))},kb=Uint8Array,Eb=Uint16Array,Ob=Uint32Array,Ab=new kb([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]),Rb=new kb([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]),Pb=new kb([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Mb=function(e,t){for(var r=new Eb(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];var i=new Ob(r[30]);for(n=1;n<30;++n)for(var o=r[n];o<r[n+1];++o)i[o]=o-r[n]<<5|n;return[r,i]},_b=Mb(Ab,2),Tb=_b[0],Nb=_b[1];Tb[28]=258,Nb[258]=28;for(var Lb=Mb(Rb,0)[1],Db=new Eb(32768),Fb=0;Fb<32768;++Fb){var Ub=(43690&Fb)>>>1|(21845&Fb)<<1;Ub=(61680&(Ub=(52428&Ub)>>>2|(13107&Ub)<<2))>>>4|(3855&Ub)<<4,Db[Fb]=((65280&Ub)>>>8|(255&Ub)<<8)>>>1}var jb=function(e,t,r){for(var n=e.length,i=0,o=new Eb(t);i<n;++i)++o[e[i]-1];var s,a=new Eb(t);for(i=0;i<t;++i)a[i]=a[i-1]+o[i-1]<<1;if(r){s=new Eb(1<<t);var l=15-t;for(i=0;i<n;++i)if(e[i])for(var u=i<<4|e[i],c=t-e[i],h=a[e[i]-1]++<<c,d=h|(1<<c)-1;h<=d;++h)s[Db[h]>>>l]=u}else for(s=new Eb(n),i=0;i<n;++i)s[i]=Db[a[e[i]-1]++]>>>15-e[i];return s},Bb=new kb(288);for(Fb=0;Fb<144;++Fb)Bb[Fb]=8;for(Fb=144;Fb<256;++Fb)Bb[Fb]=9;for(Fb=256;Fb<280;++Fb)Bb[Fb]=7;for(Fb=280;Fb<288;++Fb)Bb[Fb]=8;var zb=new kb(32);for(Fb=0;Fb<32;++Fb)zb[Fb]=5;var Vb=jb(Bb,9,0),Wb=jb(zb,5,0),qb=function(e){return(e/8>>0)+(7&e&&1)},Gb=function(e,t,r){(null==r||r>e.length)&&(r=e.length);var n=new(e instanceof Eb?Eb:e instanceof Ob?Ob:kb)(r-t);return n.set(e.subarray(t,r)),n},Kb=function(e,t,r){r<<=7&t;var n=t/8>>0;e[n]|=r,e[n+1]|=r>>>8},Yb=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},Zb=function(e,t){for(var r=[],n=0;n<e.length;++n)e[n]&&r.push({s:n,f:e[n]});var i=r.length,o=r.slice();if(!i)return[new kb(0),0];if(1==i){var s=new kb(r[0].s+1);return s[r[0].s]=1,[s,1]}r.sort((function(e,t){return e.f-t.f})),r.push({s:-1,f:25001});var a=r[0],l=r[1],u=0,c=1,h=2;for(r[0]={s:-1,f:a.f+l.f,l:a,r:l};c!=i-1;)a=r[r[u].f<r[h].f?u++:h++],l=r[u!=c&&r[u].f<r[h].f?u++:h++],r[c++]={s:-1,f:a.f+l.f,l:a,r:l};var d=o[0].s;for(n=1;n<i;++n)o[n].s>d&&(d=o[n].s);var p=new Eb(d+1),f=Jb(r[c-1],p,0);if(f>t){n=0;var g=0,m=f-t,v=1<<m;for(o.sort((function(e,t){return p[t.s]-p[e.s]||e.f-t.f}));n<i;++n){var y=o[n].s;if(!(p[y]>t))break;g+=v-(1<<f-p[y]),p[y]=t}for(g>>>=m;g>0;){var w=o[n].s;p[w]<t?g-=1<<t-p[w]++-1:++n}for(;n>=0&&g;--n){var b=o[n].s;p[b]==t&&(--p[b],++g)}f=t}return[new kb(p),f]},Jb=function(e,t,r){return-1==e.s?Math.max(Jb(e.l,t,r+1),Jb(e.r,t,r+1)):t[e.s]=r},$b=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new Eb(++t),n=0,i=e[0],o=1,s=function(e){r[n++]=e},a=1;a<=t;++a)if(e[a]==i&&a!=t)++o;else{if(!i&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(i),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(i);o=1,i=e[a]}return[r.subarray(0,n),t]},Xb=function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},Hb=function(e,t,r){var n=r.length,i=qb(t+2);e[i]=255&n,e[i+1]=n>>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var o=0;o<n;++o)e[i+o+4]=r[o];return 8*(i+4+n)},Qb=function(e,t,r,n,i,o,s,a,l,u,c){Kb(t,c++,r),++i[256];for(var h=Zb(i,15),d=h[0],p=h[1],f=Zb(o,15),g=f[0],m=f[1],v=$b(d),y=v[0],w=v[1],b=$b(g),S=b[0],C=b[1],I=new Eb(19),x=0;x<y.length;++x)I[31&y[x]]++;for(x=0;x<S.length;++x)I[31&S[x]]++;for(var k=Zb(I,7),E=k[0],O=k[1],A=19;A>4&&!E[Pb[A-1]];--A);var R,P,M,_,T=u+5<<3,N=Xb(i,Bb)+Xb(o,zb)+s,L=Xb(i,d)+Xb(o,g)+s+14+3*A+Xb(I,E)+(2*I[16]+3*I[17]+7*I[18]);if(T<=N&&T<=L)return Hb(t,c,e.subarray(l,l+u));if(Kb(t,c,1+(L<N)),c+=2,L<N){R=jb(d,p,0),P=d,M=jb(g,m,0),_=g;var D=jb(E,O,0);Kb(t,c,w-257),Kb(t,c+5,C-1),Kb(t,c+10,A-4),c+=14;for(x=0;x<A;++x)Kb(t,c+3*x,E[Pb[x]]);c+=3*A;for(var F=[y,S],U=0;U<2;++U){var j=F[U];for(x=0;x<j.length;++x){var B=31&j[x];Kb(t,c,D[B]),c+=E[B],B>15&&(Kb(t,c,j[x]>>>5&127),c+=j[x]>>>12)}}}else R=Vb,P=Bb,M=Wb,_=zb;for(x=0;x<a;++x)if(n[x]>255){B=n[x]>>>18&31;Yb(t,c,R[B+257]),c+=P[B+257],B>7&&(Kb(t,c,n[x]>>>23&31),c+=Ab[B]);var z=31&n[x];Yb(t,c,M[z]),c+=_[z],z>3&&(Yb(t,c,n[x]>>>5&8191),c+=Rb[z])}else Yb(t,c,R[n[x]]),c+=P[n[x]];return Yb(t,c,R[256]),c+P[256]},eS=new Ob([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),tS=function(e,t,r,n,i){return function(e,t,r,n,i,o){var s=e.length,a=new kb(n+s+5*(1+Math.floor(s/7e3))+i),l=a.subarray(n,a.length-i),u=0;if(!t||s<8)for(var c=0;c<=s;c+=65535){var h=c+65535;h<s?u=Hb(l,u,e.subarray(c,h)):(l[c]=o,u=Hb(l,u,e.subarray(c,s)))}else{for(var d=eS[t-1],p=d>>>13,f=8191&d,g=(1<<r)-1,m=new Eb(32768),v=new Eb(g+1),y=Math.ceil(r/3),w=2*y,b=function(t){return(e[t]^e[t+1]<<y^e[t+2]<<w)&g},S=new Ob(25e3),C=new Eb(288),I=new Eb(32),x=0,k=0,E=(c=0,0),O=0,A=0;c<s;++c){var R=b(c),P=32767&c,M=v[R];if(m[P]=M,v[R]=P,O<=c){var _=s-c;if((x>7e3||E>24576)&&_>423){u=Qb(e,l,0,S,C,I,k,E,A,c-A,u),E=x=k=0,A=c;for(var T=0;T<286;++T)C[T]=0;for(T=0;T<30;++T)I[T]=0}var N=2,L=0,D=f,F=P-M&32767;if(_>2&&R==b(c-F))for(var U=Math.min(p,_)-1,j=Math.min(32767,c),B=Math.min(258,_);F<=j&&--D&&P!=M;){if(e[c+N]==e[c+N-F]){for(var z=0;z<B&&e[c+z]==e[c+z-F];++z);if(z>N){if(N=z,L=F,z>U)break;var V=Math.min(F,z-2),W=0;for(T=0;T<V;++T){var q=c-F+T+32768&32767,G=q-m[q]+32768&32767;G>W&&(W=G,M=q)}}}F+=(P=M)-(M=m[P])+32768&32767}if(L){S[E++]=268435456|Nb[N]<<18|Lb[L];var K=31&Nb[N],Y=31&Lb[L];k+=Ab[K]+Rb[Y],++C[257+K],++I[Y],O=c+N,++x}else S[E++]=e[c],++C[e[c]]}}u=Qb(e,l,o,S,C,I,k,E,A,c-A,u)}return Gb(a,0,n+qb(u)+i)}(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,!i)};function rS(e,t){void 0===t&&(t={});var r=function(){var e=1,t=0;return{p:function(r){for(var n=e,i=t,o=r.length,s=0;s!=o;){for(var a=Math.min(s+5552,o);s<a;++s)i+=n+=r[s];n%=65521,i%=65521}e=n,t=i},d:function(){return(e>>>8<<16|(255&t)<<8|t>>>8)+2*((255&e)<<23)}}}();r.p(e);var n,i,o,s=tS(e,t,2,4);return n=s,i=t.level,o=0==i?0:i<6?1:9==i?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}(s,s.length-4,r.d()),s}const nS=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 i=e[n++];i<128||t?r+=String.fromCharCode(i):i<224?r+=String.fromCharCode((31&i)<<6|63&e[n++]):i<240?r+=String.fromCharCode((15&i)<<12|(63&e[n++])<<6|63&e[n++]):(i=((15&i)<<18|(63&e[n++])<<12|(63&e[n++])<<6|63&e[n++])-65536,r+=String.fromCharCode(55296|i>>10,56320|1023&i))}return r}(rS(function(e,t){var r=e.length;if(!t&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var n=new kb(e.length+(e.length>>>1)),i=0,o=function(e){n[i++]=e},s=0;s<r;++s){if(i+5>n.length){var a=new kb(i+8+(r-s<<1));a.set(n),n=a}var l=e.charCodeAt(s);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(++s))>>>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 Gb(n,0,i)}(JSON.stringify(t))),!0)};var iS,oS=function(){function e(e,t,r,n){var i,o,s,a=this;this.taskQueue=[],this.isProcessing=!1,this.compressEvent=function(e){var t=nS(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=E();this.canUseIdleCallback=l&&"requestIdleCallback"in l,this.eventsManager=e,this.config=t,this.deviceId=r,this.timeout=(null===(i=t.performanceConfig)||void 0===i?void 0:i.timeout)||2e3;var u=null!==(o={}.COMPRESSION_WEBWORKER_BODY)&&void 0!==o?o:n;if((null===(s=this.config.experimental)||void 0===s?void 0:s.useWebWorker)&&l&&l.Worker&&u){t.loggerProvider.log("[Experimental] Enabling web worker for compression");var c=new Worker(URL.createObjectURL(new Blob([u],{type:"application/javascript"})));c.onerror=function(e){t.loggerProvider.error(e)},c.onmessage=function(e){var t=e.data,r=t.compressedEvent,n=t.sessionId;a.addCompressedEventToManager(r,n)},this.worker=c}}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,i=r.sessionId;this.addCompressedEvent(n,i)}}this.taskQueue.length>0?requestIdleCallback((function(e){t.processQueue(e)}),{timeout:this.timeout}):this.isProcessing=!1},e}(),sS=Object.defineProperty,aS=(e,t,r)=>((e,t,r)=>t in e?sS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),lS=Object.defineProperty,uS=(e,t,r)=>((e,t,r)=>t in e?lS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),cS=Object.defineProperty,hS=(e,t,r)=>((e,t,r)=>t in e?cS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);const dS={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},pS={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},fS={};function gS(e){if(fS[e])return fS[e];const t=globalThis[e],r=t.prototype,n=e in dS?dS[e]:void 0,i=Boolean(n&&n.every((e=>{var t,n;return Boolean(null==(n=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:n.toString().includes("[native code]"))}))),o=e in pS?pS[e]:void 0,s=Boolean(o&&o.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(i&&s&&!globalThis.Zone)return fS[e]=t.prototype,t.prototype;try{const n=document.createElement("iframe");document.body.appendChild(n);const i=n.contentWindow;if(!i)return t.prototype;const o=i[e].prototype;return document.body.removeChild(n),o?fS[e]=o:r}catch{return r}}const mS={};function vS(e,t,r){var n;const i=`${e}.${String(r)}`;if(mS[i])return mS[i].call(t);const o=gS(e),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(mS[i]=s,s.call(t)):t[r]}const yS={};function wS(e,t,r){const n=`${e}.${String(r)}`;if(yS[n])return yS[n].bind(t);const i=gS(e)[r];return"function"!=typeof i?t[r]:(yS[n]=i,i.bind(t))}const bS={childNodes:function(e){return vS("Node",e,"childNodes")},parentNode:function(e){return vS("Node",e,"parentNode")},parentElement:function(e){return vS("Node",e,"parentElement")},textContent:function(e){return vS("Node",e,"textContent")},contains:function(e,t){return wS("Node",e,"contains")(t)},getRootNode:function(e){return wS("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?vS("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?vS("Element",e,"shadowRoot"):null},querySelector:function(e,t){return vS("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return vS("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return gS("MutationObserver").constructor}};class SS{constructor(){hS(this,"idNodeMap",new Map),hS(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 CS(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&CS(bS.parentNode(e),t,r);for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!!r&&CS(bS.parentNode(e),t,r)}function IS(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function xS(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 kS={exports:{}},ES=String,OS=function(){return{isColorSupported:!1,reset:ES,bold:ES,dim:ES,italic:ES,underline:ES,inverse:ES,hidden:ES,strikethrough:ES,black:ES,red:ES,green:ES,yellow:ES,blue:ES,magenta:ES,cyan:ES,white:ES,gray:ES,bgBlack:ES,bgRed:ES,bgGreen:ES,bgYellow:ES,bgBlue:ES,bgMagenta:ES,bgCyan:ES,bgWhite:ES}};kS.exports=OS(),kS.exports.createColors=OS;var AS=kS.exports;const RS=xS(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let PS=AS,MS=RS,_S=class e extends Error{constructor(t,r,n,i,o,s){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),i&&(this.source=i),s&&(this.plugin=s),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=PS.isColorSupported),MS&&e&&(t=MS(t));let r,n,i=t.split(/\r?\n/),o=Math.max(this.line-3,0),s=Math.min(this.line+2,i.length),a=String(s).length;if(e){let{bold:e,gray:t,red:i}=PS.createColors(!0);r=t=>e(i(t)),n=e=>t(e)}else r=n=e=>e;return i.slice(o,s).map(((e,t)=>{let i=o+1+t,s=" "+(" "+i).slice(-a)+" | ";if(i===this.line){let t=n(s.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return r(">")+n(s)+e+"\n "+t+r("^")}return" "+n(s)+e})).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};var TS=_S;_S.default=_S;var NS={};NS.isClean=Symbol("isClean"),NS.my=Symbol("my");const LS={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let DS=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 i=(e.raws.between||"")+(t?";":"");this.builder(r+n+i,e)}}beforeAfter(e,t){let r;r="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let n=e.parent,i=0;for(;n&&"root"!==n.type;)i+=1,n=n.parent;if(r.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<i;e++)r+=t}return r}block(e,t){let r,n=this.raw(e,"between","beforeOpen");this.builder(t+n+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),r=this.raw(e,"after")):r=this.raw(e,"after","emptyBody"),r&&this.builder(r),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let r=this.raw(e,"semicolon");for(let n=0;n<e.nodes.length;n++){let i=e.nodes[n],o=this.raw(i,"before");o&&this.builder(o),this.stringify(i,t!==n||r)}}comment(e){let t=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)}decl(e,t){let r=this.raw(e,"between","colon"),n=e.prop+r+this.rawValue(e,"value");e.important&&(n+=e.raws.important||" !important"),t&&(n+=";"),this.builder(n,e)}document(e){this.body(e)}raw(e,t,r){let n;if(r||(r=t),t&&(n=e.raws[t],void 0!==n))return n;let i=e.parent;if("before"===r){if(!i||"root"===i.type&&i.first===e)return"";if(i&&"document"===i.type)return""}if(!i)return LS[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 i="raw"+((s=r)[0].toUpperCase()+s.slice(1));this[i]?n=this[i](o,e):o.walk((e=>{if(n=e.raws[t],void 0!==n)return!1}))}var s;return void 0===n&&(n=LS[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 FS=DS;DS.default=DS;let US=FS;function jS(e,t){new US(t).stringify(e)}var BS=jS;jS.default=jS;let{isClean:zS,my:VS}=NS,WS=TS,qS=FS,GS=BS;function KS(e,t){let r=new e.constructor;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if("proxyCache"===n)continue;let i=e[n],o=typeof i;"parent"===n&&"object"===o?t&&(r[n]=t):"source"===n?r[n]=i:Array.isArray(i)?r[n]=i.map((e=>KS(e,r))):("object"===o&&null!==i&&(i=KS(i)),r[n]=i)}return r}let YS=class{constructor(e={}){this.raws={},this[zS]=!1,this[VS]=!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=KS(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 WS(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[zS]){this[zS]=!1;let e=this;for(;e=e.parent;)e[zS]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){let n=(t=this.toString()).indexOf(e.word);-1!==n&&(r=this.positionInside(n,t))}return r}positionInside(e,t){let r=t||this.toString(),n=this.source.start.column,i=this.source.start.line;for(let t=0;t<e;t++)"\n"===r[t]?(n=1,i+=1):n+=1;return{column:n,line:i}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let n=this.toString(),i=n.indexOf(e.word);-1!==i&&(t=this.positionInside(i,n),r=this.positionInside(i+e.word.length,n))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return(new qS).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let n of e)n===this?r=!0:r?(this.parent.insertAfter(t,n),t=n):this.parent.insertBefore(t,n);r||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let r={},n=null==t;t=t||new Map;let i=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let n=this[e];if(Array.isArray(n))r[e]=n.map((e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e));else if("object"==typeof n&&n.toJSON)r[e]=n.toJSON(null,t);else if("source"===e){let o=t.get(n.input);null==o&&(o=i,t.set(n.input,i),i++),r[e]={end:n.end,inputId:o,start:n.start}}else r[e]=n}return n&&(r.inputs=[...t.keys()].map((e=>e.toJSON()))),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=GS){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 ZS=YS;YS.default=YS;let JS=ZS,$S=class extends JS{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 XS=$S;$S.default=$S;var HS={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(r=t)=>{let n="",i=r;for(;i--;)n+=e[Math.random()*e.length|0];return n}};let{SourceMapConsumer:QS,SourceMapGenerator:eC}=RS,{existsSync:tC,readFileSync:rC}=RS,{dirname:nC,join:iC}=RS;let oC=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=nC(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new QS(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=nC(e),tC(e))return this.mapFile=e,rC(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 QS)return eC.fromSourceMap(t).toString();if(t instanceof eC)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=iC(nC(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 sC=oC;oC.default=oC;let{SourceMapConsumer:aC,SourceMapGenerator:lC}=RS,{fileURLToPath:uC,pathToFileURL:cC}=RS,{isAbsolute:hC,resolve:dC}=RS,{nanoid:pC}=HS,fC=RS,gC=TS,mC=sC,vC=Symbol("fromOffsetCache"),yC=Boolean(aC&&lC),wC=Boolean(dC&&hC),bC=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&&(!wC||/^\w+:\/\//.test(t.from)||hC(t.from)?this.file=t.from:this.file=dC(t.from)),wC&&yC){let e=new mC(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 "+pC(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let i,o,s;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,s=e.col}else o=n.line,s=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let a=this.origin(t,r,o,s);return i=a?new gC(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 gC(e,void 0===o?t:{column:r,line:t},void 0===o?r:{column:s,line:o},this.css,this.file,n.plugin),i.input={column:r,endColumn:s,endLine:o,line:t,source:this.css},this.file&&(cC&&(i.input.url=cC(this.file).toString()),i.input.file=this.file),i}fromOffset(e){let t,r;if(this[vC])r=this[vC];else{let e=this.css.split("\n");r=new Array(e.length);let t=0;for(let n=0,i=e.length;n<i;n++)r[n]=t,t+=e[n].length+1;this[vC]=r}t=r[r.length-1];let n=0;if(e>=t)n=r.length-1;else{let t,i=r.length-2;for(;n<i;)if(t=n+(i-n>>1),e<r[t])i=t-1;else{if(!(e>=r[t+1])){n=t;break}n=t+1}}return{col:e-r[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:dC(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,n){if(!this.map)return!1;let i,o,s=this.map.consumer(),a=s.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof r&&(i=s.originalPositionFor({column:n,line:r})),o=hC(a.source)?cC(a.source):new URL(a.source,this.map.consumer().sourceRoot||cC(this.map.mapFile));let l={column:a.column,endColumn:i&&i.column,endLine:i&&i.line,line:a.line,url:o.toString()};if("file:"===o.protocol){if(!uC)throw new Error("file: protocol is not available in this PostCSS build");l.file=uC(o)}let u=s.sourceContentFor(a.source);return u&&(l.source=u),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 SC=bC;bC.default=bC,fC&&fC.registerInput&&fC.registerInput(bC);let{SourceMapConsumer:CC,SourceMapGenerator:IC}=RS,{dirname:xC,relative:kC,resolve:EC,sep:OC}=RS,{pathToFileURL:AC}=RS,RC=SC,PC=Boolean(CC&&IC),MC=Boolean(xC&&EC&&kC&&OC);var _C=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||xC(e.file);!1===this.mapOpts.sourcesContent?(t=new CC(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(),MC&&PC&&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=IC.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new IC({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 IC({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,r=1,n=1,i="<no source>",o={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,((s,a,l)=>{if(this.css+=s,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=i,o.original.line=1,o.original.column=0,this.map.addMapping(o))),e=s.match(/\n/g),e?(r+=e.length,t=s.lastIndexOf("\n"),n=s.length-t):n+=s.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=i,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?xC(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=xC(EC(r,this.mapOpts.annotation)));let n=kC(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 RC(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(AC){let t=AC(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;"\\"===OC&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let TC=ZS,NC=class extends TC{constructor(e){super(e),this.type="comment"}};var LC=NC;NC.default=NC;let DC,FC,UC,jC,{isClean:BC,my:zC}=NS,VC=XS,WC=LC,qC=ZS;function GC(e){return e.map((e=>(e.nodes&&(e.nodes=GC(e.nodes)),delete e.source,e)))}function KC(e){if(e[BC]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)KC(t)}let YC=class e extends qC{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,r,n=this.getIterator();for(;this.indexes[n]<this.proxyOf.nodes.length&&(t=this.indexes[n],r=e(this.proxyOf.nodes[t],t),!1!==r);)this.indexes[n]+=1;return delete this.indexes[n],r}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...r)=>e[t](...r.map((e=>"function"==typeof e?(t,r)=>e(t.toProxy(),r):e))):"every"===t||"some"===t?r=>e[t](((e,...t)=>r(e.toProxy(),...t))):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map((e=>e.toProxy())):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let r,n=this.index(e),i=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let e of i)this.proxyOf.nodes.splice(n+1,0,e);for(let e in this.indexes)r=this.indexes[e],n<r&&(this.indexes[e]=r+i.length);return this.markDirty(),this}insertBefore(e,t){let r,n=this.index(e),i=0===n&&"prepend",o=this.normalize(t,this.proxyOf.nodes[n],i).reverse();n=this.index(e);for(let e of o)this.proxyOf.nodes.splice(n,0,e);for(let e in this.indexes)r=this.indexes[e],n<=r&&(this.indexes[e]=r+o.length);return this.markDirty(),this}normalize(t,r){if("string"==typeof t)t=GC(DC(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 VC(t)]}else if(t.selector)t=[new FC(t)];else if(t.name)t=[new UC(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new WC(t)]}return t.map((t=>(t[zC]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[BC]&&KC(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]}};YC.registerParse=e=>{DC=e},YC.registerRule=e=>{FC=e},YC.registerAtRule=e=>{UC=e},YC.registerRoot=e=>{jC=e};var ZC=YC;YC.default=YC,YC.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,UC.prototype):"rule"===e.type?Object.setPrototypeOf(e,FC.prototype):"decl"===e.type?Object.setPrototypeOf(e,VC.prototype):"comment"===e.type?Object.setPrototypeOf(e,WC.prototype):"root"===e.type&&Object.setPrototypeOf(e,jC.prototype),e[zC]=!0,e.nodes&&e.nodes.forEach((e=>{YC.rebuild(e)}))};let JC,$C,XC=ZC,HC=class extends XC{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new JC(new $C,this,e).stringify()}};HC.registerLazyResult=e=>{JC=e},HC.registerProcessor=e=>{$C=e};var QC=HC;HC.default=HC;let eI={};var tI=function(e){eI[e]||(eI[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let rI=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 nI=rI;rI.default=rI;let iI=nI,oI=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 iI(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter((e=>"warning"===e.type))}get content(){return this.css}};var sI=oI;oI.default=oI;const aI="'".charCodeAt(0),lI='"'.charCodeAt(0),uI="\\".charCodeAt(0),cI="/".charCodeAt(0),hI="\n".charCodeAt(0),dI=" ".charCodeAt(0),pI="\f".charCodeAt(0),fI="\t".charCodeAt(0),gI="\r".charCodeAt(0),mI="[".charCodeAt(0),vI="]".charCodeAt(0),yI="(".charCodeAt(0),wI=")".charCodeAt(0),bI="{".charCodeAt(0),SI="}".charCodeAt(0),CI=";".charCodeAt(0),II="*".charCodeAt(0),xI=":".charCodeAt(0),kI="@".charCodeAt(0),EI=/[\t\n\f\r "#'()/;[\\\]{}]/g,OI=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,AI=/.[\r\n"'(/\\]/,RI=/[\da-f]/i;let PI=ZC,MI=class extends PI{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 _I=MI;MI.default=MI,PI.registerAtRule(MI);let TI,NI,LI=ZC,DI=class extends LI{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 TI(new NI,this,e).stringify()}};DI.registerLazyResult=e=>{TI=e},DI.registerProcessor=e=>{NI=e};var FI=DI;DI.default=DI,LI.registerRoot(DI);let UI={comma:e=>UI.split(e,[","],!0),space:e=>UI.split(e,[" ","\n","\t"]),split(e,t,r){let n=[],i="",o=!1,s=0,a=!1,l="",u=!1;for(let r of e)u?u=!1:"\\"===r?u=!0:a?r===l&&(a=!1):'"'===r||"'"===r?(a=!0,l=r):"("===r?s+=1:")"===r?s>0&&(s-=1):0===s&&t.includes(r)&&(o=!0),o?(""!==i&&n.push(i.trim()),i="",o=!1):i+=r;return(r||""!==i)&&n.push(i.trim()),n}};var jI=UI;UI.default=UI;let BI=ZC,zI=jI,VI=class extends BI{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return zI.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 WI=VI;VI.default=VI,BI.registerRule(VI);let qI=XS,GI=function(e,t={}){let r,n,i,o,s,a,l,u,c,h,d=e.css.valueOf(),p=t.ignoreErrors,f=d.length,g=0,m=[],v=[];function y(t){throw e.error("Unclosed "+t,g)}return{back:function(e){v.push(e)},endOfFile:function(){return 0===v.length&&g>=f},nextToken:function(e){if(v.length)return v.pop();if(g>=f)return;let t=!!e&&e.ignoreUnclosed;switch(r=d.charCodeAt(g),r){case hI:case dI:case fI:case gI:case pI:n=g;do{n+=1,r=d.charCodeAt(n)}while(r===dI||r===hI||r===fI||r===gI||r===pI);h=["space",d.slice(g,n)],g=n-1;break;case mI:case vI:case bI:case SI:case xI:case CI:case wI:{let e=String.fromCharCode(r);h=[e,e,g];break}case yI:if(u=m.length?m.pop()[1]:"",c=d.charCodeAt(g+1),"url"===u&&c!==aI&&c!==lI&&c!==dI&&c!==hI&&c!==fI&&c!==pI&&c!==gI){n=g;do{if(a=!1,n=d.indexOf(")",n+1),-1===n){if(p||t){n=g;break}y("bracket")}for(l=n;d.charCodeAt(l-1)===uI;)l-=1,a=!a}while(a);h=["brackets",d.slice(g,n+1),g,n],g=n}else n=d.indexOf(")",g+1),o=d.slice(g,n+1),-1===n||AI.test(o)?h=["(","(",g]:(h=["brackets",o,g,n],g=n);break;case aI:case lI:i=r===aI?"'":'"',n=g;do{if(a=!1,n=d.indexOf(i,n+1),-1===n){if(p||t){n=g+1;break}y("string")}for(l=n;d.charCodeAt(l-1)===uI;)l-=1,a=!a}while(a);h=["string",d.slice(g,n+1),g,n],g=n;break;case kI:EI.lastIndex=g+1,EI.test(d),n=0===EI.lastIndex?d.length-1:EI.lastIndex-2,h=["at-word",d.slice(g,n+1),g,n],g=n;break;case uI:for(n=g,s=!0;d.charCodeAt(n+1)===uI;)n+=1,s=!s;if(r=d.charCodeAt(n+1),s&&r!==cI&&r!==dI&&r!==hI&&r!==fI&&r!==gI&&r!==pI&&(n+=1,RI.test(d.charAt(n)))){for(;RI.test(d.charAt(n+1));)n+=1;d.charCodeAt(n+1)===dI&&(n+=1)}h=["word",d.slice(g,n+1),g,n],g=n;break;default:r===cI&&d.charCodeAt(g+1)===II?(n=d.indexOf("*/",g+2)+1,0===n&&(p||t?n=d.length:y("comment")),h=["comment",d.slice(g,n+1),g,n],g=n):(OI.lastIndex=g+1,OI.test(d),n=0===OI.lastIndex?d.length-1:OI.lastIndex-2,h=["word",d.slice(g,n+1),g,n],m.push(h),g=n)}return g++,h},position:function(){return g}}},KI=LC,YI=_I,ZI=FI,JI=WI;const $I={empty:!0,space:!0};var XI=class{constructor(e){this.input=e,this.root=new ZI,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,i=new YI;i.name=e[1].slice(1),""===i.name&&this.unnamedAtrule(i,e),this.init(i,e[2]);let o=!1,s=!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){i.source.end=this.getPosition(e[2]),i.source.end.offset++,this.semicolon=!0;break}if("{"===t){s=!0;break}if("}"===t){if(a.length>0){for(n=a.length-1,r=a[n];r&&"space"===r[0];)r=a[--n];r&&(i.source.end=this.getPosition(r[3]||r[2]),i.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}i.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(i.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(i,"params",a),o&&(e=a[a.length-1],i.source.end=this.getPosition(e[3]||e[2]),i.source.end.offset++,this.spaces=i.raws.between,i.raws.between="")):(i.raws.afterName="",i.params=""),s&&(i.nodes=[],this.current=i)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let r,n=0;for(let i=t-1;i>=0&&(r=e[i],"space"===r[0]||(n+=1,2!==n));i--);throw this.input.error("Missed semicolon","word"===r[0]?r[3]+1:r[2])}colon(e){let t,r,n,i=0;for(let[o,s]of e.entries()){if(t=s,r=t[0],"("===r&&(i+=1),")"===r&&(i-=1),0===i&&":"===r){if(n){if("word"===n[0]&&"progid"===n[1])continue;return o}this.doubleColon(t)}n=t}return!1}comment(e){let t=new KI;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=GI(this.input)}decl(e,t){let r=new qI;this.init(r,e[0][2]);let n,i=e[e.length-1];for(";"===i[0]&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(i[3]||i[2]||function(e){for(let t=e.length-1;t>=0;t--){let r=e[t],n=r[3]||r[2];if(n)return n}}(e)),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,s=[];for(;e.length&&(o=e[0][0],"space"===o||"comment"===o);)s.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),i="";for(let e=t;e>0;e--){let t=n[e][0];if(0===i.trim().indexOf("!")&&"space"!==t)break;i=n.pop()[1]+i}0===i.trim().indexOf("!")&&(r.important=!0,r.raws.important=i,e=n)}if("space"!==n[0]&&"comment"!==n[0])break}e.some((e=>"space"!==e[0]&&"comment"!==e[0]))&&(r.raws.between+=s.map((e=>e[1])).join(""),s=[]),this.raw(r,"value",s.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 JI;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,r=null,n=!1,i=null,o=[],s=e[1].startsWith("--"),a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)i||(i=l),o.push("("===r?")":"]");else if(s&&n&&"{"===r)i||(i=l),o.push("}");else if(0===o.length){if(";"===r){if(n)return void this.decl(a,s);break}if("{"===r)return void this.rule(a);if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}":"===r&&(n=!0)}else r===o[o.length-1]&&(o.pop(),0===o.length&&(i=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(i),t&&n){if(!s)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,s)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,r,n){let i,o,s,a,l=r.length,u="",c=!0;for(let e=0;e<l;e+=1)i=r[e],o=i[0],"space"!==o||e!==l-1||n?"comment"===o?(a=r[e-1]?r[e-1][0]:"empty",s=r[e+1]?r[e+1][0]:"empty",$I[a]||$I[s]||","===u.slice(-1)?c=!1:u+=i[1]):u+=i[1]:c=!1;if(!c){let n=r.reduce(((e,t)=>e+t[1]),"");e.raws[t]={raw:n,value:u}}e[t]=u}rule(e){e.pop();let t=new JI;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 HI=ZC,QI=XI,ex=SC;function tx(e,t){let r=new ex(e,t),n=new QI(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 rx=tx;tx.default=tx,HI.registerParse(tx);let{isClean:nx,my:ix}=NS,ox=_C,sx=BS,ax=ZC,lx=QC,ux=tI,cx=sI,hx=rx,dx=FI;const px={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},fx={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},gx={Once:!0,postcssPlugin:!0,prepare:!0};function mx(e){return"object"==typeof e&&"function"==typeof e.then}function vx(e){let t=!1,r=px[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 yx(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:vx(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function wx(e){return e[nx]=!1,e.nodes&&e.nodes.forEach((e=>wx(e))),e}let bx={},Sx=class e{constructor(t,r,n){let i;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof e||r instanceof cx)i=wx(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=hx;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{i=e(r,n)}catch(e){this.processed=!0,this.error=e}i&&!i[ix]&&ax.rebuild(i)}else i=wx(r);this.result=new cx(t,i,n),this.helpers={...bx,postcss:bx,result:this.result},this.plugins=this.processor.plugins.map((e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e))}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let r=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(r.postcssVersion&&"production"!==process.env.NODE_ENV){let e=r.postcssPlugin,t=r.postcssVersion,n=this.result.processor.version,i=t.split("."),o=n.split(".");(i[0]!==o[0]||parseInt(i[1])>parseInt(o[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+n+", but "+e+" uses "+t+". Perhaps this is the source of the error below.")}}else e.plugin=r.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,r)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,r])};for(let t of this.plugins)if("object"==typeof t)for(let r in t){if(!fx[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!gx[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(mx(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[nx];){e[nx]=!0;let t=[yx(e)];for(;t.length>0;){let e=this.visitTick(t);if(mx(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 mx(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=sx;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new ox(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(mx(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[nx];)e[nx]=!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||ux("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(mx(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,i]=n[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===n.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return i(r.toProxy(),this.helpers)}catch(e){throw this.handleError(e,r)}}if(0!==t.iterator){let n,i=t.iterator;for(;n=r.nodes[r.indexes[i]];)if(r.indexes[i]+=1,!n[nx])return n[nx]=!0,void e.push(yx(n));t.iterator=0,delete r.indexes[i]}let i=t.events;for(;t.eventIndex<i.length;){let e=i[t.eventIndex];if(t.eventIndex+=1,0===e)return void(r.nodes&&r.nodes.length&&(r[nx]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[nx]=!0;let t=vx(e);for(let r of t)if(0===r)e.nodes&&e.each((e=>{e[nx]||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"}};Sx.registerPostcss=e=>{bx=e};var Cx=Sx;Sx.default=Sx,dx.registerLazyResult(Sx),lx.registerLazyResult(Sx);let Ix=_C,xx=BS,kx=tI,Ex=rx;const Ox=sI;let Ax=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 i=xx;this.result=new Ox(this._processor,n,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let s=new Ix(i,n,this._opts,t);if(s.isMap()){let[e,t]=s.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else s.clearAnnotation(),this.result.css=s.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||kx("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=Ex;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 Rx=Ax;Ax.default=Ax;let Px=Rx,Mx=Cx,_x=QC,Tx=FI,Nx=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 Mx(this,e,t):new Px(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var Lx=Nx;Nx.default=Nx,Tx.registerProcessor(Nx),_x.registerProcessor(Nx);let Dx=XS,Fx=sC,Ux=LC,jx=_I,Bx=SC,zx=FI,Vx=WI;function Wx(e,t){if(Array.isArray(e))return e.map((e=>Wx(e)));let{inputs:r,...n}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:Bx.prototype};r.map&&(r.map={...r.map,__proto__:Fx.prototype}),t.push(r)}}if(n.nodes&&(n.nodes=e.nodes.map((e=>Wx(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 zx(n);if("decl"===n.type)return new Dx(n);if("rule"===n.type)return new Vx(n);if("comment"===n.type)return new Ux(n);if("atrule"===n.type)return new jx(n);throw new Error("Unknown node type: "+e.type)}var qx=Wx;Wx.default=Wx;let Gx=TS,Kx=XS,Yx=Cx,Zx=ZC,Jx=Lx,$x=BS,Xx=qx,Hx=QC,Qx=nI,ek=LC,tk=_I,rk=sI,nk=SC,ik=rx,ok=jI,sk=WI,ak=FI,lk=ZS;function uk(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new Jx(e)}uk.plugin=function(e,t){let r,n=!1;function i(...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 i=t(...r);return i.postcssPlugin=e,i.postcssVersion=(new Jx).version,i}return Object.defineProperty(i,"postcss",{get:()=>(r||(r=i()),r)}),i.process=function(e,t,r){return uk([i(r)]).process(e,t)},i},uk.stringify=$x,uk.parse=ik,uk.fromJSON=Xx,uk.list=ok,uk.comment=e=>new ek(e),uk.atRule=e=>new tk(e),uk.decl=e=>new Kx(e),uk.rule=e=>new sk(e),uk.root=e=>new ak(e),uk.document=e=>new Hx(e),uk.CssSyntaxError=Gx,uk.Declaration=Kx,uk.Container=Zx,uk.Processor=Jx,uk.Document=Hx,uk.Comment=ek,uk.Warning=Qx,uk.AtRule=tk,uk.Result=rk,uk.Input=nk,uk.Rule=sk,uk.Root=ak,uk.Node=lk,Yx.registerPostcss(uk);var ck=uk;uk.default=uk;const hk=IS(ck);hk.stringify,hk.fromJSON,hk.plugin,hk.parse,hk.list,hk.document,hk.comment,hk.atRule,hk.rule,hk.decl,hk.root,hk.CssSyntaxError,hk.Declaration,hk.Container,hk.Processor,hk.Document,hk.Comment,hk.Warning,hk.AtRule,hk.Result,hk.Input,hk.Rule,hk.Root,hk.Node;var dk=Object.defineProperty,pk=(e,t,r)=>((e,t,r)=>t in e?dk(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);function fk(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function gk(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 mk={exports:{}},vk=String,yk=function(){return{isColorSupported:!1,reset:vk,bold:vk,dim:vk,italic:vk,underline:vk,inverse:vk,hidden:vk,strikethrough:vk,black:vk,red:vk,green:vk,yellow:vk,blue:vk,magenta:vk,cyan:vk,white:vk,gray:vk,bgBlack:vk,bgRed:vk,bgGreen:vk,bgYellow:vk,bgBlue:vk,bgMagenta:vk,bgCyan:vk,bgWhite:vk}};mk.exports=yk(),mk.exports.createColors=yk;var wk=mk.exports;const bk=gk(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let Sk=wk,Ck=bk,Ik=class e extends Error{constructor(t,r,n,i,o,s){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),i&&(this.source=i),s&&(this.plugin=s),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=Sk.isColorSupported),Ck&&e&&(t=Ck(t));let r,n,i=t.split(/\r?\n/),o=Math.max(this.line-3,0),s=Math.min(this.line+2,i.length),a=String(s).length;if(e){let{bold:e,gray:t,red:i}=Sk.createColors(!0);r=t=>e(i(t)),n=e=>t(e)}else r=n=e=>e;return i.slice(o,s).map(((e,t)=>{let i=o+1+t,s=" "+(" "+i).slice(-a)+" | ";if(i===this.line){let t=n(s.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return r(">")+n(s)+e+"\n "+t+r("^")}return" "+n(s)+e})).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};var xk=Ik;Ik.default=Ik;var kk={};kk.isClean=Symbol("isClean"),kk.my=Symbol("my");const Ek={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let Ok=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 i=(e.raws.between||"")+(t?";":"");this.builder(r+n+i,e)}}beforeAfter(e,t){let r;r="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let n=e.parent,i=0;for(;n&&"root"!==n.type;)i+=1,n=n.parent;if(r.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<i;e++)r+=t}return r}block(e,t){let r,n=this.raw(e,"between","beforeOpen");this.builder(t+n+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),r=this.raw(e,"after")):r=this.raw(e,"after","emptyBody"),r&&this.builder(r),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let r=this.raw(e,"semicolon");for(let n=0;n<e.nodes.length;n++){let i=e.nodes[n],o=this.raw(i,"before");o&&this.builder(o),this.stringify(i,t!==n||r)}}comment(e){let t=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)}decl(e,t){let r=this.raw(e,"between","colon"),n=e.prop+r+this.rawValue(e,"value");e.important&&(n+=e.raws.important||" !important"),t&&(n+=";"),this.builder(n,e)}document(e){this.body(e)}raw(e,t,r){let n;if(r||(r=t),t&&(n=e.raws[t],void 0!==n))return n;let i=e.parent;if("before"===r){if(!i||"root"===i.type&&i.first===e)return"";if(i&&"document"===i.type)return""}if(!i)return Ek[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 i="raw"+((s=r)[0].toUpperCase()+s.slice(1));this[i]?n=this[i](o,e):o.walk((e=>{if(n=e.raws[t],void 0!==n)return!1}))}var s;return void 0===n&&(n=Ek[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 Ak=Ok;Ok.default=Ok;let Rk=Ak;function Pk(e,t){new Rk(t).stringify(e)}var Mk=Pk;Pk.default=Pk;let{isClean:_k,my:Tk}=kk,Nk=xk,Lk=Ak,Dk=Mk;function Fk(e,t){let r=new e.constructor;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if("proxyCache"===n)continue;let i=e[n],o=typeof i;"parent"===n&&"object"===o?t&&(r[n]=t):"source"===n?r[n]=i:Array.isArray(i)?r[n]=i.map((e=>Fk(e,r))):("object"===o&&null!==i&&(i=Fk(i)),r[n]=i)}return r}let Uk=class{constructor(e={}){this.raws={},this[_k]=!1,this[Tk]=!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=Fk(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 Nk(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[_k]){this[_k]=!1;let e=this;for(;e=e.parent;)e[_k]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){let n=(t=this.toString()).indexOf(e.word);-1!==n&&(r=this.positionInside(n,t))}return r}positionInside(e,t){let r=t||this.toString(),n=this.source.start.column,i=this.source.start.line;for(let t=0;t<e;t++)"\n"===r[t]?(n=1,i+=1):n+=1;return{column:n,line:i}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let n=this.toString(),i=n.indexOf(e.word);-1!==i&&(t=this.positionInside(i,n),r=this.positionInside(i+e.word.length,n))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return(new Lk).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let n of e)n===this?r=!0:r?(this.parent.insertAfter(t,n),t=n):this.parent.insertBefore(t,n);r||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let r={},n=null==t;t=t||new Map;let i=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let n=this[e];if(Array.isArray(n))r[e]=n.map((e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e));else if("object"==typeof n&&n.toJSON)r[e]=n.toJSON(null,t);else if("source"===e){let o=t.get(n.input);null==o&&(o=i,t.set(n.input,i),i++),r[e]={end:n.end,inputId:o,start:n.start}}else r[e]=n}return n&&(r.inputs=[...t.keys()].map((e=>e.toJSON()))),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=Dk){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 jk=Uk;Uk.default=Uk;let Bk=jk,zk=class extends Bk{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 Vk=zk;zk.default=zk;var Wk={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(r=t)=>{let n="",i=r;for(;i--;)n+=e[Math.random()*e.length|0];return n}};let{SourceMapConsumer:qk,SourceMapGenerator:Gk}=bk,{existsSync:Kk,readFileSync:Yk}=bk,{dirname:Zk,join:Jk}=bk;let $k=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=Zk(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new qk(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=Zk(e),Kk(e))return this.mapFile=e,Yk(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 qk)return Gk.fromSourceMap(t).toString();if(t instanceof Gk)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=Jk(Zk(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 Xk=$k;$k.default=$k;let{SourceMapConsumer:Hk,SourceMapGenerator:Qk}=bk,{fileURLToPath:eE,pathToFileURL:tE}=bk,{isAbsolute:rE,resolve:nE}=bk,{nanoid:iE}=Wk,oE=bk,sE=xk,aE=Xk,lE=Symbol("fromOffsetCache"),uE=Boolean(Hk&&Qk),cE=Boolean(nE&&rE),hE=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&&(!cE||/^\w+:\/\//.test(t.from)||rE(t.from)?this.file=t.from:this.file=nE(t.from)),cE&&uE){let e=new aE(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 "+iE(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let i,o,s;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,s=e.col}else o=n.line,s=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let a=this.origin(t,r,o,s);return i=a?new sE(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 sE(e,void 0===o?t:{column:r,line:t},void 0===o?r:{column:s,line:o},this.css,this.file,n.plugin),i.input={column:r,endColumn:s,endLine:o,line:t,source:this.css},this.file&&(tE&&(i.input.url=tE(this.file).toString()),i.input.file=this.file),i}fromOffset(e){let t,r;if(this[lE])r=this[lE];else{let e=this.css.split("\n");r=new Array(e.length);let t=0;for(let n=0,i=e.length;n<i;n++)r[n]=t,t+=e[n].length+1;this[lE]=r}t=r[r.length-1];let n=0;if(e>=t)n=r.length-1;else{let t,i=r.length-2;for(;n<i;)if(t=n+(i-n>>1),e<r[t])i=t-1;else{if(!(e>=r[t+1])){n=t;break}n=t+1}}return{col:e-r[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:nE(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,n){if(!this.map)return!1;let i,o,s=this.map.consumer(),a=s.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof r&&(i=s.originalPositionFor({column:n,line:r})),o=rE(a.source)?tE(a.source):new URL(a.source,this.map.consumer().sourceRoot||tE(this.map.mapFile));let l={column:a.column,endColumn:i&&i.column,endLine:i&&i.line,line:a.line,url:o.toString()};if("file:"===o.protocol){if(!eE)throw new Error("file: protocol is not available in this PostCSS build");l.file=eE(o)}let u=s.sourceContentFor(a.source);return u&&(l.source=u),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 dE=hE;hE.default=hE,oE&&oE.registerInput&&oE.registerInput(hE);let{SourceMapConsumer:pE,SourceMapGenerator:fE}=bk,{dirname:gE,relative:mE,resolve:vE,sep:yE}=bk,{pathToFileURL:wE}=bk,bE=dE,SE=Boolean(pE&&fE),CE=Boolean(gE&&vE&&mE&&yE);var IE=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||gE(e.file);!1===this.mapOpts.sourcesContent?(t=new pE(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(),CE&&SE&&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=fE.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new fE({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 fE({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,r=1,n=1,i="<no source>",o={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,((s,a,l)=>{if(this.css+=s,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=i,o.original.line=1,o.original.column=0,this.map.addMapping(o))),e=s.match(/\n/g),e?(r+=e.length,t=s.lastIndexOf("\n"),n=s.length-t):n+=s.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=i,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?gE(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=gE(vE(r,this.mapOpts.annotation)));let n=mE(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 bE(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(wE){let t=wE(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;"\\"===yE&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let xE=jk,kE=class extends xE{constructor(e){super(e),this.type="comment"}};var EE=kE;kE.default=kE;let OE,AE,RE,PE,{isClean:ME,my:_E}=kk,TE=Vk,NE=EE,LE=jk;function DE(e){return e.map((e=>(e.nodes&&(e.nodes=DE(e.nodes)),delete e.source,e)))}function FE(e){if(e[ME]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)FE(t)}let UE=class e extends LE{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,r,n=this.getIterator();for(;this.indexes[n]<this.proxyOf.nodes.length&&(t=this.indexes[n],r=e(this.proxyOf.nodes[t],t),!1!==r);)this.indexes[n]+=1;return delete this.indexes[n],r}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...r)=>e[t](...r.map((e=>"function"==typeof e?(t,r)=>e(t.toProxy(),r):e))):"every"===t||"some"===t?r=>e[t](((e,...t)=>r(e.toProxy(),...t))):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map((e=>e.toProxy())):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let r,n=this.index(e),i=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let e of i)this.proxyOf.nodes.splice(n+1,0,e);for(let e in this.indexes)r=this.indexes[e],n<r&&(this.indexes[e]=r+i.length);return this.markDirty(),this}insertBefore(e,t){let r,n=this.index(e),i=0===n&&"prepend",o=this.normalize(t,this.proxyOf.nodes[n],i).reverse();n=this.index(e);for(let e of o)this.proxyOf.nodes.splice(n,0,e);for(let e in this.indexes)r=this.indexes[e],n<=r&&(this.indexes[e]=r+o.length);return this.markDirty(),this}normalize(t,r){if("string"==typeof t)t=DE(OE(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 TE(t)]}else if(t.selector)t=[new AE(t)];else if(t.name)t=[new RE(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new NE(t)]}return t.map((t=>(t[_E]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[ME]&&FE(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]}};UE.registerParse=e=>{OE=e},UE.registerRule=e=>{AE=e},UE.registerAtRule=e=>{RE=e},UE.registerRoot=e=>{PE=e};var jE=UE;UE.default=UE,UE.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,RE.prototype):"rule"===e.type?Object.setPrototypeOf(e,AE.prototype):"decl"===e.type?Object.setPrototypeOf(e,TE.prototype):"comment"===e.type?Object.setPrototypeOf(e,NE.prototype):"root"===e.type&&Object.setPrototypeOf(e,PE.prototype),e[_E]=!0,e.nodes&&e.nodes.forEach((e=>{UE.rebuild(e)}))};let BE,zE,VE=jE,WE=class extends VE{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new BE(new zE,this,e).stringify()}};WE.registerLazyResult=e=>{BE=e},WE.registerProcessor=e=>{zE=e};var qE=WE;WE.default=WE;let GE={};var KE=function(e){GE[e]||(GE[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let YE=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 ZE=YE;YE.default=YE;let JE=ZE,$E=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 JE(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter((e=>"warning"===e.type))}get content(){return this.css}};var XE=$E;$E.default=$E;const HE="'".charCodeAt(0),QE='"'.charCodeAt(0),eO="\\".charCodeAt(0),tO="/".charCodeAt(0),rO="\n".charCodeAt(0),nO=" ".charCodeAt(0),iO="\f".charCodeAt(0),oO="\t".charCodeAt(0),sO="\r".charCodeAt(0),aO="[".charCodeAt(0),lO="]".charCodeAt(0),uO="(".charCodeAt(0),cO=")".charCodeAt(0),hO="{".charCodeAt(0),dO="}".charCodeAt(0),pO=";".charCodeAt(0),fO="*".charCodeAt(0),gO=":".charCodeAt(0),mO="@".charCodeAt(0),vO=/[\t\n\f\r "#'()/;[\\\]{}]/g,yO=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,wO=/.[\r\n"'(/\\]/,bO=/[\da-f]/i;let SO=jE,CO=class extends SO{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 IO=CO;CO.default=CO,SO.registerAtRule(CO);let xO,kO,EO=jE,OO=class extends EO{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 xO(new kO,this,e).stringify()}};OO.registerLazyResult=e=>{xO=e},OO.registerProcessor=e=>{kO=e};var AO=OO;OO.default=OO,EO.registerRoot(OO);let RO={comma:e=>RO.split(e,[","],!0),space:e=>RO.split(e,[" ","\n","\t"]),split(e,t,r){let n=[],i="",o=!1,s=0,a=!1,l="",u=!1;for(let r of e)u?u=!1:"\\"===r?u=!0:a?r===l&&(a=!1):'"'===r||"'"===r?(a=!0,l=r):"("===r?s+=1:")"===r?s>0&&(s-=1):0===s&&t.includes(r)&&(o=!0),o?(""!==i&&n.push(i.trim()),i="",o=!1):i+=r;return(r||""!==i)&&n.push(i.trim()),n}};var PO=RO;RO.default=RO;let MO=jE,_O=PO,TO=class extends MO{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return _O.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 NO=TO;TO.default=TO,MO.registerRule(TO);let LO=Vk,DO=function(e,t={}){let r,n,i,o,s,a,l,u,c,h,d=e.css.valueOf(),p=t.ignoreErrors,f=d.length,g=0,m=[],v=[];function y(t){throw e.error("Unclosed "+t,g)}return{back:function(e){v.push(e)},endOfFile:function(){return 0===v.length&&g>=f},nextToken:function(e){if(v.length)return v.pop();if(g>=f)return;let t=!!e&&e.ignoreUnclosed;switch(r=d.charCodeAt(g),r){case rO:case nO:case oO:case sO:case iO:n=g;do{n+=1,r=d.charCodeAt(n)}while(r===nO||r===rO||r===oO||r===sO||r===iO);h=["space",d.slice(g,n)],g=n-1;break;case aO:case lO:case hO:case dO:case gO:case pO:case cO:{let e=String.fromCharCode(r);h=[e,e,g];break}case uO:if(u=m.length?m.pop()[1]:"",c=d.charCodeAt(g+1),"url"===u&&c!==HE&&c!==QE&&c!==nO&&c!==rO&&c!==oO&&c!==iO&&c!==sO){n=g;do{if(a=!1,n=d.indexOf(")",n+1),-1===n){if(p||t){n=g;break}y("bracket")}for(l=n;d.charCodeAt(l-1)===eO;)l-=1,a=!a}while(a);h=["brackets",d.slice(g,n+1),g,n],g=n}else n=d.indexOf(")",g+1),o=d.slice(g,n+1),-1===n||wO.test(o)?h=["(","(",g]:(h=["brackets",o,g,n],g=n);break;case HE:case QE:i=r===HE?"'":'"',n=g;do{if(a=!1,n=d.indexOf(i,n+1),-1===n){if(p||t){n=g+1;break}y("string")}for(l=n;d.charCodeAt(l-1)===eO;)l-=1,a=!a}while(a);h=["string",d.slice(g,n+1),g,n],g=n;break;case mO:vO.lastIndex=g+1,vO.test(d),n=0===vO.lastIndex?d.length-1:vO.lastIndex-2,h=["at-word",d.slice(g,n+1),g,n],g=n;break;case eO:for(n=g,s=!0;d.charCodeAt(n+1)===eO;)n+=1,s=!s;if(r=d.charCodeAt(n+1),s&&r!==tO&&r!==nO&&r!==rO&&r!==oO&&r!==sO&&r!==iO&&(n+=1,bO.test(d.charAt(n)))){for(;bO.test(d.charAt(n+1));)n+=1;d.charCodeAt(n+1)===nO&&(n+=1)}h=["word",d.slice(g,n+1),g,n],g=n;break;default:r===tO&&d.charCodeAt(g+1)===fO?(n=d.indexOf("*/",g+2)+1,0===n&&(p||t?n=d.length:y("comment")),h=["comment",d.slice(g,n+1),g,n],g=n):(yO.lastIndex=g+1,yO.test(d),n=0===yO.lastIndex?d.length-1:yO.lastIndex-2,h=["word",d.slice(g,n+1),g,n],m.push(h),g=n)}return g++,h},position:function(){return g}}},FO=EE,UO=IO,jO=AO,BO=NO;const zO={empty:!0,space:!0};var VO=class{constructor(e){this.input=e,this.root=new jO,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,i=new UO;i.name=e[1].slice(1),""===i.name&&this.unnamedAtrule(i,e),this.init(i,e[2]);let o=!1,s=!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){i.source.end=this.getPosition(e[2]),i.source.end.offset++,this.semicolon=!0;break}if("{"===t){s=!0;break}if("}"===t){if(a.length>0){for(n=a.length-1,r=a[n];r&&"space"===r[0];)r=a[--n];r&&(i.source.end=this.getPosition(r[3]||r[2]),i.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}i.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(i.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(i,"params",a),o&&(e=a[a.length-1],i.source.end=this.getPosition(e[3]||e[2]),i.source.end.offset++,this.spaces=i.raws.between,i.raws.between="")):(i.raws.afterName="",i.params=""),s&&(i.nodes=[],this.current=i)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let r,n=0;for(let i=t-1;i>=0&&(r=e[i],"space"===r[0]||(n+=1,2!==n));i--);throw this.input.error("Missed semicolon","word"===r[0]?r[3]+1:r[2])}colon(e){let t,r,n,i=0;for(let[o,s]of e.entries()){if(t=s,r=t[0],"("===r&&(i+=1),")"===r&&(i-=1),0===i&&":"===r){if(n){if("word"===n[0]&&"progid"===n[1])continue;return o}this.doubleColon(t)}n=t}return!1}comment(e){let t=new FO;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=DO(this.input)}decl(e,t){let r=new LO;this.init(r,e[0][2]);let n,i=e[e.length-1];for(";"===i[0]&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(i[3]||i[2]||function(e){for(let t=e.length-1;t>=0;t--){let r=e[t],n=r[3]||r[2];if(n)return n}}(e)),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,s=[];for(;e.length&&(o=e[0][0],"space"===o||"comment"===o);)s.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),i="";for(let e=t;e>0;e--){let t=n[e][0];if(0===i.trim().indexOf("!")&&"space"!==t)break;i=n.pop()[1]+i}0===i.trim().indexOf("!")&&(r.important=!0,r.raws.important=i,e=n)}if("space"!==n[0]&&"comment"!==n[0])break}e.some((e=>"space"!==e[0]&&"comment"!==e[0]))&&(r.raws.between+=s.map((e=>e[1])).join(""),s=[]),this.raw(r,"value",s.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 BO;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,r=null,n=!1,i=null,o=[],s=e[1].startsWith("--"),a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)i||(i=l),o.push("("===r?")":"]");else if(s&&n&&"{"===r)i||(i=l),o.push("}");else if(0===o.length){if(";"===r){if(n)return void this.decl(a,s);break}if("{"===r)return void this.rule(a);if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}":"===r&&(n=!0)}else r===o[o.length-1]&&(o.pop(),0===o.length&&(i=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(i),t&&n){if(!s)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,s)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,r,n){let i,o,s,a,l=r.length,u="",c=!0;for(let e=0;e<l;e+=1)i=r[e],o=i[0],"space"!==o||e!==l-1||n?"comment"===o?(a=r[e-1]?r[e-1][0]:"empty",s=r[e+1]?r[e+1][0]:"empty",zO[a]||zO[s]||","===u.slice(-1)?c=!1:u+=i[1]):u+=i[1]:c=!1;if(!c){let n=r.reduce(((e,t)=>e+t[1]),"");e.raws[t]={raw:n,value:u}}e[t]=u}rule(e){e.pop();let t=new BO;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 WO=jE,qO=VO,GO=dE;function KO(e,t){let r=new GO(e,t),n=new qO(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 YO=KO;KO.default=KO,WO.registerParse(KO);let{isClean:ZO,my:JO}=kk,$O=IE,XO=Mk,HO=jE,QO=qE,eA=KE,tA=XE,rA=YO,nA=AO;const iA={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},oA={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},sA={Once:!0,postcssPlugin:!0,prepare:!0};function aA(e){return"object"==typeof e&&"function"==typeof e.then}function lA(e){let t=!1,r=iA[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 uA(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:lA(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function cA(e){return e[ZO]=!1,e.nodes&&e.nodes.forEach((e=>cA(e))),e}let hA={},dA=class e{constructor(t,r,n){let i;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof e||r instanceof tA)i=cA(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=rA;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{i=e(r,n)}catch(e){this.processed=!0,this.error=e}i&&!i[JO]&&HO.rebuild(i)}else i=cA(r);this.result=new tA(t,i,n),this.helpers={...hA,postcss:hA,result:this.result},this.plugins=this.processor.plugins.map((e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e))}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let r=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(r.postcssVersion&&"production"!==process.env.NODE_ENV){let e=r.postcssPlugin,t=r.postcssVersion,n=this.result.processor.version,i=t.split("."),o=n.split(".");(i[0]!==o[0]||parseInt(i[1])>parseInt(o[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+n+", but "+e+" uses "+t+". Perhaps this is the source of the error below.")}}else e.plugin=r.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,r)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,r])};for(let t of this.plugins)if("object"==typeof t)for(let r in t){if(!oA[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!sA[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(aA(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[ZO];){e[ZO]=!0;let t=[uA(e)];for(;t.length>0;){let e=this.visitTick(t);if(aA(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 aA(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=XO;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new $O(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(aA(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[ZO];)e[ZO]=!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||eA("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(aA(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,i]=n[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===n.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return i(r.toProxy(),this.helpers)}catch(e){throw this.handleError(e,r)}}if(0!==t.iterator){let n,i=t.iterator;for(;n=r.nodes[r.indexes[i]];)if(r.indexes[i]+=1,!n[ZO])return n[ZO]=!0,void e.push(uA(n));t.iterator=0,delete r.indexes[i]}let i=t.events;for(;t.eventIndex<i.length;){let e=i[t.eventIndex];if(t.eventIndex+=1,0===e)return void(r.nodes&&r.nodes.length&&(r[ZO]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[ZO]=!0;let t=lA(e);for(let r of t)if(0===r)e.nodes&&e.each((e=>{e[ZO]||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"}};dA.registerPostcss=e=>{hA=e};var pA=dA;dA.default=dA,nA.registerLazyResult(dA),QO.registerLazyResult(dA);let fA=IE,gA=Mk,mA=KE,vA=YO;const yA=XE;let wA=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 i=gA;this.result=new yA(this._processor,n,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let s=new fA(i,n,this._opts,t);if(s.isMap()){let[e,t]=s.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else s.clearAnnotation(),this.result.css=s.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||mA("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=vA;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 bA=wA;wA.default=wA;let SA=bA,CA=pA,IA=qE,xA=AO,kA=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 CA(this,e,t):new SA(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var EA=kA;kA.default=kA,xA.registerProcessor(kA),IA.registerProcessor(kA);let OA=Vk,AA=Xk,RA=EE,PA=IO,MA=dE,_A=AO,TA=NO;function NA(e,t){if(Array.isArray(e))return e.map((e=>NA(e)));let{inputs:r,...n}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:MA.prototype};r.map&&(r.map={...r.map,__proto__:AA.prototype}),t.push(r)}}if(n.nodes&&(n.nodes=e.nodes.map((e=>NA(e,t)))),n.source){let{inputId:e,...r}=n.source;n.source=r,null!=e&&(n.source.input=t[e])}if("root"===n.type)return new _A(n);if("decl"===n.type)return new OA(n);if("rule"===n.type)return new TA(n);if("comment"===n.type)return new RA(n);if("atrule"===n.type)return new PA(n);throw new Error("Unknown node type: "+e.type)}var LA=NA;NA.default=NA;let DA=xk,FA=Vk,UA=pA,jA=jE,BA=EA,zA=Mk,VA=LA,WA=qE,qA=ZE,GA=EE,KA=IO,YA=XE,ZA=dE,JA=YO,$A=PO,XA=NO,HA=AO,QA=jk;function eR(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new BA(e)}eR.plugin=function(e,t){let r,n=!1;function i(...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 i=t(...r);return i.postcssPlugin=e,i.postcssVersion=(new BA).version,i}return Object.defineProperty(i,"postcss",{get:()=>(r||(r=i()),r)}),i.process=function(e,t,r){return eR([i(r)]).process(e,t)},i},eR.stringify=zA,eR.parse=JA,eR.fromJSON=VA,eR.list=$A,eR.comment=e=>new GA(e),eR.atRule=e=>new KA(e),eR.decl=e=>new FA(e),eR.rule=e=>new XA(e),eR.root=e=>new HA(e),eR.document=e=>new WA(e),eR.CssSyntaxError=DA,eR.Declaration=FA,eR.Container=jA,eR.Processor=BA,eR.Document=WA,eR.Comment=GA,eR.Warning=qA,eR.AtRule=KA,eR.Result=YA,eR.Input=ZA,eR.Rule=XA,eR.Root=HA,eR.Node=QA,UA.registerPostcss(eR);var tR=eR;eR.default=eR;const rR=fk(tR);rR.stringify,rR.fromJSON,rR.plugin,rR.parse,rR.list,rR.document,rR.comment,rR.atRule,rR.rule,rR.decl,rR.root,rR.CssSyntaxError,rR.Declaration,rR.Container,rR.Processor,rR.Document,rR.Comment,rR.Warning,rR.AtRule,rR.Result,rR.Input,rR.Rule,rR.Root,rR.Node;class nR{constructor(...e){pk(this,"parentElement",null),pk(this,"parentNode",null),pk(this,"ownerDocument"),pk(this,"firstChild",null),pk(this,"lastChild",null),pk(this,"previousSibling",null),pk(this,"nextSibling",null),pk(this,"ELEMENT_NODE",1),pk(this,"TEXT_NODE",3),pk(this,"nodeType"),pk(this,"nodeName"),pk(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 nR))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 iR={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},oR={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},sR={};function aR(e){if(sR[e])return sR[e];const t=globalThis[e],r=t.prototype,n=e in iR?iR[e]:void 0,i=Boolean(n&&n.every((e=>{var t,n;return Boolean(null==(n=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:n.toString().includes("[native code]"))}))),o=e in oR?oR[e]:void 0,s=Boolean(o&&o.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(i&&s&&!globalThis.Zone)return sR[e]=t.prototype,t.prototype;try{const n=document.createElement("iframe");document.body.appendChild(n);const i=n.contentWindow;if(!i)return t.prototype;const o=i[e].prototype;return document.body.removeChild(n),o?sR[e]=o:r}catch{return r}}const lR={};function uR(e,t,r){var n;const i=`${e}.${String(r)}`;if(lR[i])return lR[i].call(t);const o=aR(e),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(lR[i]=s,s.call(t)):t[r]}const cR={};function hR(e,t,r){const n=`${e}.${String(r)}`;if(cR[n])return cR[n].bind(t);const i=aR(e)[r];return"function"!=typeof i?t[r]:(cR[n]=i,i.bind(t))}const dR={childNodes:function(e){return uR("Node",e,"childNodes")},parentNode:function(e){return uR("Node",e,"parentNode")},parentElement:function(e){return uR("Node",e,"parentElement")},textContent:function(e){return uR("Node",e,"textContent")},contains:function(e,t){return hR("Node",e,"contains")(t)},getRootNode:function(e){return hR("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?uR("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?uR("Element",e,"shadowRoot"):null},querySelector:function(e,t){return uR("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return uR("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return aR("MutationObserver").constructor}};const pR="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 fR={map:{},getId:()=>(console.error(pR),-1),getNode:()=>(console.error(pR),null),removeNodeFromMap(){console.error(pR)},has:()=>(console.error(pR),!1),reset(){console.error(pR)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(fR=new Proxy(fR,{get:(e,t,r)=>("map"===t&&console.error(pR),Reflect.get(e,t,r))}));let gR=Date.now;function mR(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:dR.parentElement(e)}/[1-9][0-9]{12}/.test(Date.now().toString())||(gR=()=>(new Date).getTime());function vR(e){var t;let r=null;return"getRootNode"in e&&(null==(t=dR.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&dR.host(dR.getRootNode(e))&&(r=dR.host(dR.getRootNode(e))),r}function yR(e){let t,r=e;for(;t=vR(r);)r=t;return r}function wR(e){const t=e.ownerDocument;if(!t)return!1;const r=yR(e);return dR.contains(t,r)}const bR=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){uS(this,"id",1),uS(this,"styleIDMap",new WeakMap),uS(this,"idStyleMap",new Map)}getId(e){return this.styleIDMap.get(e)??-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let r;return r=void 0===t?this.id++:t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}},get _mirror(){return fR},closestElementOfNode:mR,getBaseDimension:function e(t,r){var n,i;const o=null==(i=null==(n=t.ownerDocument)?void 0:n.defaultView)?void 0:i.frameElement;if(!o||o===r)return{x:0,y:0,relativeScale:1,absoluteScale:1};const s=o.getBoundingClientRect(),a=e(o,r),l=s.height/o.clientHeight;return{x:s.x*a.relativeScale+a.x,y:s.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:yR,getShadowHost:vR,getWindowHeight:function(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight},getWindowScroll:function(e){var t,r,n,i;const o=e.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(t=dR.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=dR.parentElement(o.body))?void 0:n.scrollTop)||(null==(i=null==o?void 0:o.body)?void 0:i.scrollTop)||0}},getWindowWidth:function(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth},hasShadowRoot:function(e){return!!e&&(e instanceof nR&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(dR.shadowRoot(e)))},hookSetter:function e(t,r,n,i,o=window){const s=o.Object.getOwnPropertyDescriptor(t,r);return o.Object.defineProperty(t,r,i?n:{set(e){setTimeout((()=>{n.set.call(this,e)}),0),s&&s.set&&s.set.call(this,e)}}),()=>e(t,r,s||{},!0)},inDom:function(e){const t=e.ownerDocument;return!!t&&(dR.contains(t,e)||wR(e))},isAncestorRemoved:function e(t,r){if(function(e){const t=e&&"host"in e&&"mode"in e&&bS.host(e)||null;return Boolean(t&&"shadowRoot"in t&&bS.shadowRoot(t)===e)}(t))return!1;const n=r.getId(t);if(!r.has(n))return!0;const i=dR.parentNode(t);return(!i||i.nodeType!==t.DOCUMENT_NODE)&&(!i||e(i,r))},isBlocked:function(e,t,r,n){if(!e)return!1;const i=mR(e);if(!i)return!1;try{if("string"==typeof t){if(i.classList.contains(t))return!0;if(n&&null!==i.closest("."+t))return!0}else if(CS(i,t,n))return!0}catch(e){}if(r){if(i.matches(r))return!0;if(n&&null!==i.closest(r))return!0}return!1},isIgnored:function(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||-2===t.getId(e)},isSerialized:function(e,t){return-1!==t.getId(e)},isSerializedIframe:function(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))},isSerializedStylesheet:function(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))},iterateResolveTree:function e(t,r){r(t.value);for(let n=t.children.length-1;n>=0;n--)e(t.children[n],r)},legacy_isTouchEvent:function(e){return Boolean(e.changedTouches)},get nowTimestamp(){return gR},on:function(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)},patch:function(e,t,r){try{if(!(t in e))return()=>{};const n=e[t],i=r(n);return"function"==typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=i,()=>{e[t]=n}}catch{return()=>{}}},polyfill:function(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)},queueToResolveTrees:function(e){const t={},r=(e,r)=>{const n={value:e,parent:r,children:[]};return t[e.node.id]=n,n},n=[];for(const i of e){const{nextId:e,parentId:o}=i;if(e&&e in t){const o=t[e];if(o.parent){const e=o.parent.children.indexOf(o);o.parent.children.splice(e,0,r(i,o.parent))}else{const e=n.indexOf(o);n.splice(e,0,r(i,null))}}else if(o in t){const e=t[o];e.children.push(r(i,e))}else n.push(r(i,null))}return n},shadowHostInDom:wR,throttle:function(e,t,r={}){let n=null,i=0;return function(...o){const s=Date.now();i||!1!==r.leading||(i=s);const a=t-(s-i),l=this;a<=0||a>t?(n&&(clearTimeout(n),n=null),i=s,e.apply(l,o)):n||!1===r.trailing||(n=setTimeout((()=>{i=!1===r.leading?0:Date.now(),n=null,e.apply(l,o)}),a))}},uniqueTextMutations:function(e){const t=new Set,r=[];for(let n=e.length;n--;){const i=e[n];t.has(i.id)||(r.push(i),t.add(i.id))}return r}},Symbol.toStringTag,{value:"Module"}));for(var SR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",CR="undefined"==typeof Uint8Array?[]:new Uint8Array(256),IR=0;IR<SR.length;IR++)CR[SR.charCodeAt(IR)]=IR;"undefined"!=typeof window&&window.Blob&&new Blob([(e=>Uint8Array.from(atob(e),(e=>e.charCodeAt(0))))("KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=")],{type:"text/javascript;charset=utf-8"});try{if(2!==Array.from([1],(e=>2*e))[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(iS=e.contentWindow)?void 0:iS.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}var xR;new SS,function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(xR||(xR={}));class kR{constructor(e){aS(this,"fileName"),aS(this,"functionName"),aS(this,"lineNumber"),aS(this,"columnNumber"),this.fileName=e.fileName||"",this.functionName=e.functionName||"",this.lineNumber=e.lineNumber,this.columnNumber=e.columnNumber}toString(){const e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?`${this.functionName} (${this.fileName}:${e}:${t})`:`${this.fileName}:${e}:${t}`}}const ER=/(^|@)\S+:\d+/,OR=/^\s*at .*(\S+:\d+|\(native\))/m,AR=/^(eval@)?(\[native code])?$/,RR={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(OR)?this.parseV8OrIE(e):e.stack?this.parseFFOrSafari(e):(console.warn("[console-record-plugin]: Failed to parse error object:",e),[]):[]},extractLocation:function(e){if(-1===e.indexOf(":"))return[e];const t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error(`Cannot parse given url: ${e}`);return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(OR)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));let t=e.replace(/^\s+/,"").replace(/\(eval code/g,"(");const r=t.match(/ (\((.+):(\d+):(\d+)\)$)/);t=r?t.replace(r[0],""):t;const n=t.split(/\s+/).slice(1),i=this.extractLocation(r?r[1]:n.pop()),o=n.join(" ")||void 0,s=["eval","<anonymous>"].indexOf(i[0])>-1?void 0:i[0];return new kR({functionName:o,fileName:s,lineNumber:i[1],columnNumber:i[2]})}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(e){return!e.match(AR)}),this).map((function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new kR({functionName:e});{const t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),n=r&&r[1]?r[1]:void 0,i=this.extractLocation(e.replace(t,""));return new kR({functionName:n,fileName:i[0],lineNumber:i[1],columnNumber:i[2]})}}),this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){const t=/Line (\d+).*script (?:in )?(\S+)/i,r=e.message.split("\n"),n=[];for(let e=2,i=r.length;e<i;e+=2){const i=t.exec(r[e]);i&&n.push(new kR({fileName:i[2],lineNumber:parseFloat(i[1])}))}return n},parseOpera10:function(e){const t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=e.stacktrace.split("\n"),n=[];for(let e=0,i=r.length;e<i;e+=2){const i=t.exec(r[e]);i&&n.push(new kR({functionName:i[3]||void 0,fileName:i[2],lineNumber:parseFloat(i[1])}))}return n},parseOpera11:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(ER)&&!e.match(/^Error created at/)}),this).map((function(e){const t=e.split("@"),r=this.extractLocation(t.pop()),n=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new kR({functionName:n,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function PR(e){if(!e||!e.outerHTML)return"";let t="";for(;e.parentElement;){let r=e.localName;if(!r)break;r=r.toLowerCase();const n=e.parentElement,i=[];if(n.children&&n.children.length>0)for(let e=0;e<n.children.length;e++){const t=n.children[e];t.localName&&t.localName.toLowerCase&&t.localName.toLowerCase()===r&&i.push(t)}i.length>1&&(r+=`:eq(${i.indexOf(e)})`),t=r+(t?">"+t:""),e=n}return t}function MR(e){return"[object Object]"===Object.prototype.toString.call(e)}function _R(e,t){if(0===t)return!0;const r=Object.keys(e);for(const n of r)if(MR(e[n])&&_R(e[n],t-1))return!0;return!1}function TR(e,t){const r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,t);const n=[],i=[];return JSON.stringify(e,(function(e,t){if(n.length>0){const r=n.indexOf(this);~r?n.splice(r+1):n.push(this),~r?i.splice(r,1/0,e):i.push(e),~n.indexOf(t)&&(t=n[0]===t?"[Circular ~]":"[Circular ~."+i.slice(0,n.indexOf(t)).join(".")+"]")}else n.push(t);if(null===t)return t;if(void 0===t)return"undefined";if(function(e){if(MR(e)&&Object.keys(e).length>r.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(MR(e)&&_R(e,r.depthOfLimit))return!0;return!1}(t))return function(e){let t=e.toString();r.stringLengthLimit&&t.length>r.stringLengthLimit&&(t=`${t.slice(0,r.stringLengthLimit)}...`);return t}(t);if("bigint"==typeof t)return t.toString()+"n";if(t instanceof Event){const e={};for(const r in t){const n=t[r];Array.isArray(n)?e[r]=PR(n.length?n[0]:null):e[r]=n}return e}return t instanceof Node?t instanceof HTMLElement?t?t.outerHTML:"":t.nodeName:t instanceof Error?t.stack?t.stack+"\nEnd of stack for Error object":t.name+": "+t.message:t}))}const NR={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};function LR(e,t,r){const n=r?Object.assign({},NR,r):NR,i=n.logger;if(!i)return()=>{};let o;o="string"==typeof i?t[i]:i;let s=0,a=!1;const l=[];if(n.level.includes("error")){const r=t=>{const r=t.message,i=t.error,o=RR.parse(i).map((e=>e.toString())),s=[TR(r,n.stringifyOptions)];e({level:"error",trace:o,payload:s})};t.addEventListener("error",r),l.push((()=>{t.removeEventListener("error",r)}));const i=t=>{let r,i;t.reason instanceof Error?(r=t.reason,i=[TR(`Uncaught (in promise) ${r.name}: ${r.message}`,n.stringifyOptions)]):(r=new Error,i=[TR("Uncaught (in promise)",n.stringifyOptions),TR(t.reason,n.stringifyOptions)]);const o=RR.parse(r).map((e=>e.toString()));e({level:"error",trace:o,payload:i})};t.addEventListener("unhandledrejection",i),l.push((()=>{t.removeEventListener("unhandledrejection",i)}))}for(const e of n.level)l.push(u(o,e));return()=>{l.forEach((e=>e()))};function u(t,r){return t[r]?bR.patch(t,r,(t=>(...i)=>{if(t.apply(this,i),!("assert"===r&&i[0]||a)){a=!0;try{const t=RR.parse(new Error).map((e=>e.toString())).splice(1),o=("assert"===r?i.slice(1):i).map((e=>TR(e,n.stringifyOptions)));s++,s<n.lengthThreshold?e({level:r,trace:t,payload:o}):s===n.lengthThreshold&&e({level:"warn",trace:[],payload:[TR("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...i)}finally{a=!1}}})):()=>{}}}var DR=function(){function e(){this.fetchObserver=null}return e.prototype.start=function(e){this.eventCallback=e,this.observeFetch()},e.prototype.stop=function(){var e;null===(e=this.fetchObserver)||void 0===e||e.call(this),this.fetchObserver=null,this.eventCallback=void 0},e.prototype.notifyEvent=function(e){var t;null===(t=this.eventCallback)||void 0===t||t.call(this,e)},e.prototype.observeFetch=function(){var e=this,t=E();if(t){var r=t.fetch;r&&(t.fetch=function(t,n){return a(e,void 0,void 0,(function(){var e,i,o,s,a,u,c;return l(this,(function(l){switch(l.label){case 0:e=Date.now(),i={timestamp:e,type:"fetch",method:(null==n?void 0:n.method)||"GET",url:t.toString(),requestHeaders:null==n?void 0:n.headers},l.label=1;case 1:return l.trys.push([1,3,,4]),[4,r(t,n)];case 2:return o=l.sent(),u=Date.now(),i.status=o.status,i.duration=u-e,s={},o.headers.forEach((function(e,t){s[t]=e})),i.responseHeaders=s,this.notifyEvent(i),[2,o];case 3:throw a=l.sent(),u=Date.now(),i.duration=u-e,c=a,i.error={name:c.name||"UnknownError",message:c.message||"An unknown error occurred"},this.notifyEvent(i),a;case 4:return[2]}}))}))},this.fetchObserver=function(){t.fetch=r})}},e}(),FR=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=E();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,i,s,a;return l(this,(function(l){switch(l.label){case 0:return l.trys.push([0,3,,4]),e=void 0,(i=this.config)?(e={config:hw(i),version:mw},n?[4,cw()]:[3,2]):[3,2];case 1:s=l.sent(),e=o(o({},s),e),l.label=2;case 2:return this.recordCancelCallback?sg.addCustomEvent(t,o(o({},r),e)):this.loggerProvider.debug("Not able to add custom replay capture event ".concat(t," due to no ongoing recording.")),[3,4];case 3:return a=l.sent(),this.loggerProvider.debug("Error while adding custom replay capture event: ",a),[3,4];case 4:return[2]}}))}))},this.stopRecordingEvents=function(){var t;try{e.loggerProvider.log("Session Replay capture stopping."),e.recordCancelCallback&&e.recordCancelCallback(),e.recordCancelCallback=null,null===(t=e.networkObservers)||void 0===t||t.stop()}catch(t){var r=t;e.loggerProvider.warn("Error occurred while stopping replay capture: ".concat(r.toString()))}},this.loggerProvider=new Bi(new D)}return e.prototype.init=function(e,t){return M(this._init(e,t))},e.prototype._init=function(e,t){var r,n,i,o,s,u;return a(this,void 0,void 0,(function(){var a,d,p,f,g,m,v,y,w,b,S;return l(this,(function(l){switch(l.label){case 0:return this.loggerProvider=new Bi(t.loggerProvider||new D),Object.prototype.hasOwnProperty.call(t,"logLevel")&&this.loggerProvider.enable(t.logLevel),this.identifiers=new xb({sessionId:t.sessionId,deviceId:t.deviceId}),a=this,[4,pw(e,t)];case 1:return a.joinedConfigGenerator=l.sent(),d=this,[4,this.joinedConfigGenerator.generateJoinedConfig(this.identifiers.sessionId)];case 2:d.config=l.sent(),t.sessionId&&(null===(r=this.config.interactionConfig)||void 0===r?void 0:r.enabled)&&(p=Ib.default({sessionId:t.sessionId,type:"interaction"},this.config),this.pageLeaveFns=[p.send(this.getDeviceId.bind(this)).bind(p)],this.scrollHook=p.hook.bind(p)),f=[],"idb"!==(g=this.config.storeType)||(null===(n=E())||void 0===n?void 0:n.indexedDB)||(g="memory",this.loggerProvider.warn("Could not use preferred indexedDB storage, reverting to in memory option.")),this.loggerProvider.log("Using ".concat(g," for event storage.")),l.label=3;case 3:return l.trys.push([3,5,,6]),[4,tb({config:this.config,sessionId:this.identifiers.sessionId,type:"replay",storeType:g})];case 4:return m=l.sent(),f.push({name:"replay",manager:m}),[3,6];case 5:return v=l.sent(),S=v,this.loggerProvider.warn("Error occurred while creating replay events manager: ".concat(S.toString())),[3,6];case 6:if(!(null===(i=this.config.interactionConfig)||void 0===i?void 0:i.enabled))return[3,10];y=this.config.interactionConfig.batch?yb:vb,l.label=7;case 7:return l.trys.push([7,9,,10]),[4,tb({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:g})];case 8:return w=l.sent(),f.push({name:"interaction",manager:w}),[3,10];case 9:return b=l.sent(),S=b,this.loggerProvider.warn("Error occurred while creating interaction events manager: ".concat(S.toString())),[3,10];case 10:return this.eventsManager=new(rb.bind.apply(rb,h([void 0],c(f),!1))),this.eventCompressor&&this.eventCompressor.terminate(),this.eventCompressor=new oS(this.eventsManager,this.config,this.getDeviceId()),(null===(u=null===(s=this.config.loggingConfig)||void 0===s?void 0:s.network)||void 0===u?void 0:u.enabled)&&(this.networkObservers=new DR),this.loggerProvider.log("Installing @amplitude/session-replay-browser."),this.teardownEventListeners(!1),this.initialize(!0),[2]}}))}))},e.prototype.setSessionId=function(e,t){return M(this.asyncSetSessionId(e,t))},e.prototype.asyncSetSessionId=function(e,t){return a(this,void 0,void 0,(function(){var r,n,i;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 xb({sessionId:e,deviceId:n}),this.joinedConfigGenerator&&r?(i=this,[4,this.joinedConfigGenerator.generateJoinedConfig(this.identifiers.sessionId)]):[3,2];case 1:i.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(),i={};return n&&((e={})[Li]=r.sessionReplayId?r.sessionReplayId:null,i=e,t.debugMode&&(i[Fi]=JSON.stringify({appHash:lw(t.apiKey).toString()}))),this.addCustomRRWebEvent(Ti.GET_SR_PROPS,{shouldRecord:n,eventProperties:i},10===this.eventCount),10===this.eventCount&&(this.eventCount=0),this.eventCount++,i},e.prototype.sendEvents=function(e){var t,r=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;(null===(e=this.config)||void 0===e?void 0:e.instanceName)&&(r=te(this.config.instanceName).identityStore.getIdentity().optOut);return void 0!==r?r:null===(t=this.config)||void 0===t?void 0:t.optOut},e.prototype.getShouldRecord=function(){if(!this.identifiers||!this.config||!this.identifiers.sessionId)return this.loggerProvider.warn("Session is not being recorded due to lack of config, please call sessionReplay.init."),!1;if(!this.config.captureEnabled)return this.loggerProvider.log("Session ".concat(this.identifiers.sessionId," not being captured due to capture being disabled for project or because the remote config could not be fetched.")),!1;if(this.shouldOptOut())return this.loggerProvider.log("Opting session ".concat(this.identifiers.sessionId," out of recording due to optOut config.")),!1;var e,t,r,n=(e=this.identifiers.sessionId,t=this.config.sampleRate,r=lw(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 i=null===(n=null===(r=this.config)||void 0===r?void 0:r.privacyConfig)||void 0===n?void 0:n.maskSelector;return i||void 0},e.prototype.getRecordingPlugins=function(e){var t,r=[];return(null===(t=null==e?void 0:e.console)||void 0===t?void 0:t.enabled)&&r.push({name:"rrweb/console@1",observer:LR,options:{level:e.console.levels}}),r.length>0?r:void 0},e.prototype.recordEvents=function(){var e,t,r=this,n=this.config,i=this.getShouldRecord(),o=null===(e=this.identifiers)||void 0===e?void 0:e.sessionId;if(i&&o&&n){this.stopRecordingEvents(),null===(t=this.networkObservers)||void 0===t||t.start((function(e){r.addCustomRRWebEvent(Ti.FETCH_REQUEST,e)}));var s=n.privacyConfig,a=n.interactionConfig,l=n.loggingConfig,u=(null==a?void 0:a.enabled)?{mouseInteraction:this.eventsManager&&wb(this.loggerProvider,{eventsManager:this.eventsManager,sessionId:o,deviceIdFn:this.getDeviceId.bind(this)}),scroll:this.scrollHook}:{};this.loggerProvider.log("Session Replay capture beginning for ".concat(o,".")),this.recordCancelCallback=sg({emit:function(e){if(r.shouldOptOut())return r.loggerProvider.log("Opting session ".concat(o," out of recording due to optOut config.")),r.stopRecordingEvents(),void r.sendEvents();r.eventCompressor&&r.eventCompressor.enqueueEvent(e,o)},inlineStylesheet:n.shouldInlineStylesheet,hooks:u,maskAllInputs:!0,maskTextClass:Ui,blockClass:"amp-block",blockSelector:this.getBlockSelectors(),maskInputFn:aw("input",s),maskTextFn:aw("text",s),maskTextSelector:this.getMaskTextSelectors(),recordCanvas:!1,errorHandler:function(e){var t=e;if(t.message.includes("insertRule")&&t.message.includes("CSSStyleSheet"))throw t;if(t._external_)throw t;return r.loggerProvider.warn("Error while capturing replay: ",t.toString()),!0},plugins:this.getRecordingPlugins(l)}),this.addCustomRRWebEvent(Ti.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}(),UR=function(e){return function(){var t=e.config||zi();return{logger:t.loggerProvider,logLevel:t.logLevel}}},jR=function(){var e=new FR;return{init:de(e.init.bind(e),"init",UR(e)),setSessionId:de(e.setSessionId.bind(e),"setSessionId",UR(e)),getSessionId:de(e.getSessionId.bind(e),"getSessionId",UR(e)),getSessionReplayProperties:de(e.getSessionReplayProperties.bind(e),"getSessionReplayProperties",UR(e)),flush:de(e.flush.bind(e),"flush",UR(e)),shutdown:de(e.shutdown.bind(e),"shutdown",UR(e))}}(),BR=jR.init,zR=jR.setSessionId,VR=jR.getSessionId,WR=jR.getSessionReplayProperties,qR=jR.flush,GR=jR.shutdown,KR="1.15.0",YR=function(){function e(t){this.name=e.pluginName,this.type="enrichment",this.sr={flush:qR,getSessionId:VR,getSessionReplayProperties:WR,init:BR,setSessionId:zR,shutdown:GR},this.options=o({forceSessionTracking:!1},t),this.srInitOptions=this.options}return e.prototype.setup=function(e,t){var r,n,i,s,u;return a(this,void 0,void 0,(function(){var t;return l(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),null==e||e.loggerProvider.log("Installing @amplitude/plugin-session-replay, version ".concat(KR,".")),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=o(o({},e.defaultTracking),{sessions:!0})),this.srInitOptions={instanceName:this.config.instanceName,deviceId:null!==(r=this.options.deviceId)&&void 0!==r?r:this.config.deviceId,optOut:this.config.optOut,sessionId:this.options.customSessionId?void 0:this.config.sessionId,loggerProvider:this.config.loggerProvider,logLevel:this.config.logLevel,flushMaxRetries:this.config.flushMaxRetries,serverZone:this.config.serverZone,configServerUrl:this.options.configServerUrl,trackServerUrl:this.options.trackServerUrl,sampleRate:this.options.sampleRate,privacyConfig:{blockSelector:null===(n=this.options.privacyConfig)||void 0===n?void 0:n.blockSelector,maskSelector:null===(i=this.options.privacyConfig)||void 0===i?void 0:i.maskSelector,unmaskSelector:null===(s=this.options.privacyConfig)||void 0===s?void 0:s.unmaskSelector,defaultMaskLevel:null===(u=this.options.privacyConfig)||void 0===u?void 0:u.defaultMaskLevel},debugMode:this.options.debugMode,shouldInlineStylesheet:this.options.shouldInlineStylesheet,version:{type:"plugin",version:KR},performanceConfig:this.options.performanceConfig,storeType:this.options.storeType,experimental:this.options.experimental},[4,this.sr.init(e.apiKey,this.srInitOptions).promise];case 1:return a.sent(),[3,3];case 2:return t=a.sent(),null==e||e.loggerProvider.error("Session Replay: Failed to initialize due to ".concat(t.message)),[3,3];case 3:return[2]}}))}))},e.prototype.onSessionIdChanged=function(e){return a(this,void 0,void 0,(function(){return l(this,(function(t){switch(t.label){case 0:return this.config.loggerProvider.debug("Analytics session id is changed to ".concat(e,", SR session id is ").concat(String(this.sr.getSessionId()),".")),[4,this.sr.setSessionId(e).promise];case 1:return t.sent(),[2]}}))}))},e.prototype.onOptOutChanged=function(e){return a(this,void 0,void 0,(function(){return l(this,(function(t){switch(t.label){case 0:return this.config.loggerProvider.debug("optOut is changed to ".concat(String(e),", calling ").concat(e?"sessionReplay.shutdown()":"sessionReplay.init()",".")),e?(this.sr.shutdown(),[3,3]):[3,1];case 1:return[4,this.sr.init(this.config.apiKey,this.srInitOptions).promise];case 2:t.sent(),t.label=3;case 3:return[2]}}))}))},e.prototype.execute=function(e){var t;return a(this,void 0,void 0,(function(){var r,n,i;return l(this,(function(s){switch(s.label){case 0:return s.trys.push([0,8,,9]),this.options.customSessionId?(r=this.options.customSessionId(e))?r===this.sr.getSessionId()?[3,2]:[4,this.sr.setSessionId(r).promise]:[3,3]:[3,4];case 1:s.sent(),s.label=2;case 2:n=this.sr.getSessionReplayProperties(),e.event_properties=o(o({},e.event_properties),n),s.label=3;case 3:return[3,7];case 4:return(r=this.config.sessionId)&&r!==this.sr.getSessionId()?[4,this.sr.setSessionId(r).promise]:[3,6];case 5:s.sent(),s.label=6;case 6:r&&r===e.session_id&&(n=this.sr.getSessionReplayProperties(),e.event_properties=o(o({},e.event_properties),n)),s.label=7;case 7:return[2,Promise.resolve(e)];case 8:return i=s.sent(),null===(t=this.config)||void 0===t||t.loggerProvider.error("Session Replay: Failed to enrich event due to ".concat(i.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{this.sr.shutdown(),this.config=null}catch(t){null===(e=this.config)||void 0===e||e.loggerProvider.error("Session Replay: teardown failed due to ".concat(t.message))}return[2]}))}))},e.prototype.getSessionReplayProperties=function(){return this.sr.getSessionReplayProperties()},e.pluginName="@amplitude/plugin-session-replay-browser",e}(),ZR=function(e,t){return ZR=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])},ZR(e,t)};function JR(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}ZR(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var $R=function(){return $R=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},$R.apply(this,arguments)};function XR(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((n=n.apply(e,t||[])).next())}))}function HR(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(l){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}function QR(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 eP(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}function tP(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var rP="is",nP="is not",iP="contains",oP="does not contain",sP="less",aP="less or equal",lP="greater",uP="greater or equal",cP="version less",hP="version less or equal",dP="version greater",pP="version greater or equal",fP="set is",gP="set is not",mP="set contains",vP="set does not contain",yP="set contains any",wP="set does not contain any",bP="regex match",SP="regex does not match",CP=-862048943,IP=461845907,xP=function(e,t){void 0===t&&(t=0);for(var r=function(e){for(var t=[],r=0,n=0;n<e.length;n++){var i=e.charCodeAt(n);i<128?t[r++]=i:i<2048?(t[r++]=i>>6|192,t[r++]=63&i|128):55296==(64512&i)&&n+1<e.length&&56320==(64512&e.charCodeAt(n+1))?(i=65536+((1023&i)<<10)+(1023&e.charCodeAt(++n)),t[r++]=i>>18|240,t[r++]=i>>12&63|128,t[r++]=i>>6&63|128,t[r++]=63&i|128):(t[r++]=i>>12|224,t[r++]=i>>6&63|128,t[r++]=63&i|128)}return Uint8Array.from(t)}(e),n=r.length,i=n>>2,o=t,s=0;s<i;s++){var a=AP(r,s<<2);o=kP(a,o)}var l=i<<2,u=0;switch(n-l){case 3:u^=r[l+2]<<16,u^=r[l+1]<<8,u^=r[l],u=Math.imul(u,CP),u=OP(u,15),o^=u=Math.imul(u,IP);break;case 2:u^=r[l+1]<<8,u^=r[l],u=Math.imul(u,CP),u=OP(u,15),o^=u=Math.imul(u,IP);break;case 1:u^=r[l],u=Math.imul(u,CP),u=OP(u,15),o^=u=Math.imul(u,IP)}return EP(o^=n)>>>0},kP=function(e,t){var r=e,n=t;return r=Math.imul(r,CP),r=OP(r,15),r=Math.imul(r,IP),n=OP(n^=r,13),(n=Math.imul(n,5))+-430675100|0},EP=function(e){var t=e;return t^=t>>>16,t=Math.imul(t,-2048144789),t^=t>>>13,t=Math.imul(t,-1028477387),t^=t>>>16},OP=function(e,t,r){return void 0===r&&(r=32),t>r&&(t%=r),(e<<t|(e&4294967295<<r-t>>>0)>>>0>>>r-t>>>0)>>>0},AP=function(e,t){void 0===t&&(t=0);var r=e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3];return RP(r)},RP=function(e){return(-16777216&e)>>>24|(16711680&e)>>>8|(65280&e)<<8|(255&e)<<24},PP=function(e,t){var r,n;if(t&&0!==t.length){try{for(var i=QR(t),o=i.next();!o.done;o=i.next()){var s=o.value;if(!s||!e||"object"!=typeof e)return;e=e[s]}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return e||void 0}},MP="^".concat("(\\d+)\\.(\\d+)","(\\.").concat("(\\d+)").concat("(-(([-\\w]+\\.?)*))?",")?$"),_P=function(){function e(e,t,r,n){void 0===n&&(n=void 0),this.major=e,this.minor=t,this.patch=r,this.preRelease=n}return e.parse=function(t){if(t){var r=new RegExp(MP).exec(t);if(r){var n=Number(r[1]),i=Number(r[2]);if(!isNaN(n)&&!isNaN(i))return new e(n,i,Number(r[4])||0,r[5]||void 0)}}},e.prototype.compareTo=function(e){return this.major>e.major?1:this.major<e.major?-1:this.minor>e.minor?1:this.minor<e.minor?-1:this.patch>e.patch?1:this.patch<e.patch||this.preRelease&&!e.preRelease?-1:!this.preRelease&&e.preRelease?1:this.preRelease&&e.preRelease?this.preRelease>e.preRelease?1:this.preRelease<e.preRelease?-1:0:0},e}(),TP=function(){function e(){}return e.prototype.evaluate=function(e,t){var r,n,i={},o={context:e,result:i};try{for(var s=QR(t),a=s.next();!a.done;a=s.next()){var l=a.value,u=this.evaluateFlag(o,l);u&&(i[l.key]=u)}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return i},e.prototype.evaluateFlag=function(e,t){var r,n,i;try{for(var o=QR(t.segments),s=o.next();!s.done;s=o.next()){var a=s.value;if(i=this.evaluateSegment(e,t,a)){var l=$R($R($R({},t.metadata),a.metadata),i.metadata);i=$R($R({},i),{metadata:l});break}}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return i},e.prototype.evaluateSegment=function(e,t,r){var n;return r.conditions?this.evaluateConditions(e,r.conditions)&&void 0!==(n=this.bucket(e,r))?t.variants[n]:void 0:void 0!==(n=this.bucket(e,r))?t.variants[n]:void 0},e.prototype.evaluateConditions=function(e,t){var r,n,i,o;try{for(var s=QR(t),a=s.next();!a.done;a=s.next()){var l=a.value,u=!0;try{for(var c=(i=void 0,QR(l)),h=c.next();!h.done;h=c.next()){var d=h.value;if(!(u=this.matchCondition(e,d)))break}}catch(e){i={error:e}}finally{try{h&&!h.done&&(o=c.return)&&o.call(c)}finally{if(i)throw i.error}}if(u)return!0}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return!1},e.prototype.matchCondition=function(e,t){var r=PP(e,t.selector);if(r){if(this.isSetOperator(t.op)){var n=this.coerceStringArray(r);return!!n&&this.matchSet(n,t.op,t.values)}var i=this.coerceString(r);return void 0!==i&&this.matchString(i,t.op,t.values)}return this.matchNull(t.op,t.values)},e.prototype.getHash=function(e){return xP(e)},e.prototype.bucket=function(e,t){var r,n,i,o;if(!t.bucket)return t.variant;var s=this.coerceString(PP(e,t.bucket.selector));if(!s||0===s.length)return t.variant;var a="".concat(t.bucket.salt,"/").concat(s),l=this.getHash(a),u=l%100,c=Math.floor(l/100);try{for(var h=QR(t.bucket.allocations),d=h.next();!d.done;d=h.next()){var p=d.value,f=p.range[0],g=p.range[1];if(u>=f&&u<g)try{for(var m=(i=void 0,QR(p.distributions)),v=m.next();!v.done;v=m.next()){var y=v.value,w=y.range[0],b=y.range[1];if(c>=w&&c<b)return y.variant}}catch(e){i={error:e}}finally{try{v&&!v.done&&(o=m.return)&&o.call(m)}finally{if(i)throw i.error}}}}catch(e){r={error:e}}finally{try{d&&!d.done&&(n=h.return)&&n.call(h)}finally{if(r)throw r.error}}return t.variant},e.prototype.matchNull=function(e,t){var r=this.containsNone(t);switch(e){case rP:case iP:case sP:case aP:case lP:case uP:case cP:case hP:case dP:case pP:case fP:case mP:case yP:return r;case nP:case oP:case vP:case wP:return!r;default:return!1}},e.prototype.matchSet=function(e,t,r){switch(t){case fP:return this.setEquals(e,r);case gP:return!this.setEquals(e,r);case mP:return this.matchesSetContainsAll(e,r);case vP:return!this.matchesSetContainsAll(e,r);case yP:return this.matchesSetContainsAny(e,r);case wP:return!this.matchesSetContainsAny(e,r);default:return!1}},e.prototype.matchString=function(e,t,r){var n=this;switch(t){case rP:return this.matchesIs(e,r);case nP:return!this.matchesIs(e,r);case iP:return this.matchesContains(e,r);case oP:return!this.matchesContains(e,r);case sP:case aP:case lP:case uP:return this.matchesComparable(e,t,r,(function(e){return n.parseNumber(e)}),this.comparator);case cP:case hP:case dP:case pP:return this.matchesComparable(e,t,r,(function(e){return _P.parse(e)}),this.versionComparator);case bP:return this.matchesRegex(e,r);case SP:return!this.matchesRegex(e,r);default:return!1}},e.prototype.matchesIs=function(e,t){if(this.containsBooleans(t)){var r=e.toLowerCase();if("true"===r||"false"===r)return t.some((function(e){return e.toLowerCase()===r}))}return t.some((function(t){return e===t}))},e.prototype.matchesContains=function(e,t){var r,n;try{for(var i=QR(t),o=i.next();!o.done;o=i.next()){var s=o.value;if(e.toLowerCase().includes(s.toLowerCase()))return!0}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return!1},e.prototype.matchesComparable=function(e,t,r,n,i){var o=this,s=n(e),a=r.map((function(e){return n(e)})).filter((function(e){return void 0!==e}));return void 0===s||0===a.length?r.some((function(r){return o.comparator(e,t,r)})):a.some((function(e){return i(s,t,e)}))},e.prototype.comparator=function(e,t,r){switch(t){case sP:case cP:return e<r;case aP:case hP:return e<=r;case lP:case dP:return e>r;case uP:case pP:return e>=r;default:return!1}},e.prototype.versionComparator=function(e,t,r){var n=e.compareTo(r);switch(t){case sP:case cP:return n<0;case aP:case hP:return n<=0;case lP:case dP:return n>0;case uP:case pP:return n>=0;default:return!1}},e.prototype.matchesRegex=function(e,t){return t.some((function(t){return Boolean(new RegExp(t).exec(e))}))},e.prototype.containsNone=function(e){return e.some((function(e){return"(none)"===e}))},e.prototype.containsBooleans=function(e){return e.some((function(e){switch(e.toLowerCase()){case"true":case"false":return!0;default:return!1}}))},e.prototype.parseNumber=function(e){var t;return null!==(t=Number(e))&&void 0!==t?t:void 0},e.prototype.coerceString=function(e){if(null!=e)return"object"==typeof e?JSON.stringify(e):String(e)},e.prototype.coerceStringArray=function(e){var t=this;if(Array.isArray(e))return e.map((function(e){return t.coerceString(e)})).filter(Boolean);var r=String(e);try{var n=JSON.parse(r);return Array.isArray(n)?e.map((function(e){return t.coerceString(e)})).filter(Boolean):(i=this.coerceString(r))?[i]:void 0}catch(e){var i;return(i=this.coerceString(r))?[i]:void 0}},e.prototype.isSetOperator=function(e){switch(e){case fP:case gP:case mP:case vP:case yP:case wP:return!0;default:return!1}},e.prototype.setEquals=function(e,t){var r=new Set(e),n=new Set(t);return r.size===n.size&&tP([],eP(n),!1).every((function(e){return r.has(e)}))},e.prototype.matchesSetContainsAll=function(e,t){var r,n;if(e.length<t.length)return!1;try{for(var i=QR(t),o=i.next();!o.done;o=i.next()){var s=o.value;if(!this.matchesIs(s,e))return!1}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return!0},e.prototype.matchesSetContainsAny=function(e,t){var r,n;try{for(var i=QR(t),o=i.next();!o.done;o=i.next()){var s=o.value;if(this.matchesIs(s,e))return!0}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return!1},e}(),NP=function(e,t,r){var n,i;void 0===r&&(r=[]);var o=t[e];if(o){if(!o.dependencies||0===o.dependencies.length)return delete t[o.key],[o];r.push(o.key);var s=[],a=function(e){if(r.some((function(t){return t===e})))throw Error("Detected a cycle between flags ".concat(r));var n=NP(e,t,r);n&&s.push.apply(s,tP([],eP(n),!1))};try{for(var l=QR(o.dependencies),u=l.next();!u.done;u=l.next()){a(u.value)}}catch(e){n={error:e}}finally{try{u&&!u.done&&(i=l.return)&&i.call(l)}finally{if(n)throw n.error}}return s.push(o),r.pop(),delete t[o.key],s}};const LP="function"==typeof btoa,DP="function"==typeof Buffer,FP=("function"==typeof TextDecoder&&new TextDecoder,"function"==typeof TextEncoder?new TextEncoder:void 0),UP=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),jP=((e=>{let t={};e.forEach(((e,r)=>t[e]=r))})(UP),String.fromCharCode.bind(String)),BP=("function"==typeof Uint8Array.from&&Uint8Array.from.bind(Uint8Array),e=>e.replace(/=/g,"").replace(/[+\/]/g,(e=>"+"==e?"-":"_"))),zP=e=>{let t,r,n,i,o="";const s=e.length%3;for(let s=0;s<e.length;){if((r=e.charCodeAt(s++))>255||(n=e.charCodeAt(s++))>255||(i=e.charCodeAt(s++))>255)throw new TypeError("invalid character found");t=r<<16|n<<8|i,o+=UP[t>>18&63]+UP[t>>12&63]+UP[t>>6&63]+UP[63&t]}return s?o.slice(0,s-3)+"===".substring(s):o},VP=LP?e=>btoa(e):DP?e=>Buffer.from(e,"binary").toString("base64"):zP,WP=DP?e=>Buffer.from(e).toString("base64"):e=>{let t=[];for(let r=0,n=e.length;r<n;r+=4096)t.push(jP.apply(null,e.subarray(r,r+4096)));return VP(t.join(""))},qP=e=>{if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?jP(192|t>>>6)+jP(128|63&t):jP(224|t>>>12&15)+jP(128|t>>>6&63)+jP(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return jP(240|t>>>18&7)+jP(128|t>>>12&63)+jP(128|t>>>6&63)+jP(128|63&t)},GP=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,KP=e=>e.replace(GP,qP),YP=DP?e=>Buffer.from(e,"utf8").toString("base64"):FP?e=>WP(FP.encode(e)):e=>VP(KP(e)),ZP=(e,t=!1)=>t?BP(YP(e)):YP(e),JP=e=>ZP(e,!0),$P=JP;var XP=function(e){function t(r,n){var i=e.call(this,n)||this;return i.statusCode=r,Object.setPrototypeOf(i,t.prototype),i}return JR(t,e),t}(Error),HP=function(e){function t(r){var n=e.call(this,r)||this;return Object.setPrototypeOf(n,t.prototype),n}return JR(t,e),t}(Error),QP=function(){function e(e,t,r){this.deploymentKey=e,this.serverUrl=t,this.httpClient=r}return e.prototype.getVariants=function(e,t){return XR(this,void 0,void 0,(function(){var r,n,i,o;return HR(this,(function(s){switch(s.label){case 0:return r=$P(JSON.stringify(e)),n={Authorization:"Api-Key ".concat(this.deploymentKey),"X-Amp-Exp-User":r},(null==t?void 0:t.flagKeys)&&(n["X-Amp-Exp-Flag-Keys"]=$P(JSON.stringify(t.flagKeys))),(null==t?void 0:t.trackingOption)&&(n["X-Amp-Exp-Track"]=t.trackingOption),i=new URL("".concat(this.serverUrl,"/sdk/v2/vardata?v=0")),(null==t?void 0:t.evaluationMode)&&i.searchParams.append("eval_mode",null==t?void 0:t.evaluationMode),(null==t?void 0:t.deliveryMethod)&&i.searchParams.append("delivery_method",null==t?void 0:t.deliveryMethod),[4,this.httpClient.request({requestUrl:i.toString(),method:"GET",headers:n,timeoutMillis:null==t?void 0:t.timeoutMillis})];case 1:if(200!=(o=s.sent()).status)throw new XP(o.status,"Fetch error response: status=".concat(o.status));return[2,JSON.parse(o.body)]}}))}))},e}(),eM=function(){function e(e,t,r){this.deploymentKey=e,this.serverUrl=t,this.httpClient=r}return e.prototype.getFlags=function(e){return XR(this,void 0,void 0,(function(){var t,r;return HR(this,(function(n){switch(n.label){case 0:return t={Authorization:"Api-Key ".concat(this.deploymentKey)},(null==e?void 0:e.libraryName)&&(null==e?void 0:e.libraryVersion)&&(t["X-Amp-Exp-Library"]="".concat(e.libraryName,"/").concat(e.libraryVersion)),(null==e?void 0:e.user)&&(t["X-Amp-Exp-User"]=$P(JSON.stringify(e.user))),[4,this.httpClient.request({requestUrl:"".concat(this.serverUrl,"/sdk/v2/flags")+((null==e?void 0:e.deliveryMethod)?"?delivery_method=".concat(e.deliveryMethod):""),method:"GET",headers:t,timeoutMillis:null==e?void 0:e.timeoutMillis})];case 1:if(200!=(r=n.sent()).status)throw Error("Flags error response: status=".concat(r.status));return[2,JSON.parse(r.body).reduce((function(e,t){return e[t.key]=t,e}),{})]}}))}))},e}(),tM="undefined"!=typeof globalThis?globalThis:global||self,rM=function(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:void 0},nM=function(){function e(e,t){this.poller=void 0,this.action=e,this.ms=t}return e.prototype.start=function(){this.poller||(this.poller=tM.setInterval(this.action,this.ms),this.action())},e.prototype.stop=function(){this.poller&&(tM.clearInterval(this.poller),this.poller=void 0)},e}(),iM="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},oM={exports:{}};!function(e,t){!function(r,n){var i="function",o="undefined",s="object",a="string",l="model",u="name",c="type",h="vendor",d="version",p="architecture",f="console",g="mobile",m="tablet",v="smarttv",y="wearable",w="embedded",b="Amazon",S="Apple",C="ASUS",I="BlackBerry",x="Browser",k="Chrome",E="Firefox",O="Google",A="Huawei",R="LG",P="Microsoft",M="Motorola",_="Opera",T="Samsung",N="Sony",L="Xiaomi",D="Zebra",F="Facebook",U=function(e){for(var t={},r=0;r<e.length;r++)t[e[r].toUpperCase()]=e[r];return t},j=function(e,t){return typeof e===a&&-1!==B(t).indexOf(B(e))},B=function(e){return e.toLowerCase()},z=function(e,t){if(typeof e===a)return e=e.replace(/^\s\s*/,"").replace(/\s\s*$/,""),typeof t===o?e:e.substring(0,275)},V=function(e,t){for(var r,o,a,l,u,c,h=0;h<t.length&&!u;){var d=t[h],p=t[h+1];for(r=o=0;r<d.length&&!u;)if(u=d[r++].exec(e))for(a=0;a<p.length;a++)c=u[++o],typeof(l=p[a])===s&&l.length>0?2===l.length?typeof l[1]==i?this[l[0]]=l[1].call(this,c):this[l[0]]=l[1]:3===l.length?typeof l[1]!==i||l[1].exec&&l[1].test?this[l[0]]=c?c.replace(l[1],l[2]):n:this[l[0]]=c?l[1].call(this,c,l[2]):n:4===l.length&&(this[l[0]]=c?l[3].call(this,c.replace(l[1],l[2])):n):this[l]=c||n;h+=2}},W=function(e,t){for(var r in t)if(typeof t[r]===s&&t[r].length>0){for(var i=0;i<t[r].length;i++)if(j(t[r][i],e))return"?"===r?n:r}else if(j(t[r],e))return"?"===r?n:r;return e},q={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},G={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[d,[u,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[d,[u,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[u,d],[/opios[\/ ]+([\w\.]+)/i],[d,[u,_+" Mini"]],[/\bopr\/([\w\.]+)/i],[d,[u,_]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[u,d],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[d,[u,"UC"+x]],[/\bqbcore\/([\w\.]+)/i],[d,[u,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[d,[u,"WeChat"]],[/konqueror\/([\w\.]+)/i],[d,[u,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[d,[u,"IE"]],[/yabrowser\/([\w\.]+)/i],[d,[u,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[u,/(.+)/,"$1 Secure "+x],d],[/\bfocus\/([\w\.]+)/i],[d,[u,E+" Focus"]],[/\bopt\/([\w\.]+)/i],[d,[u,_+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[d,[u,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[d,[u,"Dolphin"]],[/coast\/([\w\.]+)/i],[d,[u,_+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[d,[u,"MIUI "+x]],[/fxios\/([-\w\.]+)/i],[d,[u,E]],[/\bqihu|(qi?ho?o?|360)browser/i],[[u,"360 "+x]],[/(oculus|samsung|sailfish)browser\/([\w\.]+)/i],[[u,/(.+)/,"$1 "+x],d],[/(comodo_dragon)\/([\w\.]+)/i],[[u,/_/g," "],d],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[u,d],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i],[u],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[u,F],d],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[u,d],[/\bgsa\/([\w\.]+) .*safari\//i],[d,[u,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[d,[u,k+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[u,k+" WebView"],d],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[d,[u,"Android "+x]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[u,d],[/version\/([\w\.]+) .*mobile\/\w+ (safari)/i],[d,[u,"Mobile Safari"]],[/version\/([\w\.]+) .*(mobile ?safari|safari)/i],[d,u],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[u,[d,W,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[u,d],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[u,"Netscape"],d],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[d,[u,E+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[u,d]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[p,"amd64"]],[/(ia32(?=;))/i],[[p,B]],[/((?:i[346]|x)86)[;\)]/i],[[p,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[p,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[p,"armhf"]],[/windows (ce|mobile); ppc;/i],[[p,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[p,/ower/,"",B]],[/(sun4\w)[;\)]/i],[[p,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[p,B]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[pt]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[l,[h,T],[c,m]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[l,[h,T],[c,g]],[/((ipod|iphone)\d+,\d+)/i],[l,[h,S],[c,g]],[/(ipad\d+,\d+)/i],[l,[h,S],[c,m]],[/\((ip(?:hone|od)[\w ]*);/i],[l,[h,S],[c,g]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[l,[h,S],[c,m]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[l,[h,A],[c,m]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[l,[h,A],[c,g]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[l,/_/g," "],[h,L],[c,g]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[l,/_/g," "],[h,L],[c,m]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[l,[h,"OPPO"],[c,g]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[l,[h,"Vivo"],[c,g]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[l,[h,"Realme"],[c,g]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[l,[h,M],[c,g]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[l,[h,M],[c,m]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[l,[h,R],[c,m]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[l,[h,R],[c,g]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[l,[h,"Lenovo"],[c,m]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[l,/_/g," "],[h,"Nokia"],[c,g]],[/(pixel c)\b/i],[l,[h,O],[c,m]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[l,[h,O],[c,g]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[l,[h,N],[c,g]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[l,"Xperia Tablet"],[h,N],[c,m]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[l,[h,"OnePlus"],[c,g]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[l,[h,b],[c,m]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[l,/(.+)/g,"Fire Phone $1"],[h,b],[c,g]],[/(playbook);[-\w\),; ]+(rim)/i],[l,h,[c,m]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[l,[h,I],[c,g]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[l,[h,C],[c,m]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[l,[h,C],[c,g]],[/(nexus 9)/i],[l,[h,"HTC"],[c,m]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony(?!-bra))[-_ ]?([-\w]*)/i],[h,[l,/_/g," "],[c,g]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[l,[h,"Acer"],[c,m]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[l,[h,"Meizu"],[c,g]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[l,[h,"Sharp"],[c,g]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[h,l,[c,g]],[/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[h,l,[c,m]],[/(surface duo)/i],[l,[h,P],[c,m]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[l,[h,"Fairphone"],[c,g]],[/(u304aa)/i],[l,[h,"AT&T"],[c,g]],[/\bsie-(\w*)/i],[l,[h,"Siemens"],[c,g]],[/\b(rct\w+) b/i],[l,[h,"RCA"],[c,m]],[/\b(venue[\d ]{2,7}) b/i],[l,[h,"Dell"],[c,m]],[/\b(q(?:mv|ta)\w+) b/i],[l,[h,"Verizon"],[c,m]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[l,[h,"Barnes & Noble"],[c,m]],[/\b(tm\d{3}\w+) b/i],[l,[h,"NuVision"],[c,m]],[/\b(k88) b/i],[l,[h,"ZTE"],[c,m]],[/\b(nx\d{3}j) b/i],[l,[h,"ZTE"],[c,g]],[/\b(gen\d{3}) b.+49h/i],[l,[h,"Swiss"],[c,g]],[/\b(zur\d{3}) b/i],[l,[h,"Swiss"],[c,m]],[/\b((zeki)?tb.*\b) b/i],[l,[h,"Zeki"],[c,m]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[h,"Dragon Touch"],l,[c,m]],[/\b(ns-?\w{0,9}) b/i],[l,[h,"Insignia"],[c,m]],[/\b((nxa|next)-?\w{0,9}) b/i],[l,[h,"NextBook"],[c,m]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[h,"Voice"],l,[c,g]],[/\b(lvtel\-)?(v1[12]) b/i],[[h,"LvTel"],l,[c,g]],[/\b(ph-1) /i],[l,[h,"Essential"],[c,g]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[l,[h,"Envizen"],[c,m]],[/\b(trio[-\w\. ]+) b/i],[l,[h,"MachSpeed"],[c,m]],[/\btu_(1491) b/i],[l,[h,"Rotor"],[c,m]],[/(shield[\w ]+) b/i],[l,[h,"Nvidia"],[c,m]],[/(sprint) (\w+)/i],[h,l,[c,g]],[/(kin\.[onetw]{3})/i],[[l,/\./g," "],[h,P],[c,g]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[l,[h,D],[c,m]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[l,[h,D],[c,g]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[h,l,[c,f]],[/droid.+; (shield) bui/i],[l,[h,"Nvidia"],[c,f]],[/(playstation [345portablevi]+)/i],[l,[h,N],[c,f]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[l,[h,P],[c,f]],[/smart-tv.+(samsung)/i],[h,[c,v]],[/hbbtv.+maple;(\d+)/i],[[l,/^/,"SmartTV"],[h,T],[c,v]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[h,R],[c,v]],[/(apple) ?tv/i],[h,[l,S+" TV"],[c,v]],[/crkey/i],[[l,k+"cast"],[h,O],[c,v]],[/droid.+aft(\w)( bui|\))/i],[l,[h,b],[c,v]],[/\(dtv[\);].+(aquos)/i],[l,[h,"Sharp"],[c,v]],[/(bravia[\w- ]+) bui/i],[l,[h,N],[c,v]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[h,z],[l,z],[c,v]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[c,v]],[/((pebble))app/i],[h,l,[c,y]],[/droid.+; (glass) \d/i],[l,[h,O],[c,y]],[/droid.+; (wt63?0{2,3})\)/i],[l,[h,D],[c,y]],[/(quest( 2)?)/i],[l,[h,F],[c,y]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[h,[c,w]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[l,[c,g]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[l,[c,m]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[c,m]],[/(phone|mobile(?:[;\/]| safari)|pda(?=.+windows ce))/i],[[c,g]],[/(android[-\w\. ]{0,9});.+buil/i],[l,[h,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[d,[u,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[d,[u,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i],[u,d],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[d,u]],os:[[/microsoft (windows) (vista|xp)/i],[u,d],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[u,[d,W,q]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[u,"Windows"],[d,W,q]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[d,/_/g,"."],[u,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[u,"Mac OS"],[d,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[d,u],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[u,d],[/\(bb(10);/i],[d,[u,I]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[d,[u,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[d,[u,E+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[d,[u,"webOS"]],[/crkey\/([\d\.]+)/i],[d,[u,k+"cast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[u,"Chromium OS"],d],[/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[u,d],[/(sunos) ?([\w\.\d]*)/i],[[u,"Solaris"],d],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[u,d]]},K=function(e,t){if(typeof e===s&&(t=e,e=n),!(this instanceof K))return new K(e,t).getResult();var i=e||(typeof r!==o&&r.navigator&&r.navigator.userAgent?r.navigator.userAgent:""),f=t?function(e,t){var r={};for(var n in e)t[n]&&t[n].length%2==0?r[n]=t[n].concat(e[n]):r[n]=e[n];return r}(G,t):G;return this.getBrowser=function(){var e={};return e[u]=n,e[d]=n,V.call(e,i,f.browser),e.major=function(e){return typeof e===a?e.replace(/[^\d\.]/g,"").split(".")[0]:n}(e.version),e},this.getCPU=function(){var e={};return e[p]=n,V.call(e,i,f.cpu),e},this.getDevice=function(){var e={};return e[h]=n,e[l]=n,e[c]=n,V.call(e,i,f.device),e},this.getEngine=function(){var e={};return e[u]=n,e[d]=n,V.call(e,i,f.engine),e},this.getOS=function(){var e={};return e[u]=n,e[d]=n,V.call(e,i,f.os),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return i},this.setUA=function(e){return i=typeof e===a&&e.length>275?z(e,275):e,this},this.setUA(i),this};K.VERSION="0.7.31",K.BROWSER=U([u,d,"major"]),K.CPU=U([p]),K.DEVICE=U([l,h,c,f,g,v,m,y,w]),K.ENGINE=K.OS=U([u,d]),e.exports&&(t=e.exports=K),t.UAParser=K;var Y=typeof r!==o&&(r.jQuery||r.Zepto);if(Y&&!Y.ua){var Z=new K;Y.ua=Z.getResult(),Y.ua.get=function(){return Z.getUA()},Y.ua.set=function(e){Z.setUA(e);var t=Z.getResult();for(var r in t)Y.ua[r]=t[r]}}}("object"==typeof window?window:iM)}(oM,oM.exports);var sM=function(){return sM=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},sM.apply(this,arguments)};function aM(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((n=n.apply(e,t||[])).next())}))}function lM(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(l){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}function uM(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 cM(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}function hM(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var dM=function(e,t){var r,n;void 0===t&&(t=!1);var i=pM(e,t),o=void 0,s=tM.document.cookie.split("; ");try{for(var a=uM(s),l=a.next();!l.done;l=a.next()){var u=cM(l.value.split("=",2),2),c=u[0],h=u[1];c===i&&(o=decodeURIComponent(h))}}catch(e){r={error:e}}finally{try{l&&!l.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}if(o)try{if(t){var d=atob(o);return JSON.parse(decodeURIComponent(d))}var p=o.split("."),f=void 0;return p.length>=2&&p[1]&&(f=atob(p[1])),{deviceId:p[0],userId:f}}catch(e){return}},pM=function(e,t){if(t){if((null==e?void 0:e.length)<10)return;return"AMP_".concat(e.substring(0,10))}if(!((null==e?void 0:e.length)<6))return"amp_".concat(e.substring(0,6))},fM=function(){function e(e,t,r){this.type="integration",this.apiKey=e,this.identityStore=t.identityStore,this.eventBridge=t.eventBridge,this.contextProvider=t.applicationContextProvider,this.timeoutMillis=r,this.loadPersistedState(),r<=0&&(this.setup=void 0)}return e.prototype.setup=function(e,t){return aM(this,void 0,void 0,(function(){return lM(this,(function(r){return(null==e?void 0:e.automaticFetchOnAmplitudeIdentityChange)&&this.identityStore.addIdentityListener((function(){null==t||t.fetch()})),[2,this.waitForConnectorIdentity(this.timeoutMillis)]}))}))},e.prototype.getUser=function(){var e=this.identityStore.getIdentity();return{user_id:e.userId,device_id:e.deviceId,user_properties:e.userProperties,version:this.contextProvider.versionName}},e.prototype.track=function(e){return!!this.eventBridge.receiver&&(this.eventBridge.logEvent({eventType:e.eventType,eventProperties:e.eventProperties}),!0)},e.prototype.loadPersistedState=function(){if(!this.apiKey||this.apiKey.startsWith("client-"))return!1;var e=dM(this.apiKey,!0);return(e||(e=dM(this.apiKey,!1))||(e=function(e){var t=pM(e,!0);try{var r=tM.localStorage.getItem(t);if(!r)return;var n=JSON.parse(r);if("object"!=typeof n)return;return n}catch(e){return}}(this.apiKey))||!!(e=function(e){var t=pM(e,!0);try{var r=tM.sessionStorage.getItem(t);if(!r)return;var n=JSON.parse(r);if("object"!=typeof n)return;return n}catch(e){return}}(this.apiKey)))&&(this.commitIdentityToConnector(e),!0)},e.prototype.commitIdentityToConnector=function(e){var t=this.identityStore.editIdentity();t.setDeviceId(e.deviceId),e.userId&&t.setUserId(e.userId),t.commit()},e.prototype.waitForConnectorIdentity=function(e){return aM(this,void 0,void 0,(function(){var t,r=this;return lM(this,(function(n){return(t=this.identityStore.getIdentity()).userId||t.deviceId?[2]:[2,Promise.race([new Promise((function(e){var t=function(){e(),r.identityStore.removeIdentityListener(t)};r.identityStore.addIdentityListener(t)})),new Promise((function(t,r){tM.setTimeout(r,e,"Timed out waiting for Amplitude Analytics SDK to initialize.")}))])]}))}))},e}();var gM,mM,vM=tM.fetch||function(e,t){return t=t||{},new Promise((function(r,n){var i=new XMLHttpRequest,o=[],s=[],a={},l=function(){return{ok:2==(i.status/100|0),statusText:i.statusText,status:i.status,url:i.responseURL,text:function(){return Promise.resolve(i.responseText)},json:function(){return Promise.resolve(JSON.parse(i.responseText))},blob:function(){return Promise.resolve(new Blob([i.response]))},clone:l,headers:{keys:function(){return o},entries:function(){return s},get:function(e){return a[e.toLowerCase()]},has:function(e){return e.toLowerCase()in a}}}};for(var u in i.open(t.method||"get",e,!0),i.onload=function(){i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,(function(e,t,r){o.push(t=t.toLowerCase()),s.push([t,r]),a[t]=a[t]?a[t]+","+r:r})),r(l())},i.onerror=n,i.withCredentials="include"==t.credentials,t.headers)i.setRequestHeader(u,t.headers[u]);i.send(t.body||null)}))},yM=function(){function e(e){this.client=e}return e.prototype.request=function(e){return aM(this,void 0,void 0,(function(){return lM(this,(function(t){switch(t.label){case 0:return[4,this.client.request(e.requestUrl,e.method,e.headers,null,e.timeoutMillis)];case 1:return[2,t.sent()]}}))}))},e}(),wM={request:function(e,t,r,n,i){return function(e,t){return null==t||t<=0?e:new Promise((function(r,n){tM.setTimeout((function(){n(new HP("Request timeout after "+t+" milliseconds"))}),t),e.then(r,n)}))}(aM(void 0,void 0,void 0,(function(){var i,o;return lM(this,(function(s){switch(s.label){case 0:return[4,vM(e,{method:t,headers:r,body:n})];case 1:return i=s.sent(),o={status:i.status},[4,i.text()];case 2:return o.body=s.sent(),[2,o]}}))})),i)}};!function(e){e.LocalStorage="localStorage",e.InitialVariants="initialVariants"}(gM||(gM={})),function(e){e.LocalStorage="storage",e.InitialVariants="initial",e.SecondaryLocalStorage="secondary-storage",e.SecondaryInitialVariants="secondary-initial",e.FallbackInline="fallback-inline",e.FallbackConfig="fallback-config",e.LocalEvaluation="local-evaluation"}(mM||(mM={}));var bM=function(e){return!e||e===mM.FallbackInline||e===mM.FallbackConfig||e===mM.SecondaryInitialVariants},SM={debug:!1,instanceName:"$default_instance",fallbackVariant:{},initialVariants:{},initialFlags:void 0,source:gM.LocalStorage,serverUrl:"https://api.lab.amplitude.com",flagsServerUrl:"https://flag.lab.amplitude.com",serverZone:"US",fetchTimeoutMillis:1e4,retryFetchOnFailure:!0,automaticExposureTracking:!0,pollOnStart:!0,flagConfigPollingIntervalMillis:3e5,fetchOnStart:!0,automaticFetchOnAmplitudeIdentityChange:!1,userProvider:null,analyticsProvider:null,exposureTrackingProvider:null,httpClient:wM},CM="1.15.5",IM=function(){function e(e,t){var r,n=this;this.isReady=new Promise((function(e){n.resolve=e})),this.config=e,this.client=t;var i=null!==(r=e.instanceName)&&void 0!==r?r:SM.instanceName;this.queue=new kM(i),this.cache=new xM(i)}return e.prototype.ready=function(){return this.integration?this.isReady:Promise.resolve()},e.prototype.setIntegration=function(e){var t=this;this.integration&&this.integration.teardown&&this.integration.teardown(),this.integration=e,e.setup?this.integration.setup(this.config,this.client).then((function(){t.queue.setTracker(t.integration.track.bind(e)),t.resolve()}),(function(){t.queue.setTracker(t.integration.track.bind(e)),t.resolve()})):(this.queue.setTracker(this.integration.track.bind(e)),this.resolve())},e.prototype.getUser=function(){return this.integration?this.integration.getUser():{}},e.prototype.track=function(e){if(this.cache.shouldTrack(e)){var t=this.getExposureEvent(e);this.queue.push(t)}},e.prototype.getExposureEvent=function(e){var t,r,n,i={eventType:"$exposure",eventProperties:e};return(null===(t=e.metadata)||void 0===t?void 0:t.exposureEvent)?i={eventType:null===(r=e.metadata)||void 0===r?void 0:r.exposureEvent,eventProperties:e}:"web"===(null===(n=e.metadata)||void 0===n?void 0:n.deliveryMethod)&&(i={eventType:"$impression",eventProperties:e}),i},e}(),xM=function(){function e(e){this.isSessionStorageAvailable=EM(),this.inMemoryCache={},this.storageKey="EXP_sent_v2_".concat(e),this.isSessionStorageAvailable&&tM.sessionStorage.removeItem("EXP_sent_".concat(e))}return e.prototype.shouldTrack=function(e){var t;if("web"===(null===(t=e.metadata)||void 0===t?void 0:t.deliveryMethod))return!0;this.loadCache();var r=this.inMemoryCache[e.flag_key],n=!1;return r&&r.variant===e.variant||(n=!0,this.inMemoryCache[e.flag_key]=e),this.storeCache(),n},e.prototype.loadCache=function(){if(this.isSessionStorageAvailable){var e=tM.sessionStorage.getItem(this.storageKey);this.inMemoryCache=e?JSON.parse(e):{}}},e.prototype.storeCache=function(){this.isSessionStorageAvailable&&tM.sessionStorage.setItem(this.storageKey,JSON.stringify(this.inMemoryCache))},e}(),kM=function(){function e(e,t){void 0===t&&(t=512),this.isLocalStorageAvailable=function(){var e=rM();if(e)try{var t="EXP_test";return e.localStorage.setItem(t,t),e.localStorage.removeItem(t),!0}catch(e){return!1}return!1}(),this.inMemoryQueue=[],this.storageKey="EXP_unsent_".concat(e),this.maxQueueSize=t}return e.prototype.push=function(e){this.loadQueue(),this.inMemoryQueue.push(e),this.flush(),this.storeQueue()},e.prototype.setTracker=function(e){var t=this;this.tracker=e,this.poller=tM.setInterval((function(){t.loadFlushStore()}),1e3),this.loadFlushStore()},e.prototype.flush=function(){var e,t;if(this.tracker&&0!==this.inMemoryQueue.length){try{for(var r=uM(this.inMemoryQueue),n=r.next();!n.done;n=r.next()){var i=n.value;if(!this.tracker(i))return}}catch(t){e={error:t}}finally{try{n&&!n.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}this.inMemoryQueue=[],this.poller&&(tM.clearInterval(this.poller),this.poller=void 0)}},e.prototype.loadQueue=function(){if(this.isLocalStorageAvailable){var e=tM.localStorage.getItem(this.storageKey);this.inMemoryQueue=e?JSON.parse(e):[]}},e.prototype.storeQueue=function(){this.isLocalStorageAvailable&&(this.inMemoryQueue.length>this.maxQueueSize&&(this.inMemoryQueue=this.inMemoryQueue.slice(this.inMemoryQueue.length-this.maxQueueSize)),tM.localStorage.setItem(this.storageKey,JSON.stringify(this.inMemoryQueue)))},e.prototype.loadFlushStore=function(){this.loadQueue(),this.flush(),this.storeQueue()},e}(),EM=function(){var e=rM();if(e)try{var t="EXP_test";return e.sessionStorage.setItem(t,t),e.sessionStorage.removeItem(t),!0}catch(e){return!1}return!1},OM=function(){function e(){this.globalScope=rM()}return e.prototype.get=function(e){var t;return null===(t=this.globalScope)||void 0===t?void 0:t.localStorage.getItem(e)},e.prototype.put=function(e,t){var r;null===(r=this.globalScope)||void 0===r||r.localStorage.setItem(e,t)},e.prototype.delete=function(e){var t;null===(t=this.globalScope)||void 0===t||t.localStorage.removeItem(e)},e}(),AM=function(){function e(e,t,r){this.cache={},this.namespace=e,this.storage=t,this.transformer=r}return e.prototype.get=function(e){return this.cache[e]},e.prototype.getAll=function(){return sM({},this.cache)},e.prototype.put=function(e,t){this.cache[e]=t},e.prototype.putAll=function(e){var t,r;try{for(var n=uM(Object.keys(e)),i=n.next();!i.done;i=n.next()){var o=i.value;this.cache[o]=e[o]}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}},e.prototype.remove=function(e){delete this.cache[e]},e.prototype.clear=function(){this.cache={}},e.prototype.load=function(){var e,t,r,n=this.storage.get(this.namespace);try{r=JSON.parse(n)||{}}catch(e){return}var i={};try{for(var o=uM(Object.keys(r)),s=o.next();!s.done;s=o.next()){var a=s.value;try{var l=void 0;(l=this.transformer?this.transformer(r[a]):r[a])&&(i[a]=l)}catch(e){}}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}this.clear(),this.putAll(i)},e.prototype.store=function(e){void 0===e&&(e=this.cache),this.storage.put(this.namespace,JSON.stringify(e))},e}(),RM=function(e){if("string"==typeof e)return{key:e,value:e};if("object"==typeof e){var t=e.key,r=e.value,n=e.payload,i=e.metadata,o=e.expKey;i&&i.experimentKey?o=i.experimentKey:o&&((i=i||{}).experimentKey=o);var s={};return t?s.key=t:r&&(s.key=r),r&&(s.value=r),i&&(s.metadata=i),n&&(s.payload=n),o&&(s.expKey=o),s}},PM=function(){function e(){this.globalScope=rM()}return e.prototype.get=function(e){var t;return null===(t=this.globalScope)||void 0===t?void 0:t.sessionStorage.getItem(e)},e.prototype.put=function(e,t){var r;null===(r=this.globalScope)||void 0===r||r.sessionStorage.setItem(e,t)},e.prototype.delete=function(e){var t;null===(t=this.globalScope)||void 0===t||t.sessionStorage.removeItem(e)},e}(),MM=function(e){return null==e},_M=function(e){return!!MM(e)||e&&0===Object.keys(e).length},TM=function(e){var t;return"local"===(null===(t=null==e?void 0:e.metadata)||void 0===t?void 0:t.evaluationMode)},NM=function(){function e(e,t,r,n){this.started=!1,this.done=!1,this.attempts=e,this.min=t,this.max=r,this.scalar=n}return e.prototype.start=function(e){return aM(this,void 0,void 0,(function(){return lM(this,(function(t){switch(t.label){case 0:if(this.started)throw Error("Backoff already started");return this.started=!0,[4,this.backoff(e,0,this.min)];case 1:return t.sent(),[2]}}))}))},e.prototype.cancel=function(){this.done=!0,clearTimeout(this.timeoutHandle)},e.prototype.backoff=function(e,t,r){return aM(this,void 0,void 0,(function(){var n=this;return lM(this,(function(i){return this.done||(this.timeoutHandle=tM.setTimeout((function(){return aM(n,void 0,void 0,(function(){var n,i;return lM(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,e()];case 1:return o.sent(),[3,3];case 2:return o.sent(),(n=t+1)<this.attempts&&(i=Math.min(r*this.scalar,this.max),this.backoff(e,n,i)),[3,3];case 3:return[2]}}))}))}),r)),[2]}))}))},e}(),LM=function(e){return null==e?{}:"string"==typeof e?{key:e,value:e}:e},DM=function(e){if(!e)return{};var t=void 0;e.metadata&&(t=e.metadata.experimentKey);var r={};return e.key&&(r.key=e.key),e.value&&(r.value=e.value),e.payload&&(r.payload=e.payload),t&&(r.expKey=t),e.metadata&&(r.metadata=e.metadata),r},FM=function(){function e(e){this.setProperties={},this.unsetProperties={},this.analyticsProvider=e}return e.prototype.track=function(e){this.setProperties[e.key]!=e.variant.value&&(this.setProperties[e.key]=e.variant.value,delete this.unsetProperties[e.key],this.analyticsProvider.track(e))},e.prototype.setUserProperty=function(e){this.setProperties[e.key]!=e.variant.value&&this.analyticsProvider.setUserProperty(e)},e.prototype.unsetUserProperty=function(e){this.unsetProperties[e.key]||(this.unsetProperties[e.key]="unset",delete this.setProperties[e.key],this.analyticsProvider.unsetUserProperty(e))},e}(),UM=function(){function e(e){this.tracked={},this.exposureTrackingProvider=e}return e.prototype.track=function(e){var t=this.tracked[e.flag_key];t&&t.variant===e.variant||(this.tracked[e.flag_key]=e,this.exposureTrackingProvider.track(e))},e}(),jM=function(){function e(e,t){var r,n,i,o,s=this;this.engine=new TP,this.isRunning=!1,this.apiKey=e,this.config=sM(sM(sM({},SM),t),{serverUrl:(null==t?void 0:t.serverUrl)||("eu"===(null===(r=null==t?void 0:t.serverZone)||void 0===r?void 0:r.toLowerCase())?"https://api.lab.eu.amplitude.com":SM.serverUrl),flagsServerUrl:(null==t?void 0:t.flagsServerUrl)||("eu"===(null===(n=null==t?void 0:t.serverZone)||void 0===n?void 0:n.toLowerCase())?"https://flag.lab.eu.amplitude.com":SM.flagsServerUrl),flagConfigPollingIntervalMillis:t.flagConfigPollingIntervalMillis<6e4?6e4:null!==(i=t.flagConfigPollingIntervalMillis)&&void 0!==i?i:SM.flagConfigPollingIntervalMillis});var a=null===(o=this.config)||void 0===o?void 0:o.internalInstanceNameSuffix;if(this.isWebExperiment="web"===a,this.poller=new nM((function(){return s.doFlags()}),this.config.flagConfigPollingIntervalMillis),this.config.initialVariants)for(var l in this.config.initialVariants)this.config.initialVariants[l]=RM(this.config.initialVariants[l]);this.config.userProvider&&(this.userProvider=this.config.userProvider),this.config.analyticsProvider&&(this.analyticsProvider=new FM(this.config.analyticsProvider)),this.config.exposureTrackingProvider&&(this.exposureTrackingProvider=new UM(this.config.exposureTrackingProvider)),this.integrationManager=new IM(this.config,this);var u,c=new yM(this.config.httpClient||wM);this.flagApi=new eM(this.apiKey,this.config.flagsServerUrl,c),this.evaluationApi=new QP(this.apiKey,this.config.serverUrl,c);var h=a?"".concat(this.config.instanceName,"-").concat(a):this.config.instanceName;u=this.isWebExperiment?new PM:new OM,this.variants=function(e,t,r){var n=e.substring(e.length-6),i="amp-exp-".concat(t,"-").concat(n);return new AM(i,r,RM)}(this.apiKey,h,u),this.flags=function(e,t,r){void 0===r&&(r=new OM);var n=e.substring(e.length-6),i="amp-exp-".concat(t,"-").concat(n,"-flags");return new AM(i,r)}(this.apiKey,h,u);try{this.flags.load(),this.variants.load()}catch(e){}this.mergeInitialFlagsWithStorage()}return e.prototype.start=function(e){var t;return aM(this,void 0,void 0,(function(){var r;return lM(this,(function(n){switch(n.label){case 0:return this.isRunning?[2]:(this.isRunning=!0,this.setUser(e),r=this.doFlags(),null===(t=this.config.fetchOnStart)||void 0===t||t?[4,Promise.all([this.fetch(e),r])]:[3,2]);case 1:return n.sent(),[3,4];case 2:return[4,r];case 3:n.sent(),n.label=4;case 4:return this.config.pollOnStart&&this.poller.start(),[2]}}))}))},e.prototype.stop=function(){this.isRunning&&(this.poller.stop(),this.isRunning=!1)},e.prototype.fetch=function(e,t){return void 0===e&&(e=this.user),aM(this,void 0,void 0,(function(){var r;return lM(this,(function(n){switch(n.label){case 0:this.setUser(e||{}),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.fetchInternal(e,this.config.fetchTimeoutMillis,this.config.retryFetchOnFailure,t)];case 2:return n.sent(),[3,4];case 3:return r=n.sent(),this.config.debug&&(r instanceof HP?console.debug(r):console.error(r)),[3,4];case 4:return[2,this]}}))}))},e.prototype.variant=function(e,t){var r,n;if(!this.apiKey)return{value:void 0};var i=this.variantAndSource(e,t);return this.config.automaticExposureTracking&&this.exposureInternal(e,i),this.debug("[Experiment] variant for ".concat(e," is ").concat((null===(r=i.variant)||void 0===r?void 0:r.key)||(null===(n=i.variant)||void 0===n?void 0:n.value))),i.variant||{}},e.prototype.exposure=function(e){var t=this.variantAndSource(e);this.exposureInternal(e,t)},e.prototype.all=function(){if(!this.apiKey)return{};var e=this.evaluate();for(var t in e){var r=this.flags.get(t);TM(r)||delete e[t]}return sM(sM(sM({},this.secondaryVariants()),this.sourceVariants()),e)},e.prototype.clear=function(){this.variants.clear();try{this.variants.store()}catch(e){}},e.prototype.getUser=function(){var e;if(!this.user)return this.user;if(null===(e=this.user)||void 0===e?void 0:e.user_properties){var t=sM({},this.user.user_properties);return sM(sM({},this.user),{user_properties:t})}return sM({},this.user)},e.prototype.setUser=function(e){var t;if(e)if(null===(t=this.user)||void 0===t?void 0:t.user_properties){var r=sM({},e.user_properties);this.user=sM(sM({},e),{user_properties:r})}else this.user=sM({},e);else this.user=null},e.prototype.getUserProvider=function(){return this.userProvider},e.prototype.setUserProvider=function(e){return this.userProvider=e,this},e.prototype.mergeInitialFlagsWithStorage=function(){var e=this;this.config.initialFlags&&JSON.parse(this.config.initialFlags).forEach((function(t){e.flags.get(t.key)||e.flags.put(t.key,t)}))},e.prototype.evaluate=function(e){var t,r,n=this.addContext(this.user),i=function(e,t){var r,n,i=$R({},e),o=[],s=t||Object.keys(i);try{for(var a=QR(s),l=a.next();!l.done;l=a.next()){var u=l.value,c=NP(u,i);c&&o.push.apply(o,tP([],eP(c),!1))}}catch(e){r={error:e}}finally{try{l&&!l.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return o}(this.flags.getAll(),e),o=function(e){var t,r,n,i;if(!e)return{};var o={user:e},s=rM();s&&(o.page={url:s.location.href});var a={};if(!e.groups)return o;try{for(var l=uM(Object.keys(e.groups)),u=l.next();!u.done;u=l.next()){var c=u.value,h=e.groups[c];if(h.length>0&&h[0]){var d=h[0],p={group_name:d},f=null===(i=null===(n=e.group_properties)||void 0===n?void 0:n[c])||void 0===i?void 0:i[d];f&&Object.keys(f).length>0&&(p.group_properties=f),a[c]=p}}}catch(e){t={error:e}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(t)throw t.error}}return Object.keys(a).length>0&&(o.groups=a),delete o.user.groups,delete o.user.group_properties,o}(n),s=this.engine.evaluate(o,i),a={};try{for(var l=uM(Object.keys(s)),u=l.next();!u.done;u=l.next()){var c=u.value;a[c]=DM(s[c])}}catch(e){t={error:e}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(t)throw t.error}}return a},e.prototype.variantAndSource=function(e,t){var r={};this.config.source===gM.LocalStorage?r=this.localStorageVariantAndSource(e,t):this.config.source===gM.InitialVariants&&(r=this.initialVariantsVariantAndSource(e,t));var n=this.flags.get(e);return(TM(n)||!r.variant&&n)&&(r=this.localEvaluationVariantAndSource(e,n,t)),r},e.prototype.localEvaluationVariantAndSource=function(e,t,r){var n,i={},o=this.evaluate([t.key])[e],s=mM.LocalEvaluation,a=null===(n=null==o?void 0:o.metadata)||void 0===n?void 0:n.default;if(!MM(o)&&!a)return{variant:LM(o),source:s,hasDefaultVariant:!1};if(a&&(i={variant:LM(o),source:s,hasDefaultVariant:!0}),!MM(r))return{variant:LM(r),source:mM.FallbackInline,hasDefaultVariant:i.hasDefaultVariant};var l=this.config.initialVariants[e];if(!MM(l))return{variant:LM(l),source:mM.SecondaryInitialVariants,hasDefaultVariant:i.hasDefaultVariant};var u=LM(this.config.fallbackVariant),c={variant:u,source:mM.FallbackConfig,hasDefaultVariant:i.hasDefaultVariant};return _M(u)?i:c},e.prototype.localStorageVariantAndSource=function(e,t){var r,n={},i=this.variants.get(e),o=null===(r=null==i?void 0:i.metadata)||void 0===r?void 0:r.default;if(!MM(i)&&!o)return{variant:LM(i),source:mM.LocalStorage,hasDefaultVariant:!1};if(o&&(n={variant:LM(i),source:mM.LocalStorage,hasDefaultVariant:!0}),!MM(t))return{variant:LM(t),source:mM.FallbackInline,hasDefaultVariant:n.hasDefaultVariant};var s=this.config.initialVariants[e];if(!MM(s))return{variant:LM(s),source:mM.SecondaryInitialVariants,hasDefaultVariant:n.hasDefaultVariant};var a=LM(this.config.fallbackVariant),l={variant:a,source:mM.FallbackConfig,hasDefaultVariant:n.hasDefaultVariant};return _M(a)?n:l},e.prototype.initialVariantsVariantAndSource=function(e,t){var r,n={},i=this.config.initialVariants[e];if(!MM(i))return{variant:LM(i),source:mM.InitialVariants,hasDefaultVariant:!1};var o=this.variants.get(e),s=null===(r=null==o?void 0:o.metadata)||void 0===r?void 0:r.default;if(!MM(o)&&!s)return{variant:LM(o),source:mM.LocalStorage,hasDefaultVariant:!1};if(s&&(n={variant:LM(o),source:mM.LocalStorage,hasDefaultVariant:!0}),!MM(t))return{variant:LM(t),source:mM.FallbackInline,hasDefaultVariant:n.hasDefaultVariant};var a=LM(this.config.fallbackVariant),l={variant:a,source:mM.FallbackConfig,hasDefaultVariant:n.hasDefaultVariant};return _M(a)?n:l},e.prototype.fetchInternal=function(e,t,r,n){return aM(this,void 0,void 0,(function(){var i,o;return lM(this,(function(s){switch(s.label){case 0:if(!this.apiKey)throw Error("Experiment API key is empty");this.debug("[Experiment] Fetch all: retry=".concat(r)),r&&this.stopRetries(),s.label=1;case 1:return s.trys.push([1,4,,5]),[4,this.doFetch(e,t,n)];case 2:return i=s.sent(),[4,this.storeVariants(i,n)];case 3:return s.sent(),[2,i];case 4:throw o=s.sent(),r&&this.shouldRetryFetch(o)&&this.startRetries(e,n),o;case 5:return[2]}}))}))},e.prototype.cleanUserPropsForFetch=function(e){var t=sM({},e);return delete t.cookie,t},e.prototype.doFetch=function(e,t,r){return aM(this,void 0,void 0,(function(){var n,i,o,s,a,l,u;return lM(this,(function(c){switch(c.label){case 0:return[4,this.addContextOrWait(e)];case 1:return e=c.sent(),e=this.cleanUserPropsForFetch(e),this.debug("[Experiment] Fetch variants for user: ",e),[4,this.evaluationApi.getVariants(e,sM({timeoutMillis:t},r))];case 2:n=c.sent(),i={};try{for(o=uM(Object.keys(n)),s=o.next();!s.done;s=o.next())a=s.value,i[a]=DM(n[a])}catch(e){l={error:e}}finally{try{s&&!s.done&&(u=o.return)&&u.call(o)}finally{if(l)throw l.error}}return this.debug("[Experiment] Received variants: ",i),[2,i]}}))}))},e.prototype.doFlags=function(){return aM(this,void 0,void 0,(function(){var e,t,r;return lM(this,(function(n){switch(n.label){case 0:return n.trys.push([0,4,,5]),e=void 0,this.isWebExperiment?[4,this.addContextOrWait(this.getUser())]:[3,2];case 1:e=n.sent(),n.label=2;case 2:return[4,this.flagApi.getFlags({libraryName:"experiment-js-client",libraryVersion:CM,timeoutMillis:this.config.fetchTimeoutMillis,deliveryMethod:this.isWebExperiment?"web":void 0,user:(null==e?void 0:e.user_id)||(null==e?void 0:e.device_id)?{user_id:null==e?void 0:e.user_id,device_id:null==e?void 0:e.device_id}:void 0})];case 3:return t=n.sent(),this.flags.clear(),this.flags.putAll(t),[3,5];case 4:if(!((r=n.sent())instanceof HP))throw r;return this.config.debug&&console.debug(r),[3,5];case 5:try{this.flags.store()}catch(e){}return this.mergeInitialFlagsWithStorage(),[2]}}))}))},e.prototype.storeVariants=function(e,t){return aM(this,void 0,void 0,(function(){var r,n,i,o;return lM(this,(function(s){for(o in 0===(r=t&&t.flagKeys?t.flagKeys:[]).length&&this.variants.clear(),n=function(t){r=r.filter((function(e){return e!==t})),i.variants.put(t,e[t])},i=this,e)n(o);for(o in r)this.variants.remove(o);try{this.variants.store()}catch(e){}return this.debug("[Experiment] Stored variants: ",e),[2]}))}))},e.prototype.startRetries=function(e,t){return aM(this,void 0,void 0,(function(){var r=this;return lM(this,(function(n){return this.debug("[Experiment] Retry fetch"),this.retriesBackoff=new NM(8,500,1e4,1.5),this.retriesBackoff.start((function(){return aM(r,void 0,void 0,(function(){return lM(this,(function(r){switch(r.label){case 0:return[4,this.fetchInternal(e,1e4,!1,t)];case 1:return r.sent(),[2]}}))}))})),[2]}))}))},e.prototype.stopRetries=function(){this.retriesBackoff&&this.retriesBackoff.cancel()},e.prototype.addContext=function(e){var t,r=null===(t=this.userProvider)||void 0===t?void 0:t.getUser(),n=this.integrationManager.getUser(),i=sM(sM(sM({},null==r?void 0:r.user_properties),n.user_properties),null==e?void 0:e.user_properties);return sM(sM(sM(sM({library:"experiment-js-client/".concat(CM)},r),n),e),{user_properties:i})},e.prototype.addContextOrWait=function(e){return aM(this,void 0,void 0,(function(){return lM(this,(function(t){switch(t.label){case 0:return[4,this.integrationManager.ready()];case 1:return t.sent(),[2,this.addContext(e)]}}))}))},e.prototype.sourceVariants=function(){return this.config.source==gM.LocalStorage?this.variants.getAll():this.config.source==gM.InitialVariants?this.config.initialVariants:void 0},e.prototype.secondaryVariants=function(){return this.config.source==gM.LocalStorage?this.config.initialVariants:this.config.source==gM.InitialVariants?this.variants.getAll():void 0},e.prototype.exposureInternal=function(e,t){var r,n,i,o,s,a,l,u,c;if(null===(i=null===(n=null===(r=t.variant)||void 0===r?void 0:r.metadata)||void 0===n?void 0:n.trackExposure)||void 0===i||i){this.legacyExposureInternal(e,t.variant,t.source);var h={flag_key:e},d=bM(t.source);if(!d||t.hasDefaultVariant){(null===(o=t.variant)||void 0===o?void 0:o.expKey)&&(h.experiment_key=null===(s=t.variant)||void 0===s?void 0:s.expKey);var p=null===(a=t.variant)||void 0===a?void 0:a.metadata;d||(null==p?void 0:p.default)||((null===(l=t.variant)||void 0===l?void 0:l.key)?h.variant=t.variant.key:(null===(u=t.variant)||void 0===u?void 0:u.value)&&(h.variant=t.variant.value)),p&&(h.metadata=p),null===(c=this.exposureTrackingProvider)||void 0===c||c.track(h),this.integrationManager.track(h)}}},e.prototype.legacyExposureInternal=function(e,t,r){var n,i,o,s,a;if(this.analyticsProvider){var l=function(e,t,r,n){var i,o=null==r?void 0:r.value,s="[Experiment] ".concat(t);return{name:"[Experiment] Exposure",user:e,key:t,variant:r,userProperty:s,properties:{key:t,variant:o,source:n},userProperties:(i={},i[s]=o,i)}}(this.addContext(this.getUser()),e,t,r);bM(r)||!(null==t?void 0:t.value)?null===(i=null===(n=this.analyticsProvider)||void 0===n?void 0:n.unsetUserProperty)||void 0===i||i.call(n,l):(null==t?void 0:t.value)&&(null===(s=null===(o=this.analyticsProvider)||void 0===o?void 0:o.setUserProperty)||void 0===s||s.call(o,l),null===(a=this.analyticsProvider)||void 0===a||a.track(l))}},e.prototype.debug=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];this.config.debug&&console.debug.apply(console,hM([e],cM(t),!1))},e.prototype.shouldRetryFetch=function(e){return!(e instanceof XP)||(e.statusCode<400||e.statusCode>=500||429===e.statusCode)},e.prototype.addPlugin=function(e){"integration"===e.type&&this.integrationManager.setIntegration(e)},e}(),BM=function(){function e(e,t){var r,n,i;this.globalScope=rM(),this.userAgent=void 0!==(null===(r=this.globalScope)||void 0===r?void 0:r.navigator)?null===(n=this.globalScope)||void 0===n?void 0:n.navigator.userAgent:void 0,this.ua=new oM.exports.UAParser(this.userAgent).getResult(),this.localStorage=new OM,this.sessionStorage=new PM,this.userProvider=e,this.apiKey=t,this.storageKey="EXP_".concat(null===(i=this.apiKey)||void 0===i?void 0:i.slice(0,10),"_DEFAULT_USER_PROVIDER")}return e.prototype.getUser=function(){var e,t,r,n,i,o=(null===(e=this.userProvider)||void 0===e?void 0:e.getUser())||{};return sM({language:this.getLanguage(),platform:"Web",os:this.getOs(this.ua),device_model:this.getDeviceModel(this.ua),device_category:null!==(r=null===(t=this.ua.device)||void 0===t?void 0:t.type)&&void 0!==r?r:"desktop",referring_url:null===(i=null===(n=this.globalScope)||void 0===n?void 0:n.document)||void 0===i?void 0:i.referrer.replace(/\/$/,""),cookie:this.getCookie(),browser:this.getBrowser(this.ua),landing_url:this.getLandingUrl(),first_seen:this.getFirstSeen(),url_param:this.getUrlParam(),user_agent:this.userAgent},o)},e.prototype.getLanguage=function(){return"undefined"!=typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},e.prototype.getOs=function(e){var t,r;return[null===(t=e.browser)||void 0===t?void 0:t.name,null===(r=e.browser)||void 0===r?void 0:r.major].filter((function(e){return null!=e})).join(" ")},e.prototype.getDeviceModel=function(e){var t;return null===(t=e.os)||void 0===t?void 0:t.name},e.prototype.getBrowser=function(e){var t,r=null===(t=e.browser)||void 0===t?void 0:t.name;return(null==r?void 0:r.includes("Chrom"))&&(r="Chrome"),(null==r?void 0:r.includes("Firefox"))&&(r="Firefox"),(null==r?void 0:r.includes("Safari"))&&(r="Safari"),(null==r?void 0:r.includes("Edge"))&&(r="Edge"),(null==r?void 0:r.includes("Opera"))&&(r="Opera"),r},e.prototype.getCookie=function(){var e,t,r,n,i;if(null===(t=null===(e=this.globalScope)||void 0===e?void 0:e.document)||void 0===t?void 0:t.cookie)return Object.fromEntries(null===(i=null===(n=null===(r=this.globalScope)||void 0===r?void 0:r.document)||void 0===n?void 0:n.cookie)||void 0===i?void 0:i.split("; ").map((function(e){return e.split("=")})))},e.prototype.getLandingUrl=function(){var e,t;try{var r=JSON.parse(this.sessionStorage.get(this.storageKey)||"{}");return r.landing_url||(r.landing_url=null===(t=null===(e=this.globalScope)||void 0===e?void 0:e.location)||void 0===t?void 0:t.href.replace(/\/$/,""),this.sessionStorage.put(this.storageKey,JSON.stringify(r))),r.landing_url}catch(e){return}},e.prototype.getFirstSeen=function(){try{var e=JSON.parse(this.localStorage.get(this.storageKey)||"{}");return e.first_seen||(e.first_seen=(Date.now()/1e3).toString(),this.localStorage.put(this.storageKey,JSON.stringify(e))),e.first_seen}catch(e){return}},e.prototype.getUrlParam=function(){var e,t,r;if(this.globalScope){var n={};try{var i=new URL(this.globalScope.location.href);try{for(var o=uM(i.searchParams),s=o.next();!s.done;s=o.next()){var a=cM(s.value,2),l=a[0],u=a[1];n[l]=hM(hM([],cM(null!==(r=n[l])&&void 0!==r?r:[]),!1),cM(u.split(",")),!1)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}}catch(e){return}return Object.entries(n).reduce((function(e,t){var r=cM(t,2),n=r[0],i=r[1];return e[n]=1==i.length?i[0]:i,e}),{})}},e}();tM.experimentInstances={};var zM=tM.experimentInstances,VM=function(e){return(null==e?void 0:e.instanceName)||SM.instanceName},WM=function(e,t,r){var n=function(e,t){var r=VM(t),n=null==t?void 0:t.internalInstanceNameSuffix;return n?"".concat(r,".").concat(e,".").concat(n):"".concat(r,".").concat(e)}(e,t),i=zM[n];return i||(i=function(e,t){return new jM(e,sM(sM({},t),{userProvider:new BM(null==t?void 0:t.userProvider,e)}))}(e,t),r&&i.addPlugin(r()),zM[n]=i,i)},qM=function(){function e(t){this.name=e.pluginName,this.config=t}return e.prototype.setup=function(e,t){var r;return a(this,void 0,void 0,(function(){return l(this,(function(t){return this.experiment=function(e,t){return WM(e,t,(function(){return new fM(e,ee.getInstance(VM(t)),1e4)}))}((null===(r=this.config)||void 0===r?void 0:r.deploymentKey)?this.config.deploymentKey:e.apiKey,this.config),[2]}))}))},e.pluginName="@amplitude/experiment-analytics-plugin",e}(),GM=function(e){return new qM(e)},KM=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.initAll=function(t,r){return a(this,void 0,void 0,(function(){var n,i,s;return l(this,(function(a){switch(a.label){case 0:return n={serverZone:null==r?void 0:r.serverZone,instanceName:null==r?void 0:r.instanceName},[4,e.prototype.init.call(this,t,o(o({},null==r?void 0:r.analytics),n)).promise];case 1:return a.sent(),(null==r?void 0:r.sr)?[3,3]:[4,e.prototype.add.call(this,(l=o(o({},"boolean"==typeof(null==r?void 0:r.sr)?{}:null==r?void 0:r.sr),n),new YR(l))).promise];case 2:a.sent(),a.label=3;case 3:return[4,e.prototype.add.call(this,GM(o(o({},"boolean"==typeof(null==r?void 0:r.experiment)?{}:null==r?void 0:r.experiment),n))).promise];case 4:return a.sent(),void 0===(i=e.prototype.plugin.call(this,YR.pluginName))?this.config.loggerProvider.debug("SR plugin is not found."):this.sr=i.sr,void 0===(s=e.prototype.plugin.call(this,qM.pluginName))?this.config.loggerProvider.debug("Experiment plugin is not found."):this.experiment=s.experiment,[2]}var l}))}))},t.prototype.init=function(t,r,n){void 0===t&&(t="");var i=e.prototype.init.call(this,t,r,n);return this.config.loggerProvider.debug("Only analytics SDK is initialized. Use initAll() instead to initialize all blade SDKs."),i},t}(Mi),YM=function(){var e=new KM;return{experiment:e.experiment,sr:e.sr,initAll:de(e.initAll.bind(e),"initAll",ue(e),he(e,["config"])),init:de(e.init.bind(e),"init",ue(e),he(e,["config"])),add:de(e.add.bind(e),"add",ue(e),he(e,["config.apiKey","timeline.plugins"])),remove:de(e.remove.bind(e),"remove",ue(e),he(e,["config.apiKey","timeline.plugins"])),track:de(e.track.bind(e),"track",ue(e),he(e,["config.apiKey","timeline.queue.length"])),logEvent:de(e.logEvent.bind(e),"logEvent",ue(e),he(e,["config.apiKey","timeline.queue.length"])),identify:de(e.identify.bind(e),"identify",ue(e),he(e,["config.apiKey","timeline.queue.length"])),groupIdentify:de(e.groupIdentify.bind(e),"groupIdentify",ue(e),he(e,["config.apiKey","timeline.queue.length"])),setGroup:de(e.setGroup.bind(e),"setGroup",ue(e),he(e,["config.apiKey","timeline.queue.length"])),revenue:de(e.revenue.bind(e),"revenue",ue(e),he(e,["config.apiKey","timeline.queue.length"])),flush:de(e.flush.bind(e),"flush",ue(e),he(e,["config.apiKey","timeline.queue.length"])),getUserId:de(e.getUserId.bind(e),"getUserId",ue(e),he(e,["config","config.userId"])),setUserId:de(e.setUserId.bind(e),"setUserId",ue(e),he(e,["config","config.userId"])),getDeviceId:de(e.getDeviceId.bind(e),"getDeviceId",ue(e),he(e,["config","config.deviceId"])),setDeviceId:de(e.setDeviceId.bind(e),"setDeviceId",ue(e),he(e,["config","config.deviceId"])),reset:de(e.reset.bind(e),"reset",ue(e),he(e,["config","config.userId","config.deviceId"])),getSessionId:de(e.getSessionId.bind(e),"getSessionId",ue(e),he(e,["config"])),setSessionId:de(e.setSessionId.bind(e),"setSessionId",ue(e),he(e,["config"])),extendSession:de(e.extendSession.bind(e),"extendSession",ue(e),he(e,["config"])),setOptOut:de(e.setOptOut.bind(e),"setOptOut",ue(e),he(e,["config"])),setTransport:de(e.setTransport.bind(e),"setTransport",ue(e),he(e,["config"]))}},ZM=YM(),JM=ZM.initAll,$M=ZM.experiment,XM=ZM.sr,HM=ZM.add,QM=ZM.extendSession,e_=ZM.flush,t_=ZM.getDeviceId,r_=ZM.getSessionId,n_=ZM.getUserId,i_=ZM.groupIdentify,o_=ZM.identify,s_=ZM.logEvent,a_=ZM.remove,l_=ZM.reset,u_=ZM.revenue,c_=ZM.setDeviceId,h_=ZM.setGroup,d_=ZM.setOptOut,p_=ZM.setSessionId,f_=ZM.setTransport,g_=ZM.setUserId,m_=ZM.track;e.add=HM,e.createInstance=YM,e.experiment=$M,e.extendSession=QM,e.flush=e_,e.getDeviceId=t_,e.getSessionId=r_,e.getUserId=n_,e.groupIdentify=i_,e.identify=o_,e.initAll=JM,e.logEvent=s_,e.remove=a_,e.reset=l_,e.revenue=u_,e.setDeviceId=c_,e.setGroup=h_,e.setOptOut=d_,e.setSessionId=p_,e.setTransport=f_,e.setUserId=g_,e.sr=XM,e.track=m_,Object.defineProperty(e,"__esModule",{value:!0})}));
|